Browse Source

no message

linwenxin 4 months ago
parent
commit
daace3e431

+ 1 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/orderStatus.json

@@ -37,4 +37,4 @@
   "WDBH": "网点驳回",
   "GCSZX": "工程师完工",
   "DJD": "待接单"
-}
+}

+ 21 - 13
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/serviceInfo.js

@@ -495,19 +495,27 @@ export default {
       )
     }
 
-    getDataDictionary({
-      pageNum: 1,
-      pageSize: -1,
-      params: [
-        { param: 'a.status', compare: '=', value: 'ON' },
-        { param: 'a.dict_type', compare: '=', value: 'SALES_TYPE' }
-      ]
-    }).then(res => {
-      this.SALES_TYPE_LIST = res.data.records.map(item => ({
-        value: Number(item.dictCode),
-        label: item.dictValue
-      }))
-    })
+    // getDataDictionary({
+    //   pageNum: 1,
+    //   pageSize: -1,
+    //   params: [
+    //     { param: 'a.status', compare: '=', value: 'ON' },
+    //     { param: 'a.dict_type', compare: '=', value: 'SALES_TYPE' }
+    //   ]
+    // }).then(res => {
+    //   this.SALES_TYPE_LIST = res.data.records
+    //     .filter(item => {
+    //       if (this.orderInfo?.isImportExcel) {
+    //         return Number(item.dictCode) < 100
+    //       } else {
+    //         return Number(item.dictCode) >= 100
+    //       }
+    //     })
+    //     .map(item => ({
+    //       value: Number(item.dictCode),
+    //       label: item.dictValue
+    //     }))
+    // })
 
     // 获取工单渠道
     getDataDictionary({

+ 26 - 4
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/workOrderLogic.js

@@ -8,6 +8,7 @@ import {
   email
 } from '@/components/template/rules_verify.js'
 import { orderBaseDetail, orderBaseProductList } from '@/api/workOrderPool.js'
+import { getDataDictionary } from '@/api/dataDictionary.js'
 import md5 from 'md5'
 var initdata_ = {
   // 基础信息--------------------
@@ -97,6 +98,27 @@ export default {
     id: {
       handler(newVal, oldVal) {
         this.getorderDetail(data => {
+          getDataDictionary({
+            pageNum: 1,
+            pageSize: -1,
+            params: [
+              { param: 'a.status', compare: '=', value: 'ON' },
+              { param: 'a.dict_type', compare: '=', value: 'SALES_TYPE' }
+            ]
+          }).then(res => {
+            this.SALES_TYPE_LIST = res.data.records
+              .filter(item => {
+                if (this.orderInfo?.isImportExcel) {
+                  return Number(item.dictCode) < 100
+                } else {
+                  return Number(item.dictCode) >= 100
+                }
+              })
+              .map(item => ({
+                value: Number(item.dictCode),
+                label: item.dictValue
+              }))
+          })
           if (!!~[1, 2, 3].indexOf(this?.workOrderType)) {
             this.$nextTick(() => {
               // 获取地址信息
@@ -313,8 +335,10 @@ export default {
         },
         saleType: {
           isEdit:
-            this.userInfo.type == 1 &&
-            ['DYY', 'DQD', 'DSHPG', 'DWDPG', 'DJD', 'FWZ'].includes(this?.orderInfo?.orderStatus),
+            !this.orderInfo.id ||
+            ((this.userInfo.type == 1 ||
+              `(${this?.userInfo.userName})${this?.userInfo.nickName}` == this?.orderInfo.createBy) &&
+              ['DYY', 'DQD', 'DSHPG', 'DWDPG', 'DJD', 'FWZ'].includes(this?.orderInfo?.orderStatus)),
           isShow: true,
           isRules: [...required]
         },
@@ -463,14 +487,12 @@ export default {
       if (this.cloneWorkOrder) {
         // 创建工单
         this.orderInfo = Object.assign({}, JSON.parse(JSON.stringify(this.cloneWorkOrder)), {
-          saleType: this?.workOrderType,
           workerId_fz: ''
         })
         cb && cb(this.orderInfo)
       } else {
         // 创建工单
         this.orderInfo = Object.assign({}, JSON.parse(JSON.stringify(initdata_)), {
-          saleType: this?.workOrderType,
           workerId_fz: ''
         })
         cb && cb(this.orderInfo)