linwenxin hai 1 ano
pai
achega
cd6a5888be

+ 24 - 22
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/basicInfo.js

@@ -46,7 +46,7 @@ export default {
               },
               events: {
                 change: (val) => {
-                  this.getorderDetail(()=>{
+                  this.getorderDetail(() => {
                     if (val) {
                       this.orderInfo.rpProjectRepairId = val
                       this.orderInfo.rpProjectRepairName = this.wb_project.find(item => item.value == val).label
@@ -292,27 +292,29 @@ export default {
     }
   },
   methods: {
-    getWeiBaoDetail(){
-      if(this.orderInfo.rpProjectRepairId){
+    getWeiBaoDetail() {
+      if (this.orderInfo.rpProjectRepairId) {
         getDetail({
-          id:this.orderInfo.rpProjectRepairId
-        }).then(res=>{
+          id: this.orderInfo.rpProjectRepairId
+        }).then(res => {
 
-          this.orderInfo.userName = res.data.manger
-          this.orderInfo.linkName = res.data.manger
-          this.orderInfo.userMobile = res.data.mobile
-          this.orderInfo.provinceId = res.data.provinceId
-          this.orderInfo.province = res.data.province
-          this.orderInfo.cityId = res.data.cityId
-          this.orderInfo.city = res.data.city
-          this.orderInfo.areaId = res.data.areaId
-          this.orderInfo.area = res.data.area
-          this.orderInfo.streetId = res.data.streetId
-          this.orderInfo.street = res.data.street
-          this.orderInfo.gpsAddress = res.data.gpsAddress||res.data.address
-          this.orderInfo.lat = res.data.lat
-          this.orderInfo.lng = res.data.lng
-          this.orderInfo.address = res.data.address
+          if (!this.id) {
+            this.orderInfo.userName = res.data.manger
+            this.orderInfo.linkName = res.data.manger
+            this.orderInfo.userMobile = res.data.mobile
+            this.orderInfo.provinceId = res.data.provinceId
+            this.orderInfo.province = res.data.province
+            this.orderInfo.cityId = res.data.cityId
+            this.orderInfo.city = res.data.city
+            this.orderInfo.areaId = res.data.areaId
+            this.orderInfo.area = res.data.area
+            this.orderInfo.streetId = res.data.streetId
+            this.orderInfo.street = res.data.street
+            this.orderInfo.gpsAddress = res.data.gpsAddress || res.data.address
+            this.orderInfo.lat = res.data.lat
+            this.orderInfo.lng = res.data.lng
+            this.orderInfo.address = res.data.address
+          }
 
           // 工单小类下拉
           this.orderSmallTypeData = res.data.typeList.map(item => ({
@@ -321,13 +323,13 @@ export default {
           }))
 
           // 网点下拉数据
-          this.websitList = (res.data.websitList||[]).map(item => ({
+          this.websitList = (res.data.websitList || []).map(item => ({
             label: item.websitName,
             value: item.websitId
           }))
 
           // 产品信息可选项
-          this.productList_wb = (res.data.productList||[])
+          this.productList_wb = (res.data.productList || [])
 
           this.getinitlbslist()
         })

+ 1 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/pandanxinxi.js

@@ -213,7 +213,7 @@ export default {
   },
   created() {
     // 普通工单选择网点数据
-    if(this.workOrderType == 0){
+    if (this.workOrderType == 0) {
       getWebsit({ type: "C", status: true, isAll: this.isAllWebsit || this.id ? true : false }).then(res => {
         this.websitList = res.data.map(item => ({
           label: item.name,

+ 1 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/productColumns.js

@@ -246,7 +246,7 @@ export default {
                         "mainId": "",
                         "mainName": "",
                         "num": "",
-                        "insideCode":"",
+                        "insideCode": "",
                         "orderBaseId": this.id || '',
                         "productId": "",
                         "productName": "",

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

@@ -54,7 +54,7 @@ export default {
           if (this.workOrderType == 0) {
             // 普通工单
             return [{
-              isShow: this.formOptions.orderChannelId.isShow && !this.id,
+              isShow: this.formOptions.orderChannelId.isShow,
               name: 'el-select',
               md: 6,
               options: this.orderChannels,
@@ -83,7 +83,7 @@ export default {
             this.orderInfo.orderChannelId = "工程维保"
             // 维保工单
             return [{
-              isShow: this.formOptions.orderChannelId.isShow && !this.id,
+              isShow: this.formOptions.orderChannelId.isShow,
               name: 'el-input',
               md: 6,
               attributes: {
@@ -137,21 +137,21 @@ export default {
   },
   created() {
     // 普通工单选择网点数据
-    if(this.workOrderType == 0){
-    // 获取工单类型
-    listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
-      this.orderSmallTypeData = res.data.records.map(item => ({
-        value: item.id,
-        label: item.orderSmallTypeText
-      }))
-    })
-    // 获取工单渠道
-    getDataDictionary({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "ON" }, { "param": "a.dict_type", "compare": "=", "value": "ORDER_CHANNEL" }] }).then(res => {
-      this.orderChannels = res.data.records.map(item => ({
-        value: item.dictCode,
-        label: item.dictValue
-      }))
-    })
-  }
+    if (this.workOrderType == 0) {
+      // 获取工单类型
+      listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
+        this.orderSmallTypeData = res.data.records.map(item => ({
+          value: item.id,
+          label: item.orderSmallTypeText
+        }))
+      })
+      // 获取工单渠道
+      getDataDictionary({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "ON" }, { "param": "a.dict_type", "compare": "=", "value": "ORDER_CHANNEL" }] }).then(res => {
+        this.orderChannels = res.data.records.map(item => ({
+          value: item.dictCode,
+          label: item.dictValue
+        }))
+      })
+    }
   },
 }

+ 1 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/wb_productColumns.js

@@ -255,7 +255,7 @@ export default {
                         "mainId": "",
                         "mainName": "",
                         "num": "",
-                        "insideCode":"",
+                        "insideCode": "",
                         "orderBaseId": this.id || '',
                         "productId": "",
                         "productName": "",

+ 6 - 8
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/workOrderLogic.js

@@ -68,17 +68,15 @@ export default {
     id: {
       handler(newVal, oldVal) {
         this.getorderDetail((data) => {
-          if(this.workOrderType==0){
+          if (this.workOrderType == 0) {
             this.$nextTick(() => {
               // 获取地址信息
               this.getinitlbslist()
               // 获取可选师傅
               this.getWorkers()
             })
-          }else if(this.workOrderType==1){
+          } else if (this.workOrderType == 1) {
             this.$nextTick(() => {
-              // 获取地址信息
-              this.getinitlbslist()
               // 获取维保单详情
               this.getWeiBaoDetail()
             })
@@ -156,7 +154,7 @@ export default {
         },
         // 客户名称
         userName: {
-          isEdit: this.workOrderType == 0 &&  !finish,
+          isEdit: this.workOrderType == 0 && !finish,
           isShow: true,
           isRules: [...required]
         },
@@ -180,13 +178,13 @@ export default {
         },
         // gps地址
         gpsAddress: {
-          isEdit:  this.workOrderType == 0 && !finish,
+          isEdit: this.workOrderType == 0 && !finish,
           isShow: true,
           isRules: [...required]
         },
         // 详细地址
         address: {
-          isEdit: this.workOrderType == 0 &&  !finish,
+          isEdit: this.workOrderType == 0 && !finish,
           isShow: true,
           isRules: []
         },
@@ -198,7 +196,7 @@ export default {
           isRules: [...required]
         },
         orderChannelId: {
-          isEdit: this.id ? false : this.workOrderType == 0 && true,
+          isEdit: this.id || this.workOrderType == 1 ? false : true,
           isShow: true,
           isRules: [...required]
         },