xiaohaizhao 1 месяц назад
Родитель
Сommit
18b4ba2324

+ 4 - 4
E-service/serviceBillList/detail.js

@@ -229,7 +229,7 @@ Page({
           backreasonShow: true
         })
         break;
-      case '转单':
+      case '转单':
         wx.navigateTo({
           url: "/E-service/serviceBillList/transferWorkOrder/transfer?id=" + detail.sa_serviceorderid + '&historicalservicesqty=' + detail.historicalservicesqty
         })
@@ -296,9 +296,9 @@ Page({
         icon: "icon-bianji2",
         label: "编辑"
       },
-      转单: {
+      转单: {
         icon: "icon-dibu-biangengchengjiaozhuangtai",
-        label: "转单"
+        label: "转单"
       },
       提交: {
         icon: "icon-tijiao",
@@ -328,7 +328,7 @@ Page({
       statusOptions.已提交 = [];
     }
     const appAuth = wx.getStorageSync('auth').applyBill;
-    statusOptions.已提交 = statusOptions.已提交.concat(appAuth.optionnames.filter(v => this.data.type == 'admin' ? ['转单', '退回', '中止'].includes(v) : ['中止'].includes(v)))
+    statusOptions.已提交 = statusOptions.已提交.concat(appAuth.optionnames.filter(v => this.data.type == 'admin' ? ['转单', '退回', '中止'].includes(v) : ['中止'].includes(v)))
     if (statusOptions[status]) {
       tabbarList = statusOptions[status].map(v => options[v]);
     }

+ 2 - 2
E-service/serviceBillList/transferWorkOrder/transfer.js

@@ -98,7 +98,7 @@ Page({
       sa_serviceorderid: options.id,
       historicalservicesqty: options.historicalservicesqty
     })
-    getApp().globalData.Language.getLanguagePackage(this, '转单');
+    getApp().globalData.Language.getLanguagePackage(this, '转单');
   },
   submit() {
     this.setData({
@@ -115,7 +115,7 @@ Page({
       this.setData({
         loading: false
       })
-      console.log("转单", res)
+      console.log("转单", res)
       if (res.code == 1) {
         getCurrentPages().find(v => v.__route__ == 'E-service/serviceBillList/detail').getDetail();
         wx.navigateBack({

+ 6 - 0
E-service/serviceImprovement/execute/index.js

@@ -148,6 +148,12 @@ Component({
               mask: true
             });
             if (res.code == '1') this.getList("", true)
+            try {
+              let page = getCurrentPages().find(v => v.__toute__ == 'E-service/serviceImprovement/detail')
+              page.getDetail()
+            } catch (error) {
+              console.log("更新详情失败",error)
+            }
           })
         }
       })

+ 5 - 5
E-service/workOrder/detail.js

@@ -201,7 +201,7 @@ Page({
     let that = this,
       detail = this.data.detail;
     switch (e.detail.label) {
-      case '转单':
+      case '转单':
         let leader = '';
         try {
           leader = detail.team.find(v => v.isleader).userid || 0
@@ -214,7 +214,7 @@ Page({
             pageSize: 9999
           }
         }).then(res => {
-          console.log("转单", res)
+          console.log("转单", res)
           if (res.code != '1') return wx.showToast({
             title: res.msg,
             icon: "none"
@@ -381,9 +381,9 @@ Page({
         icon: "icon-bianji2",
         label: "编辑"
       },
-      转单: {
+      转单: {
         icon: "icon-dibu-biangengchengjiaozhuangtai",
-        label: "转单"
+        label: "转单"
       },
       确认信息: {
         icon: "icon-jiaoqiqueren",
@@ -442,7 +442,7 @@ Page({
     if (statusOptions[status]) {
       if (!isLeader) statusOptions[status] = [];
       if ((isworkleader || isLeader) && status == '待接单') {
-        statusOptions[status] = statusOptions[status] = ['确认信息', '转单'].concat(statusOptions[status])
+        statusOptions[status] = statusOptions[status] = ['确认信息', '转单'].concat(statusOptions[status])
       }
       if (isLeader || isworkleader) {
         if (status == '待开始') statusOptions[status].unshift("确认信息");

+ 76 - 2
Eservice/nodeDetail/index.js

@@ -109,15 +109,89 @@ Page({
     })
     this.updateNode()
   },
+  // 校验必填项
+  validateRequiredFields() {
+    const workpreset = this.data.mainData.workpresetjson
+    const errors = []
+
+    if (workpreset.confirm == 11 && !this.data.form.confirm_value) {
+      errors.push('是否确认')
+    }
+
+    if (workpreset.fileupload == 11) {
+      const uploadComponent = this.selectComponent('#fileUpload')
+      if (uploadComponent && (!uploadComponent.data.originFiles || uploadComponent.data.originFiles.length === 0)) {
+        errors.push('上传附件')
+      }
+    }
+
+    if (workpreset.textedit == 11 && !this.data.form.textcontent) {
+      errors.push('文本信息')
+    }
+
+    if (workpreset.contractupload == 11) {
+      const contractUploadComponent = this.selectComponent('#contractUpload')
+      if (contractUploadComponent && (!contractUploadComponent.data.originFiles || contractUploadComponent.data.originFiles.length === 0)) {
+        errors.push('上传合同')
+      }
+    }
+
+    if (workpreset.amountpay == 11 && (!this.data.form.amount || this.data.form.amount == 0)) {
+      errors.push('是否有偿')
+    }
+
+    if (workpreset.signature == 11) {
+      const signNameComponent = this.selectComponent('#signName')
+      if (signNameComponent && (!signNameComponent.data.originFiles || signNameComponent.data.originFiles.length === 0)) {
+        errors.push('客户签字')
+      }
+    }
+
+    if (workpreset.addperson == 11 && (!this.data.mainData.trainers || this.data.mainData.trainers.length === 0)) {
+      errors.push('培训人员')
+    }
+
+    if (workpreset.additem == 11 && (!this.data.titems || this.data.titems.length === 0)) {
+      errors.push('工单物料')
+    }
+
+    return errors
+  },
   confirmBill() {
+    const errors = this.validateRequiredFields()
+    if (errors.length > 0) {
+      wx.showToast({
+        title: '必填信息未完善',
+        icon: 'none',
+        duration: 2000
+      })
+      return
+    }
+
     this.data.form.isconfirm = 1
     this.setData({
       form: this.data.form
     })
     this.updateNode()
   },
+  // 保存节点(不校验)
+  saveNode(e) {
+    this.updateNode(false, e)
+  },
   // 更新节点
-  async updateNode(e) {
+  async updateNode(needValidate = false, e) {
+    if (needValidate) {
+      const errors = this.validateRequiredFields()
+      if (errors.length > 0) {
+        wx.showToast({
+          title: '必填信息未完善',
+          icon: 'none',
+          duration: 2000
+        })
+        return
+      }
+    }
+
     this.data.form.traintitem = this.data.titems
     this.data.form.sa_workorderid = this.data.sa_workorderid
     this.data.form.sa_workorder_nodeid = this.data.sa_workorder_nodeid
@@ -132,7 +206,7 @@ Page({
       })
       this.addUser(false);
     }
-    if (e && e.currentTarget.dataset.info === 'needBack') {
+    if (e && e.currentTarget && e.currentTarget.dataset.info === 'needBack') {
       wx.navigateBack()
     } else {
       this.nodeDetail()

+ 3 - 3
Eservice/nodeDetail/index.wxml

@@ -60,7 +60,7 @@
     </view>
     <card>
       <view style="flex:1" slot="content">
-        <upload id="upload" bindData="{{bindNormalData}}"></upload>
+        <upload id="fileUpload" bindData="{{bindNormalData}}"></upload>
         <!-- <image-viewer list="{{list}}"></image-viewer> -->
       </view>
     </card>
@@ -85,7 +85,7 @@
     </view>
     <card>
       <view style="flex:1" slot="content">
-        <upload id="upload" source="messageFile" bindData="{{bindContractData}}"></upload>
+        <upload id="contractUpload" source="messageFile" bindData="{{bindContractData}}"></upload>
       </view>
     </card>
   </view>
@@ -173,6 +173,6 @@
   </view>
   <view wx:if="{{stopClick != 'stopClick'}}">
     <t-button style="margin-bottom:10px" theme="primary" size="large" bind:tap="confirmBill" block>{{language['确认完成']||'确认完成'}}</t-button>
-    <t-button theme="primary" size="large" bind:tap="updateNode" data-info="needBack" block>{{language['保存']||'保存'}}</t-button>
+    <t-button theme="primary" size="large" bind:tap="saveNode" data-info="needBack" block>{{language['保存']||'保存'}}</t-button>
   </view>
 </view>

+ 1 - 1
Eservice/workerLeader/editworkOrderDetail/index.wxml

@@ -126,7 +126,7 @@
   </view>
 </t-dialog>
 <wxs src="../../../utils/wxmlQueryPer.wxs" module="wqp" />
-<t-dialog visible="{{workLeaderDialog}}" title="{{language['转单']||'转单'}}" confirm-btn="{{language['确定']||'确定'}}" cancel-btn="{{language['取消']||'取消'}}" bind:confirm="toWorker" bind:cancel="showWorkerDialog">
+<t-dialog visible="{{workLeaderDialog}}" title="{{language['转单']||'转单'}}" confirm-btn="{{language['确定']||'确定'}}" cancel-btn="{{language['取消']||'取消'}}" bind:confirm="toWorker" bind:cancel="showWorkerDialog">
   <view slot="content">
     <view class="d-title">
       {{language['选择负责人']||'选择负责人'}}:

+ 2 - 2
Eservice/workerLeader/serviceBillDetail/index.js

@@ -40,7 +40,7 @@ Page({
       }];
     } else if (res.data.status == '待指派') {
       tabbarsList = [{
-        label: "转单",
+        label: "转单",
         icon: "icon-shenhe"
       }, {
         label: "退回",
@@ -192,7 +192,7 @@ Page({
           .catch((err) => console.log(err))
           .finally(() => Dialog.close());
         break;
-      case "转单":
+      case "转单":
         this.setData({
           showToWoker: true
         })

+ 1 - 1
Eservice/workerLeader/serviceBillDetail/index.wxml

@@ -90,7 +90,7 @@
   <t-textarea style="margin-top:20px" slot="content" placeholder="请输入退回原因" value="" disableDefaultPadding="{{true}}" bind:change="inputReason" autosize bordered />
 </t-dialog>
 
-<t-dialog visible="{{showToWoker}}" title="{{language['转单']||'转单'}}" confirm-btn="{{language['确定']||'确定'}}" cancel-btn="{{language['取消']||'取消'}}" bind:confirm="toWorker" bind:cancel="showBackReason">
+<t-dialog visible="{{showToWoker}}" title="{{language['转单']||'转单'}}" confirm-btn="{{language['确定']||'确定'}}" cancel-btn="{{language['取消']||'取消'}}" bind:confirm="toWorker" bind:cancel="showBackReason">
   <view slot="content">
     <view class="d-title">
       {{language['选择工单模板']||'选择工单模板'}}: