Sfoglia il codice sorgente

张丁 修改预约票作业类型 数据结构

zhangding 3 anni fa
parent
commit
c824667fcb

+ 8 - 8
master/src/main/java/com/ruoyi/project/invoice/controller/TApproveReserveInvoiceController.java

@@ -172,13 +172,13 @@ public class TApproveReserveInvoiceController extends BaseController {
             }
             List<TInvoiceWorkcontent> workcontents = invoiceWorkcontentMapper.selectTInvoiceWorkcontentBybookingticketId(Long.valueOf(invoice.getId()));
             for (TInvoiceWorkcontent tInvoiceWorkcontent : workcontents) {
-                if (tInvoiceWorkcontent.getWorkType()==1L||tInvoiceWorkcontent.getWorkType()==15L){
+               /* if (tInvoiceWorkcontent.getWorkType()==1L||tInvoiceWorkcontent.getWorkType()==15L){
                     tApproveReserveInvoice.setIsSpecial("1");
                     break;
                 }
                 else{
                     tApproveReserveInvoice.setIsSpecial("0");
-                }
+                }*/
             }
         }
         //开始工作流、监听
@@ -273,24 +273,24 @@ public class TApproveReserveInvoiceController extends BaseController {
                 invoiceBook.setStatus(5L);
             }else {
                 for (TInvoiceWorkcontent workcontent : workcontents) {
-                    if (workcontent.getWorkType() == 1 || workcontent.getWorkType() == 15) {
+                /*    if (workcontent.getWorkType() == 1 || workcontent.getWorkType() == 15) {
                         invoiceBook.setStatus(6L);
                         break;
                     } else {
                         invoiceBook.setStatus(3L);
-                    }
+                    }*/
                 }
             }
         }
         if (task.getName().equals("装置工程师签字确认")) {
             invoice.setDevEngineerId(getUserId());
             for (TInvoiceWorkcontent workcontent : workcontents) {
-                if (workcontent.getWorkType() == 1 || workcontent.getWorkType() == 15) {
+             /*   if (workcontent.getWorkType() == 1 || workcontent.getWorkType() == 15) {
                     invoiceBook.setStatus(6L);
                     break;
                 } else {
                     invoiceBook.setStatus(3L);
-                }
+                }*/
             }
         }
         if (task.getName().equals("装置经理签字确认")) {
@@ -303,12 +303,12 @@ public class TApproveReserveInvoiceController extends BaseController {
             param.put("istoday", "0");
         }
         for (TInvoiceWorkcontent workcontent : workcontents) {
-            if (workcontent.getWorkType() == 1 || workcontent.getWorkType() == 15) {
+          /*  if (workcontent.getWorkType() == 1 || workcontent.getWorkType() == 15) {
                 param.put("isspecial", "1");
                 break;
             } else {
                 param.put("isspecial", "0");
-            }
+            }*/
         }
         param.put("condition", devTask.getCondition());
         ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

+ 8 - 5
master/src/main/java/com/ruoyi/project/invoice/controller/TInvoiceBookingworkticketController.java

@@ -307,7 +307,7 @@ public class TInvoiceBookingworkticketController extends BaseController
         int workType10=0; int workType11=0; int workType12=0; int workType13=0; int workType14=0;
         int workType15=0; int workType16=0; int workType17=0;
         //填充下一个表格
-        for (TInvoiceWorkcontent t: newtInvoiceWorkcontentList) {
+      /*  for (TInvoiceWorkcontent t: newtInvoiceWorkcontentList) {
             if(t.getWorkType()==2){
                workType0++;
             }else  if(t.getWorkType()==3){
@@ -337,7 +337,7 @@ public class TInvoiceBookingworkticketController extends BaseController
             }else {
                 //变更、承包、停车装置暂无数据
             }
-        }
+        }*/
 
         Row row = sheet.createRow(rowIndex1+1);
         row.createCell(0).setCellValue("");
@@ -585,14 +585,17 @@ public class TInvoiceBookingworkticketController extends BaseController
                     params.put("conUnit",Texts.of(dName).fontSize(10).bold().create());
                 }
             }
-            //作业类型
+            //作业类型 遍历查找 追加到该条作业内容
             if(tInvoiceWorkcontent.getWorkType()!=null){
+                String[] wtlist=tInvoiceWorkcontent.getWorkType().split(",");
                 for (SysDictData p : book_work_type) {
-                    if (tInvoiceWorkcontent.getWorkType().toString().equals(p.getDictValue())) {
+                    for (String t : wtlist)
+                        if (t.equals(p.getDictValue())) {
                         contentUserWorkType.append(p.getDictLabel());//作业类型
                     }
                 }
-                params.put("workType"+i, Texts.of(contentUserWorkType.toString()).fontSize(10).bold().create());
+                    params.put("workType"+i, Texts.of(contentUserWorkType.toString()).fontSize(10).bold().create());
+
             }
             //作业开始时间
             if(ticket.getWorkStartTime()!=null){

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

@@ -45,7 +45,7 @@ public class TInvoiceWorkcontent extends BaseEntity
 
     /** 作业类型 */
     @Excel(name = "作业类型")
-    private Long workType;
+    private String workType;
 
     /** 风险等级 */
     @Excel(name = "风险等级")
@@ -147,12 +147,12 @@ public class TInvoiceWorkcontent extends BaseEntity
     {
         return updatedate;
     }
-    public void setWorkType(Long workType)
+    public void setWorkType(String workType)
     {
         this.workType = workType;
     }
 
-    public Long getWorkType()
+    public String getWorkType()
     {
         return workType;
     }

+ 20 - 6
ui/src/views/invoice/bookingworkticket/index.vue

@@ -308,7 +308,7 @@
                <el-row>
         <el-col :span="6">
               <el-form-item label="作业类型" prop="workType">
-        <el-select v-model="ruleForm.workType" placeholder="请选择作业类型" clearable size="small">
+        <el-select v-model="ruleForm.workType" placeholder="请选择作业类型" multiple clearable size="small">
           <el-option
             v-for="dict in workTypeOptions"
             :key="dict.dictValue"
@@ -794,10 +794,6 @@ export default {
       return this.selectDictLabel(this.workAreaOptions, row.bookingworkticket.workArea);
     },
     // 字典翻译
-    unitNumberFormat(row, column) {
-      return this.selectDictLabel(this.unitNumberOptions, row.unitNumber);
-    },
-    // 字典翻译
     floorLocationFormat(row, column) {
 
       return this.selectDictLabels(this.floorLocationOptions, row.bookingworkticket.floorLocation);
@@ -812,7 +808,7 @@ export default {
     },
     // 字典翻译
     workTypeFormat(row, column) {
-      return this.selectDictLabel(this.workTypeOptions, row.workType);
+      return this.selectDictLabels(this.workTypeOptions, row.workType);
     },
     // 字典翻译
     riskLevelFormat(row, column) {
@@ -920,6 +916,17 @@ export default {
 			  st.push(parseInt(arr[arrInt]))
 		}
         this.form.floorLocation=st
+    //作业类型也要多选 同楼层
+    for(let j=0;j<this.ruleForm.length;j++){
+ let arr1=this.ruleForm[j].workType.split(",")
+     let st1=[]
+		// 将字符串数组的每一项转换成Number,生成一个新的数组
+      	for (var arrInt in arr1) {
+			  st1.push(parseInt(arr1[arrInt]))
+		}
+        this.ruleForm[j].workType=st1
+    }
+
 
         this.ruleForm.length=response.data.tInvoiceWorkcontentList.length
       });
@@ -962,6 +969,10 @@ export default {
        if (this.form.id != null) {
               this.form.tInvoiceWorkcontentList=this.ruleForm
               this.form.floorLocation=this.form.floorLocation.join(',')
+              for(let b=0;b<this.ruleForm.length;b++){
+              this.ruleForm[b].workType=this.ruleForm[b].workType.join(',')
+              }
+              
             updateBookingworkticket(this.form).then(response => {
 
               this.msgSuccess("修改成功");
@@ -971,6 +982,9 @@ export default {
           } else {
             this.form.tInvoiceWorkcontentList=this.ruleForm
             this.form.floorLocation=this.form.floorLocation.join(',')
+              for(let b=0;b<this.ruleForm.length;b++){
+              this.ruleForm[b].workType=this.ruleForm[b].workType.join(',')
+              }
             addBookingworkticket(this.form).then(response => {
              // console.log(this.form)
            //   console.log(this.ruleForm)