فهرست منبع

张丁 修改预约作业票页面

zhangding 3 سال پیش
والد
کامیت
c07229cfad

+ 0 - 10
master/src/main/java/com/ruoyi/project/invoice/controller/TInvoiceBookingworkticketController.java

@@ -441,16 +441,6 @@ public class TInvoiceBookingworkticketController extends BaseController
         return toAjax(tInvoiceBookingworkticketService.deleteTInvoiceBookingworkticketByIds(ids));
     }
 
-    /**
-     * 关联票号
-     */
-    @PreAuthorize("@ss.hasAnyRoles ('dbbz,admin')")
-    @Log(title = "关联票号", businessType = BusinessType.OTHER)
-    @DeleteMapping("/association")
-    public AjaxResult association(@PathVariable Long[] ids)
-    {
-        return toAjax(tInvoiceBookingworkticketService.deleteTInvoiceBookingworkticketByIds(ids));
-    }
 
 
     /**

+ 12 - 0
master/src/main/java/com/ruoyi/project/invoice/domain/TInvoiceBookingworkticket.java

@@ -264,6 +264,18 @@ public class TInvoiceBookingworkticket extends BaseEntity
         this.userUnit = userUnit;
     }
 
+    @TableField(exist = false)
+    private String deptName;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+
     public Long getUserUnit()
     {
         return userUnit;

+ 14 - 0
master/src/main/java/com/ruoyi/project/invoice/domain/TInvoiceWorkcontent.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.invoice.domain;
 
 import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.framework.aspectj.lang.annotation.Excel;
 import com.ruoyi.framework.web.domain.BaseEntity;
@@ -79,6 +81,18 @@ public class TInvoiceWorkcontent extends BaseEntity
     @Excel(name = "部门编号")
     private Long deptId;
 
+    @TableField(exist = false)
+    private String deptName;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+
     public void setId(Long id)
     {
         this.id = id;

+ 71 - 46
ui/src/views/invoice/bookingworkticket/index.vue

@@ -14,9 +14,9 @@
         <el-select v-model="queryParams.workArea" placeholder="请选择作业区域" clearable size="small">
              <el-option
             v-for="dict in workAreaOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="parseInt(dict.dictValue)"
+             :key="dict.id"
+            :label="dict.workArea"
+            :value="dict.workArea"
                  ></el-option>
         </el-select>
       </el-form-item>
@@ -183,17 +183,17 @@
     />
 
     <!-- 添加或修改预约作业票台账对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-row>
-        <el-col :span="12">
+        <el-col :span="8">
             <el-form-item label="承包商" prop="workUnit">
         <el-input v-model="form.workUnit" placeholder="请输入作业单位" :disabled="edit"/>
         </el-form-item>
           </el-col>
-        <el-col :span="12">
+        <el-col :span="8">
         <el-form-item label="作业区域" prop="workArea">
-          <el-select v-model="form.workArea" placeholder="请选择作业区域">
+          <el-select v-model="form.workArea" placeholder="请选择作业区域"     @change="getDeviceup">
              <el-option
             v-for="dict in workAreaOptions"
             :key="dict.id"
@@ -201,6 +201,11 @@
             :value="dict.workArea"
                  ></el-option>
           </el-select>
+        </el-form-item>
+           </el-col>
+        <el-col :span="8">
+        <el-form-item label="归属部门" prop="deptId">
+          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
         </el-form-item>
         </el-col>
       </el-row>
@@ -269,15 +274,23 @@
             </el-col>
       </el-row>
       </el-form>
-
-            <el-form v-for="(ruleForm, index) in ruleForm" :key="index" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
-    <el-divider><i class="el-icon-more" style="color:green;font-size:100%"></i><i class="el-icon-more" style="color:green;font-size:100%"></i> <span ><font color="green">关联的作业内容</font></span>
-    <i class="el-icon-more" style="color:green;font-size:100%"></i><i class="el-icon-more" style="color:green;font-size:100%"></i></el-divider>
+ <el-card   v-for="(ruleForm, index) in ruleForm" :key="index" shadow="always">
+  <el-form  :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
+   <el-row>
+        <el-col :span="18">
           <el-form-item label="作业内容描述" prop="workDescription">
             <el-input v-model="ruleForm.workDescription"></el-input>
           </el-form-item>
+           </el-col>
+        <el-col :span="3">
+            <el-button type="success" plain @click.prevent="addDomain(ruleForm)" style="float: right;">拷贝</el-button>
+             </el-col>
+        <el-col :span="3">
+      <el-button type="info" plain @click.prevent="removeDomain(ruleForm)" style="float: right;">删除</el-button>
+        </el-col>
+      </el-row>
                <el-row>
-        <el-col :span="12">
+        <el-col :span="6">
               <el-form-item label="作业类型" prop="workType">
         <el-select v-model="ruleForm.workType" placeholder="请选择作业类型" clearable size="small">
           <el-option
@@ -289,7 +302,7 @@
         </el-select>
       </el-form-item>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="6">
           <el-form-item label="风险等级" prop="riskLevel">
         <el-select v-model="ruleForm.riskLevel" placeholder="请选择风险等级" clearable size="small">
           <el-option
@@ -301,21 +314,20 @@
         </el-select>
       </el-form-item>
        </el-col>
-      </el-row>
-            <el-row>
-        <el-col :span="12">
+        <el-col :span="6">
           <el-form-item label="作业人数" prop="workPeopleNumber">
             <el-input v-model="ruleForm.workPeopleNumber"></el-input>
           </el-form-item>
             </el-col>
-        <el-col :span="12">
+        <el-col :span="6">
              <el-form-item label="预计作业时间" prop="estimateWorktime">
-        <el-input v-model="ruleForm.estimateWorktime"  style="width: 190px"></el-input>
+        <el-input v-model="ruleForm.estimateWorktime"  ></el-input>
       </el-form-item>
        </el-col>
-      </el-row>
+      </el-row> 
         </el-form>
-
+  </el-card>
+    
         <el-button @click="resetForm1()">重置</el-button>
         <el-button @click="add">新增一条</el-button>
         <el-button @click="reduce" :disabled="flag">移除一条</el-button>
@@ -325,6 +337,7 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
 
+
  </el-dialog>
  <!-- 报告附件对话框 -->
 
@@ -380,6 +393,7 @@ import { listDevice, getDevice, delDevice, updateDevice, exportDevice} from "@/a
 import { listUnit, getUnit, delUnit, addUnit, updateUnit, exportUnit,getUserByUnit} from "@/api/invoice/unit";
 import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus,userDataScope } from "@/api/system/user";
 import { treeselect } from "@/api/system/dept";
+import { checkPermi} from "@/utils/permission"; // 权限判断函数
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -388,7 +402,7 @@ import {addInvoice} from "@/api/invoice/invoice";
 
 export default {
   name: "Bookingworkticket",
-  components: { Treeselect,AddApprove},
+  components: { Treeselect,AddApprove,checkPermi},
   data() {
     return {
       //禁用
@@ -499,7 +513,7 @@ export default {
       // 表单校验
       rules: {
         workArea: [
-          { required: true, message: "作业区域不能为空", trigger: "blur" }
+          { required: false, message: "作业区域不能为空", trigger: "blur" }
         ],
          riskLevel: [
           { required: true, message: "风险等级不能为空", trigger: "blur" }
@@ -511,7 +525,8 @@ export default {
         // 根据名称筛选部门树
         deptName(val) {
             this.$refs.tree.filter(val);
-        }
+        },
+    
    },
   created() {
       //设置表格高度对应屏幕高度
@@ -526,29 +541,18 @@ export default {
       this.getDicts("booking_work_status").then(response => {
       this.statusOptions = response.data;
     });
-
-    this.getDicts("book_unit_number").then(response => {
-      this.unitNumberOptions = response.data;
-    });
     this.getDicts("book_floor_location").then(response => {
       this.floorLocationOptions = response.data;
     });
-   
       this.getDicts("book_user_unit").then(response => {
       this.userUnitOptions = response.data;
     });
-    this.getDicts("book_work_unit").then(response => {
-      this.workUnitOptions = response.data;
-    });
     this.getDicts("book_work_type").then(response => {
       this.workTypeOptions = response.data;
     });
     this.getDicts("book_risk_level").then(response => {
       this.riskLevelOptions = response.data;
     });
-    this.getDicts("book_guardian_unit").then(response => {
-      this.guardianUnitOptions = response.data;
-    });
 
   },
   methods: {
@@ -627,6 +631,27 @@ export default {
       })
       this.addAprroveVisible = true
     },
+       //拷贝
+    addDomain(domain) {
+      let arr={}
+           arr.workType=domain.workType;
+           arr.workDescription=domain.workDescription;
+           arr.riskLevel=domain.riskLevel;
+           arr.workPeopleNumber=domain.workPeopleNumber;
+           arr.estimateWorktime=domain.estimateWorktime;
+        this.ruleForm.push(
+          arr
+        );
+        this.flags()
+      },
+    //删除自身
+    removeDomain(item) {
+        var index = this.ruleForm.indexOf(item)
+        if (index !== -1) {
+          this.ruleForm.splice(index, 1)
+        }
+        this.flags()
+      },
 // 表单添加一行
     add() {
       var arr = { }
@@ -635,15 +660,20 @@ export default {
     },
     // 表单减少一行
     reduce() {
-        this.flags()
+      
       this.ruleForm.length = this.ruleForm.length - 1
-
+      this.flags()
     },
     // 判断数组长度
     flags() {
-      console.log(this.ruleForm.length)
-      if (this.ruleForm.length <2) {
+      //如果小于1则自动补一栏 如果大于5则提示
+      if (this.ruleForm.length <2){
         this.flag = true
+      }else if(this.ruleForm.length<1){
+        this.ruleForm.push({});
+      }else if(this.ruleForm.length>5){
+        this.ruleForm.length =  this.ruleForm.length-1;
+         this.msgSuccess("最多只能添加5条相关作业内容,若需要请重新预约");
       } else {
       	//先赋值为true再赋为false, 不然会没反应
       this.flag=true
@@ -773,8 +803,9 @@ export default {
     handleAdd() {
       this.reset();
       this.resetForm1();
-        var roles =this.$store.state.user.roles
-   this.open = true;
+      var names =this.$store.state.user.name
+      this.form.workUnit=names;
+      this.open = true;
       this.title = "添加预约作业票台账";
 
     },
@@ -883,12 +914,6 @@ export default {
       // 提交上传文件
       submitFileForm() {
           this.$refs.upload.submit();
-      },
-      //关联票号
-      association(){
-        console.log(this.$store.state.user)
-        var userName = this.$store.state.user.roles;
-        this.msgSuccess(userName);
       },
         //合并单元格
       mergeMethod({ row, column, rowIndex, columnIndex }) {