linwenxin 1 vuosi sitten
vanhempi
commit
2ee5f8325e

+ 121 - 4
src/views/valueAddedService/valueAddedConfig/index.vue

@@ -26,6 +26,7 @@ import { required, mobileRequired, mobile, httpUrl, email } from '@/components/t
 import { getClassifyList } from '@/api/goods'
 import { getDataDictionary } from '@/api/dataDictionary.js'
 import operation_mixin from '@/components/template/operation_mixin.js'
+import { getWebsit } from "@/api/customerManagement.js"
 export default {
   props: {
     storageType: {
@@ -57,7 +58,8 @@ export default {
         "status": true,
         "type": "",
         "usedType": "",
-        pgIncreItems: []
+        pgIncreItems: [],
+        pgIncreWebsits: []
       },
       formDialog: false,
       isEditIndex: -1,
@@ -65,6 +67,8 @@ export default {
       classifyList: [],
       classifyListLv2: [],
       clickLook: true,
+      websitList: [],
+      websitIndex: -1
     }
   },
   computed: {
@@ -454,6 +458,109 @@ export default {
           }
         },
         {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '服务网点',
+            prop: 'pgIncreWebsits',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div>
+                <div style="margin-bottom:8px">
+                  <el-button onClick={() => {
+                    this.formData.pgIncreWebsits.push({
+                      websitId: "",
+                      linkName: "",
+                      websitPhone: "",
+                      address: "",
+                    });
+                    this.websitIndex = this.formData.pgIncreWebsits.length - 1
+                  }}>添加</el-button>
+                </div>
+                <zj-table
+                  columns={[{
+                    columnAttributes: {
+                      label: '网点名称',
+                      prop: 'websitId'
+                    },
+                    render: (h, { row, column, index }) => {
+                      return <div>
+                        <el-form-item label="" label-width="0px" prop={`pgIncreWebsits.${index}.${column.columnAttributes.prop}`} rules={required}>
+                          <el-select
+                            value={row[column.columnAttributes.prop]}
+                            onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                            disabled={!(this.websitIndex == index)}
+                            onChange={(val) => {
+                              if (val) {
+                                var data = this.websitList.find(item => item.value == val)
+                                row.linkName = data.data.linkName
+                                row.websitPhone = data.data.websitPhone
+                                row.address = data.data.address
+                              } else {
+                                row.linkName = ""
+                                row.websitPhone = ""
+                                row.address = ""
+                              }
+                            }}
+                            placeholder="请选择">
+                            {this.websitList.filter(item => (row.websitId == item.value || !this.formData.pgIncreWebsits.find(val => (val.websitId == item.value)))).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
+                          </el-select>
+                        </el-form-item>
+                      </div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '联系人',
+                      prop: 'linkName'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '联系电话',
+                      prop: 'websitPhone'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '地址',
+                      prop: 'address'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '操作',
+                    },
+                    render: (h, { row, column, index }) => {
+                      return <div style="padding-left:10px">
+                        {this.websitIndex == index ? <el-button type="text" onClick={() => {
+                          this.websitIndex = -1
+                        }}>确定</el-button> : null}
+                        {this.websitIndex != index ? <el-button type="text" onClick={() => {
+                          this.websitIndex = index
+                        }}>编辑</el-button> : null}
+                        <el-button type="text" onClick={() => {
+                          if (this.websitIndex == index) {
+                            this.websitIndex = -1
+                          }
+                          this.formData.pgIncreWebsits.splice(index, 1)
+                        }}>删除</el-button>
+                      </div>
+                    }
+                  }]}
+                  tableData={this.formData.pgIncreWebsits}
+                  tableAttributes={{
+                    size: 'mini',
+                    border: true,
+                  }} />
+              </div>
+            )
+          }
+        },
+        {
           name: 'el-input',
           md: 24,
           attributes: { disabled: false, placeholder: '请输入', type: "textarea" },
@@ -510,7 +617,9 @@ export default {
     },
     getDetail(id) {
       increConfigDetail({ id }).then(res => {
-        Object.assign(this.formData, res.data)
+        Object.assign(this.formData, res.data, {
+          pgIncreWebsits: res.data.pgIncreWebsits || []
+        })
         this.openForm()
       })
     },
@@ -543,8 +652,9 @@ export default {
     openForm() {
       Promise.all([
         getDataDictionary({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "ON" }, { "param": "a.dict_type", "compare": "=", "value": "BRAND" }] }),
-        getClassifyList({ type: 2, status: true })
-      ]).then(([res1, res2]) => {
+        getClassifyList({ type: 2, status: true }),
+        getWebsit({ isIncre: true })
+      ]).then(([res1, res2, res3]) => {
         // 获取品牌
         this.orderBrands = res1.data.records.map(item => ({
           value: item.dictCode,
@@ -560,6 +670,13 @@ export default {
           }
         });
         this.classifyListLv2 = classifyListLv2
+
+        this.websitList = res3.data.map(item => ({
+          label: item.name,
+          value: item.websitId,
+          data: item
+        }))
+
         var { companyWechatId, companyName } = JSON.parse(localStorage.getItem('greemall_user'))
         this.formData.companyWechatId = companyWechatId
         this.formData.companyWechatName = companyName

+ 2 - 2
src/views/workOrder/workOrderPool/detailModule/SettleAccounts/index.vue

@@ -1171,7 +1171,7 @@ export default {
           var pfuqinid = 0
           res.data.normList.map((item, index) => {
             if (!orderChannelId) { orderChannelId = item.orderChannelId }
-            item.settleNum = item.orderNum
+            item.settleNum = item.settleNum || ""
             normList.push({ ...item, pfuqinid: pfuqinid, zijideid: 0, bianji: res.data.settleStatus == 'YJS' ? false : true })
             item.workerList.map((resdata, ind_) => {
               if(resdata.poolStatus === "NO"){ this.showbtn = true }
@@ -1182,7 +1182,7 @@ export default {
           var otherNormList = []
           var qtpfuqinid = 0
           res.data.otherNormList.map((item, index) => {
-            item.settleNum = item.orderNum
+            item.settleNum = item.settleNum || ""
             otherNormList.push({ ...item, pfuqinid: qtpfuqinid, zijideid: 0, bianji: res.data.settleStatus == 'YJS' ? false : true })
             item.workerList.map((resdata, ind_) => {
               if(resdata.poolStatus === "NO"){ this.showbtn = true }

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

@@ -50,53 +50,79 @@ export default {
             rules: this.formOptions.orderSmallType.isRules
           }
         },
-        ...(() => {
-          if (this.workOrderType == 0) {
-            // 普通工单
-            return [{
-              isShow: this.formOptions.orderChannelId.isShow,
-              name: 'el-select',
-              md: 6,
-              options: this.orderChannels,
-              attributes: {
-                disabled: !this.formOptions.orderChannelId.isEdit,
-                placeholder: '请选择',
-                clearable: true,
-                filterable: true
-              },
-              formItemAttributes: {
-                label: '工单来源',
-                prop: 'orderChannelId',
-                rules: this.formOptions.orderChannelId.isRules
-              },
-              events: {
-                change: (val) => {
-                  if (val) {
-                    this.orderInfo.orderChannelText = this.orderChannels.find(item => item.value == val).label
-                  } else {
-                    this.orderInfo.orderChannelText = ''
-                  }
-                }
-              }
-            }]
-          } else if (this.workOrderType == 1) {
-            this.orderInfo.orderChannelId = "工程维保"
-            // 维保工单
-            return [{
-              isShow: this.formOptions.orderChannelId.isShow,
-              name: 'el-input',
-              md: 6,
-              attributes: {
-                disabled: !this.formOptions.orderChannelId.isEdit,
-              },
-              formItemAttributes: {
-                label: '工单来源',
-                prop: 'orderChannelId',
-                rules: this.formOptions.orderChannelId.isRules
+        {
+          isShow: this.formOptions.orderChannelId.isShow,
+          name: 'el-select',
+          md: 6,
+          options: this.orderChannels,
+          attributes: {
+            disabled: !this.formOptions.orderChannelId.isEdit,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '工单来源',
+            prop: 'orderChannelId',
+            rules: this.formOptions.orderChannelId.isRules
+          },
+          events: {
+            change: (val) => {
+              if (val) {
+                this.orderInfo.orderChannelText = this.orderChannels.find(item => item.value == val).label
+              } else {
+                this.orderInfo.orderChannelText = ''
               }
-            }]
+            }
           }
-        })(),
+        },
+        // ...(() => {
+        //   if (this.workOrderType == 0) {
+        //     // 普通工单
+        //     return [{
+        //       isShow: this.formOptions.orderChannelId.isShow,
+        //       name: 'el-select',
+        //       md: 6,
+        //       options: this.orderChannels,
+        //       attributes: {
+        //         disabled: !this.formOptions.orderChannelId.isEdit,
+        //         placeholder: '请选择',
+        //         clearable: true,
+        //         filterable: true
+        //       },
+        //       formItemAttributes: {
+        //         label: '工单来源',
+        //         prop: 'orderChannelId',
+        //         rules: this.formOptions.orderChannelId.isRules
+        //       },
+        //       events: {
+        //         change: (val) => {
+        //           if (val) {
+        //             this.orderInfo.orderChannelText = this.orderChannels.find(item => item.value == val).label
+        //           } else {
+        //             this.orderInfo.orderChannelText = ''
+        //           }
+        //         }
+        //       }
+        //     }]
+        //   } else if (this.workOrderType == 1) {
+        //     this.orderInfo.orderChannelId = "工程维保"
+        //     // 维保工单
+        //     return [{
+        //       isShow: this.formOptions.orderChannelId.isShow,
+        //       name: 'el-input',
+        //       md: 6,
+        //       attributes: {
+        //         disabled: !this.formOptions.orderChannelId.isEdit,
+        //       },
+        //       formItemAttributes: {
+        //         label: '工单来源',
+        //         prop: 'orderChannelId',
+        //         rules: this.formOptions.orderChannelId.isRules
+        //       }
+        //     }]
+        //   }
+        // })(),
         {
           isShow: this.formOptions.appointmentTime.isShow,
           name: 'el-date-picker',
@@ -145,13 +171,13 @@ export default {
           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
-        }))
-      })
     }
+    // 获取工单来源
+    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
+      }))
+    })
   },
 }