Browse Source

编辑中工单状态去掉“完成工单”选项;编辑工单中的工单状态修改为“完成工作内容”时,实际完成时间刷新成系统当前时间

jiuling 4 months ago
parent
commit
44cde549ae
1 changed files with 22 additions and 6 deletions
  1. 22 6
      pages/worksheetinfo/worksheetinfo.js

+ 22 - 6
pages/worksheetinfo/worksheetinfo.js

@@ -33,10 +33,7 @@ Page({
       value: 6,
       text: '完成工作内容'
     }
-    , {
-      value: 7,
-      text: '完成工单'
-    }],
+    ],
     workstatusindex: 0,
     workstatusFinished: false,
     workBigclass: [{
@@ -104,7 +101,9 @@ Page({
       placeholder: '请选择时间', 
       startDateTime: '2020-01-01 00:00',
       endDateTime: '2040-01-01 00:00',
-      pText: Util.formatTimePicker(new Date()) //'2022-04-30 00:00'
+      pText: Util.formatTimePicker(new Date()), //'2022-04-30 00:00'
+      pTextOld: null,
+      flag: true
     },
     workEndtimeParams:{
       placeholder: '请选择时间', 
@@ -129,7 +128,7 @@ Page({
   },
   bindChargstationsChange: function(e) {
     if (this.data.chargstationsindex != e.detail.value) {
-      console.log('picker发送选择改变,携带值为', e.detail.value)
+      //console.log('picker发送选择改变,携带值为', e.detail.value)
       let chargstationid = this.data.chargstations[e.detail.value].id;
       let worksheetinfo = this.data.worksheetinfo;
       worksheetinfo.accendant = null;
@@ -150,6 +149,23 @@ Page({
       workstatusindex: e.detail.value,
       worksheetinfo
     });
+    if(e.detail.value == 5){
+      let finishparams = this.data.finishparams
+      finishparams['pTextOld'] =  this.data.finishparams.pText
+      finishparams['pText'] = Util.formatTimePicker(new Date())
+      finishparams['flag'] = false
+      this.setData({
+        finishparams: finishparams,
+      });
+    }
+    console.log(this.data.finishparams);
+    if(e.detail.value != 5 && !this.data.finishparams.flag){
+      let finishparams = this.data.finishparams
+      finishparams.pText = this.data.finishparams.pTextOld
+      this.setData({
+        finishparams: finishparams,
+      });
+    }
   },
   bindWorkBigclassChange: function(e) {
     //console.log('picker发送选择改变,携带值为', e.detail.value)