linwenxin hace 4 meses
padre
commit
cc8688f88e
Se han modificado 40 ficheros con 10004 adiciones y 0 borrados
  1. 53 0
      src/views/workOrder/workOrderPool2/components/mixins/showRecordSelected.js
  2. 112 0
      src/views/workOrder/workOrderPool2/components/reassignment/index.vue
  3. 312 0
      src/views/workOrder/workOrderPool2/components/reassignment/pandanxinxi.js
  4. 206 0
      src/views/workOrder/workOrderPool2/components/reschedule/index.vue
  5. 147 0
      src/views/workOrder/workOrderPool2/detail.vue
  6. 96 0
      src/views/workOrder/workOrderPool2/detailModule/CallLog/index.vue
  7. 296 0
      src/views/workOrder/workOrderPool2/detailModule/CompletionDetails/index.vue
  8. 98 0
      src/views/workOrder/workOrderPool2/detailModule/Evaluation/index.vue
  9. 116 0
      src/views/workOrder/workOrderPool2/detailModule/OperationDetail/index.vue
  10. 250 0
      src/views/workOrder/workOrderPool2/detailModule/PartsApplication/formModule.vue
  11. 70 0
      src/views/workOrder/workOrderPool2/detailModule/PartsApplication/index.vue
  12. 786 0
      src/views/workOrder/workOrderPool2/detailModule/Payment/index.vue
  13. 1657 0
      src/views/workOrder/workOrderPool2/detailModule/SettleAccounts/index.vue
  14. 56 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/abnormal.vue
  15. 56 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/activateOrder.vue
  16. 35 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/button_mixin.js
  17. 57 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/cancelOrder.vue
  18. 75 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/cloneWorkOrder.vue
  19. 29 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/closeButton.vue
  20. 142 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/cloudCall.vue
  21. 62 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/commitSave.vue
  22. 124 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/copyInfo.vue
  23. 56 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/orderBaseDow.vue
  24. 58 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/orderReject.vue
  25. 459 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/processFeedback.vue
  26. 56 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/unurgent.vue
  27. 56 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/urgent.vue
  28. 35 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/workContactLetter.vue
  29. 214 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/index.vue
  30. 687 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/basicInfo.js
  31. 251 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/dispatchInfo.js
  32. 40 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/orderStatus.json
  33. 27 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/otherInfo.js
  34. 394 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/pandanxinxi.js
  35. 495 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/productColumns.js
  36. 557 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/serviceInfo.js
  37. 493 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/wb_productColumns.js
  38. 502 0
      src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/workOrderLogic.js
  39. 736 0
      src/views/workOrder/workOrderPool2/index.vue
  40. 53 0
      src/views/workOrder/workOrderPool2/mixins/orderStatus_FH.js

+ 53 - 0
src/views/workOrder/workOrderPool2/components/mixins/showRecordSelected.js

@@ -0,0 +1,53 @@
+import { required } from '@/components/template/rules_verify.js'
+import { orderBaseList } from '@/api/workOrderPool.js'
+import { tableDataParsing } from '@/utils/common.js'
+export default {
+  props: {
+    recordSelected: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      columns: []
+    }
+  },
+  watch: {
+    recordSelected: {
+      handler() {
+        this.orderInfo.recordSelected = [...this.recordSelected.map(item => ({ ...item }))]
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  created() {
+    orderBaseList({ pageNum: 1, pageSize: 1, params: [{ param: 'a.id', compare: '=', value: '0' }] }).then(res => {
+      this.columns = tableDataParsing(res.fieldBeans.filter(item => !~['orderFlags', 'orderType'].indexOf(item.jname)))
+    })
+  },
+  computed: {
+    selectedItems() {
+      return [
+        {
+          name: 'slot-component',
+          md: 24,
+          formItemAttributes: {
+            label: '',
+            'label-width': '0px',
+            prop: 'recordSelected',
+            rules: [...required]
+          },
+          render: (h, { props }) => {
+            return (
+              <div>
+                <zj-table columns={this.columns} table-data={this.orderInfo.recordSelected} />
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  }
+}

+ 112 - 0
src/views/workOrder/workOrderPool2/components/reassignment/index.vue

@@ -0,0 +1,112 @@
+<template>
+  <zj-page-container>
+    <zj-page-fill class="neibuview">
+      <zj-form-container ref="formRef" :form-data="orderInfo" :form-attributes="{ size: 'mini' }">
+        <zj-form-module
+          title="派单信息"
+          label-width="100px"
+          :form-data="orderInfo"
+          :form-items="pandanxinxi"
+        ></zj-form-module>
+        <zj-form-module
+          title="已选工单"
+          label-width="100px"
+          :form-data="orderInfo"
+          :form-items="selectedItems"
+        ></zj-form-module>
+      </zj-form-container>
+    </zj-page-fill>
+    <!-- 操作按钮 -->
+    <div>
+      <div style="box-sizing: border-box; padding: 16px; text-align: right">
+        <el-button size="mini" @click="$emit('close')"> 取消 </el-button>
+        <el-button type="primary" size="mini" @click="allVerify"> 确定 </el-button>
+      </div>
+    </div>
+  </zj-page-container>
+</template>
+
+<script>
+import pandanxinxi from './pandanxinxi.js'
+import showRecordSelected from '../mixins/showRecordSelected.js'
+import { required } from '@/components/template/rules_verify.js'
+import { changeOrderChangeWorker } from '@/api/workOrderPool.js'
+export default {
+  mixins: [pandanxinxi, showRecordSelected],
+  data() {
+    return {
+      orderInfo: {
+        websitId: '',
+        workerId: '',
+        workerId_fz: '',
+        orderWorkers: [],
+        recordSelected: []
+      },
+      isAllWebsit: true
+    }
+  },
+  computed: {
+    formOptions() {
+      return {
+        // 派单信息-----------------------------
+        // 服务商网点
+        websitId: {
+          isEdit: true,
+          isShow: true,
+          isRules: [...required]
+        },
+        isQd: {
+          isEdit: false,
+          isShow: false,
+          isRules: []
+        },
+        workerId: {
+          isEdit: true,
+          isShow: true,
+          isRules: [...required]
+        },
+        orderWorkers: {
+          isEdit: true,
+          isShow: true,
+          isRules: [...required]
+        }
+      }
+    }
+  },
+  methods: {
+    allVerify() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          changeOrderChangeWorker({
+            ids: this.orderInfo.recordSelected.map(item => item.id),
+            websitId: this.orderInfo.websitId,
+            workerIds: this.orderInfo.orderWorkers.map(item => item.workerId)
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '派单成功!'
+            })
+            this.$emit('close')
+          })
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep & > .zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    & > div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 312 - 0
src/views/workOrder/workOrderPool2/components/reassignment/pandanxinxi.js

@@ -0,0 +1,312 @@
+import { getWebsit } from '@/api/customerManagement.js'
+import { memberListPageV2 } from '@/api/masterManagement'
+
+export default {
+  data() {
+    return {
+      websitList: [],
+      workerList: []
+    }
+  },
+  computed: {
+    workersColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '工程师信息',
+            prop: 'workerName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '工程师类型',
+            prop: 'isMaster'
+          },
+          render: (h, { row, column, index }) => {
+            return <div style="padding-left:10px">{row.isMaster ? '主要工程师' : '辅助工程师'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '联系电话',
+            prop: 'workerMobile'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '身份证',
+            prop: 'workerIdcard'
+          }
+        },
+        ...(() => {
+          if (this.formOptions.orderWorkers.isEdit) {
+            return [
+              {
+                columnAttributes: {
+                  label: '操作'
+                },
+                render: (h, { row, column, index }) => {
+                  return !row.isMaster ? (
+                    <div style="padding-left:10px">
+                      <el-button
+                        type="text"
+                        onClick={() => {
+                          this.orderInfo.orderWorkers.splice(index, 1)
+                        }}
+                      >
+                        删除
+                      </el-button>
+                    </div>
+                  ) : null
+                }
+              }
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    pandanxinxi() {
+      return [
+        {
+          isShow: !this?.orderInfo?.isThreeOrder && this.formOptions.websitId.isShow,
+          name: 'el-select',
+          options: this.websitList.map(item => ({ ...item, label: `(${item.value})${item.label}` })),
+          md: 8,
+          attributes: {
+            disabled: !this.formOptions.websitId.isEdit,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '网点名称',
+            prop: 'websitId',
+            rules: this.formOptions.websitId.isRules
+          },
+          events: {
+            change: val => {
+              this.orderInfo.workerId = ''
+              this.orderInfo.workerName = ''
+              this.orderInfo.workerIdcard = ''
+              this.orderInfo.workerMobile = ''
+              this.workerList = []
+              this.orderInfo.orderWorkers = []
+              this.getWorkers()
+              if (val) {
+                this.orderInfo['websitName'] = this.websitList.find(item => item.value == val).label
+              } else {
+                this.orderInfo['websitName'] = ''
+              }
+            }
+          }
+        },
+        {
+          isShow: !!this?.orderInfo?.isThreeOrder && this.formOptions.websitId.isShow,
+          name: 'slot-component',
+          md: 8,
+          attributes: { disabled: true, placeholder: '请输入' },
+          formItemAttributes: { label: '网点信息', prop: 'websitName' },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <el-input
+                value={`${formData.websitName || ''}-${formData.websitId || ''}`}
+                disabled={true}
+                size="mini"
+                placeholder="请输入"
+              ></el-input>
+            )
+          }
+        },
+        {
+          isShow: this.formOptions.isQd.isShow,
+          name: 'el-switch',
+          md: 8,
+          attributes: {
+            disabled: !this.formOptions.isQd.isEdit
+          },
+          formItemAttributes: {
+            label: '是否抢单',
+            prop: 'isQd',
+            rules: this.formOptions.isQd.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.isQd.isShow,
+          name: 'slot-component',
+          md: 8,
+          formItemAttributes: { label: '', prop: '' },
+          render: (h, { props }) => {
+            return null
+          }
+        },
+        {
+          isShow: !this.formOptions.isQd.isShow,
+          name: 'slot-component',
+          md: 16,
+          formItemAttributes: { label: '', prop: '' },
+          render: (h, { props }) => {
+            return null
+          }
+        },
+        ...(() => {
+          if (this.formOptions.workerId.isEdit) {
+            return [
+              {
+                isShow: this.formOptions.workerId.isShow,
+                name: 'el-select',
+                options: this.workerList.filter(
+                  item =>
+                    this.orderInfo.workerId == item.value ||
+                    !~this.orderInfo.orderWorkers.map(item => item.workerId).indexOf(item.value)
+                ),
+                md: 8,
+                attributes: {
+                  disabled: !this.formOptions.workerId.isEdit,
+                  placeholder: '请选择',
+                  clearable: true,
+                  filterable: true
+                },
+                formItemAttributes: {
+                  label: '主要工程师',
+                  prop: 'workerId',
+                  rules: this.formOptions.workerId.isRules
+                },
+                events: {
+                  change: val => {
+                    var index = this.orderInfo.orderWorkers.map(item => item.isMaster).indexOf(true)
+                    if (!!~index) {
+                      this.orderInfo.orderWorkers.splice(index, 1)
+                    }
+                    if (val) {
+                      var data = this.workerList.find(item => item.value == val).data
+                      this.orderInfo.workerName = data.workerName
+                      this.orderInfo.workerIdcard = data.workerIdcard
+                      this.orderInfo.workerMobile = data.workerMobile
+                      this.orderInfo.orderWorkers.unshift({ ...data, isMaster: true })
+                      if (data.slaveWorkerId) {
+                        var data2 = this.workerList.find(item => item.value == data.slaveWorkerId).data
+                        this.orderInfo.orderWorkers.push({ ...data2, isMaster: false })
+                        this.orderInfo.workerId_fz = ''
+                      }
+                      if (this.orderInfo.orderWorkers.length > 1) {
+                        this.orderInfo.orderWorkers.map((item, index) => {
+                          if (index > 0) {
+                            item.isMaster = false
+                          }
+                        })
+                      }
+                    } else {
+                      this.orderInfo.workerName = ''
+                      this.orderInfo.workerIdcard = ''
+                      this.orderInfo.workerMobile = ''
+                    }
+                  }
+                }
+              }
+            ]
+          }
+          return []
+        })(),
+        ...(() => {
+          if (this.formOptions.orderWorkers.isEdit) {
+            return [
+              {
+                isShow: this.formOptions.orderWorkers.isEdit,
+                name: 'el-select',
+                options: this.workerList.filter(
+                  item => !~this.orderInfo.orderWorkers.map(item => item.workerId).indexOf(item.value)
+                ),
+                md: 8,
+                attributes: {
+                  disabled: !this.formOptions.orderWorkers.isEdit,
+                  placeholder: '请选择',
+                  clearable: true,
+                  filterable: true
+                },
+                formItemAttributes: {
+                  label: '辅助工程师',
+                  prop: 'workerId_fz'
+                },
+                events: {
+                  change: val => {
+                    if (val) {
+                      var data = this.workerList.find(item => item.value == val).data
+                      this.orderInfo.orderWorkers.push({ ...data, isMaster: false })
+                      this.orderInfo.workerId_fz = ''
+                    }
+                  }
+                }
+              }
+            ]
+          }
+          return []
+        })(),
+        {
+          isShow: this.formOptions.orderWorkers.isShow,
+          name: 'slot-component',
+          md: 24,
+          formItemAttributes: {
+            label: '已选工程师',
+            prop: 'orderWorkers',
+            rules: this.formOptions.orderWorkers.isRules
+          },
+          render: (h, { props }) => {
+            var { formData } = props
+            return (
+              <div>
+                <zj-table
+                  isDrop={true}
+                  columns={this.workersColumns}
+                  tableData={this.orderInfo.orderWorkers}
+                ></zj-table>
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  created() {
+    // 普通工单选择网点数据
+    if (!!~[1, 2, 3].indexOf(this?.workOrderType) || this.isAllWebsit) {
+      getWebsit({ type: 'C', status: true, isAll: this.isAllWebsit || this.id ? true : false }).then(res => {
+        this.websitList = res.data.map(item => ({
+          label: item.name,
+          value: item.websitId,
+          data: item
+        }))
+      })
+    }
+  },
+  methods: {
+    getWorkers() {
+      if (this.orderInfo.websitId) {
+        memberListPageV2({
+          pageNum: 1,
+          pageSize: -1,
+          params: [
+            { param: 'b.examine_status', compare: '=', value: 'OK' },
+            { param: 'b.websit_id', compare: '=', value: this.orderInfo.websitId }
+          ]
+        }).then(res => {
+          this.workerList = res.data.records.map(item => {
+            var { id, userId, ...data } = item
+            return {
+              value: userId,
+              label: data.nickName,
+              data: {
+                workerId: userId,
+                workerName: data.nickName,
+                workerIdcard: data.idCard,
+                workerMobile: data.mobile,
+                ...data
+              }
+            }
+          })
+        })
+      }
+    }
+  }
+}

+ 206 - 0
src/views/workOrder/workOrderPool2/components/reschedule/index.vue

@@ -0,0 +1,206 @@
+<template>
+  <zj-page-container>
+    <zj-page-fill class="neibuview">
+      <zj-form-container ref="formRef" :form-data="orderInfo" :form-attributes="{ size: 'mini' }">
+        <zj-form-module
+          title="预单信息"
+          label-width="110px"
+          :form-data="orderInfo"
+          :form-items="serviceInfo"
+        ></zj-form-module>
+        <zj-form-module
+          title="已选工单"
+          label-width="100px"
+          :form-data="orderInfo"
+          :form-items="selectedItems"
+        ></zj-form-module>
+      </zj-form-container>
+    </zj-page-fill>
+    <!-- 操作按钮 -->
+    <div>
+      <div style="box-sizing: border-box; padding: 16px; text-align: right">
+        <el-button size="mini" @click="$emit('close')"> 取消 </el-button>
+        <el-button type="primary" size="mini" @click="allVerify"> 确定 </el-button>
+      </div>
+    </div>
+  </zj-page-container>
+</template>
+
+<script>
+import showRecordSelected from '../mixins/showRecordSelected.js'
+import { required } from '@/components/template/rules_verify.js'
+import { changeOrderChangeAppointmentTime } from '@/api/workOrderPool.js'
+import { addHours } from '@/utils/common.js'
+export default {
+  mixins: [showRecordSelected],
+  data() {
+    return {
+      orderInfo: {
+        appointmentTime: '',
+        appointmentEndTime: '',
+        recordSelected: [],
+        remark: ''
+      }
+    }
+  },
+  computed: {
+    serviceInfo() {
+      return [
+        // {
+        //   isShow: this.formOptions.appointmentTime.isShow,
+        //   name: 'el-date-picker',
+        //   md: 8,
+        //   attributes: {
+        //     disabled: !this.formOptions.appointmentTime.isEdit,
+        //     style: { width: '100%' },
+        //     placeholder: '请选择',
+        //     'value-format': 'yyyy-MM-dd HH:mm:ss',
+        //     'picker-options': {
+        //       disabledDate: time => {
+        //         return time.getTime() < Date.now() - 86400000
+        //       }
+        //     }
+        //   },
+        //   formItemAttributes: {
+        //     label: '预约上门日期',
+        //     prop: 'appointmentTime',
+        //     rules: this.formOptions.appointmentTime.isRules
+        //   }
+        // },
+        {
+          isShow: this.formOptions.appointmentTime.isShow,
+          name: 'el-date-picker',
+          md: 8,
+          attributes: {
+            disabled: !this.formOptions.appointmentTime.isEdit,
+            'picker-options': 'pickerOptions11',
+            'popper-class': 'custom-popper11',
+            'append-to-body': true,
+            style: { width: '100%' },
+            type: 'datetime',
+            placeholder: '请选择',
+            'value-format': 'yyyy-MM-dd HH:mm:ss',
+            'picker-options': {
+              disabledDate: time => {
+                return time.getTime() < Date.now() - 86400000
+              }
+            }
+          },
+          events: {
+            change: value => {
+              if (value && new Date(value).getTime() < new Date().getTime() - 2000) {
+                this.orderInfo.appointmentTime = ''
+                this.$message.warning('必须大于当前时间')
+              } else {
+                this.orderInfo.appointmentEndTime = ''
+              }
+            }
+          },
+          formItemAttributes: {
+            label: '预约开始时间',
+            prop: 'appointmentTime',
+            rules: this.formOptions.appointmentTime.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.appointmentTime.isShow,
+          name: 'el-date-picker',
+          md: 8,
+          attributes: {
+            disabled: !this.formOptions.appointmentTime.isEdit,
+            'picker-options': 'pickerOptions11',
+            'popper-class': 'custom-popper11',
+            'append-to-body': true,
+            style: { width: '100%' },
+            type: 'datetime',
+            placeholder: '请选择',
+            'value-format': 'yyyy-MM-dd HH:mm:ss',
+            'picker-options': {
+              disabledDate: time => {
+                var data = this.orderInfo?.appointmentTime?.split(' ')?.[0]
+                return (
+                  time.getTime() < new Date(data ? `${data} 00:00:00` : '').getTime() ||
+                  time.getTime() > new Date(data ? `${data} 00:00:00` : '').getTime()
+                )
+              }
+            }
+          },
+          events: {
+            change: value => {
+              if (value && new Date(value).getTime() < new Date().getTime() - 2000) {
+                this.orderInfo.appointmentEndTime = ''
+                this.$message.warning('必须大于当前时间')
+              } else if (value && new Date(value).getTime() < new Date(this.orderInfo?.appointmentTime).getTime()) {
+                this.orderInfo.appointmentTime = value
+              }
+            }
+          },
+          formItemAttributes: {
+            label: '预约结束时间',
+            prop: 'appointmentEndTime',
+            rules: this.formOptions.appointmentTime.isRules
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            type: 'textarea',
+            rows: 3,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark'
+          }
+        }
+      ]
+    },
+    formOptions() {
+      return {
+        appointmentTime: {
+          isEdit: true,
+          isShow: true,
+          isRules: [...required]
+        }
+      }
+    }
+  },
+  methods: {
+    allVerify() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          changeOrderChangeAppointmentTime({
+            ids: this.orderInfo.recordSelected.map(item => item.id),
+            appointmentTime: this.orderInfo.appointmentTime,
+            appointmentEndTime: this.orderInfo.appointmentEndTime,
+            remark: this.orderInfo.remark
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '约单成功!'
+            })
+            this.$emit('close')
+          })
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep & > .zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    & > div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 147 - 0
src/views/workOrder/workOrderPool2/detail.vue

@@ -0,0 +1,147 @@
+<template>
+  <div class="yemiansize">
+    <el-tabs v-model="activeName" type="card" :lazy="true" @tab-click="handleClick">
+      <el-tab-pane label="工单信息" name="workOrderInfo" key="workOrderInfo"> </el-tab-pane>
+      <el-tab-pane v-if="!isThreeOrder" label="操作明细" name="operationDetails" key="operationDetails"> </el-tab-pane>
+      <el-tab-pane v-if="!isThreeOrder" label="通话记录" name="CallLog" key="CallLog"> </el-tab-pane>
+      <el-tab-pane v-if="!isThreeOrder" label="完工明细" name="detailsCompletion" key="detailsCompletion"></el-tab-pane>
+      <el-tab-pane v-if="!isThreeOrder" label="支付费用" name="payFee" key="payFee"></el-tab-pane>
+      <el-tab-pane v-if="!isThreeOrder && EvaluationShow" label="评价信息" name="Evaluation" key="Evaluation">
+      </el-tab-pane>
+      <el-tab-pane
+        v-if="!isThreeOrder && SettleAccountsShow"
+        label="费用结算"
+        name="SettleAccounts"
+        key="SettleAccounts"
+      >
+      </el-tab-pane>
+      <el-tab-pane
+        v-if="!isThreeOrder && PartsApplicationShow"
+        label="配件申请"
+        name="PartsApplication"
+        key="PartsApplication"
+      >
+      </el-tab-pane>
+    </el-tabs>
+    <div class="view_div">
+      <div
+        :style="{
+          height: activeName === 'workOrderInfo' ? '100%' : '0px',
+          overflow: activeName === 'workOrderInfo' ? '' : 'hidden'
+        }"
+      >
+        <workOrderInfo :id="id" ref="workOrderInfo" :workOrderType="workOrderType" />
+      </div>
+      <OperationDetail v-if="activeName == 'operationDetails'" :id="id" ref="operationDetails" />
+      <CallLog v-if="activeName == 'CallLog'" :id="id" ref="CallLog" />
+      <CompletionDetails v-if="activeName == 'detailsCompletion'" :id="id" ref="detailsCompletion" />
+      <Payment v-if="activeName == 'payFee'" :id="id" ref="payFee" :workOrderType="workOrderType" />
+      <Evaluation v-if="activeName == 'Evaluation' && EvaluationShow" :id="id" ref="Evaluation" />
+      <SettleAccounts v-if="activeName == 'SettleAccounts' && SettleAccountsShow" :id="id" ref="SettleAccounts" />
+      <PartsApplication
+        v-if="activeName == 'PartsApplication' && PartsApplicationShow"
+        :id="id"
+        ref="PartsApplication"
+      />
+    </div>
+  </div>
+</template>
+
+<script>
+import workOrderInfo from './detailModule/workOrderInfo/index.vue'
+import OperationDetail from './detailModule/OperationDetail/index.vue'
+import CompletionDetails from './detailModule/CompletionDetails/index.vue'
+import Payment from './detailModule/Payment/index.vue'
+import Evaluation from './detailModule/Evaluation/index.vue'
+import SettleAccounts from './detailModule/SettleAccounts/index.vue'
+import PartsApplication from './detailModule/PartsApplication/index.vue'
+import CallLog from './detailModule/CallLog/index.vue'
+import { orderBaseDetail } from '@/api/workOrderPool.js'
+export default {
+  components: {
+    workOrderInfo,
+    OperationDetail,
+    CompletionDetails,
+    Payment,
+    Evaluation,
+    SettleAccounts,
+    PartsApplication,
+    CallLog
+  },
+  props: {
+    id: {
+      type: [String, Number],
+      default: null
+    },
+    workOrderType: {
+      type: [Number],
+      default: null
+    }
+  },
+  data() {
+    return {
+      activeName: this?.$route?.params?.pagePam || 'workOrderInfo',
+      EvaluationShow: false,
+      SettleAccountsShow: false,
+      PartsApplicationShow: true,
+      isThreeOrder: false
+    }
+  },
+  created() {
+    orderBaseDetail({
+      orderBaseId: this.id
+    }).then(res => {
+      this.isThreeOrder = res?.data?.isThreeOrder
+      if (
+        !['DYY'].includes(res?.data?.orderStatus) &&
+        ![
+          'DSHPG',
+          'CJ',
+          'YPD',
+          'DXSPD',
+          'DZBPG',
+          'DWDSPGP',
+          'DXSSPGP',
+          'DTJXSSPGP',
+          'DZBSPGP',
+          'DFZXPD',
+          'DFZXSPGP',
+          'XSBH',
+          'TJXSBH',
+          'ZBBH',
+          'FZXBH',
+          'FL'
+        ].includes(res?.data?.orderStatus) &&
+        !['DWDPG', 'DWDPD', 'WDBH'].includes(res?.data?.orderStatus) &&
+        !['DJD', 'DSM', 'YZP'].includes(res?.data?.orderStatus) &&
+        !['FWZ', 'GCSZT', 'BFWG'].includes(res?.data?.orderStatus) &&
+        !['YQX', 'FWZT', 'YCGB', 'FWQX'].includes(res?.data?.orderStatus)
+      ) {
+        this.EvaluationShow = true
+        this.SettleAccountsShow = true
+      }
+    })
+  },
+  methods: {
+    handleClick(tab, event) {}
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.yemiansize {
+  height: calc(100vh - 85px) !important;
+  overflow: hidden;
+
+  & > ::v-deep .el-tabs:nth-child(1) {
+    & > .el-tabs__header:nth-child(1) {
+      margin-bottom: 0 !important;
+    }
+  }
+
+  .view_div {
+    height: calc(100% - 42px) !important;
+    overflow-y: auto;
+  }
+}
+</style>

+ 96 - 0
src/views/workOrder/workOrderPool2/detailModule/CallLog/index.vue

@@ -0,0 +1,96 @@
+<template>
+  <zj-page-container>
+    <zj-page-fill class="neibuview">
+      <zj-form-container>
+        <zj-form-module title="通话记录">
+          <zj-table
+            :columns="evaluationColumns"
+            :table-data="evaluationData"
+            :table-attributes="{
+              border: true
+            }"
+          />
+        </zj-form-module>
+      </zj-form-container>
+    </zj-page-fill>
+  </zj-page-container>
+</template>
+
+<script>
+import { unCallListOrder } from '@/api/cloudCall.js'
+import { tableDataParsing } from '@/utils/common.js'
+export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null
+    }
+  },
+  data() {
+    return {
+      evaluationData: [],
+      evaluationColumns: []
+    }
+  },
+  mounted() {
+    this.getOrderQualityLis2()
+  },
+  methods: {
+    getOrderQualityLis2() {
+      unCallListOrder({
+        pageNum: 1,
+        pageSize: -1,
+        params: [{ param: 'a.order_base_id', compare: 'like', value: this.id }]
+      }).then(res => {
+        this.evaluationColumns = tableDataParsing(
+          res.fieldBeans.filter(item => !~['orderFlags', 'orderType'].indexOf(item.jname))
+        ).map(item => {
+          if (item.columnAttributes.prop == 'fileUrl') {
+            item.columnAttributes['min-width'] = 360
+            item.render = (h, { row, index, column }) => {
+              return (
+                <div style="padding:0 6px;cursor: pointer;">
+                  {row.fileUrl ? (
+                    <div style="margin:13px  0 0  0">
+                      <audio controls>
+                        <source src={row.fileUrl} type="audio/ogg" contentEditable="true" />
+                        <source src={row.fileUrl} type="audio/mpeg" contentEditable="true" />
+                      </audio>
+                    </div>
+                  ) : null}
+                </div>
+              )
+            }
+          }
+          return item
+        })
+        this.$nextTick(() => {
+          this.evaluationData = res.data.records.map(item => {
+            Object.keys(item).map(key => {
+              var val = JSON.parse(res?.fieldBeans?.find(val => val.jname == key)?.enumMap || '{}')[item[key]]
+              if (val) item[key] = val
+            })
+            return item
+          })
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep & > .zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    & > div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 296 - 0
src/views/workOrder/workOrderPool2/detailModule/CompletionDetails/index.vue

@@ -0,0 +1,296 @@
+<template>
+  <zj-page-container>
+    <zj-page-fill class="neibuview">
+      <zj-form-container v-if="!detailId" key="completeDetail">
+        <zj-form-module title="完工明细">
+          <zj-table :columns="completeDetailColumns" :table-data="completeDetailData" />
+        </zj-form-module>
+      </zj-form-container>
+      <zj-form-container v-else key="details">
+        <template v-if="formData.pgOrderBase && formData.pgOrderBase.orderType !== 'INSTALL'">
+          <zj-form-module title="维修信息" :form-data="formData" :form-items="repairInfo" />
+          <zj-form-module title="采集图片" :form-data="formData" :form-items="INSTALL_pgOrderProductImgs" />
+          <zj-form-module title="故障图片" :form-data="formData" :form-items="BUG_pgOrderProductImgs" />
+        </template>
+        <zj-form-module v-else title="采集信息" :form-data="formData" :form-items="INSTALL_pgOrderProductImgs" />
+      </zj-form-container>
+    </zj-page-fill>
+    <div v-if="detailId" style="box-sizing: border-box; padding: 16px">
+      <el-button @click="close" size="mini">关闭</el-button>
+    </div>
+  </zj-page-container>
+</template>
+
+<script>
+import { changeOrderGetOrderProduct, changeOrderProductDetail } from '@/api/workOrderPool.js'
+import ImageUpload from '@/components/file-upload'
+export default {
+  components: {
+    ImageUpload
+  },
+  props: {
+    id: {
+      type: [String, Number],
+      default: null
+    }
+  },
+  data() {
+    return {
+      completeDetailData: [],
+      detailId: '',
+      formData: {
+        bugRemark: '',
+        detailRemark: '',
+        isDefend: '',
+        pgOrderProductDetails: []
+      }
+    }
+  },
+  computed: {
+    completeDetailColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '操作',
+            prop: '',
+            width: 60
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div style="padding-left:10px">
+                <el-button
+                  type="text"
+                  onClick={() => {
+                    this.detailId = row.id
+                  }}
+                >
+                  查看
+                </el-button>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '品牌名称',
+            prop: 'brandName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品大类',
+            prop: 'mainName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品小类',
+            prop: 'smallName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '机型名称',
+            prop: 'productName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '内机条码',
+            prop: 'insideCode',
+            width: '120px'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '外机条码',
+            prop: 'outCode',
+            width: '120px'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '负责工程师',
+            prop: 'workerName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '联系电话',
+            prop: 'workerMobile'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '状态',
+            prop: 'status'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '采集时间',
+            prop: 'giveTime'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '采集地址',
+            prop: 'sumbitAddress',
+            width: 260
+          }
+        },
+        {
+          columnAttributes: {
+            label: '最后采集图片时 (总部结算--GPS定位地址)',
+            prop: 'giveAddress',
+            width: 260
+          }
+        }
+      ]
+    },
+    repairInfo() {
+      return [
+        {
+          name: 'el-input',
+          md: 14,
+          attributes: { disabled: true, placeholder: '' },
+          formItemAttributes: { label: '故障现象', prop: 'bugRemark' }
+        },
+        {
+          name: 'el-radio',
+          options: [
+            { label: '是', value: 'YES' },
+            { label: '否', value: 'NO' }
+          ],
+          md: 10,
+          attributes: { disabled: true, placeholder: '' },
+          formItemAttributes: { label: '是否质保', prop: 'isDefend' }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: { disabled: true, type: 'textarea', placeholder: '' },
+          formItemAttributes: { label: '备注', prop: 'detailRemark' }
+        }
+      ]
+    },
+    INSTALL_pgOrderProductImgs() {
+      return [
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '',
+            prop: '',
+            'label-width': '0px'
+          },
+          render: (h, { props, onInput }) => {
+            return (
+              <ImageUpload
+                fileList={this.formData?.pgOrderProductDetails
+                  ?.filter(item => item.type === 'INSTALL')
+                  .map(item => ({ url: item.fileUrl, name: item.fileName }))}
+                limit={1000}
+                isEdit={false}
+                viewOnline={false}
+                download={false}
+                showName={true}
+              />
+            )
+          }
+        },
+        {
+          show: this.formData.pgOrderBase && this.formData.pgOrderBase.orderType == 'INSTALL',
+          name: 'el-input',
+          md: 24,
+          attributes: { disabled: true, type: 'textarea', placeholder: '' },
+          formItemAttributes: { label: '备注', prop: 'detailRemark' }
+        }
+      ]
+    },
+    BUG_pgOrderProductImgs() {
+      return [
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '',
+            prop: '',
+            'label-width': '0px'
+          },
+          render: (h, { props, onInput }) => {
+            return (
+              <ImageUpload
+                fileList={this.formData?.pgOrderProductDetails
+                  ?.filter(item => item.type === 'BUG')
+                  .map(item => ({ url: item.fileUrl, name: item.fileName }))}
+                limit={1000}
+                isEdit={false}
+                viewOnline={false}
+                download={false}
+                showName={true}
+              />
+            )
+          }
+        }
+      ]
+    }
+  },
+  watch: {
+    id: {
+      handler(newVal, oldVal) {
+        if (this.id) {
+          changeOrderGetOrderProduct({
+            id: this.id
+          }).then(res => {
+            console.log(res.data)
+            this.completeDetailData = res.data.map(item => {
+              return {
+                ...item,
+                status: { WAIT: '待采集', WAIT_SAVE: '待完善', WAIT_OK: '临时采集', OK: '已采集' }[item.status]
+              }
+            })
+          })
+        }
+      },
+      deep: true,
+      immediate: true
+    },
+    detailId: {
+      handler(newVal, oldVal) {
+        if (this.detailId) {
+          changeOrderProductDetail({
+            id: this.detailId
+          }).then(res => {
+            this.formData = res.data
+            console.log(res)
+          })
+        }
+      },
+      deep: true
+    }
+  },
+  methods: {
+    close() {
+      this.$data.formData = this.$options.data().formData
+      this.detailId = ''
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep & > .zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    & > div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 98 - 0
src/views/workOrder/workOrderPool2/detailModule/Evaluation/index.vue

@@ -0,0 +1,98 @@
+<template>
+  <zj-page-container>
+    <zj-page-fill class="neibuview">
+      <zj-form-container>
+        <zj-form-module title="评价信息">
+          <zj-table
+            :columns="evaluationColumns"
+            :table-data="evaluationData"
+            :table-attributes="{
+              border: true
+            }"
+          />
+        </zj-form-module>
+      </zj-form-container>
+    </zj-page-fill>
+  </zj-page-container>
+</template>
+
+<script>
+import { listPageV2 } from '@/api/workOrder/appraise'
+import { tableDataParsing } from '@/utils/common.js'
+export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null
+    }
+  },
+  data() {
+    return {
+      evaluationData: [],
+      evaluationColumns: []
+    }
+  },
+  watch: {
+    id: {
+      handler(newVal, oldVal) {
+        listPageV2({ pageNum: 1, pageSize: -1, params: [{ param: 'a.id', compare: '=', value: this.id }] }).then(
+          res => {
+            this.evaluationColumns = tableDataParsing(
+              res.fieldBeans.filter(item => !~['orderFlags', 'orderType'].indexOf(item.jname))
+            ).map(item => {
+              if (item.columnAttributes.prop == 'appraiseImgUrl') {
+                item.render = (h, { row, index, column }) => {
+                  return (
+                    <div style="padding:0 6px;cursor: pointer;">
+                      {row.appraiseImgUrl
+                        ? row.appraiseImgUrl
+                            .split(',')
+                            .map(url => (
+                              <el-image
+                                src={this.$showImgUrl(url)}
+                                preview-src-list={[this.$showImgUrl(url)]}
+                                fit="fit"
+                                style="width:80px;height:80px;"
+                              />
+                            ))
+                        : null}
+                    </div>
+                  )
+                }
+              }
+              return item
+            })
+            this.$nextTick(() => {
+              this.evaluationData = res.data.records.map(item => {
+                Object.keys(item).map(key => {
+                  var val = JSON.parse(res?.fieldBeans?.find(val => val.jname == key)?.enumMap || '{}')[item[key]]
+                  if (val) item[key] = val
+                })
+                return item
+              })
+            })
+          }
+        )
+      },
+      deep: true,
+      immediate: true
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep & > .zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    & > div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 116 - 0
src/views/workOrder/workOrderPool2/detailModule/OperationDetail/index.vue

@@ -0,0 +1,116 @@
+<template>
+  <zj-page-container>
+    <zj-page-fill class="neibuview">
+      <zj-form-container>
+        <zj-form-module title="操作明细">
+          <zj-table :columns="operationDetailColumns" :tableData="logList" :tableAttributes="{
+            border: true
+          }"></zj-table>
+        </zj-form-module>
+      </zj-form-container>
+    </zj-page-fill>
+  </zj-page-container>
+</template>
+
+<script>
+import { orderBaseLogList } from "@/api/workOrderPool.js"
+import ImageUpload from '@/components/file-upload'
+export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null,
+    }
+  },
+  components: {
+    ImageUpload
+  },
+  data() {
+    return {
+      logList: []
+    }
+  },
+  watch: {
+    id: {
+      handler(newVal, oldVal) {
+        this.getOrderBaseLogList()
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  computed: {
+    operationDetailColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '操作类别',
+            prop: 'type',
+            width: 140
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作内容',
+            prop: 'content',
+          }
+        },
+        {
+          columnAttributes: {
+            label: '附件',
+            prop: 'imgSrc',
+            width: 310
+          },
+          render: (h, { row, column, index }) => {
+            return <div style="padding: 0 10px">
+              <ImageUpload fileList={row.imgSrc ? row.imgSrc.split(",").map(url => ({ url })) : []} limit={100} isEdit={false} />
+            </div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作时间',
+            prop: 'createTime',
+            width: 140
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作人',
+            prop: 'createBy',
+            width: 140
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    // 获取操作记录
+    getOrderBaseLogList() {
+      if (this.id) {
+        orderBaseLogList({
+          orderBaseId: this.id
+        }).then(res => {
+          this.logList = res.data
+        })
+      }
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep &>.zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    &>div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 250 - 0
src/views/workOrder/workOrderPool2/detailModule/PartsApplication/formModule.vue

@@ -0,0 +1,250 @@
+<template>
+  <zj-form-module :title="'申请信息' + (index + 1)" :form-data="item" :form-items="formItems">
+    <div
+      v-if="item.status == 'ING'"
+      style="text-align: right; box-sizing: border-box; padding-bottom: 10px; padding-right: 10px"
+    >
+      <el-button size="mini" plain @click="quxiao">取消申请</el-button>
+      <el-button size="mini" type="primary" plain @click="daohuo">到货反馈</el-button>
+    </div>
+  </zj-form-module>
+</template>
+
+<script>
+import editTable from '@/components/template/editTable.js'
+import {
+  orderPartsApplyItemModify,
+  orderPartsApplyCancel,
+  orderPartsApplyEnd,
+  orderPartsApplyItemDel
+} from '@/api/workOrderPool.js'
+export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null
+    },
+    item: {
+      type: Object,
+      default: () => ({})
+    },
+    index: {
+      type: [String, Number],
+      default: null
+    }
+  },
+  mixins: [editTable],
+  data() {
+    return {}
+  },
+  computed: {
+    formItems() {
+      return [
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '申请单号', prop: 'id' }
+        },
+        {
+          name: 'slot-component',
+          md: 6,
+          formItemAttributes: { label: '申请状态', prop: 'status' },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <el-input
+                disabled={true}
+                value={{ ING: '申请中', END: '到货反馈', CANCEL: '取消申请' }[value]}
+                placeholder=""
+              ></el-input>
+            )
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '申请人', prop: 'createBy' }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '申请时间', prop: 'createTime' }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '取消人', prop: 'cancelBy' }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '取消时间', prop: 'cancelTime' }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '反馈人', prop: 'confirmBy' }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '反馈时间', prop: 'confirmTime' }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            disabled: true,
+            type: 'textarea',
+            rows: 2,
+            placeholder: '-'
+          },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark'
+          }
+        },
+        {
+          name: 'slot-component',
+          md: 24,
+          formItemAttributes: { label: '配件信息', prop: 'items' },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            console.log(value)
+            return this.convertTableJson(
+              value,
+              [
+                {
+                  columnAttributes: {
+                    label: '配件名称',
+                    prop: 'name',
+                    propName: 'name'
+                  },
+                  editRender: (h, { row, column, index }) => {
+                    return (
+                      <div class="redbordererr">
+                        <el-form-item label="" label-width="0px">
+                          <el-input
+                            value={row[column.columnAttributes.prop]}
+                            onInput={val => {
+                              row[column.columnAttributes.prop] = val
+                            }}
+                            placeholder="请输入内容"
+                          ></el-input>
+                        </el-form-item>
+                      </div>
+                    )
+                  },
+                  viewRender: (h, { row, column, index }) => {
+                    return <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '数量',
+                    prop: 'qty',
+                    propName: 'qty'
+                  },
+                  editRender: (h, { row, column, index }) => {
+                    return (
+                      <div class="redbordererr">
+                        <el-form-item label="" label-width="0px">
+                          <el-input
+                            value={row[column.columnAttributes.prop]}
+                            onInput={val => {
+                              row[column.columnAttributes.prop] = val
+                            }}
+                            placeholder="请输入内容"
+                            type="number"
+                          ></el-input>
+                        </el-form-item>
+                      </div>
+                    )
+                  },
+                  viewRender: (h, { row, column, index }) => {
+                    return <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+                  }
+                }
+              ],
+              {
+                isEdit: this.item.status == 'ING',
+                isAdd: false,
+                isDel: false // this.item.status == "ING",
+              },
+              {
+                confirm: ({ row, column, index }) => {
+                  orderPartsApplyItemModify({ ...row }).then(res => {
+                    this.isEditTableIndex = -1
+                    this.$message({
+                      type: 'success',
+                      message: '保存成功'
+                    })
+                  })
+                },
+                delete: ({ row, column, index }, cb) => {
+                  orderPartsApplyItemDel({ ...row }).then(res => {
+                    this.$message({
+                      type: 'success',
+                      message: '删除成功'
+                    })
+                    cb && cb()
+                  })
+                }
+              }
+            )
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    quxiao() {
+      this.$confirm('是否确认取消?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          orderPartsApplyCancel({
+            id: this.item.id
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '取消成功'
+            })
+            this.$emit('shuaxin')
+          })
+        })
+        .catch(() => {})
+    },
+    daohuo() {
+      this.$confirm('是否确认反馈?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          orderPartsApplyEnd({
+            id: this.item.id
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '反馈成功'
+            })
+            this.$emit('shuaxin')
+          })
+        })
+        .catch(() => {})
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 70 - 0
src/views/workOrder/workOrderPool2/detailModule/PartsApplication/index.vue

@@ -0,0 +1,70 @@
+<template>
+  <zj-page-container>
+    <zj-page-fill class="neibuview">
+      <template v-if="payData.length">
+        <zj-form-container>
+          <template v-for="(item, index) in payData">
+            <formModule :item="payData[index]" :index="index" @shuaxin="shuaxin"> </formModule>
+          </template>
+        </zj-form-container>
+      </template>
+      <el-empty v-else description="暂时没有配件申请"></el-empty>
+    </zj-page-fill>
+  </zj-page-container>
+</template>
+
+<script>
+import { orderPartsApplyRecord } from '@/api/workOrderPool.js'
+import formModule from './formModule.vue'
+export default {
+  components: {
+    formModule
+  },
+  props: {
+    id: {
+      type: [String, Number],
+      default: null
+    }
+  },
+  data() {
+    return {
+      payData: []
+    }
+  },
+  watch: {
+    id: {
+      handler(newVal, oldVal) {
+        this.shuaxin()
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  computed: {},
+  methods: {
+    shuaxin() {
+      orderPartsApplyRecord({
+        orderId: this.id
+      }).then(res => {
+        this.payData = res.data || []
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep & > .zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    & > div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 786 - 0
src/views/workOrder/workOrderPool2/detailModule/Payment/index.vue

@@ -0,0 +1,786 @@
+<template>
+  <zj-page-container>
+    <zj-page-fill class="neibuview">
+      <template v-if="payData.length">
+        <zj-form-container>
+          <template v-for="(item, index) in payData">
+            <zj-form-module
+              :key="index"
+              :title="`支付费用${index + 1} 【支付订单号:${item.orderId}】`"
+              :form-data="payData[index]"
+              :form-items="
+                [formItemsL1, formItems(item)][!!~[1, 2, 3].indexOf(workOrderType) ? 0 : workOrderType == 4 ? 1 : 0]
+              "
+            >
+              <div v-if="item.examineStatus === 'FAIL'" style="text-align: right">
+                <el-button size="mini" type="danger" plain @click="enginMaterialCancelFun(item)">取消申请</el-button>
+              </div>
+            </zj-form-module>
+          </template>
+        </zj-form-container>
+      </template>
+      <el-empty v-else description="暂时没有支付信息"></el-empty>
+    </zj-page-fill>
+  </zj-page-container>
+</template>
+
+<script>
+import { listPageV2 } from '@/api/workOrder/appraise'
+import { tableDataParsing } from '@/utils/common.js'
+import { changeOrderGetOrderList, enginMaterialDetailWorker, enginMaterialCancel } from '@/api/workOrderPool.js'
+import { orderBaseDetail } from '@/api/workOrderPool.js'
+import { number } from 'echarts'
+export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null
+    },
+    workOrderType: {
+      type: Number,
+      default: 1 // 1普通工单, 4维保工单
+    }
+  },
+  data() {
+    return {
+      payData: [],
+      orderBaseDetail: {}
+    }
+  },
+  watch: {
+    id: {
+      handler(newVal, oldVal) {
+        this.getxiangqing()
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  computed: {
+    formItemsL1() {
+      return [
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '费用信息'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <el-descriptions
+                border
+                title=""
+                column={3}
+                colon={false}
+                labelStyle={{ width: '11%' }}
+                contentStyle={{ width: '22.3%' }}
+              >
+                <el-descriptions-item label="网点名称">{`(${formData.websitId})${formData.websitName}`}</el-descriptions-item>
+                <el-descriptions-item label="工单号">{formData.workerOrderId}</el-descriptions-item>
+                <el-descriptions-item label="工程师编号">
+                  {formData.workerNumber || formData.workerId}
+                </el-descriptions-item>
+                <el-descriptions-item label="工程师名称">{formData.workerName}</el-descriptions-item>
+                <el-descriptions-item label="工程师电话">{formData.workerMobile}</el-descriptions-item>
+                <el-descriptions-item label="支付方式">
+                  {{ WECHAT: '微信支付', LINE: '线下支付', EXAMINE: '审批' }[formData.payType] || '微信支付'}
+                </el-descriptions-item>
+                <el-descriptions-item label="客户名称">{formData.pgOrderBase.userName}</el-descriptions-item>
+                <el-descriptions-item label="电话号码">{formData.userMobile}</el-descriptions-item>
+                <el-descriptions-item label="支付状态">
+                  {{ CANCEL: '取消', WAIT: '待支付', PAID: '已支付' }[formData.payStatus]}
+                </el-descriptions-item>
+                <el-descriptions-item label="支付总金额">{this.toFixed(formData.totalAmount)}</el-descriptions-item>
+                {!!~[1, 2, 3].indexOf(this?.workOrderType) ? (
+                  <el-descriptions-item label="总手续费">{formData.commissionAmount}</el-descriptions-item>
+                ) : null}
+                <el-descriptions-item label="支付时间">{formData.payTime}</el-descriptions-item>
+                <el-descriptions-item label="分账状态">
+                  {{ WAIT: '待结算', OK: '完成', YC: '异常结算', LINE: '线下结算' }[formData.settlementStatus]}
+                </el-descriptions-item>
+                {this?.workOrderType == 4
+                  ? [
+                      <el-descriptions-item label=""></el-descriptions-item>,
+                      <el-descriptions-item label="审批状态">
+                        {{ WAIT: '待审', OK: '审批', FAIL: '驳回', NO: '取消' }[formData.examineStatus] || ''}
+                      </el-descriptions-item>,
+                      <el-descriptions-item label="审批人">{formData.examineName}</el-descriptions-item>,
+                      <el-descriptions-item label="审批时间">{formData.examineTime}</el-descriptions-item>
+                    ]
+                  : null}
+              </el-descriptions>
+            )
+          }
+        },
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '支付明细'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <zj-table
+                columns={[
+                  {
+                    columnAttributes: {
+                      label: '费用名称',
+                      prop: 'goodsName'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '单价',
+                      prop: 'goodsAmount'
+                    },
+                    render: (h, { row, column }) => {
+                      return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '数量',
+                      prop: 'num'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '费用金额',
+                      prop: 'totalAmount'
+                    },
+                    render: (h, { row, column }) => {
+                      return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                    }
+                  },
+                  ...(() => {
+                    if (!!~[1, 2, 3].indexOf(this?.workOrderType)) {
+                      return [
+                        {
+                          columnAttributes: {
+                            label: '师傅分账金额',
+                            prop: 'workerAmount'
+                          },
+                          render: (h, { row, column }) => {
+                            return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                          }
+                        },
+                        {
+                          columnAttributes: {
+                            label: '师傅手续费',
+                            prop: 'workerProceAmount'
+                          },
+                          render: (h, { row, column }) => {
+                            return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                          }
+                        },
+                        {
+                          columnAttributes: {
+                            label: '网点分账金额',
+                            prop: 'websitAmount'
+                          },
+                          render: (h, { row, column }) => {
+                            return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                          }
+                        },
+                        {
+                          columnAttributes: {
+                            label: '网点手续费',
+                            prop: 'websitProceAmount'
+                          },
+                          render: (h, { row, column }) => {
+                            return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                          }
+                        }
+                      ]
+                    }
+                    return []
+                  })()
+                ]}
+                table-data={
+                  [formData.workerOrderItems, formData.rpMaterialOrderItems][
+                    !!~[1, 2, 3].indexOf(this?.workOrderType) ? 0 : this?.workOrderType == 4 ? 1 : 0
+                  ]
+                }
+              />
+            )
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: { disabled: true, type: 'textarea', placeholder: '' },
+          formItemAttributes: { label: '备注', prop: 'remark' }
+        },
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '交易记录'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <zj-table
+                columns={[
+                  {
+                    columnAttributes: {
+                      label: 'id',
+                      prop: 'orderId'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '交易类型',
+                      prop: 'goodsType'
+                    },
+                    render: (h, { row }) => {
+                      return <div>{{ M: '辅材', P: '配件' }[row.goodsType]}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '交易金额',
+                      prop: 'totalAmount'
+                    },
+                    render: (h, { row, column }) => {
+                      return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '交易状态',
+                      prop: 'payStatus'
+                    },
+                    render: (h, { row }) => {
+                      return <div>{{ CANCEL: '取消', WAIT: '待支付', PAID: '已支付' }[row.payStatus]}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '交易时间',
+                      prop: 'payTime'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '创建时间',
+                      prop: 'createTime'
+                    }
+                  }
+                ]}
+                table-data={[formData]}
+              />
+            )
+          }
+        },
+        {
+          isShow: this.orderBaseDetail.orderType == 'REPAIR',
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '配件信息'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <zj-table
+                columns={[
+                  {
+                    columnAttributes: {
+                      label: '维修标识',
+                      prop: 'repairFlag'
+                    },
+                    render: (h, { row }) => {
+                      return <div>{{ INNER: '保内', OUTSIDE: '保外' }[row.repairFlag]}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '旧配件编号',
+                      prop: 'oldPartsNumber'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '旧配件名称',
+                      prop: 'oldPartsName'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '新配件编号',
+                      prop: 'goodsCode'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '新配件名称',
+                      prop: 'goodsName'
+                    }
+                  }
+                ]}
+                table-data={formData.workerOrderItems || []}
+              />
+            )
+          }
+        },
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '其它费用表',
+            'label-width': '90px'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <zj-table
+                columns={[
+                  {
+                    columnAttributes: {
+                      label: '费用名称',
+                      prop: 'amountName'
+                    },
+                    render: (h, { row, column }) => {
+                      return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '费用金额',
+                      prop: 'normAmount'
+                    },
+                    render: (h, { row, column }) => {
+                      return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '师傅分账金额',
+                      prop: 'sffzje'
+                    },
+                    render: (h, { row, column }) => {
+                      return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '师傅手续费',
+                      prop: 'sfsxf'
+                    },
+                    render: (h, { row, column }) => {
+                      return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                    }
+                  }
+                ]}
+                table-data={formData.gengduofeiyong || []}
+              />
+            )
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    formItems(itemData) {
+      return [
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '基本信息'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <el-descriptions
+                border
+                title=""
+                column={2}
+                colon={false}
+                labelStyle={{ width: '13%' }}
+                contentStyle={{ width: '37%' }}
+              >
+                <el-descriptions-item label="申请单号">{formData.orderId}</el-descriptions-item>
+                <el-descriptions-item label="项目名称">{formData.rpProjectRepairName}</el-descriptions-item>
+                <el-descriptions-item label="工单单号">{formData.workerOrderId}</el-descriptions-item>
+                <el-descriptions-item label="负责人">{formData.userName}</el-descriptions-item>
+                <el-descriptions-item label="联系电话">{formData.userMobile}</el-descriptions-item>
+                <el-descriptions-item label="项目地址">{formData.pgOrderBase.address}</el-descriptions-item>
+                <el-descriptions-item label="创单人">{formData.pgOrderBase.createBy}</el-descriptions-item>
+                <el-descriptions-item label="创单人电话">{formData.pgOrderBase.createMobile}</el-descriptions-item>
+                <el-descriptions-item label="创单时间">{formData.pgOrderBase.createTime}</el-descriptions-item>
+                <el-descriptions-item label="工单类型">{formData.orderSmallTypeText}</el-descriptions-item>
+                <el-descriptions-item label="网点名称">{formData.websitName}</el-descriptions-item>
+                <el-descriptions-item label="申请人">{formData.workerName}</el-descriptions-item>
+                <el-descriptions-item label="联系电话">{formData.workerMobile}</el-descriptions-item>
+                <el-descriptions-item label="申请时间">{formData.createTime}</el-descriptions-item>
+                <el-descriptions-item label="包含全部费用">
+                  {{ YES: '是', NO: '否' }[formData.isAllFee]}
+                </el-descriptions-item>
+
+                {formData.isAllFee == 'NO' || formData.payType == 'WECHAT' || formData.payType == 'LINE' ? (
+                  <el-descriptions-item label="费用支付方式">
+                    {{ EXAMINE: '审批后结算', SITE: '现场支付' }[formData.feePayMethod]}
+                  </el-descriptions-item>
+                ) : null}
+
+                {(formData.isAllFee == 'NO' || formData.payType == 'WECHAT') && formData.feePayMethod == 'EXAMINE'
+                  ? [
+                      <el-descriptions-item label="费用单状态">
+                        {
+                          { WAIT: '待审', OK: '通过', FAIL: '驳回', PAID: '现场支付', NO: '取消', NO_PAID: '未支付' }[
+                            formData.examineStatus
+                          ]
+                        }
+                      </el-descriptions-item>,
+                      <el-descriptions-item label="审批人">{formData.examineName}</el-descriptions-item>,
+                      <el-descriptions-item label="审批时间">{formData.examineTime}</el-descriptions-item>,
+                      <el-descriptions-item label="取消人">{formData.cancelName}</el-descriptions-item>,
+                      <el-descriptions-item label="取消时间">{formData.cancelTime}</el-descriptions-item>
+                    ]
+                  : null}
+
+                {formData.payType == 'LINE' && formData.feePayMethod == 'EXAMINE'
+                  ? [
+                      <el-descriptions-item label="结算状态">
+                        {{ WAIT: '待结算', OVER: '已结算' }[formData.status]}
+                      </el-descriptions-item>,
+                      <el-descriptions-item label="结算人">{formData.settleName}</el-descriptions-item>,
+                      <el-descriptions-item label="结算时间">{formData.settleTime}</el-descriptions-item>
+                    ]
+                  : null}
+              </el-descriptions>
+            )
+          }
+        },
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '费用明细'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <zj-table
+                columns={[
+                  {
+                    columnAttributes: {
+                      label: '费用名称',
+                      prop: 'goodsName'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '费用类型',
+                      prop: 'chargeType'
+                    },
+                    render: (h, { row, column, index }) => {
+                      return (
+                        <div style="padding-left:10px">
+                          {{ MCC: '辅材物料', ACC: '配件物料', SERV: '服务收费' }[row.chargeType]}
+                        </div>
+                      )
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '单价',
+                      prop: 'goodsAmount'
+                    },
+                    render: (h, { row, column }) => {
+                      return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '数量',
+                      prop: 'num'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '费用金额',
+                      prop: 'totalAmount'
+                    },
+                    render: (h, { row, column }) => {
+                      return <div>{this.toFixed(row[column.columnAttributes.prop])}</div>
+                    }
+                  }
+                ]}
+                table-data={formData.rpMaterialOrderItems}
+              />
+            )
+          }
+        },
+        {
+          md: 8,
+          isShow: itemData.goodsType == 'M',
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '辅材费用合计'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <span>
+                {[
+                  0,
+                  0,
+                  0,
+                  ...formData.rpMaterialOrderItems
+                    .filter(item => item.chargeType == 'MCC')
+                    .map(item => item.totalAmount)
+                ]
+                  .reduce(function (prev, curr, idx, arr) {
+                    return prev + curr
+                  })
+                  .toFixed(2)}
+              </span>
+            )
+          }
+        },
+        {
+          md: 8,
+          isShow: itemData.goodsType == 'P',
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '配件费用合计'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <span>
+                {[
+                  0,
+                  0,
+                  0,
+                  ...formData.rpMaterialOrderItems
+                    .filter(item => item.chargeType == 'ACC')
+                    .map(item => item.totalAmount)
+                ]
+                  .reduce(function (prev, curr, idx, arr) {
+                    return prev + curr
+                  })
+                  .toFixed(2)}
+              </span>
+            )
+          }
+        },
+        {
+          md: 8,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '服务收费费用合计'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <span>
+                {[
+                  0,
+                  0,
+                  0,
+                  ...formData.rpMaterialOrderItems
+                    .filter(item => item.chargeType == 'SERV')
+                    .map(item => item.totalAmount)
+                ]
+                  .reduce(function (prev, curr, idx, arr) {
+                    return prev + curr
+                  })
+                  .toFixed(2)}
+              </span>
+            )
+          }
+        },
+        {
+          md: 8,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '总金额'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <span>
+                {[0, 0, 0, ...formData.rpMaterialOrderItems.map(item => item.totalAmount)]
+                  .reduce(function (prev, curr, idx, arr) {
+                    return prev + curr
+                  })
+                  .toFixed(2)}
+              </span>
+            )
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: { disabled: true, type: 'textarea', placeholder: '' },
+          formItemAttributes: { label: '申请备注', prop: 'remark' }
+        },
+        {
+          md: 24,
+          isShow: itemData.payType == 'WECHAT',
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '交易记录'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <zj-table
+                columns={[
+                  {
+                    columnAttributes: {
+                      label: 'id',
+                      prop: 'orderId'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '交易类型',
+                      prop: 'goodsType'
+                    },
+                    render: (h, { row }) => {
+                      return <div>{{ M: '辅材', P: '配件' }[row.goodsType]}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '交易金额',
+                      prop: 'totalAmount'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '交易状态',
+                      prop: 'payStatus'
+                    },
+                    render: (h, { row }) => {
+                      return <div>{{ CANCEL: '取消', WAIT: '待支付', PAID: '已支付' }[row.payStatus]}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '交易时间',
+                      prop: 'payTime'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '创建时间',
+                      prop: 'createTime'
+                    }
+                  }
+                ]}
+                table-data={[formData]}
+              />
+            )
+          }
+        }
+      ]
+    },
+    getxiangqing() {
+      if (this.id) {
+        orderBaseDetail({
+          orderBaseId: this.id
+        }).then(resData => {
+          this.orderBaseDetail = resData.data
+          if (!!~[1, 2, 3].indexOf(this?.workOrderType)) {
+            changeOrderGetOrderList({
+              id: this.id
+            }).then(res => {
+              this.payData = res.data.map(item => {
+                return {
+                  ...item,
+                  gengduofeiyong: [
+                    {
+                      chargeType: 'SERV',
+                      amountName: '服务费用',
+                      normAmount: item.servicePrice || 0,
+                      sfsxf: Math.ceil((item.servicePrice || 0) * 0.6) / 100,
+                      sffzje: item.servicePrice - Math.ceil((item.servicePrice || 0) * 0.6) / 100
+                    },
+                    {
+                      chargeType: 'SERV',
+                      amountName: '其他费用',
+                      normAmount: item.otherPrice || 0,
+                      sfsxf: Math.ceil((item.otherPrice || 0) * 0.6) / 100,
+                      sffzje: item.otherPrice - Math.ceil((item.otherPrice || 0) * 0.6) / 100
+                    }
+                  ]
+                }
+              })
+              console.log(this.payData)
+            })
+          } else if (this?.workOrderType == 4) {
+            enginMaterialDetailWorker({
+              workerOrderId: this.id
+            }).then(res => {
+              this.payData = res.data.map(item => {
+                return {
+                  ...item,
+                  gengduofeiyong: [
+                    {
+                      chargeType: 'SERV',
+                      amountName: '服务费用',
+                      normAmount: item.servicePrice || 0,
+                      sfsxf: Math.ceil((item.servicePrice || 0) * 0.6) / 100,
+                      sffzje: item.servicePrice - Math.ceil((item.servicePrice || 0) * 0.6) / 100
+                    },
+                    {
+                      chargeType: 'SERV',
+                      amountName: '其他费用',
+                      normAmount: item.otherPrice || 0,
+                      sfsxf: Math.ceil((item.otherPrice || 0) * 0.6) / 100,
+                      sffzje: item.otherPrice - Math.ceil((item.otherPrice || 0) * 0.6) / 100
+                    }
+                  ]
+                }
+              })
+              console.log(this.payData)
+            })
+          }
+        })
+      }
+    },
+    enginMaterialCancelFun(item) {
+      this.$confirm('是否确认取消申请?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          enginMaterialCancel({
+            id: item.orderId
+          }).then(res => {
+            this.getxiangqing()
+          })
+        })
+        .catch(() => {})
+    },
+    toFixed(num = 0) {
+      return (num || 0).toFixed(2)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep & > .zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    & > div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 1657 - 0
src/views/workOrder/workOrderPool2/detailModule/SettleAccounts/index.vue

@@ -0,0 +1,1657 @@
+<template>
+  <zj-page-container>
+    <zj-page-fill class="neibuview">
+      <zj-form-container ref="formRef" v-if="formData.orderType" :form-data="formData">
+        <zj-form-module
+          :title="`费用结算-${{ INSTALL: '安装', REPAIR: '维修' }[formData.orderType]}`"
+          :form-data="formData"
+          :form-items="repairInfo"
+        />
+      </zj-form-container>
+      <el-empty v-else description="暂时没有结算信息"></el-empty>
+    </zj-page-fill>
+    <div v-if="formData.settleStatus == 'YWG'" style="box-sizing: border-box; padding: 16px">
+      <el-button type="primary" size="mini" @click="queding">确定结算</el-button>
+    </div>
+    <div v-else style="box-sizing: border-box; padding: 16px">
+      <el-button v-if="showbtn" type="danger" size="mini" @click="itemOrderBaseSettleNormReset">重新结算</el-button>
+    </div>
+  </zj-page-container>
+</template>
+
+<script>
+import { required } from '@/components/template/rules_verify.js'
+import { listPageV2 } from '@/api/workOrder/settlementStandardInstall'
+import { listPageV2 as listPageV2Repair } from '@/api/workOrder/settlementStandardRepair'
+import {
+  orderBaseSettleNormDetail,
+  orderBaseSettleNormConfirm,
+  settleNormInstallQuery,
+  settleNormOtherQuery,
+  orderBaseSettleNormReset
+} from '@/api/workOrderPool.js'
+import { EventBus } from '@/utils/eventBus'
+export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null
+    }
+  },
+  data() {
+    return {
+      gonglv: [],
+      gonglr: [],
+      classifyList: [],
+      otherList: [],
+      formData: {},
+      showbtn: false
+    }
+  },
+  computed: {
+    // 产品信息
+    productInfoColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '工单来源',
+            prop: 'orderChannelText'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品品牌',
+            prop: 'brand'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品大类',
+            prop: 'mainName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品小类',
+            prop: 'smallName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品机型',
+            prop: 'goodsName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '数量',
+            prop: 'orderNum'
+          }
+        }
+      ]
+    },
+    // 师傅信息
+    masterInfoColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '工程师名称',
+            prop: 'workerName'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {this.formData?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '联系电话',
+            prop: 'workerMobile',
+            width: '140px'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {this.formData?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '结算费用',
+            prop: 'settleAmount'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`normList.${row.pfuqinid}.workerList.${row.zijideid}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    type="number"
+                    disabled={
+                      !this.formData.normList[row.pfuqinid].bianji ||
+                      this.formData?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.['poolStatus'] == 'YES'
+                    }
+                    value={
+                      this.formData?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]
+                    }
+                    onInput={val => {
+                      // var num = 0
+                      // this.formData?.normList[row.pfuqinid]?.workerList.map((item, in_dex) => {
+                      //   if (in_dex !== row.zijideid) {
+                      //     num += Number(item.settleAmount)
+                      //   }
+                      // })
+                      // // 最大
+                      // var maxNum = Number(this.formData.normList[row.pfuqinid]["settleAmount"]) - num
+                      // this.formData.normList[row.pfuqinid].workerList[row.zijideid][column.columnAttributes.prop] = Number(val) > maxNum ? maxNum : Number(val)
+                      this.formData.normList[row.pfuqinid].workerList[row.zijideid][column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '确认人',
+            prop: 'confirmBy'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {this.formData?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '确认时间',
+            prop: 'confirmTime'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {this.formData?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '汇总状态',
+            prop: 'poolStatus'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {
+                  { NO: '未汇总', YES: '已汇总' }[
+                    this.formData?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]
+                  ]
+                }
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作',
+            prop: '',
+            fixed: 'right',
+            width: '100px'
+          },
+          render: (h, { row, column, index }) => {
+            return this.formData.settleStatus == 'YWG' ||
+              (this.formData.settleStatus == 'YJS' &&
+                this.formData?.normList[row.pfuqinid]?.workerList.find(item => item.poolStatus == 'NO')) ? (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {this.formData.normList[row.pfuqinid].bianji ? (
+                  <el-button
+                    type="text"
+                    onClick={() => {
+                      var yjsje = [
+                        0,
+                        0,
+                        0,
+                        this.formData?.normList[row.pfuqinid]?.workerList
+                          .filter(item => item.poolStatus == 'YES')
+                          .map(item => item.settleAmount)
+                      ].reduce(function (prev, curr, idx, arr) {
+                        return prev + curr
+                      })
+                      var nou = this.formData?.normList[row.pfuqinid]?.workerList.filter(
+                        item => item.poolStatus == 'NO'
+                      )
+                      var qian = (
+                        (((Number(this.formData?.normList[row.pfuqinid]['settleAmount']) - yjsje) / nou.length) * 100) /
+                        100
+                      ).toFixed(2)
+                      var rongyu = (
+                        Number(this.formData?.normList[row.pfuqinid]['settleAmount']) -
+                        yjsje -
+                        qian * nou.length
+                      ).toFixed(2)
+                      nou.map((item, index) => {
+                        if (index === 0) {
+                          item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
+                        } else {
+                          item.settleAmount = qian
+                        }
+                      })
+                    }}
+                  >
+                    平分费用
+                  </el-button>
+                ) : null}
+                {this.formData.normList[row.pfuqinid].bianji ? (
+                  <el-button
+                    type="text"
+                    onClick={() => {
+                      var item = this.formData.normList[row.pfuqinid]
+                      if (
+                        [0, 0, 0, ...item.workerList.map(val => Number(val.settleAmount))].reduce(function (
+                          prev,
+                          curr,
+                          idx,
+                          arr
+                        ) {
+                          return prev + curr
+                        }) == Number(item.settleAmount)
+                      ) {
+                        this.formData.normList[row.pfuqinid].bianji = false
+                      } else {
+                        this.$message.warning(
+                          `费用信息-${item.channelText}-${item.parentCategoryName}-${item.categoryName}-${item.label}:合计结算总金额与总金额不等`
+                        )
+                      }
+                    }}
+                  >
+                    确定
+                  </el-button>
+                ) : null}
+                {!this.formData.normList[row.pfuqinid].bianji ? (
+                  <el-button
+                    type="text"
+                    onClick={() => {
+                      this.formData.normList[row.pfuqinid].bianji = true
+                    }}
+                  >
+                    修改
+                  </el-button>
+                ) : null}
+              </div>
+            ) : null
+          }
+        }
+      ]
+    },
+    masterInfoColumnsOther() {
+      return [
+        {
+          columnAttributes: {
+            label: '工程师名称',
+            prop: 'workerName'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {this.formData?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '联系电话',
+            prop: 'workerMobile',
+            width: '140px'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {this.formData?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '结算费用',
+            prop: 'settleAmount'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`otherNormList.${row.pfuqinid}.workerList.${row.zijideid}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    type="number"
+                    disabled={
+                      !this.formData.otherNormList[row.pfuqinid].bianji ||
+                      this.formData?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.['poolStatus'] == 'YES'
+                    }
+                    value={
+                      this.formData?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[
+                        column.columnAttributes.prop
+                      ]
+                    }
+                    onInput={val => {
+                      // var num = 0
+                      // this.formData?.otherNormList[row.pfuqinid]?.workerList.map((item, in_dex) => {
+                      //   if (in_dex !== row.zijideid) {
+                      //     num += Number(item.settleAmount)
+                      //   }
+                      // })
+                      // // 最大
+                      // var maxNum = Number(this.formData.otherNormList[row.pfuqinid]["settleAmount"]) - num
+                      // this.formData.otherNormList[row.pfuqinid].workerList[row.zijideid][column.columnAttributes.prop] = Number(val) > maxNum ? maxNum : Number(val)
+                      this.formData.otherNormList[row.pfuqinid].workerList[row.zijideid][column.columnAttributes.prop] =
+                        val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '确认人',
+            prop: 'confirmBy'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {this.formData?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '确认时间',
+            prop: 'confirmTime'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {this.formData?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '汇总状态',
+            prop: 'poolStatus'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {
+                  { NO: '未汇总', YES: '已汇总' }[
+                    this.formData?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[
+                      column.columnAttributes.prop
+                    ]
+                  ]
+                }
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作',
+            prop: '',
+            fixed: 'right',
+            width: '100px'
+          },
+          render: (h, { row, column, index }) => {
+            return this.formData.settleStatus == 'YWG' ||
+              (this.formData.settleStatus == 'YJS' &&
+                this.formData?.otherNormList[row.pfuqinid]?.workerList.find(item => item.poolStatus == 'NO')) ? (
+              <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                {this.formData.otherNormList[row.pfuqinid].bianji ? (
+                  <el-button
+                    type="text"
+                    onClick={() => {
+                      var yjsje = [
+                        0,
+                        0,
+                        0,
+                        this.formData?.otherNormList[row.pfuqinid]?.workerList
+                          .filter(item => item.poolStatus == 'YES')
+                          .map(item => item.settleAmount)
+                      ].reduce(function (prev, curr, idx, arr) {
+                        return prev + curr
+                      })
+                      var nou = this.formData?.otherNormList[row.pfuqinid]?.workerList.filter(
+                        item => item.poolStatus == 'NO'
+                      )
+                      var qian = (
+                        (((Number(this.formData?.otherNormList[row.pfuqinid]['settleAmount']) - yjsje) / nou.length) *
+                          100) /
+                        100
+                      ).toFixed(2)
+                      var rongyu = (
+                        Number(this.formData?.otherNormList[row.pfuqinid]['settleAmount']) -
+                        yjsje -
+                        qian * nou.length
+                      ).toFixed(2)
+                      nou.map((item, index) => {
+                        if (index === 0) {
+                          item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
+                        } else {
+                          item.settleAmount = qian
+                        }
+                      })
+                    }}
+                  >
+                    平分费用
+                  </el-button>
+                ) : null}
+                {this.formData.otherNormList[row.pfuqinid].bianji ? (
+                  <el-button
+                    type="text"
+                    onClick={() => {
+                      var item = this.formData.otherNormList[row.pfuqinid]
+                      if (
+                        [0, 0, 0, ...item.workerList.map(val => Number(val.settleAmount))].reduce(function (
+                          prev,
+                          curr,
+                          idx,
+                          arr
+                        ) {
+                          return prev + curr
+                        }) == Number(item.settleAmount)
+                      ) {
+                        this.formData.otherNormList[row.pfuqinid].bianji = false
+                      } else {
+                        this.$message.warning(
+                          `其他费用信息-${item.channelText}-${item.type}-${item.label}:合计结算总金额与总金额不等`
+                        )
+                      }
+                    }}
+                  >
+                    确定
+                  </el-button>
+                ) : null}
+                {!this.formData.otherNormList[row.pfuqinid].bianji ? (
+                  <el-button
+                    type="text"
+                    onClick={() => {
+                      this.formData.otherNormList[row.pfuqinid].bianji = true
+                    }}
+                  >
+                    修改
+                  </el-button>
+                ) : null}
+              </div>
+            ) : null
+          }
+        }
+      ]
+    },
+    classifyColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '工单类型',
+            prop: 'typeName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '结算工单来源',
+            prop: 'channelId',
+            width: '110'
+          },
+          render: (h, { row, column, index }) => {
+            return this.panfuan(row) ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`normList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      row.parentCategoryId = ''
+                      row.parentCategoryName = ''
+                      row.categoryId = ''
+                      row.categoryName = ''
+                      row.label = ''
+                      row.normAmount = ''
+                      row.repairAmount = ''
+                      row.settleNormId = ''
+                      if (val) {
+                        var data = this.classifyListChuLi('orderChannelId', 'orderChannelText').find(
+                          item => item.value == val
+                        )
+                        row.channelText = data.label
+                      } else {
+                        row.channelText = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.classifyListChuLi('orderChannelId', 'orderChannelText').map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : null
+          }
+        },
+        {
+          columnAttributes: {
+            label: '结算产品大类',
+            prop: 'parentCategoryId',
+            width: '110'
+          },
+          render: (h, { row, column, index }) => {
+            return this.panfuan(row) ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`normList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      row.categoryId = ''
+                      row.categoryName = ''
+                      row.label = ''
+                      row.normAmount = ''
+                      row.repairAmount = ''
+                      row.settleNormId = ''
+                      if (val) {
+                        var data = this.classifyListChuLi(
+                          'parentCategoryId',
+                          'parentCategoryName',
+                          item => item.orderChannelId == row.channelId
+                        ).find(item => item.value == val)
+                        row.parentCategoryName = data.label
+                      } else {
+                        row.parentCategoryName = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.classifyListChuLi(
+                      'parentCategoryId',
+                      'parentCategoryName',
+                      item => item.orderChannelId == row.channelId
+                    ).map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : null
+          }
+        },
+        {
+          columnAttributes: {
+            label: '结算产品小类',
+            prop: 'categoryId',
+            width: '110'
+          },
+          render: (h, { row, column, index }) => {
+            return this.panfuan(row) ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`normList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      row.label = ''
+                      row.normAmount = ''
+                      row.repairAmount = ''
+                      row.settleNormId = ''
+                      if (val) {
+                        var data = this.classifyListChuLi(
+                          'categoryId',
+                          'categoryName',
+                          item => item.orderChannelId == row.channelId && item.parentCategoryId == row.parentCategoryId
+                        ).find(item => item.value == val)
+                        row.categoryName = data.label
+                      } else {
+                        row.categoryName = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.classifyListChuLi(
+                      'categoryId',
+                      'categoryName',
+                      item => item.orderChannelId == row.channelId && item.parentCategoryId == row.parentCategoryId
+                    ).map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : null
+          }
+        }
+      ]
+    },
+    normColumns() {
+      return [
+        ...this.productInfoColumns,
+        ...this.classifyColumns,
+        ...(() => {
+          if (this.formData.orderType == 'INSTALL') {
+            return [
+              {
+                columnAttributes: {
+                  label: '结算功率',
+                  prop: 'label'
+                },
+                render: (h, { row, column, index }) => {
+                  return this.panfuan(row) ? (
+                    <div class="redbordererr">
+                      <el-form-item
+                        label=""
+                        label-width="0px"
+                        prop={`normList.${index}.${column.columnAttributes.prop}`}
+                        rules={required}
+                      >
+                        <el-select
+                          disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={val => {
+                            row[column.columnAttributes.prop] = val
+                          }}
+                          onChange={val => {
+                            if (val) {
+                              var data = this.getflList(this.gonglv, row).find(item => item.label == val)
+                              row.normAmount = data.normAmount
+                              row.settleNormId = data.id
+                            } else {
+                              row.normAmount = ''
+                              row.settleNormId = ''
+                            }
+                          }}
+                          placeholder="请选择"
+                        >
+                          {this.getflList(this.gonglv, row).map((item, index_) => (
+                            <el-option key={index_} label={item.label} value={item.label}></el-option>
+                          ))}
+                        </el-select>
+                      </el-form-item>
+                    </div>
+                  ) : null
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '结算标准(元/套)',
+                  prop: 'normAmount'
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '结算数量',
+                  prop: 'settleNum'
+                },
+                render: (h, { row, column, index }) => {
+                  return this.panfuan(row) ? (
+                    <div class="redbordererr">
+                      <el-form-item
+                        label=""
+                        label-width="0px"
+                        prop={`normList.${index}.${column.columnAttributes.prop}`}
+                        rules={required}
+                      >
+                        <el-input
+                          type="number"
+                          disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={val => {
+                            row[column.columnAttributes.prop] = val
+                          }}
+                          placeholder="请输入内容"
+                        ></el-input>
+                      </el-form-item>
+                    </div>
+                  ) : null
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '结算金额(元)',
+                  prop: 'settleAmount'
+                },
+                render: (h, { row, column, index }) => {
+                  row.settleAmount = ((Number(row.normAmount || 0) * Number(row.settleNum || 0) * 100) / 100).toFixed(2)
+                  return this.panfuan(row) ? <div class="redbordererr">{row.settleAmount}</div> : null
+                }
+              }
+            ]
+          }
+          return []
+        })(),
+        ...(() => {
+          if (this.formData.orderType == 'REPAIR') {
+            return [
+              {
+                columnAttributes: {
+                  label: '质保类型',
+                  prop: 'label'
+                },
+                render: (h, { row, column, index }) => {
+                  return this.panfuan(row) ? (
+                    <div class="redbordererr">
+                      <el-form-item
+                        label=""
+                        label-width="0px"
+                        prop={`normList.${index}.${column.columnAttributes.prop}`}
+                        rules={required}
+                      >
+                        <el-select
+                          disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={val => {
+                            row[column.columnAttributes.prop] = val
+                          }}
+                          onChange={val => {
+                            if (val) {
+                              var data = this.getflList(this.gonglr, row).find(item => item.label == val)
+                              row.repairAmount = data.repairAmount
+                              row.normAmount = data.normAmount
+                              row.settleNormId = data.id
+                            } else {
+                              row.repairAmount = ''
+                              row.normAmount = ''
+                              row.settleNormId = ''
+                            }
+                          }}
+                          placeholder="请选择"
+                        >
+                          {this.getflList(this.gonglr, row).map((item, index_) => (
+                            <el-option
+                              key={index_}
+                              label={{ INSIDE: '保内', OUT: '保外' }[item.label]}
+                              value={item.label}
+                            ></el-option>
+                          ))}
+                        </el-select>
+                      </el-form-item>
+                    </div>
+                  ) : null
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '上门费(元/单)',
+                  prop: 'repairAmount',
+                  width: '110'
+                },
+                render: (h, { row, column, index }) => {
+                  return this.panfuan(row) ? (
+                    <div class="redbordererr">
+                      <el-form-item
+                        label=""
+                        label-width="0px"
+                        prop={`normList.${index}.${column.columnAttributes.prop}`}
+                        rules={required}
+                      >
+                        <el-input
+                          disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                          type="number"
+                          value={row[column.columnAttributes.prop]}
+                          onInput={val => {
+                            row[column.columnAttributes.prop] = val
+                          }}
+                          placeholder="请输入内容"
+                        ></el-input>
+                      </el-form-item>
+                    </div>
+                  ) : null
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '维修费结算比例%',
+                  prop: 'normAmount',
+                  width: '110'
+                },
+                render: (h, { row, column, index }) => {
+                  return this.panfuan(row) ? <div class="redbordererr">{row[column.columnAttributes.prop]}%</div> : null
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '维修费用结算',
+                  prop: 'repairNormAmount',
+                  width: '110'
+                },
+                render: (h, { row, column, index }) => {
+                  return this.panfuan(row) ? (
+                    <div class="redbordererr">
+                      <el-form-item
+                        label=""
+                        label-width="0px"
+                        prop={`normList.${index}.${column.columnAttributes.prop}`}
+                        rules={required}
+                      >
+                        <el-input
+                          disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                          type="number"
+                          value={row[column.columnAttributes.prop]}
+                          onInput={val => {
+                            row[column.columnAttributes.prop] = val
+                          }}
+                          placeholder="请输入内容"
+                        ></el-input>
+                      </el-form-item>
+                    </div>
+                  ) : null
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '结算数量',
+                  prop: 'settleNum'
+                },
+                render: (h, { row, column, index }) => {
+                  return this.panfuan(row) ? (
+                    <div class="redbordererr">
+                      <el-form-item
+                        label=""
+                        label-width="0px"
+                        prop={`normList.${index}.${column.columnAttributes.prop}`}
+                        rules={required}
+                      >
+                        <el-input
+                          type="number"
+                          disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={val => {
+                            row[column.columnAttributes.prop] = val
+                          }}
+                          placeholder="请输入内容"
+                        ></el-input>
+                      </el-form-item>
+                    </div>
+                  ) : null
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '结算金额(元)',
+                  prop: 'settleAmount'
+                },
+                render: (h, { row, column, index }) => {
+                  row.settleAmount = (
+                    ((Number(row.repairAmount || 0) +
+                      (Number(row.normAmount || 0) / 100) *
+                        Number(row.repairNormAmount || 0) *
+                        Number(row.settleNum || 0)) *
+                      100) /
+                    100
+                  ).toFixed(2)
+                  return this.panfuan(row) ? <div class="redbordererr">{row.settleAmount}</div> : null
+                }
+              }
+            ]
+          }
+          return []
+        })(),
+        {
+          columnAttributes: {
+            label: '备注',
+            prop: 'remark'
+          },
+          render: (h, { row, column, index }) => {
+            return this.panfuan(row) ? (
+              <div class="redbordererr">
+                <el-form-item label="" label-width="0px">
+                  <el-input
+                    disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : null
+          }
+        },
+        ...this.masterInfoColumns
+      ]
+    },
+    otherclassifyColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '结算工单来源',
+            prop: 'channelId',
+            width: '110'
+          },
+          render: (h, { row, column, index }) => {
+            return this.panfuan(row) ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`normList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      row.type = ''
+                      row.label = ''
+                      row.normAmount = ''
+                      row.settleNormId = ''
+                      row.settleNum = ''
+                      if (val) {
+                        var data = this.otherListChuLi('orderChannelId', 'orderChannelText').find(
+                          item => item.value == val
+                        )
+                        row.channelText = data.label
+                      } else {
+                        row.channelText = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.otherListChuLi('orderChannelId', 'orderChannelText').map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : null
+          }
+        },
+        {
+          columnAttributes: {
+            label: '费用类型',
+            prop: 'type'
+          },
+          render: (h, { row, column, index }) => {
+            return this.panfuan(row) ? (
+              <div class="redbordererr">
+                <el-form-item label="" label-width="0px">
+                  <el-select
+                    disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      row.label = ''
+                      row.normAmount = ''
+                      row.settleNormId = ''
+                      row.settleNum = ''
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.otherListChuLi('type', 'typeName', item => item.orderChannelId == row.channelId).map(
+                      (item, index_) => (
+                        <el-option key={index_} label={item.label} value={item.value}></el-option>
+                      )
+                    )}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : null
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格',
+            prop: 'label'
+          },
+          render: (h, { row, column, index }) => {
+            return this.panfuan(row) ? (
+              <div class="redbordererr">
+                <el-form-item label="" label-width="0px">
+                  <el-select
+                    disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      row.settleNum = ''
+                      if (val) {
+                        var data = this.otherListChuLi(
+                          'label',
+                          'label',
+                          item => {
+                            return item.orderChannelId == row.channelId && item.type == row.type
+                          },
+                          'normAmount',
+                          'id'
+                        ).find(item => item.label == val)
+                        row.normAmount = data.normAmount
+                        row.settleNormId = data.id
+                      } else {
+                        row.normAmount = ''
+                        row.settleNormId = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.otherListChuLi(
+                      'label',
+                      'label',
+                      item => item.orderChannelId == row.channelId && item.type == row.type
+                    ).map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : null
+          }
+        }
+      ]
+    },
+    otherColumns() {
+      return [
+        ...this.productInfoColumns,
+        ...this.otherclassifyColumns,
+        {
+          columnAttributes: {
+            label: '单价(元/套)',
+            prop: 'normAmount'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '数量',
+            prop: 'settleNum'
+          },
+          render: (h, { row, column, index }) => {
+            return this.panfuan(row) ? (
+              <div class="redbordererr">
+                <el-form-item label="" label-width="0px">
+                  <el-input
+                    type="number"
+                    disabled={!row.bianji || row.normAmount ? this.formData.settleStatus != 'YWG' : true}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : null
+          }
+        },
+        {
+          columnAttributes: {
+            label: '结算金额(元)',
+            prop: 'settleAmount'
+          },
+          render: (h, { row, column, index }) => {
+            row.settleAmount = ((Number(row.normAmount || 0) * Number(row.settleNum || 0) * 100) / 100).toFixed(2)
+            return this.panfuan(row) ? <div class="redbordererr">{row.settleAmount}</div> : null
+          }
+        },
+        {
+          columnAttributes: {
+            label: '备注',
+            prop: 'remark'
+          },
+          render: (h, { row, column, index }) => {
+            return this.panfuan(row) ? (
+              <div class="redbordererr">
+                <el-form-item label="" label-width="0px">
+                  <el-input
+                    disabled={!row.bianji || this.formData.settleStatus != 'YWG'}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : null
+          }
+        },
+        ...this.masterInfoColumnsOther
+      ]
+    },
+    // 师傅汇总
+    shiFuHuiZongColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '工程师名称',
+            prop: 'workerName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '联系电话',
+            prop: 'workerMobile'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '费用结算总金额',
+            prop: 'zonjine'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '结算总金额',
+            prop: 'settleAmount'
+          }
+        }
+      ]
+    },
+    repairInfo() {
+      return [
+        {
+          name: 'slot-component',
+          md: 6,
+          attributes: { disabled: true },
+          formItemAttributes: { label: '网点名称', prop: 'websitName' },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <el-input
+                value={`${formData.websitName || ''}`}
+                disabled={true}
+                size="mini"
+                placeholder="请输入"
+              ></el-input>
+            )
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true },
+          formItemAttributes: { label: '工程师', prop: 'workerName' }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true },
+          formItemAttributes: { label: '联系电话', prop: 'mobile' }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true },
+          formItemAttributes: { label: '身份证', prop: 'idcard' }
+        },
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '费用结算',
+            prop: 'normList'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <zj-table
+                columns={this.normColumns}
+                table-data={formData.normList}
+                tableAttributes={{
+                  'span-method': ({ row, column, rowIndex, columnIndex }) => {
+                    if (columnIndex === this.normColumns.length - 1) {
+                      if (row.zijideid == 0) {
+                        return {
+                          rowspan: formData.normList[row.pfuqinid].workerList.length,
+                          colspan: 1
+                        }
+                      } else {
+                        return {
+                          rowspan: 0,
+                          colspan: 0
+                        }
+                      }
+                    }
+                  }
+                }}
+              />
+            )
+          }
+        },
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '其他费用结算',
+            prop: 'otherNormList'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <zj-table
+                columns={this.otherColumns}
+                table-data={formData.otherNormList}
+                tableAttributes={{
+                  'span-method': ({ row, column, rowIndex, columnIndex }) => {
+                    if (columnIndex === this.otherColumns.length - 1) {
+                      if (row.zijideid == 0) {
+                        return {
+                          rowspan: formData.otherNormList[row.pfuqinid].workerList.length,
+                          colspan: 1
+                        }
+                      } else {
+                        return {
+                          rowspan: 0,
+                          colspan: 0
+                        }
+                      }
+                    }
+                  }
+                }}
+              />
+            )
+          }
+        },
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '师傅结算费用汇总',
+            prop: 'otherNormList'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+
+            return (
+              <zj-table
+                columns={this.shiFuHuiZongColumns}
+                table-data={this.zongbiaoheji}
+                tableAttributes={{
+                  'span-method': ({ row, column, rowIndex, columnIndex }) => {
+                    if (columnIndex === 2) {
+                      if (rowIndex == 0) {
+                        return {
+                          rowspan: this.zongbiaoheji.length,
+                          colspan: 1
+                        }
+                      } else {
+                        return {
+                          rowspan: 0,
+                          colspan: 0
+                        }
+                      }
+                    }
+                  }
+                }}
+              />
+            )
+          }
+        }
+      ]
+    },
+    zongbiaoheji() {
+      var workers = {}
+      var zonjine = 0
+      this.formData.normList.map(item => {
+        zonjine += Number(item.settleAmount) || 0
+        item?.workerList?.map(data => {
+          if (!workers[data.workerId]) {
+            workers[data.workerId] = JSON.parse(JSON.stringify(data))
+          } else {
+            workers[data.workerId].settleAmount = (
+              ((Number(workers[data.workerId].settleAmount) + Number(data.settleAmount)) * 100) /
+              100
+            ).toFixed(2)
+          }
+        })
+      })
+      this.formData.otherNormList.map(item => {
+        zonjine += Number(item.settleAmount) || 0
+        item?.workerList?.map(data => {
+          if (!workers[data.workerId]) {
+            workers[data.workerId] = JSON.parse(JSON.stringify(data))
+          } else {
+            workers[data.workerId].settleAmount = (
+              ((Number(workers[data.workerId].settleAmount) + Number(data.settleAmount)) * 100) /
+              100
+            ).toFixed(2)
+          }
+        })
+      })
+      return Object.keys(workers).map(key => {
+        workers[key].zonjine = ((zonjine * 100) / 100).toFixed(2)
+        return workers[key]
+      })
+    }
+  },
+  watch: {
+    id: {
+      handler(newVal, oldVal) {
+        this.init()
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  methods: {
+    panfuan(item) {
+      if (!!item.id) {
+        return true
+      } else {
+        return false
+      }
+    },
+
+    // 产品类型过滤筛选
+    classifyListChuLi(value, label, func, ...keys) {
+      var obj = {}
+      this.classifyList.map(item => {
+        if (func && !func(item)) {
+          return
+        }
+        obj[item[value]] = {
+          label: item[label]
+        }
+        for (var key of keys) {
+          obj[item[value]][key] = item[key]
+        }
+      })
+      return Object.keys(obj).map(value => {
+        return {
+          value: value,
+          ...obj[value]
+        }
+      })
+    },
+
+    // 其他类型筛选
+    otherListChuLi(value, label, func, ...keys) {
+      var obj = {}
+      this.otherList.map(item => {
+        if (func && !func(item)) {
+          return
+        }
+        obj[item[value]] = {
+          label: item[label]
+        }
+        for (var key of keys) {
+          obj[item[value]][key] = item[key]
+        }
+      })
+      return Object.keys(obj).map(value => {
+        return {
+          value: value,
+          ...obj[value]
+        }
+      })
+    },
+
+    getflList(list = [], row = {}) {
+      return list.filter(
+        item =>
+          item.type == row.type && item.parentCategoryId == row.parentCategoryId && item.categoryId == row.categoryId
+        // &&
+        // !~this.formData.normList.map(v => `${v.type}_${v.parentCategoryId}_${v.categoryId}_${v.label}`).filter(v => (
+        //   v != `${row.type}_${row.parentCategoryId}_${row.categoryId}_${row.label}`
+        // )).indexOf(`${item.type}_${item.parentCategoryId}_${item.categoryId}_${item.label}`)
+      )
+    },
+
+    queding() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          try {
+            this.formData.normList
+              .filter(item => !!item.id)
+              .map(item => {
+                if (
+                  [0, 0, 0, ...item.workerList.map(val => Number(val.settleAmount))].reduce(function (
+                    prev,
+                    curr,
+                    idx,
+                    arr
+                  ) {
+                    return prev + curr
+                  }) !== Number(item.settleAmount)
+                ) {
+                  throw new Error(
+                    `费用信息-${item.channelText}-${item.parentCategoryName}-${item.categoryName}-${item.label}:合计结算总金额与总金额不等`
+                  )
+                }
+              })
+            this.formData.otherNormList
+              .filter(item => !!item.id)
+              .map(item => {
+                if (
+                  [0, 0, 0, ...item.workerList.map(val => Number(val.settleAmount))].reduce(function (
+                    prev,
+                    curr,
+                    idx,
+                    arr
+                  ) {
+                    return prev + curr
+                  }) !== Number(item.settleAmount)
+                ) {
+                  throw new Error(
+                    `其他费用信息-${item.channelText}-${item.type}-${item.label}:合计结算总金额与总金额不等`
+                  )
+                }
+              })
+          } catch (err) {
+            this.$message.warning(err.message)
+            return
+          }
+          orderBaseSettleNormConfirm({
+            ...this.formData,
+            normList: this.formData.normList.filter(item => !!item.id),
+            otherNormList: this.formData.otherNormList.filter(item => !!item.id)
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '结算成功'
+            })
+            // 结算成功后跳转列表
+            EventBus.$emit('handleOrderClone')
+          })
+        }
+      })
+    },
+
+    itemOrderBaseSettleNormReset() {
+      try {
+        this.formData.normList
+          .filter(item => !!item.id)
+          .map(item => {
+            if (
+              [0, 0, 0, ...item.workerList.map(val => Number(val.settleAmount))].reduce(function (
+                prev,
+                curr,
+                idx,
+                arr
+              ) {
+                return prev + curr
+              }) !== Number(item.settleAmount)
+            ) {
+              throw new Error(
+                `费用信息-${item.channelText}-${item.parentCategoryName}-${item.categoryName}-${item.label}:合计结算总金额与总金额不等`
+              )
+            }
+          })
+        this.formData.otherNormList
+          .filter(item => !!item.id)
+          .map(item => {
+            if (
+              [0, 0, 0, ...item.workerList.map(val => Number(val.settleAmount))].reduce(function (
+                prev,
+                curr,
+                idx,
+                arr
+              ) {
+                return prev + curr
+              }) !== Number(item.settleAmount)
+            ) {
+              throw new Error(`其他费用信息-${item.channelText}-${item.type}-${item.label}:合计结算总金额与总金额不等`)
+            }
+          })
+      } catch (err) {
+        this.$message.warning(err.message)
+        return
+      }
+      orderBaseSettleNormReset({
+        ...this.formData,
+        normList: this.formData.normList.filter(item => !!item.id),
+        otherNormList: this.formData.otherNormList.filter(item => !!item.id)
+      }).then(res => {
+        this.$message({
+          type: 'success',
+          message: '结算成功'
+        })
+        // 结算成功后跳转列表
+        EventBus.$emit('handleOrderClone')
+      })
+    },
+
+    init() {
+      if (this.id) {
+        orderBaseSettleNormDetail({
+          id: this.id
+        }).then(res => {
+          var orderChannelId
+          var normList = []
+          var pfuqinid = 0
+          res.data.normList.map((item, index) => {
+            if (!orderChannelId) {
+              orderChannelId = item.orderChannelId
+            }
+            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
+              }
+              if (ind_ !== 0) {
+                normList.push({ pfuqinid: pfuqinid, zijideid: ind_ })
+              }
+              if (ind_ == item.workerList.length - 1) {
+                pfuqinid += ind_ + 1
+              }
+            })
+          })
+          var otherNormList = []
+          var qtpfuqinid = 0
+          res.data.otherNormList.map((item, index) => {
+            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
+              }
+              if (ind_ !== 0) {
+                otherNormList.push({ pfuqinid: qtpfuqinid, zijideid: ind_ })
+              }
+              if (ind_ == item.workerList.length - 1) {
+                qtpfuqinid += ind_ + 1
+              }
+            })
+          })
+          this.formData = res.data ? { ...res.data, normList, otherNormList } : {}
+          // -------------------------------------------------------------------
+          if (this.formData.orderType == 'INSTALL') {
+            // 安装单请求
+            listPageV2({ pageNum: 1, pageSize: -1 }).then(res => {
+              this.gonglv = res.data.records
+            })
+          } else if (this.formData.orderType == 'REPAIR') {
+            // 维修单请求
+            listPageV2Repair({ pageNum: 1, pageSize: -1 }).then(res => {
+              this.gonglr = res.data.records
+            })
+          }
+          settleNormInstallQuery({
+            settleNormType: this.formData.orderType,
+            type: this.formData.orderSmallType
+          }).then(res => {
+            this.classifyList = res.data
+          })
+          settleNormOtherQuery().then(res => {
+            this.otherList = res.data
+          })
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep & > .zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    & > div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 56 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/abnormal.vue

@@ -0,0 +1,56 @@
+<template>
+  <div class="withinLine">
+    <el-button @click="abnormal" :disabled="disabled" type="primary" size="mini">设为异常</el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { MessageBox } from '@zjlib/element-ui2'
+import { orderBaseFlag } from '@/api/workOrderPool.js'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    abnormal() {
+      this.lockBtn()
+      MessageBox.confirm('是否确定将此单设置为异常单,请谨慎操作', '设为异常确认', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          orderBaseFlag({ flag: true, orderBaseId: this.orderInfo.id, orderFlagEnum: 'YI_CHANGE' })
+            .then(res => {
+              this.unlockBtn()
+              // 编辑保存后不跳转列表,刷新数据
+              this.acquireVerify(this, 'getorderDetail')()
+              // 刷新操作记录
+              this.acquireVerify(this, 'getOrderBaseLogList')()
+              this.$message({
+                type: 'success',
+                message: '设置成功!'
+              })
+            })
+            .catch(() => {
+              this.unlockBtn()
+            })
+        })
+        .catch(() => {
+          this.unlockBtn()
+        })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 56 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/activateOrder.vue

@@ -0,0 +1,56 @@
+<template>
+  <div class="withinLine">
+    <el-button @click="abnormal" :disabled="disabled" type="primary" size="mini">激活工单</el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { MessageBox } from '@zjlib/element-ui2'
+import { orderBaseActive } from '@/api/workOrderPool.js'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    abnormal() {
+      this.lockBtn()
+      MessageBox.confirm('是否确定将此单重新激活,请谨慎操作', '激活工单确认', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          orderBaseActive({ orderBaseId: this.orderInfo.id })
+            .then(res => {
+              this.unlockBtn()
+              // 编辑保存后不跳转列表,刷新数据
+              this.acquireVerify(this, 'getorderDetail')()
+              // 刷新操作记录
+              this.acquireVerify(this, 'getOrderBaseLogList')()
+              this.$message({
+                type: 'success',
+                message: '激活成功!'
+              })
+            })
+            .catch(() => {
+              this.unlockBtn()
+            })
+        })
+        .catch(() => {
+          this.unlockBtn()
+        })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 35 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/button_mixin.js

@@ -0,0 +1,35 @@
+export default {
+  props: {
+    orderInfo: {
+      type: Object,
+      default: () => ({})
+    },
+    orderType: {
+      type: Number,
+      default: null
+    }
+  },
+  data() {
+    return {
+      disabled: false
+    }
+  },
+  methods: {
+    acquireVerify(v, name) {
+      if (v.$parent[name]) {
+        return v.$parent[name]
+      } else {
+        return this.acquireVerify(v.$parent, name)
+      }
+    },
+    lockBtn() {
+      this.disabled = true
+      setTimeout(() => {
+        this.disabled = false
+      }, 5000)
+    },
+    unlockBtn() {
+      this.disabled = false
+    }
+  }
+}

+ 57 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/cancelOrder.vue

@@ -0,0 +1,57 @@
+<template>
+  <div class="withinLine">
+    <el-button @click="abnormal" :disabled="disabled" type="primary" size="mini">取消工单</el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { MessageBox } from '@zjlib/element-ui2'
+import { orderBaseCancel } from '@/api/workOrderPool.js'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    abnormal() {
+      this.lockBtn()
+      MessageBox.confirm('是否确定取消此单,请谨慎操作', '取消工单', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          orderBaseCancel({
+            orderBaseId: this.orderInfo.id
+          })
+            .then(res => {
+              // 编辑保存后不跳转列表,刷新数据
+              this.acquireVerify(this, 'getorderDetail')()
+              // 刷新操作记录
+              this.acquireVerify(this, 'getOrderBaseLogList')()
+              this.$message({
+                type: 'success',
+                message: '取消成功!'
+              })
+            })
+            .catch(() => {
+              this.unlockBtn()
+            })
+        })
+        .catch(() => {
+          this.unlockBtn()
+        })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 75 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/cloneWorkOrder.vue

@@ -0,0 +1,75 @@
+<template>
+  <div class="withinLine">
+    <el-button type="primary" :disabled="disabled" size="mini" @click="save"> 创建服务单 </el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { EventBus } from '@/utils/eventBus'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    save() {
+      EventBus.$emit('cloneWorkOrder', {
+        ...this.removeFields(JSON.parse(JSON.stringify(this.orderInfo)), [
+          'id',
+          'createBy',
+          'createDate',
+          'updateBy',
+          'updateTime',
+          'orderStatus',
+          'orderFlags',
+          'orderBaseId',
+          'orderWorkers',
+          'orderWorkers_cp',
+          'workerId',
+          'workerIdList',
+          'workerId_fz',
+          'workerIdcard',
+          'workerMobile',
+          'workerName',
+          'workerReceTime',
+          'workerRemark'
+        ]),
+        orderWorkers: []
+      })
+    },
+    removeFields(jsonData, fieldsToRemove) {
+      if (typeof jsonData !== 'object' || jsonData === null) {
+        // 如果传入的不是对象,则直接返回
+        return jsonData
+      } else if (Array.isArray(jsonData)) {
+        // 如果是数组,则递归处理每个元素
+        return jsonData.map(item => this.removeFields(item, fieldsToRemove))
+      } else {
+        // 如果是对象,则遍历键值对
+        for (var key in jsonData) {
+          if (jsonData.hasOwnProperty(key)) {
+            if (fieldsToRemove.includes(key)) {
+              // 如果字段名在指定的要删除的字段数组中,则删除该字段
+              delete jsonData[key]
+            } else {
+              // 否则递归处理字段值
+              jsonData[key] = this.removeFields(jsonData[key], fieldsToRemove)
+            }
+          }
+        }
+        return jsonData
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 29 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/closeButton.vue

@@ -0,0 +1,29 @@
+<template>
+  <div class="withinLine">
+    <el-button type="info" size="mini" @click="clone">关闭</el-button>
+  </div>
+</template>
+
+<script>
+import { EventBus } from '@/utils/eventBus'
+import buttonMixin from './button_mixin.js'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    clone() {
+      EventBus.$emit('handleOrderClone')
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 142 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/cloudCall.vue

@@ -0,0 +1,142 @@
+<template>
+  <div class="withinLine_cloud_call">
+    <i class="el-icon-phone" @click="letClick" @contextmenu.prevent.stop="rigClick"></i>
+    <el-dialog
+      :modal="true"
+      title="设置联通云呼登入名"
+      :visible.sync="dialogbol"
+      width="700px"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :modal-append-to-body="true"
+      :append-to-body="true"
+    >
+      <el-form :model="form" :rules="formRules" ref="ruleForm" label-width="130px" label-position="top">
+        <el-form-item label="联通云呼登录名" prop="unicomIntegratedId">
+          <el-input style="width: 300px" v-model="form.unicomIntegratedId"></el-input>
+        </el-form-item>
+        <el-form-item label="联通云呼-接听方式" prop="unicomIntegratedType">
+          <el-radio-group v-model="form.unicomIntegratedType">
+            <el-radio label="ExtenType">默认</el-radio>
+            <el-radio label="Local">直线电话/手机</el-radio>
+            <el-radio label="sip">电脑客户端</el-radio>
+            <el-radio label="gateway">语音网关/IP话机</el-radio>
+          </el-radio-group>
+          <div>
+            (<span style="color: red">选择任意一种成功即可,不成功就换个方式试试</span
+            >)对应云呼平台登录界面选择的接听方式。
+          </div>
+          <div>(按对方平台说的两个地方都选择IP话机,可以不需要每天都登录)</div>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="Cancel">取 消</el-button>
+        <el-button size="mini" @click="Confirm" type="primary">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { commonUnicomeCall, commonUnicomeConfigSave } from '@/api/cloudCall.js'
+import buttonMixin from './button_mixin.js'
+import { getUserInfo } from '@/api/setting'
+import { mapGetters } from 'vuex'
+export default {
+  mixins: [buttonMixin],
+  props: {
+    phone: {
+      type: [String, Number],
+      default: ''
+    }
+  },
+
+  data() {
+    return {
+      dialogbol: false,
+      form: {
+        unicomIntegratedId: '',
+        unicomIntegratedType: ''
+      },
+      formRules: {
+        unicomIntegratedId: [{ required: true, message: '请输入', trigger: 'blur' }],
+        unicomIntegratedType: [{ required: true, message: '请选择', trigger: 'change' }]
+      }
+    }
+  },
+  computed: {
+    ...mapGetters(['userid'])
+  },
+  methods: {
+    letClick() {
+      if (this.phone) {
+        commonUnicomeCall({
+          orderBaseId: this?.orderInfo?.id,
+          phone: this.phone
+        }).then(res => {
+          this.$message({
+            type: 'success',
+            message: '成功'
+          })
+        })
+      } else {
+        this.$message({
+          type: 'warning',
+          message: '请先选择工程师'
+        })
+        return
+      }
+    },
+    rigClick() {
+      getUserInfo({ adminUserId: this.userid }).then(res => {
+        this.form.unicomIntegratedId = res?.data?.unicomIntegratedId || ''
+        this.form.unicomIntegratedType = res?.data?.unicomIntegratedType || ''
+        this.dialogbol = true
+      })
+    },
+    Cancel() {
+      this.dialogbol = false
+    },
+    Confirm() {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          commonUnicomeConfigSave(this.form).then(res => {
+            this.$message({
+              type: 'success',
+              message: '设置成功'
+            })
+            this.dialogbol = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+.el-input-group__append {
+  position: relative !important;
+}
+.withinLine_cloud_call {
+  position: absolute !important;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  width: 100%;
+  height: 100%;
+  .el-icon-phone {
+    width: 100%;
+    height: 100%;
+    display: inline-block;
+    text-align: center;
+    line-height: 26px;
+    background-color: #409eff !important;
+    color: #fff !important;
+  }
+}
+</style>

+ 62 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/commitSave.vue

@@ -0,0 +1,62 @@
+<template>
+  <div class="withinLine">
+    <el-button type="primary" :disabled="disabled" size="mini" @click="save">
+      {{ orderInfo.id ? '保存' : '下派工单' }}
+    </el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { EventBus } from '@/utils/eventBus'
+import { orderBaseSave } from '@/api/workOrderPool.js'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    save() {
+      this.acquireVerify(
+        this,
+        'allVerify'
+      )(v => {
+        if (v) {
+          this.lockBtn()
+          orderBaseSave({
+            ...this.orderInfo
+          })
+            .then(res => {
+              if (this.orderInfo.id) {
+                // 编辑保存后不跳转列表,刷新数据
+                this.acquireVerify(this, 'getorderDetail')()
+                // 刷新操作记录
+                this.acquireVerify(this, 'getOrderBaseLogList')()
+                this.$message({
+                  type: 'success',
+                  message: '保存成功'
+                })
+              } else {
+                // 创建保存后跳转列表
+                EventBus.$emit('handleOrderClone')
+              }
+              this.unlockBtn()
+            })
+            .catch(() => {
+              this.unlockBtn()
+            })
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 124 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/copyInfo.vue

@@ -0,0 +1,124 @@
+<template>
+  <el-button v-if="btnys && columnCopyClassKey" :class="columnCopyClassKey" type="info" size="mini">{{
+    text
+  }}</el-button>
+  <div v-else-if="columnCopyClassKey" class="withinLine">
+    <el-button :class="columnCopyClassKey" type="primary" size="mini">{{ text }}</el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import ClipboardJS from 'clipboard'
+import md5 from 'md5'
+var nrBR = `
+`
+export default {
+  mixins: [buttonMixin],
+  props: {
+    text: {
+      type: String,
+      default: ''
+    },
+    columnCopyClass: {
+      type: String,
+      default: 'columnCopyClass_cp'
+    },
+    info: {
+      type: Array,
+      default: () => []
+    },
+    cpText: {
+      type: String,
+      default: ''
+    },
+    btnys: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      columnCopyClassKey: 'name-' + this.getRandom16Chars(md5(this.columnCopyClass + '_' + this.orderInfo.id))
+    }
+  },
+  mounted() {
+    this.textCopy()
+  },
+  beforeDestroy() {
+    if (this.clipboard?.listener?.destroy) {
+      this.clipboard.listener.destroy()
+    }
+  },
+  methods: {
+    getRandom16Chars(str) {
+      // 确保输入字符串的长度是32
+      if (str.length !== 32) {
+        throw new Error('输入字符串必须是32个字符长')
+      }
+      // 创建一个存储选中的字符的数组
+      let selectedChars = []
+      // 使用 Set 来确保没有重复的索引
+      let indices = new Set()
+      // 随机选择16个不同的索引
+      while (indices.size < 10) {
+        let randomIndex = Math.floor(Math.random() * 32)
+        indices.add(randomIndex)
+      }
+      // 根据选中的索引提取字符
+      indices.forEach(index => {
+        selectedChars.push(str[index])
+      })
+      // 返回选中的16个字符组成的字符串
+      return selectedChars.join('')
+    },
+    // 组装复制内容
+    cpFormInfo() {
+      if (this.cpText) {
+        return this.cpText
+      }
+      return this.info
+        .map(item => {
+          return `${item.formItemAttributes.label}: ${
+            item.getValue
+              ? item.getValue() || ''
+              : item.formItemAttributes.prop && item.formItemAttributes.prop !== '_'
+              ? item.options && this.orderInfo[item.formItemAttributes.prop]
+                ? item.options.find(val => val.value === this.orderInfo[item.formItemAttributes.prop])?.label || ''
+                : this.orderInfo[item.formItemAttributes.prop] || ''
+              : ''
+          }`
+        })
+        .join(nrBR)
+    },
+    // 绑定复制功能
+    textCopy() {
+      this.$nextTick(() => {
+        if (this.clipboard?.listener?.destroy) {
+          this.clipboard.listener.destroy()
+        }
+        this.clipboard = new ClipboardJS(`.${this.columnCopyClassKey}`, {
+          text: this.cpFormInfo
+        })
+        this.clipboard.on('success', () => {
+          this.$message({
+            type: 'success',
+            message: '复制成功'
+          })
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 56 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/orderBaseDow.vue

@@ -0,0 +1,56 @@
+<template>
+  <div class="withinLine">
+    <el-button @click="abnormal" :disabled="disabled" type="primary" size="mini">总部下载</el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { MessageBox } from '@zjlib/element-ui2'
+import { orderBaseDow } from '@/api/workOrderPool.js'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    abnormal() {
+      this.lockBtn()
+      MessageBox.confirm('是否确定总部下载', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          orderBaseDow({ orderBaseId: this.orderInfo.id })
+            .then(res => {
+              this.unlockBtn()
+              // 编辑保存后不跳转列表,刷新数据
+              this.acquireVerify(this, 'getorderDetail')()
+              // 刷新操作记录
+              this.acquireVerify(this, 'getOrderBaseLogList')()
+              this.$message({
+                type: 'success',
+                message: '成功!'
+              })
+            })
+            .catch(() => {
+              this.unlockBtn()
+            })
+        })
+        .catch(() => {
+          this.unlockBtn()
+        })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 58 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/orderReject.vue

@@ -0,0 +1,58 @@
+<template>
+  <div class="withinLine">
+    <el-button @click="urgent" :disabled="disabled" type="primary" size="mini">工单驳回</el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { MessageBox } from '@zjlib/element-ui2'
+import { orderBaseReject } from '@/api/workOrderPool.js'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    urgent() {
+      this.lockBtn()
+      MessageBox.confirm('是否确定工单驳回?', '工单驳回', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          orderBaseReject({
+            orderBaseId: this.orderInfo.id
+          })
+            .then(res => {
+              this.unlockBtn()
+              // 编辑保存后不跳转列表,刷新数据
+              this.acquireVerify(this, 'getorderDetail')()
+              // 刷新操作记录
+              this.acquireVerify(this, 'getOrderBaseLogList')()
+              this.$message({
+                type: 'success',
+                message: '驳回成功!'
+              })
+            })
+            .catch(() => {
+              this.unlockBtn()
+            })
+        })
+        .catch(() => {
+          this.unlockBtn()
+        })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 459 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/processFeedback.vue

@@ -0,0 +1,459 @@
+<template>
+  <div class="withinLine">
+    <el-button type="primary" size="mini" @click="open">{{ resultCodeName }}</el-button>
+    <el-dialog
+      title=""
+      width="750px"
+      custom-class="diy-dialog"
+      append-to-body
+      :modal="true"
+      :visible.sync="formDialog"
+      :show-close="true"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      :before-close="formCancel"
+    >
+      <zj-form-container v-if="formDialog" ref="formRef" :form-data="formData" :styleSwitch="false">
+        <zj-form-module
+          :title="resultCodeName"
+          label-width="140px"
+          :showPackUp="false"
+          :form-data="formData"
+          :form-items="formItems"
+        >
+        </zj-form-module>
+      </zj-form-container>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="formCancel">取 消</el-button>
+        <el-button size="mini" :disabled="disabled" @click="formConfirm" type="primary">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import ImageUpload from '@/components/file-upload'
+import { required } from '@/components/template/rules_verify.js'
+import { orderBaseLogAdd } from '@/api/workOrderPool.js'
+import editTable from '@/components/template/editTable.js'
+import { abnormalList } from '@/api/abnormalFeedbackConfig'
+export default {
+  mixins: [buttonMixin, editTable],
+  components: {
+    ImageUpload
+  },
+  props: {
+    resultCode: {
+      type: String,
+      default: ''
+    },
+    resultCodeName: {
+      type: String,
+      default: '过程反馈'
+    }
+  },
+  data() {
+    return {
+      type: this.resultCode
+        ? [this.resultCode]
+        : ['备注', '预约', '改约', '异常反馈', '完工反馈', '回访', '待件', '拉修', '不接电话', '延误', '质量信息'],
+      formDialog: false,
+      formData: {
+        orderBaseId: this.orderInfo.id,
+        imgSrc: [],
+        content: '',
+        appointmentTime: '',
+        appointmentEndTime: '',
+        type: this.resultCode,
+        typeText: this.resultCode,
+        daijianItems: [],
+        exType: '',
+        exNote: '',
+        ywType: '',
+        zlNumber: '',
+        fkTime: ''
+      },
+      formRules: {},
+      abnormalListLists: []
+    }
+  },
+  computed: {
+    // 用户信息
+    userInfo() {
+      return JSON.parse(localStorage.getItem('greemall_user'))
+    },
+    formItems() {
+      return [
+        {
+          md: 24,
+          name: 'el-radio',
+          options: this.type.map(item => ({ label: item, value: item })),
+          attributes: {},
+          formItemAttributes: {
+            label: '反馈结果',
+            prop: 'type',
+            rules: [...required]
+          },
+          events: {
+            change: val => {
+              this.formData.typeText = this.formData.type
+              this.formData.daijianItems = []
+              this.isEditTableIndex = -1
+            }
+          }
+        },
+        {
+          isShow: !!~['异常反馈'].indexOf(this.formData.type),
+          md: 24,
+          name: 'el-radio',
+          options: [...new Set(this.abnormalListLists.map(item => item.exType))].map(v => ({ label: v, value: v })),
+          attributes: {},
+          formItemAttributes: {
+            label: '异常类型',
+            prop: 'exType',
+            rules: [...required]
+          },
+          events: {
+            change: () => {
+              this.formData.exNote = ''
+            }
+          }
+        },
+        {
+          isShow: !!~['异常反馈'].indexOf(this.formData.type),
+          md: 24,
+          name: 'el-radio',
+          options: this.abnormalListLists
+            .filter(item => item.exType === this.formData.exType)
+            .map(v => ({ label: v.exNote, value: v.exNote })),
+          attributes: {},
+          formItemAttributes: {
+            label: '异常原因',
+            prop: 'exNote',
+            rules: [...required]
+          }
+        },
+        {
+          isShow: !!~['延误'].indexOf(this.formData.type),
+          md: 24,
+          name: 'el-radio',
+          options: [
+            { label: '无人接听', value: '无人接听' },
+            { label: '天气原因', value: '天气原因' },
+            { label: '配件未到货', value: '配件未到货' },
+            { label: '异常工单', value: '异常工单' }
+          ],
+          attributes: {},
+          formItemAttributes: {
+            label: '延误类型',
+            prop: 'ywType',
+            rules: [...required]
+          }
+        },
+
+        {
+          isShow: !!~['质量信息'].indexOf(this.formData.type),
+          md: 12,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '质量反馈编号',
+            prop: 'zlNumber',
+            rules: [...required]
+          }
+        },
+
+        {
+          isShow: !!~['质量信息'].indexOf(this.formData.type),
+          md: 12,
+          name: 'el-date-picker',
+          attributes: { placeholder: '请输入', type: 'datetime', 'value-format': 'yyyy-MM-dd HH:mm:ss' },
+          formItemAttributes: {
+            label: '反馈日期',
+            prop: 'fkTime',
+            rules: [...required]
+          }
+        },
+
+        {
+          isShow: !!~['预约', '改约', '待件', '拉修', '不接电话', '延误'].indexOf(this.formData.type),
+          name: 'el-date-picker',
+          md: 12,
+          attributes: {
+            'picker-options': 'pickerOptions11',
+            'popper-class': 'custom-popper11',
+            'append-to-body': true,
+            style: { width: '100%' },
+            type: 'datetime',
+            placeholder: '请选择',
+            'value-format': 'yyyy-MM-dd HH:mm:ss',
+            'picker-options': {
+              disabledDate: time => {
+                return time.getTime() < Date.now() - 86400000
+              }
+            }
+          },
+          events: {
+            change: value => {
+              if (value && new Date(value).getTime() < new Date().getTime() - 2000) {
+                this.formData.appointmentTime = ''
+                this.$message.warning('必须大于当前时间')
+              } else {
+                this.formData.appointmentEndTime = ''
+              }
+            }
+          },
+          formItemAttributes: {
+            label: `${
+              !!~['改约', '待件', '拉修', '不接电话', '延误'].indexOf(this.formData.type) ? '改约' : '预约'
+            }上门开始时间`,
+            prop: 'appointmentTime',
+            rules: [...required]
+          }
+        },
+
+        {
+          isShow: !!~['预约', '改约', '待件', '拉修', '不接电话', '延误'].indexOf(this.formData.type),
+          name: 'el-date-picker',
+          md: 12,
+          attributes: {
+            'picker-options': 'pickerOptions11',
+            'popper-class': 'custom-popper11',
+            'append-to-body': true,
+            style: { width: '100%' },
+            type: 'datetime',
+            placeholder: '请选择',
+            'value-format': 'yyyy-MM-dd HH:mm:ss',
+            'picker-options': {
+              disabledDate: time => {
+                var data = this.formData?.appointmentTime?.split(' ')?.[0]
+                return (
+                  time.getTime() < new Date(data ? `${data} 00:00:00` : '').getTime() ||
+                  time.getTime() > new Date(data ? `${data} 00:00:00` : '').getTime()
+                )
+              }
+            }
+          },
+          events: {
+            change: value => {
+              if (value && new Date(value).getTime() < new Date().getTime() - 2000) {
+                this.formData.appointmentEndTime = ''
+                this.$message.warning('必须大于当前时间')
+              } else if (value && new Date(value).getTime() < new Date(this.formData?.appointmentTime).getTime()) {
+                this.formData.appointmentTime = value
+              }
+            }
+          },
+          formItemAttributes: {
+            label: `${
+              !!~['改约', '待件', '拉修', '不接电话', '延误'].indexOf(this.formData.type) ? '改约' : '预约'
+            }上门结束时间`,
+            prop: 'appointmentEndTime',
+            rules: [...required]
+          }
+        },
+
+        {
+          isShow: !!~['待件'].indexOf(this.formData.type),
+          name: 'slot-component',
+          md: 24,
+          attributes: { disabled: false, placeholder: '' },
+          formItemAttributes: {
+            label: '待件明细',
+            prop: 'daijianItems',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return this.convertTableJson(
+              value,
+              [
+                {
+                  columnAttributes: {
+                    label: '待件申请编号',
+                    prop: 'applyNum1',
+                    rules: [...required]
+                  },
+                  editRender: this.inputEditRender,
+                  viewRender: this.inputViewRender
+                },
+                {
+                  columnAttributes: {
+                    label: '待件物料编号',
+                    prop: 'applyNum2',
+                    rules: [...required]
+                  },
+                  editRender: this.inputEditRender,
+                  viewRender: this.inputViewRender
+                }
+              ],
+              {
+                isEdit: true,
+                isAdd: true,
+                isDel: true
+              },
+              {
+                add: () => {
+                  this.formData.daijianItems.push({
+                    applyNum1: '',
+                    applyNum2: ''
+                  })
+                  this.isEditTableIndex = this.formData.daijianItems.length - 1
+                },
+                delete: ({ row, column, index }, cb) => {
+                  if (this.isEditTableIndex == index) {
+                    this.isEditTableIndex = -1
+                  } else if (this.isEditTableIndex > index) {
+                    this.isEditTableIndex--
+                  }
+                  cb?.()
+                },
+                verify: ({ row, column, index }, isEditTableIndex) => {
+                  return new Promise(r => {
+                    if (isEditTableIndex > -1) {
+                      this.$refs.formRef.validateField(
+                        [`daijianItems.${isEditTableIndex}.applyNum1`, `daijianItems.${isEditTableIndex}.applyNum2`],
+                        v => {
+                          r(!!v)
+                        }
+                      )
+                    } else {
+                      r(true)
+                    }
+                  })
+                }
+              }
+            )
+          }
+        },
+
+        {
+          md: 24,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', type: 'textarea' },
+          formItemAttributes: {
+            label: '反馈内容',
+            prop: 'content',
+            rules: [...required]
+          }
+        },
+
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '上传附件(最多6个)',
+            prop: 'imgSrc',
+            rules: []
+          },
+          render: (h, { props, onInput }) => {
+            return <ImageUpload fileList={this.formData.imgSrc} limit={6} />
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    open() {
+      Promise.all([
+        abnormalList({ pageNum: 1, pageSize: -1, params: [{ param: 'status', compare: '=', value: 'ON' }] })
+      ]).then(([res1]) => {
+        this.abnormalListLists = res1.data.records
+        this.formDialog = true
+      })
+    },
+    formCancel() {
+      this.formDialog = false
+      this.formData = {
+        orderBaseId: this.orderInfo.id,
+        imgSrc: [],
+        content: '',
+        appointmentTime: '',
+        appointmentEndTime: '',
+        type: this.resultCode,
+        typeText: this.resultCode
+      }
+    },
+    formConfirm() {
+      this.$refs.formRef.validate(valid => {
+        if (valid) {
+          this.lockBtn()
+
+          orderBaseLogAdd({
+            ...this.formData,
+            imgSrc: this.formData.imgSrc.map(item => item.url).join(','),
+            applyNum: !!~['待件'].indexOf(this.formData.type)
+              ? this.formData.daijianItems.map(item => `${item.applyNum1}|${item.applyNum2}`).join(',')
+              : ''
+          })
+            .then(res => {
+              this.unlockBtn()
+              // 编辑保存后不跳转列表,刷新数据
+              this.acquireVerify(this, 'getorderDetail')()
+              // 刷新操作记录
+              this.acquireVerify(this, 'getOrderBaseLogList')()
+              this.$message({
+                type: 'success',
+                message: '反馈成功'
+              })
+              this.formCancel()
+            })
+            .catch(() => {
+              this.unlockBtn()
+            })
+        }
+      })
+    },
+
+    inputEditRender: (h, { row, column, index }) => {
+      return (
+        <div class="redbordererr">
+          <el-form-item
+            label=""
+            label-width="0px"
+            prop={`daijianItems.${index}.${column.columnAttributes.prop}`}
+            rules={column.columnAttributes.rules || []}
+          >
+            <el-input
+              value={row[column.columnAttributes.prop]}
+              onInput={val => {
+                row[column.columnAttributes.prop] = val
+              }}
+              placeholder="请输入内容"
+            ></el-input>
+          </el-form-item>
+        </div>
+      )
+    },
+
+    inputViewRender: (h, { row, column, index }) => {
+      return <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-date-editor.el-input,
+.el-date-editor.el-input__inner {
+  width: 100%;
+}
+
+.xijiezhanshi {
+  width: 100%;
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 5px;
+}
+
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 56 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/unurgent.vue

@@ -0,0 +1,56 @@
+<template>
+  <div class="withinLine">
+    <el-button @click="urgent" :disabled="disabled" type="primary" size="mini">不加急</el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { MessageBox } from '@zjlib/element-ui2'
+import { orderBaseFlag } from '@/api/workOrderPool.js'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    urgent() {
+      this.lockBtn()
+      MessageBox.confirm('取消加急操作,会消息通知所有订单相关人员,请谨慎操作', '取消加急确认', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          orderBaseFlag({ flag: false, orderBaseId: this.orderInfo.id, orderFlagEnum: 'JIA_JI' })
+            .then(res => {
+              this.unlockBtn()
+              // 编辑保存后不跳转列表,刷新数据
+              this.acquireVerify(this, 'getorderDetail')()
+              // 刷新操作记录
+              this.acquireVerify(this, 'getOrderBaseLogList')()
+              this.$message({
+                type: 'success',
+                message: '取消加急成功!'
+              })
+            })
+            .catch(() => {
+              this.unlockBtn()
+            })
+        })
+        .catch(() => {
+          this.unlockBtn()
+        })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 56 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/urgent.vue

@@ -0,0 +1,56 @@
+<template>
+  <div class="withinLine">
+    <el-button @click="urgent" :disabled="disabled" type="primary" size="mini">加急</el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { MessageBox } from '@zjlib/element-ui2'
+import { orderBaseFlag } from '@/api/workOrderPool.js'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    urgent() {
+      this.lockBtn()
+      MessageBox.confirm('加急操作,会消息通知所有订单相关人员,请谨慎操作', '加急确认', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          orderBaseFlag({ flag: true, orderBaseId: this.orderInfo.id, orderFlagEnum: 'JIA_JI' })
+            .then(res => {
+              this.unlockBtn()
+              // 编辑保存后不跳转列表,刷新数据
+              this.acquireVerify(this, 'getorderDetail')()
+              // 刷新操作记录
+              this.acquireVerify(this, 'getOrderBaseLogList')()
+              this.$message({
+                type: 'success',
+                message: '加急成功!'
+              })
+            })
+            .catch(() => {
+              this.unlockBtn()
+            })
+        })
+        .catch(() => {
+          this.unlockBtn()
+        })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 35 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/buttons/workContactLetter.vue

@@ -0,0 +1,35 @@
+<template>
+  <div class="withinLine">
+    <el-button @click="abnormal" :disabled="disabled" type="primary" size="mini">工作联络函</el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { MessageBox } from '@zjlib/element-ui2'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    abnormal() {
+      this.$router.push({
+        name: 'workContactLetterPage',
+        query: {
+          orderBaseId: this?.orderInfo?.id
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 214 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/index.vue

@@ -0,0 +1,214 @@
+<template>
+  <zj-page-container v-if="orderInfo">
+    <zj-page-fill class="neibuview">
+      <zj-form-container
+        ref="formRef"
+        :form-data="orderInfo"
+        :form-rules="formRules"
+        :form-attributes="{ size: 'mini' }"
+      >
+        <!-- 派工信息 创建不需要 -->
+        <zj-form-module
+          v-if="id"
+          title="派工信息"
+          label-width="100px"
+          :form-data="orderInfo"
+          :form-items="dispatchInfo"
+        >
+          <div slot="internal-bottom" style="text-align: right">
+            <copy-info
+              text="复制工单信息"
+              columnCopyClass="columnCopyClasslinonnoin"
+              :info="dispatchInfo"
+              :order-info="orderInfo"
+            />
+          </div>
+          <div slot="right" style="width: 55%; position: relative">
+            <div class="pgxxTable">
+              <zj-table
+                :columns="logColumns"
+                :table-data="logList"
+                :table-attributes="{ height: '100%', border: true }"
+              />
+            </div>
+          </div>
+        </zj-form-module>
+        <!-- 基本信息 -->
+        <zj-form-module title="基本信息" :form-data="orderInfo" :form-items="basicInfo" />
+        <!-- 服务信息 -->
+        <zj-form-module title="服务信息" label-width="140px" :form-data="orderInfo" :form-items="serviceInfo" />
+        <!-- 产品信息 -->
+        <zj-form-module
+          title="产品信息"
+          :form-data="orderInfo"
+          :form-items="workOrderType == 4 ? product_wb : product"
+        />
+        <!-- 其它信息 -->
+        <!-- <zj-form-module title="其它信息" :form-data="orderInfo" :form-items="otherInfo" /> -->
+        <!-- 派单信息 -->
+        <zj-form-module title="派单信息" label-width="100px" :form-data="orderInfo" :form-items="pandanxinxi" />
+      </zj-form-container>
+    </zj-page-fill>
+    <!-- 操作按钮 -->
+    <div>
+      <div style="box-sizing: border-box; padding: 10px 10px 0" v-if="id">
+        <!-- 关闭 -->
+        <!-- <close-button /> -->
+        <!-- 1,保存  -->
+        <commitSave v-if="~btnRestrict.indexOf(1)" :orderInfo="orderInfo" :orderType="orderType" />
+        <!-- 2,过程反馈  -->
+        <processFeedback
+          v-if="~btnRestrict.indexOf(2)"
+          resultCodeName="过程反馈"
+          :orderInfo="orderInfo"
+          :orderType="orderType"
+        />
+        <!-- 3,设为异常  -->
+        <abnormal v-if="~btnRestrict.indexOf(3)" :orderInfo="orderInfo" :orderType="orderType" />
+        <!-- 4,加急  -->
+        <urgent v-if="~btnRestrict.indexOf(4)" :orderInfo="orderInfo" :orderType="orderType" />
+        <!-- 5,不加急  -->
+        <unurgent v-if="~btnRestrict.indexOf(5)" :orderInfo="orderInfo" :orderType="orderType" />
+        <!-- 6,取消工单  -->
+        <cancelOrder
+          v-if="
+            ~btnRestrict.indexOf(6) &&
+            (userInfo.type == 1 || `(${userInfo.userName})${userInfo.nickName}` == orderInfo.createBy)
+          "
+          :orderInfo="orderInfo"
+          :orderType="orderType"
+        />
+        <!-- 7,回访  -->
+        <processFeedback
+          v-if="~btnRestrict.indexOf(7)"
+          resultCodeName="回访"
+          resultCode="回访"
+          :orderInfo="orderInfo"
+          :orderType="orderType"
+        />
+        <!-- 8,新建工单 -->
+        <!-- 9,工单驳回 -->
+        <orderReject v-if="~btnRestrict.indexOf(9)" :orderInfo="orderInfo" :orderType="orderType" />
+        <!-- 10,激活工单 -->
+        <activateOrder v-if="~btnRestrict.indexOf(10)" :orderInfo="orderInfo" :orderType="orderType" />
+        <!-- 21,总部下载 -->
+        <orderBaseDow v-if="orderInfo && orderInfo.isImportExcel" :orderInfo="orderInfo" :orderType="orderType" />
+        <!-- <cloneWorkOrderBtn v-if="~btnRestrict.indexOf(20)" :orderInfo="orderInfo" :orderType="orderType" /> -->
+
+        <!-- 工作联络函 -->
+        <workContactLetter :orderInfo="orderInfo" :orderType="orderType" />
+      </div>
+      <div style="box-sizing: border-box; padding: 10px 10px 0" v-else>
+        <!-- 关闭 -->
+        <close-button />
+        <!-- 1,下派服务单  -->
+        <commitSave :orderInfo="orderInfo" :orderType="orderType" />
+      </div>
+    </div>
+  </zj-page-container>
+</template>
+
+<script>
+import workOrderLogic from './mixins/workOrderLogic.js'
+import basicInfo from './mixins/basicInfo.js'
+import dispatchInfo from './mixins/dispatchInfo.js'
+import otherInfo from './mixins/otherInfo.js'
+import productColumns from './mixins/productColumns.js'
+import wb_productColumns from './mixins/wb_productColumns.js'
+import serviceInfo from './mixins/serviceInfo.js'
+import pandanxinxi from './mixins/pandanxinxi.js'
+import copyInfo from './buttons/copyInfo.vue'
+import closeButton from './buttons/closeButton.vue'
+import commitSave from './buttons/commitSave.vue'
+import urgent from './buttons/urgent.vue'
+import unurgent from './buttons/unurgent.vue'
+import abnormal from './buttons/abnormal.vue'
+import cloneWorkOrderBtn from './buttons/cloneWorkOrder.vue'
+import processFeedback from './buttons/processFeedback.vue'
+import cancelOrder from './buttons/cancelOrder.vue'
+import orderReject from './buttons/orderReject.vue'
+import activateOrder from './buttons/activateOrder.vue'
+import orderBaseDow from './buttons/orderBaseDow.vue'
+import workContactLetter from './buttons/workContactLetter.vue'
+
+export default {
+  components: {
+    copyInfo,
+    closeButton,
+    commitSave,
+    urgent,
+    unurgent,
+    abnormal,
+    processFeedback,
+    cancelOrder,
+    orderReject,
+    activateOrder,
+    cloneWorkOrderBtn,
+    orderBaseDow,
+    workContactLetter
+  },
+  mixins: [
+    workOrderLogic,
+    basicInfo,
+    dispatchInfo,
+    otherInfo,
+    productColumns,
+    wb_productColumns,
+    serviceInfo,
+    pandanxinxi
+  ],
+  methods: {
+    allVerify(cb) {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        cb && cb(valid, invalidFields, errLabels)
+      })
+    },
+    appointVerify(arr, cb) {
+      this.$refs.formRef.validateField(arr, (valid, invalidFields, errLabels) => {
+        cb && cb(valid, invalidFields, errLabels)
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep & > .zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    & > div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+
+.pgxxTable {
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+}
+
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+
+.redbordererr {
+  ::v-deep .el-form-item {
+    margin: 0 !important;
+    overflow: hidden;
+  }
+}
+</style>

+ 687 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/basicInfo.js

@@ -0,0 +1,687 @@
+import { lbsAmapRegion } from '@/api/common.js'
+import { listPageV2, getDetail } from '@/api/engineeringMaintenance/basicData'
+import { orderEnginbaseList } from '@/api/basicEngineeringData'
+import { orderBaseUpdate } from '@/api/workOrderPool'
+import geographicalPosi from '@/components/geographicalPosi/index.vue'
+import cloudCall from '../buttons/cloudCall.vue'
+export default {
+  data() {
+    return {
+      provinceList: [],
+      cityList: [],
+      areaList: [],
+      streetList: [],
+      wb_project: [],
+      gc_project: []
+    }
+  },
+  created() {
+    function getTimef(sfm = '00:00:00') {
+      var currentDate = new Date()
+      var year = currentDate.getFullYear()
+      var month = ('0' + (currentDate.getMonth() + 1)).slice(-2) // 月份从0开始,需要加1
+      var day = ('0' + currentDate.getDate()).slice(-2)
+      return year + '-' + month + '-' + day + ' ' + sfm
+    }
+    // 获取工程下拉
+    orderEnginbaseList({
+      pageNum: 1,
+      pageSize: -1,
+      params: []
+    }).then(res => {
+      this.gc_project = res.data.records.map(item => {
+        return {
+          value: item.projectNo,
+          label: item.projectName,
+          data: item
+        }
+      })
+    })
+    // 获取维保下拉
+    listPageV2({
+      pageNum: 1,
+      pageSize: -1,
+      params: [
+        { param: 'a.start_time', compare: '<=', value: getTimef() },
+        { param: 'a.end_time', compare: '>=', value: getTimef() }
+      ]
+    }).then(res => {
+      this.wb_project = res.data.records.map(item => {
+        return {
+          value: item.id,
+          label: item.projectName,
+          data: item
+        }
+      })
+    })
+  },
+  computed: {
+    // 基本信息数据模型
+    basicInfo() {
+      return [
+        ...(() => {
+          if (this.workOrderType == 4) {
+            return [
+              {
+                isShow: this.formOptions.rpProjectRepairId.isShow,
+                name: 'el-select',
+                md: 12,
+                options: this.wb_project,
+                attributes: {
+                  disabled: !this.formOptions.rpProjectRepairId.isEdit,
+                  placeholder: '请选择',
+                  clearable: true,
+                  filterable: true
+                },
+                formItemAttributes: {
+                  label: '维保项目',
+                  prop: 'rpProjectRepairId',
+                  rules: this.formOptions.rpProjectRepairId.isRules
+                },
+                events: {
+                  change: val => {
+                    this.getorderDetail(() => {
+                      if (val) {
+                        this.orderInfo.rpProjectRepairId = val
+                        this.orderInfo.rpProjectRepairName = this.wb_project.find(item => item.value == val).label
+                        this.getWeiBaoDetail()
+                      }
+                    })
+                  }
+                }
+              },
+              {
+                name: 'slot-component',
+                md: 12,
+                formItemAttributes: {
+                  'label-width': '0px',
+                  prop: ''
+                },
+                render: (h, { props }) => {
+                  return null
+                }
+              }
+            ]
+          } else if (this.workOrderType == 2) {
+            return [
+              {
+                isShow: this.formOptions.projectNo.isShow,
+                name: 'el-select',
+                md: 12,
+                options: this.gc_project,
+                attributes: {
+                  disabled: !this.formOptions.projectNo.isEdit,
+                  placeholder: '请选择',
+                  clearable: true,
+                  filterable: true
+                },
+                formItemAttributes: {
+                  label: '工程名称',
+                  prop: 'projectNo',
+                  rules: this.formOptions.projectNo.isRules
+                },
+                events: {
+                  change: val => {
+                    this.getorderDetail(() => {
+                      if (val) {
+                        this.orderInfo.projectNo = val
+                        var item = this.gc_project.find(item => item.value == val)
+                        if (item) {
+                          this.orderInfo.projectName = item.label
+                          var data = item.data
+                          if (data) {
+                            this.orderInfo.userName = data.manger
+                            this.orderInfo.linkName = data.manger
+                            this.orderInfo.userMobile = data.mobile
+                            this.orderInfo.provinceId = data.provinceId
+                            this.orderInfo.province = data.province
+                            this.orderInfo.cityId = data.cityId
+                            this.orderInfo.city = data.city
+                            this.orderInfo.areaId = data.areaId
+                            this.orderInfo.area = data.area
+                            this.orderInfo.streetId = data.streetId
+                            this.orderInfo.street = data.street
+                            this.orderInfo.gpsAddress = data.gpsAddress || data.address
+                            this.orderInfo.lat = data.lat
+                            this.orderInfo.lng = data.lng
+                            this.orderInfo.address = data.address
+                            this.getinitlbslist()
+                          }
+                        }
+                      }
+                    })
+                  }
+                }
+              },
+              {
+                isShow: true,
+                name: 'el-input',
+                md: 12,
+                attributes: {
+                  disabled: true
+                },
+                formItemAttributes: {
+                  label: '工程编号',
+                  prop: 'projectNo',
+                  rules: this.formOptions.projectNo.isRules
+                }
+              }
+            ]
+          }
+          return []
+        })(),
+        {
+          isShow: this.formOptions.userName.isShow,
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: !this.formOptions.userName.isEdit, placeholder: '请输入' },
+          formItemAttributes: {
+            label: '客户名称',
+            prop: 'userName',
+            rules: this.formOptions.userName.isRules
+          },
+          events: {
+            input: v => {
+              this.orderInfo.linkName = v
+              if (v) {
+                this.appointVerify(['linkName'], () => {}, false)
+              }
+            }
+          }
+        },
+        {
+          isShow: this.formOptions.linkName.isShow,
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: !this.formOptions.linkName.isEdit, placeholder: '请输入' },
+          formItemAttributes: {
+            label: '联系人',
+            prop: 'linkName',
+            rules: this.formOptions.linkName.isRules
+          }
+        },
+        // {
+        //   isShow: this.formOptions.userMobile.isShow,
+        //   name: 'el-input',
+        //   md: 6,
+        //   attributes: { disabled: !this.formOptions.userMobile.isEdit, placeholder: '请输入', maxlength: 11 },
+        //   formItemAttributes: {
+        //     label: '客户电话',
+        //     prop: 'userMobile',
+        //     rules: this.formOptions.userMobile.isRules
+        //   }
+        // },
+        {
+          isShow: this.formOptions.userMobile.isShow,
+          name: 'slot-component',
+          md: 6,
+          formItemAttributes: {
+            label: '客户电话',
+            prop: 'userMobile',
+            rules: this.formOptions.userMobile.isRules
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div>
+                <el-input
+                  value={value}
+                  onInput={v => {
+                    // 限制最多为11位有效数字
+                    if (v && v.length > 11) {
+                      v = v.slice(0, 11)
+                    }
+                    onInput(v)
+                  }}
+                  disabled={!this.formOptions.userMobile.isEdit}
+                  type="number"
+                  size="mini"
+                  placeholder="请输入"
+                >
+                  {
+                    /* 创建区别:创建的时候不要拨打 */ this.id ? (
+                      <cloudCall phone={value} orderInfo={this.orderInfo} slot="append"></cloudCall>
+                    ) : null
+                  }
+                </el-input>
+              </div>
+            )
+          }
+        },
+        // ------------------------
+        // {
+        //   isShow: this.formOptions.userMobile2.isShow,
+        //   name: 'el-input',
+        //   md: 6,
+        //   attributes: { disabled: !this.formOptions.userMobile2.isEdit, placeholder: '请输入', maxlength: 11 },
+        //   formItemAttributes: {
+        //     label: '客户电话2',
+        //     prop: 'userMobile2',
+        //     rules: this.formOptions.userMobile2.isRules
+        //   }
+        // },
+        {
+          isShow: this.formOptions.userMobile2.isShow,
+          name: 'slot-component',
+          md: 6,
+          formItemAttributes: {
+            label: '客户电话2',
+            prop: 'userMobile2',
+            rules: this.formOptions.userMobile2.isRules
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div>
+                <el-input
+                  value={value}
+                  onInput={v => {
+                    // 限制最多为11位有效数字
+                    if (v && v.length > 11) {
+                      v = v.slice(0, 11)
+                    }
+                    onInput(v)
+                  }}
+                  disabled={!this.formOptions.userMobile2.isEdit}
+                  type="number"
+                  size="mini"
+                  placeholder="请输入"
+                >
+                  {
+                    /* 创建区别:创建的时候不要拨打 */ this.id ? (
+                      <cloudCall phone={value} orderInfo={this.orderInfo} slot="append"></cloudCall>
+                    ) : null
+                  }
+                </el-input>
+              </div>
+            )
+          }
+        },
+        {
+          isShow: this.formOptions.gpsAddress.isShow,
+          name: 'el-select',
+          md: 6,
+          formItemAttributes: {
+            label: '客户地址', //省
+            prop: 'provinceId',
+            rules: this.formOptions.gpsAddress.isRules,
+            errLabel: '省'
+          },
+          options: [...this.provinceList.map((v, i) => ({ value: v.id, label: v.name })), ...this.provinceList_cp],
+          attributes: {
+            disabled: !this.formOptions.gpsAddress.isEdit,
+            clearable: true,
+            filterable: true,
+            placeholder: '请选择'
+          },
+          events: {
+            change: val => {
+              // 获取省名称
+              this.orderInfo.province =
+                [...this.provinceList.map((v, i) => ({ value: v.id, label: v.name })), ...this.provinceList_cp].find(
+                  item => item.value === val
+                )?.label || ''
+              // 清除市区街道以及详细地址数据
+              this.delDataK(1)
+              lbsAmapRegion({ pid: val }).then(res => {
+                this.cityList = res.data
+              })
+            }
+          }
+        },
+        {
+          isShow: this.formOptions.gpsAddress.isShow,
+          name: 'el-select',
+          md: 5,
+          formItemAttributes: {
+            'label-width': '0px',
+            label: '', //市
+            prop: 'cityId',
+            rules: this.formOptions.gpsAddress.isRules,
+            errLabel: '市'
+          },
+          options: [
+            ...this.cityList.map((v, i) => ({ value: v.id, label: v.name })),
+            ...this.cityList_cp.filter(_ => {
+              return this.provinceList_cp.find(item => item.value === this.orderInfo.provinceId)
+            })
+          ],
+          attributes: {
+            disabled: !this.formOptions.gpsAddress.isEdit,
+            clearable: true,
+            filterable: true,
+            placeholder: '请选择'
+          },
+          events: {
+            change: val => {
+              // 获取市名称
+              this.orderInfo.city = [
+                ...this.cityList.map((v, i) => ({ value: v.id, label: v.name })),
+                ...this.cityList_cp
+              ].find(item => item.value === val).label
+              // 清除区街道以及详细地址数据
+              this.delDataK(2)
+              lbsAmapRegion({ pid: val }).then(res => {
+                this.areaList = res.data
+              })
+            }
+          }
+        },
+
+        {
+          isShow: this.formOptions.gpsAddress.isShow,
+          name: 'el-select',
+          md: 5,
+          formItemAttributes: {
+            'label-width': '0px',
+            label: '', //区
+            prop: 'areaId',
+            rules: this.formOptions.gpsAddress.isRules,
+            errLabel: '区'
+          },
+          options: [
+            ...this.areaList.map((v, i) => ({ value: v.id, label: v.name })),
+            ...this.areaList_cp.filter(_ => {
+              return this.cityList_cp.find(item => item.value === this.orderInfo.cityId)
+            })
+          ],
+          attributes: {
+            disabled: !this.formOptions.gpsAddress.isEdit,
+            clearable: true,
+            filterable: true,
+            placeholder: '请选择'
+          },
+          events: {
+            change: val => {
+              // 获取区名称
+              this.orderInfo.area = [
+                ...this.areaList.map((v, i) => ({ value: v.id, label: v.name })),
+                ...this.areaList_cp
+              ].find(item => item.value === val).label
+              // 清除街道以及详细地址数据
+              this.delDataK(3)
+              lbsAmapRegion({ pid: val }).then(res => {
+                this.streetList = res.data
+              })
+            }
+          }
+        },
+        {
+          isShow: this.formOptions.gpsAddress.isShow,
+          name: 'el-select',
+          md: 5,
+          formItemAttributes: {
+            'label-width': '0px',
+            label: '', //街道
+            prop: 'streetId',
+            rules: this.formOptions.gpsAddress.isRules,
+            errLabel: '街道'
+          },
+          options: [
+            ...this.streetList.map((v, i) => ({ value: v.id, label: v.name })),
+            ...this.streetList_cp.filter(_ => {
+              return this.areaList_cp.find(item => item.value === this.orderInfo.areaId)
+            })
+          ],
+          attributes: {
+            disabled: !this.formOptions.gpsAddress.isEdit,
+            clearable: true,
+            filterable: true,
+            placeholder: '请选择'
+          },
+          events: {
+            change: val => {
+              // 获取街道名称
+              this.orderInfo.street = [
+                ...this.streetList.map((v, i) => ({ value: v.id, label: v.name })),
+                ...this.streetList_cp
+              ].find(item => item.value === val).label
+              // 清除详细地址数据
+              this.delDataK(4)
+            }
+          }
+        },
+        {
+          isShow: this.formOptions.gpsAddress.isShow,
+          name: 'slot-component',
+          md: 3,
+          formItemAttributes: {
+            'label-width': '0px',
+            prop: ''
+          },
+          render: (h, { props }) => {
+            return (
+              <geographicalPosi
+                disabled={!this.formOptions.gpsAddress.isEdit}
+                formData={this.orderInfo}
+                onSelectPosi={data => {
+                  // 获取经纬度
+                  this.orderInfo.lng = data.center[0]
+                  this.orderInfo.lat = data.center[1]
+                  // 获取定位的省市区街道
+                  var { province, city, district, township } = data.data.addressComponent
+                  // 获取选中省名称id
+                  var { id, name } = this.provinceList.find(item => item.name === province)
+                  this.orderInfo.provinceId = id
+                  this.orderInfo.province = name
+                  // 请求市选项
+                  lbsAmapRegion({ pid: this.orderInfo.provinceId }).then(res => {
+                    // 赋值市选项
+                    this.cityList = res.data
+                    // 获取选中市名称id
+                    var { id, name } = res.data.find(item => item.name === city)
+                    this.orderInfo.cityId = id
+                    this.orderInfo.city = name
+                    // 请求区选项
+                    lbsAmapRegion({ pid: this.orderInfo.cityId }).then(res => {
+                      // 赋值区选项
+                      this.areaList = res.data
+                      // 获取选中区名称id
+                      var { id, name } = res.data.find(item => item.name === district)
+                      this.orderInfo.areaId = id
+                      this.orderInfo.area = name
+                      // 请求街道选项
+                      lbsAmapRegion({ pid: this.orderInfo.areaId }).then(res => {
+                        // 赋值街道选项
+                        this.streetList = res.data
+                        // 获取选中街道名称id
+                        var { id, name } = res.data.find(item => item.name === township)
+                        this.orderInfo.streetId = id
+                        this.orderInfo.street = name
+                        // 赋值GPS详细地址
+                        this.orderInfo.gpsAddress = data.name
+                        // if (!this.orderInfo.address) {
+                        // this.orderInfo.address = '' //data.name
+                        // }
+                        if (this.orderInfo.id) {
+                          var {
+                            lng,
+                            lat,
+                            provinceId,
+                            province,
+                            cityId,
+                            city,
+                            areaId,
+                            area,
+                            streetId,
+                            street,
+                            gpsAddress,
+                            id
+                          } = this.orderInfo
+                          orderBaseUpdate({
+                            lng,
+                            lat,
+                            provinceId,
+                            province,
+                            cityId,
+                            city,
+                            areaId,
+                            area,
+                            streetId,
+                            street,
+                            gpsAddress,
+                            id
+                          }).then(res => {
+                            this.$message({
+                              type: 'success',
+                              message: 'GPS地址修改成功'
+                            })
+                          })
+                        }
+                      })
+                    })
+                  })
+                }}
+              />
+            )
+          }
+        },
+        {
+          isShow: this.formOptions.gpsAddress.isShow,
+          name: 'el-input',
+          md: 13,
+          formItemAttributes: { label: '', prop: 'gpsAddress', rules: [], errLabel: 'GPS地址' },
+          attributes: { disabled: true, placeholder: 'GPS地址' }
+        },
+        {
+          isShow: this.formOptions.address.isShow,
+          name: 'el-input',
+          md: 11,
+          formItemAttributes: {
+            label: '',
+            prop: 'address',
+            'label-width': '0px',
+            rules: this.formOptions.address.isRules
+          },
+          attributes: { disabled: !this.formOptions.address.isEdit, placeholder: '详细地址' }
+        },
+        {
+          isShow: this.formOptions.remark.isShow && !this.id,
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            disabled: !this.formOptions.remark.isEdit,
+            type: 'textarea',
+            rows: 3,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: this.formOptions.remark.isRules
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    getWeiBaoDetail() {
+      if (this.orderInfo.rpProjectRepairId) {
+        getDetail({
+          id: this.orderInfo.rpProjectRepairId
+        }).then(res => {
+          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 => ({
+            value: item.id,
+            label: item.orderSmallTypeText
+          }))
+
+          // 网点下拉数据
+          this.websitList = (res.data.websitList || []).map(item => ({
+            label: item.websitName,
+            value: item.websitId
+          }))
+
+          // 获取师傅
+          this.getWorkers()
+
+          // 产品信息可选项
+          this.productList_wb = res.data.productList || []
+
+          this.getinitlbslist()
+        })
+      }
+    },
+    getinitlbslist() {
+      // 初始化请求省市区街道下拉选项数据
+      lbsAmapRegion({ pid: 0 }).then(res => {
+        this.provinceList = res.data
+        // 创建工单时获取ip地址定位赋值
+        if (!this.id && !!~[1, 2, 3].indexOf(this?.workOrderType) && this.$IpAdd.province) {
+          var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
+          if (item) {
+            this.orderInfo.provinceId = item.id
+            this.orderInfo.province = item.name
+          }
+        }
+        if (this.orderInfo.provinceId) {
+          lbsAmapRegion({ pid: this.orderInfo.provinceId }).then(res => {
+            this.cityList = res.data
+            // 创建工单时获取ip地址定位赋值
+            if (!this.id && this.$IpAdd.city) {
+              var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
+              if (item2) {
+                this.orderInfo.cityId = item2.id
+                this.orderInfo.city = item2.name
+              }
+            }
+            if (this.orderInfo.cityId) {
+              lbsAmapRegion({ pid: this.orderInfo.cityId }).then(res => {
+                this.areaList = res.data
+              })
+            }
+            if (this.orderInfo.areaId) {
+              lbsAmapRegion({ pid: this.orderInfo.areaId }).then(res => {
+                this.streetList = res.data
+              })
+            }
+          })
+        }
+      })
+    },
+    delDataK(num) {
+      if (num <= 1) {
+        // 删除市
+        this.orderInfo.cityId = ''
+        this.orderInfo.city = ''
+        // 删除市选项
+        this.cityList = []
+      }
+      if (num <= 2) {
+        // 删除区
+        this.orderInfo.areaId = ''
+        this.orderInfo.area = ''
+        // 删除区选项
+        this.areaList = []
+      }
+      if (num <= 3) {
+        // 删除街道
+        this.orderInfo.streetId = ''
+        this.orderInfo.street = ''
+        // 删除街道选项
+        this.streetList = []
+      }
+      // 删除gps地址
+      this.orderInfo.gpsAddress = ''
+      this.getWebsitFun(true)
+    }
+  }
+}

+ 251 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/dispatchInfo.js

@@ -0,0 +1,251 @@
+import { orderBaseLogList } from '@/api/workOrderPool.js'
+import copyInfo from '../buttons/copyInfo.vue'
+import ImageUpload from '@/components/file-upload'
+import cloudCall from '../buttons/cloudCall.vue'
+export default {
+  data() {
+    return {
+      // 派工信息列表
+      logColumns: [
+        {
+          columnAttributes: {
+            label: '操作类别',
+            prop: 'type',
+            width: 140
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作内容',
+            prop: 'content',
+            'min-width': 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '附件',
+            prop: 'imgSrc',
+            width: 150
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div style="padding: 0 10px">
+                {row.imgSrc
+                  ? row.imgSrc.split(',').map(url => (
+                      <el-link
+                        onClick={() => {
+                          window.open(url, '_blank')
+                        }}
+                        type="primary"
+                      >
+                        附件{index + 1}
+                      </el-link>
+                    ))
+                  : []}
+                {/* <ImageUpload
+                  fileList={row.imgSrc ? row.imgSrc.split(',').map(url => ({ url })) : []}
+                  limit={100}
+                  isEdit={false}
+                /> */}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作时间',
+            prop: 'createTime',
+            width: 140
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作人',
+            prop: 'createBy',
+            width: 140
+          }
+        }
+      ],
+      logList: []
+    }
+  },
+  computed: {
+    // 派工信息
+    dispatchInfo() {
+      return [
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: { disabled: true, placeholder: '请输入' },
+          formItemAttributes: { label: '工单单号', prop: 'id' },
+          slots: {
+            append: (h, { props, onInput }) => {
+              return (
+                <copyInfo
+                  btnys={true}
+                  slot="append"
+                  text="复制"
+                  columnCopyClass="columnCopyClass_cp_888aa"
+                  cpText={props?.formData?.id}
+                ></copyInfo>
+              )
+            }
+          }
+        },
+        {
+          name: 'slot-component',
+          md: 24,
+          attributes: { disabled: true, placeholder: '请输入' },
+          formItemAttributes: { label: '网点信息', prop: 'websitName' },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <el-input
+                value={`(${formData.websitId || ''})${formData.websitName || ''}`}
+                disabled={true}
+                size="mini"
+                placeholder="请输入"
+              ></el-input>
+            )
+          },
+          getValue: () => {
+            return `(${this.orderInfo.websitId})${this.orderInfo.websitName}`
+          }
+        },
+        {
+          name: 'el-input',
+          md: 12,
+          attributes: { disabled: true, placeholder: '请选择' },
+          formItemAttributes: { label: '派工状态', prop: 'orderStatusText' }
+        },
+        {
+          name: 'el-input',
+          md: 12,
+          attributes: { disabled: true, placeholder: '请输入' },
+          formItemAttributes: { label: '创建时间', prop: 'createTime' }
+        },
+        {
+          name: 'el-input',
+          md: 12,
+          attributes: { disabled: true, placeholder: '请输入' },
+          formItemAttributes: { label: '派单时间', prop: 'dispatchTime' }
+        },
+        {
+          name: 'el-input',
+          md: 12,
+          attributes: { disabled: true, placeholder: '请输入' },
+          formItemAttributes: { label: '接单时间', prop: 'workerReceTime' }
+        },
+        ...(() => {
+          var list = []
+          ;(this.orderInfo.orderWorkers_cp || []).map(item => {
+            list.push(
+              {
+                name: 'slot-component',
+                md: 12,
+                formItemAttributes: {
+                  label: item.isMaster == '1' ? '主要工程师' : item.isMaster == '0' ? '辅助工程师' : '',
+                  prop: ''
+                },
+                render: (h, { props, onInput }) => {
+                  return <el-input value={item.workerName} disabled={true} size="mini"></el-input>
+                },
+                getValue: () => {
+                  return item.workerName
+                }
+              },
+              {
+                name: 'slot-component',
+                md: 12,
+                formItemAttributes: { label: '工程师手机号', prop: '' },
+                render: (h, { props, onInput }) => {
+                  return (
+                    <el-input value={item.workerMobile} disabled={true} size="mini">
+                      {
+                        /* 创建区别:创建的时候不要拨打 */ this.id ? (
+                          <cloudCall phone={item.workerMobile} orderInfo={this.orderInfo} slot="append"></cloudCall>
+                        ) : null
+                      }
+                    </el-input>
+                  )
+                },
+                getValue: () => {
+                  return item.workerMobile
+                }
+              }
+            )
+          })
+          return list
+        })(),
+        {
+          name: 'el-select',
+          options: [
+            { label: '默认好评', value: 'D' },
+            { label: '好评', value: 'A' },
+            { label: '中评', value: 'B' },
+            { label: '差评', value: 'C' },
+            { label: '未评价', value: 'N' },
+            { label: '其他', value: 'O' }
+          ],
+          md: 12,
+          attributes: { disabled: true, placeholder: '请选择', width: '100%' },
+          formItemAttributes: { label: '首次评价', prop: 'appraiseStatus' }
+        },
+        {
+          name: 'el-input',
+          md: 12,
+          attributes: {
+            disabled: true,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '首次评价时间',
+            prop: 'appraiseTime'
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            disabled: true,
+            type: 'textarea',
+            rows: 3,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '首次评价内容',
+            prop: 'appraiseContent'
+          }
+        },
+        {
+          isShow: this.formOptions.remark.isShow && !!this.id,
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            disabled: !this.formOptions.remark.isEdit,
+            type: 'textarea',
+            rows: 3,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: this.formOptions.remark.isRules
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    // 获取操作记录
+    getOrderBaseLogList() {
+      if (this.id) {
+        orderBaseLogList({
+          orderBaseId: this.id
+        }).then(res => {
+          this.logList = res.data
+        })
+      }
+    }
+  }
+}

+ 40 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/orderStatus.json

@@ -0,0 +1,40 @@
+{
+  "YQX": "已取消",
+  "LRCD": "录入存档",
+  "FL": "分流3.0",
+  "ZBBH": "总部驳回",
+  "DZBPG": "待总部派单",
+  "BFWG": "部分完工",
+  "YPD": "预派单",
+  "YCGB": "异常关闭",
+  "YZP": "已转派",
+  "FZXBH": "分中心驳回",
+  "DXSSPGP": "待销司审批改派",
+  "DFZXSPGP": "待分中心审批改派",
+  "DXSPD": "待销司派单",
+  "DWDSPGP": "待一级网点审批改派",
+  "DQD": "待抢单",
+  "FWQX": "服务取消",
+  "DSM": "待上门",
+  "YJS": "已结算",
+  "DWDPD": "待网点派单",
+  "TJXSBH": "同级销司驳回",
+  "DYY": "待预约",
+  "CJ": "创建",
+  "FWZ": "服务中",
+  "YWG": "已完工待结算",
+  "XSBH": "销司驳回",
+  "FWZT": "服务暂停",
+  "DWDPG": "待网点派工",
+  "YWGO": "已完工",
+  "DSHPG": "待商户派工",
+  "WDWG": "网点完工",
+  "DZBSPGP": "待总部审批改派",
+  "GCSZT": "工程师在途",
+  "DFZXPD": "待分中心派单",
+  "YCD": "异常单",
+  "DTJXSSPGP": "待同级销司审批改派",
+  "WDBH": "网点驳回",
+  "GCSZX": "工程师完工",
+  "DJD": "待接单"
+}

+ 27 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/otherInfo.js

@@ -0,0 +1,27 @@
+export default {
+  data() {
+    return {}
+  },
+  computed: {
+    otherInfo() {
+      return [
+        {
+          isShow: this.formOptions.remark.isShow,
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            disabled: !this.formOptions.remark.isEdit,
+            type: 'textarea',
+            rows: 3,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: this.formOptions.remark.isRules
+          }
+        }
+      ]
+    }
+  }
+}

+ 394 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/pandanxinxi.js

@@ -0,0 +1,394 @@
+import { getWebsit } from '@/api/customerManagement.js'
+import { memberListPageV2 } from '@/api/masterManagement'
+import { adminWebsitWebsitList } from '@/api/workOrderPool'
+import { workerTeamList } from '@/api/masterGroup.js'
+export default {
+  data() {
+    return {
+      websitList: [],
+      workerList: [],
+      workerList222: []
+    }
+  },
+  computed: {
+    workersColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '工程师信息',
+            prop: 'workerName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '工程师类型',
+            prop: 'isMaster'
+          },
+          render: (h, { row, column, index }) => {
+            return <div style="padding-left:10px">{row.isMaster ? '主要工程师' : '辅助工程师'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '联系电话',
+            prop: 'workerMobile'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '身份证',
+            prop: 'workerIdcard'
+          }
+        },
+        ...(() => {
+          if (this.formOptions.orderWorkers.isEdit) {
+            return [
+              {
+                columnAttributes: {
+                  label: '操作'
+                },
+                render: (h, { row, column, index }) => {
+                  return !row.isMaster ? (
+                    <div style="padding-left:10px">
+                      <el-button
+                        type="text"
+                        onClick={() => {
+                          this.orderInfo.orderWorkers.splice(index, 1)
+                        }}
+                      >
+                        删除
+                      </el-button>
+                    </div>
+                  ) : null
+                }
+              }
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    pandanxinxi() {
+      return [
+        {
+          isShow:
+            !this?.orderInfo?.isThreeOrder && this.formOptions.websitId.isShow && this.formOptions.websitId.isEdit,
+          name: 'el-select',
+          options: this.websitList.map(item => ({ ...item, label: `(${item.value})${item.label}` })),
+          echoInsertion: true,
+          md: 8,
+          attributes: {
+            disabled: !this.formOptions.websitId.isEdit,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '网点名称',
+            prop: 'websitId',
+            propName: 'websitName',
+            rules: this.formOptions.websitId.isRules
+          },
+          events: {
+            change: val => {
+              this.orderInfo.workerId = ''
+              this.orderInfo.workerName = ''
+              this.orderInfo.workerIdcard = ''
+              this.orderInfo.workerMobile = ''
+              this.workerList = []
+              this.orderInfo.orderWorkers = []
+              this.getWorkers()
+              if (val) {
+                this.orderInfo['websitName'] = this.websitList.find(item => item.value == val).label
+              } else {
+                this.orderInfo['websitName'] = ''
+              }
+            }
+          }
+        },
+        {
+          isShow: !(
+            !this?.orderInfo?.isThreeOrder &&
+            this.formOptions.websitId.isShow &&
+            this.formOptions.websitId.isEdit
+          ),
+          name: 'slot-component',
+          md: 8,
+          attributes: { disabled: true, placeholder: '请输入' },
+          formItemAttributes: { label: '网点信息', prop: 'websitName' },
+          render: (h, { props, onInput }) => {
+            var { formData } = props
+            return (
+              <el-input
+                value={`(${formData.websitId || ''})${formData.websitName || ''}`}
+                disabled={true}
+                size="mini"
+                placeholder="请输入"
+              ></el-input>
+            )
+          }
+        },
+        {
+          isShow: this.formOptions.isQd.isShow,
+          name: 'el-switch',
+          md: 8,
+          attributes: {
+            disabled: !this.formOptions.isQd.isEdit
+          },
+          formItemAttributes: {
+            label: '是否抢单',
+            prop: 'isQd',
+            rules: this.formOptions.isQd.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.isQd.isShow,
+          name: 'slot-component',
+          md: 8,
+          formItemAttributes: { label: '', prop: '' },
+          render: (h, { props }) => {
+            return null
+          }
+        },
+        {
+          isShow: !this.formOptions.isQd.isShow,
+          name: 'slot-component',
+          md: 16,
+          formItemAttributes: { label: '', prop: '' },
+          render: (h, { props }) => {
+            return null
+          }
+        },
+        ...(() => {
+          if (this.formOptions.workerId.isEdit) {
+            return [
+              {
+                isShow: this.formOptions.workerId.isShow,
+                name: 'el-select',
+                options: this.workerList
+                  .filter(
+                    item =>
+                      (this.orderInfo.workerId == item.value ||
+                        !~this.orderInfo.orderWorkers.map(item => item.workerId).indexOf(item.value)) &&
+                      item.data.workerNumber
+                  )
+                  .map(item => ({
+                    ...item,
+                    label: `${item.label} (${item.data.workerNumber})`
+                  })),
+                echoInsertion: true,
+                md: 8,
+                attributes: {
+                  disabled: !this.formOptions.workerId.isEdit,
+                  placeholder: '请选择',
+                  clearable: true,
+                  filterable: true
+                },
+                formItemAttributes: {
+                  label: '主要工程师',
+                  prop: 'workerId',
+                  propName: 'workerName',
+                  rules: this.formOptions.workerId.isRules
+                },
+                events: {
+                  change: val => {
+                    this.workerList222 = []
+                    if (val) {
+                      var data = this.workerList.find(item => item.value == val).data
+                      this.orderInfo.workerName = data.workerName
+                      this.orderInfo.workerIdcard = data.workerIdcard
+                      this.orderInfo.workerMobile = data.workerMobile
+                      this.orderInfo.orderWorkers = [{ ...data, isMaster: true }]
+                      memberListPageV2({
+                        pageNum: 1,
+                        pageSize: -1,
+                        checkCert: true,
+                        maserWorkerId: data.userId,
+                        params: [
+                          { param: 'b.examine_status', compare: '=', value: 'OK' },
+                          { param: 'b.websit_id', compare: '=', value: this.orderInfo.websitId }
+                        ]
+                      }).then(res => {
+                        this.workerList222 = res.data.records.map(item => {
+                          var { id, userId, ...data } = item
+                          return {
+                            value: userId,
+                            label: data.nickName,
+                            data: {
+                              workerId: userId,
+                              workerName: data.nickName,
+                              workerIdcard: data.idCard,
+                              workerMobile: data.mobile,
+                              ...data
+                            }
+                          }
+                        })
+                      })
+                    } else {
+                      this.orderInfo.workerName = ''
+                      this.orderInfo.workerIdcard = ''
+                      this.orderInfo.workerMobile = ''
+                      this.orderInfo.orderWorkers = []
+                    }
+                  }
+                }
+              }
+            ]
+          }
+          return []
+        })(),
+        ...(() => {
+          if (this.formOptions.orderWorkers.isEdit) {
+            return [
+              {
+                isShow: this.formOptions.orderWorkers.isEdit,
+                name: 'el-select',
+                options: this.workerList222
+                  .filter(item => !~this.orderInfo.orderWorkers.map(item => item.workerId).indexOf(item.value))
+                  .map(item => ({
+                    ...item,
+                    label: item.data.workerNumber ? `${item.label} (${item.data.workerNumber})` : item.label
+                  })),
+                md: 8,
+                attributes: {
+                  disabled: !this.formOptions.orderWorkers.isEdit,
+                  placeholder: '请选择',
+                  clearable: true,
+                  filterable: true
+                },
+                formItemAttributes: {
+                  label: '辅助工程师',
+                  prop: 'workerId_fz'
+                },
+                events: {
+                  change: val => {
+                    if (val) {
+                      var data = this.workerList222.find(item => item.value == val).data
+                      this.orderInfo.orderWorkers.push({ ...data, isMaster: false })
+                      this.orderInfo.workerId_fz = ''
+                    }
+                  }
+                }
+              }
+            ]
+          }
+          return []
+        })(),
+        {
+          isShow: this.formOptions.orderWorkers.isShow,
+          name: 'slot-component',
+          md: 24,
+          formItemAttributes: {
+            label: '已选工程师',
+            prop: 'orderWorkers',
+            rules: this.formOptions.orderWorkers.isRules
+          },
+          render: (h, { props }) => {
+            var { formData } = props
+            return (
+              <div>
+                <zj-table
+                  isDrop={true}
+                  columns={this.workersColumns}
+                  tableData={this.orderInfo.orderWorkers}
+                ></zj-table>
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    getWebsitFun(bool) {
+      if (bool) {
+        this.orderInfo.websitId = ''
+        this.orderInfo.websitName = ''
+        this.orderInfo.workerId = ''
+        this.orderInfo.workerName = ''
+        this.orderInfo.workerIdcard = ''
+        this.orderInfo.workerMobile = ''
+        this.workerList = []
+        this.orderInfo.orderWorkers = []
+      }
+      adminWebsitWebsitList({
+        channelId: this.orderInfo?.orderChannelId,
+        categoryId: this.orderInfo?.orderProducts?.find(item => item?.mainId)?.mainId,
+        orderSource: this.orderInfo?.source,
+        orderSmallId: this.orderInfo?.orderSmallType,
+        streetCode: this.orderInfo?.streetId,
+        status: true,
+        type: 'C'
+      }).then(res => {
+        var boll = res.data.find(item => item.ifDispatch)
+        this.websitList = res.data.map(item => ({
+          label: item.name,
+          value: item.websitId,
+          // disabled: !(boll ? item.ifDispatch : true),
+          data: item
+        }))
+        if (!this.orderInfo.id && boll) {
+          this.orderInfo.websitId = boll.websitId
+          this.orderInfo.websitName = boll.name
+          this.getWorkers()
+        }
+      })
+    },
+    getWorkers() {
+      if (this.orderInfo.websitId) {
+        memberListPageV2({
+          pageNum: 1,
+          pageSize: -1,
+          checkCert: true,
+          params: [
+            { param: 'b.examine_status', compare: '=', value: 'OK' },
+            { param: 'b.websit_id', compare: '=', value: this.orderInfo.websitId }
+          ]
+        }).then(res => {
+          this.workerList = res.data.records.map(item => {
+            var { id, userId, ...data } = item
+            return {
+              value: userId,
+              label: data.nickName,
+              data: {
+                workerId: userId,
+                workerName: data.nickName,
+                workerIdcard: data.idCard,
+                workerMobile: data.mobile,
+                ...data
+              }
+            }
+          })
+          var data2 = this.workerList.find(item => item.value == this.orderInfo.websitId)?.data
+          if (data2) {
+            memberListPageV2({
+              pageNum: 1,
+              pageSize: -1,
+              checkCert: true,
+              maserWorkerId: data2.userId,
+              params: [
+                { param: 'b.examine_status', compare: '=', value: 'OK' },
+                { param: 'b.websit_id', compare: '=', value: this.orderInfo.websitId }
+              ]
+            }).then(res => {
+              this.workerList222 = res.data.records.map(item => {
+                var { id, userId, ...data } = item
+                return {
+                  value: userId,
+                  label: data.nickName,
+                  data: {
+                    workerId: userId,
+                    workerName: data.nickName,
+                    workerIdcard: data.idCard,
+                    workerMobile: data.mobile,
+                    ...data
+                  }
+                }
+              })
+            })
+          }
+        })
+      }
+    }
+  }
+}

+ 495 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/productColumns.js

@@ -0,0 +1,495 @@
+import { getClassifyList } from '@/api/goods'
+import { getDataDictionary } from '@/api/dataDictionary.js'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+import {
+  orderBaseProductList,
+  orderBaseProductAdd,
+  orderBaseProductUpdate,
+  orderBaseProductDelete
+} from '@/api/workOrderPool.js'
+export default {
+  data() {
+    return {
+      isEditIndex: -1,
+      orderBrands: [],
+      classifyList: [],
+      classifyListLv2: []
+    }
+  },
+  computed: {
+    productColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '产品品牌',
+            prop: 'brandId'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
+                  rules={this.orderInfo.isCj ? [] : []}
+                >
+                  <el-select
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      if (val) {
+                        var data = this.orderBrands.find(item => item.value == val)
+                        row.brandName = data.label
+                      } else {
+                        row.brandName = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.orderBrands.map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row.brandName}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品大类',
+            prop: 'mainId'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
+                  rules={this.orderInfo.isCj ? [] : required}
+                >
+                  <el-select
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      row.smallId = ''
+                      row.smallName = ''
+                      if (val) {
+                        var data = this.classifyList.find(item => item.categoryId == val)
+                        row.mainName = data.name
+                        row.imgUrl = data.imgUrl
+                      } else {
+                        row.mainName = ''
+                        row.imgUrl = ''
+                      }
+                      this.getWebsitFun(true)
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.classifyList
+                      .filter(val_ => {
+                        var v_ =
+                          this.orderInfo?.orderProducts?.length > 1
+                            ? this.orderInfo?.orderProducts?.find(item => item[column.columnAttributes.prop])?.[
+                                column.columnAttributes.prop
+                              ]
+                            : false
+                        return v_ ? val_.categoryId === v_ : true
+                      })
+                      .map((item, index_) => (
+                        <el-option key={index_} label={item.name} value={item.categoryId}></el-option>
+                      ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row.mainName}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品小类',
+            prop: 'smallId'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
+                  rules={this.orderInfo.isCj ? [] : []}
+                >
+                  <el-select
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      if (val) {
+                        var data = this.classifyListLv2.find(item => item.categoryId == val)
+                        row.smallName = data.name
+                      } else {
+                        row.smallName = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.classifyListLv2
+                      .filter(item => item.parentId === row.mainId)
+                      .map((item, index_) => (
+                        <el-option key={index_} label={item.name} value={item.categoryId}></el-option>
+                      ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row.smallName}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品机型',
+            prop: 'productName'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
+                >
+                  <el-input
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '内机条码',
+            prop: 'insideCode'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item label="" label-width="0px">
+                  <el-input
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '数量',
+            prop: 'num'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
+                  rules={this.orderInfo.isCj ? [] : required}
+                >
+                  <el-input
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '备注',
+            prop: 'remark'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item label="" label-width="0px">
+                  <el-input
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        ...(() => {
+          if (this.formOptions.orderProducts.isEdit) {
+            return [
+              {
+                columnAttributes: {
+                  label: '操作'
+                },
+                render: (h, { row, column, index }) => {
+                  return (
+                    <div style="padding-left:10px">
+                      <el-button
+                        type="text"
+                        onClick={() => {
+                          this.delProduct(row, index)
+                        }}
+                      >
+                        删除
+                      </el-button>
+                      {this.isEditIndex == index && (
+                        <el-button
+                          type="text"
+                          onClick={() => {
+                            this.eidtProduct(row, index)
+                          }}
+                        >
+                          确定
+                        </el-button>
+                      )}
+                      {this.isEditIndex == -1 && (
+                        <el-button
+                          type="text"
+                          onClick={() => {
+                            this.isEditIndex = index
+                          }}
+                        >
+                          编辑
+                        </el-button>
+                      )}
+                    </div>
+                  )
+                }
+              }
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    product() {
+      return [
+        {
+          isShow: this.formOptions.orderProducts.isShow,
+          name: 'slot-component',
+          md: 24,
+          formItemAttributes: {
+            label: '',
+            'label-width': '0px',
+            prop: 'orderProducts',
+            errLabel: '产品信息',
+            rules: this.formOptions.orderProducts.isRules
+          },
+          render: (h, { props }) => {
+            return (
+              <div>
+                {this.formOptions.orderProducts.isEdit ? (
+                  <div>
+                    <el-button
+                      size="mini"
+                      type="primary"
+                      onClick={() => {
+                        this.appointVerify(this.getVfyKey(this.isEditIndex, false), v => {
+                          if (v) {
+                            try {
+                              this.orderInfo.orderProducts.map((item, index_) => {
+                                var row = this.orderInfo.orderProducts[index_ + 1]
+                                if (row) {
+                                  if (
+                                    `${row.brandId}_${row.mainId}_${row.smallId}_${row.productName}` ==
+                                    `${item.brandId}_${item.mainId}_${item.smallId}_${item.productName}`
+                                  ) {
+                                    throw new Error('')
+                                  }
+                                }
+                              })
+                            } catch (error) {
+                              this.$message.warning('产品机型重复')
+                              return
+                            }
+                            this.isEditIndex = 0
+                            this.orderInfo.orderProducts.unshift({
+                              brandId: '',
+                              brandName: '',
+                              createBy: '',
+                              createTime: '',
+                              mainId: '',
+                              mainName: '',
+                              num: '',
+                              insideCode: '',
+                              orderBaseId: this.id || '',
+                              productId: '',
+                              productName: '',
+                              remark: '',
+                              smallId: '',
+                              smallName: '',
+                              imgUrl: ''
+                            })
+                          }
+                        })
+                      }}
+                    >
+                      新增
+                    </el-button>
+                  </div>
+                ) : null}
+                <zj-table columns={this.productColumns} table-data={this.orderInfo.orderProducts} />
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  created() {
+    // 获取品牌
+    getDataDictionary({
+      pageNum: 1,
+      pageSize: -1,
+      params: [
+        { param: 'a.status', compare: '=', value: 'ON' },
+        { param: 'a.dict_type', compare: '=', value: 'BRAND' }
+      ]
+    }).then(res => {
+      this.orderBrands = res.data.records.map(item => ({
+        value: item.dictCode,
+        label: item.dictValue
+      }))
+    })
+    // 获取产品大类小类
+    getClassifyList({ type: 2, status: true }).then(res => {
+      var classifyListLv2 = []
+      this.classifyList = res.data.map(item => {
+        var { children, ...data } = item
+        classifyListLv2.push(...(children || []))
+        return {
+          ...data
+        }
+      })
+      this.classifyListLv2 = classifyListLv2
+    })
+  },
+  methods: {
+    getVfyKey(index, bool = true) {
+      return [
+        ...(() => {
+          if (bool) {
+            return [`orderProducts`]
+          }
+          return []
+        })(),
+        ...(() => {
+          if (index > -1) {
+            return [
+              // `orderProducts.${index}.brandId`,
+              `orderProducts.${index}.mainId`,
+              // `orderProducts.${index}.smallId`,
+              `orderProducts.${index}.productName`,
+              `orderProducts.${index}.num`,
+              `orderProducts.${index}.remark`
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    // 重新获取赋值
+    getOrderBaseProduct() {
+      if (this.id) {
+        orderBaseProductList({
+          orderBaseId: this.id
+        }).then(res => {
+          this.orderInfo.orderProducts = res.data || []
+        })
+      }
+    },
+    eidtProduct(row, index) {
+      try {
+        this.orderInfo.orderProducts.map((item, index_) => {
+          if (
+            `${row.brandId}_${row.mainId}_${row.smallId}_${row.productName}` ==
+              `${item.brandId}_${item.mainId}_${item.smallId}_${item.productName}` &&
+            index_ != index
+          ) {
+            throw new Error('')
+          }
+        })
+      } catch (error) {
+        this.$message.warning('产品机型重复')
+        return
+      }
+      this.appointVerify(this.getVfyKey(this.isEditIndex), v => {
+        if (v) {
+          if (this.id) {
+            ;[orderBaseProductAdd, orderBaseProductUpdate][row.id ? 1 : 0](row).then(res => {
+              this.isEditIndex = -1
+              this.getOrderBaseProduct()
+              this.getOrderBaseLogList()
+            })
+          } else {
+            this.isEditIndex = -1
+          }
+        }
+      })
+    },
+    delProduct(row, index) {
+      this.appointVerify(this.getVfyKey(this.isEditIndex), v => {
+        if (v && this.id && row.id) {
+          orderBaseProductDelete({
+            orderProductId: row.id
+          }).then(res => {
+            this.getOrderBaseProduct()
+            this.getOrderBaseLogList()
+          })
+        } else {
+          this.orderInfo.orderProducts.splice(index, 1)
+        }
+      })
+    }
+  }
+}

+ 557 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/serviceInfo.js

@@ -0,0 +1,557 @@
+import { listPageV2 } from '@/api/workOrder/orderType'
+import { getDataDictionary } from '@/api/dataDictionary.js'
+import { getWebsit } from '@/api/customerManagement.js'
+
+export default {
+  data() {
+    return {
+      orderSmallTypeData: [],
+      orderChannels: [],
+      WORKER_ORDER_SOURCE: [],
+      createWebsitList: [],
+      SALES_TYPE_LIST: []
+    }
+  },
+  computed: {
+    serviceInfo() {
+      return [
+        {
+          isShow: this.formOptions.createWebsitId.isShow,
+          name: 'el-select',
+          md: 6,
+          options: this.createWebsitList.map(item => ({ ...item, label: `(${item.value})${item.label}` })),
+          attributes: {
+            disabled: !this.formOptions.createWebsitId.isEdit,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '创建网点',
+            prop: 'createWebsitId',
+            rules: this.formOptions.createWebsitId.isRules
+          },
+          events: {
+            change: val => {
+              if (val) {
+                this.orderInfo.createWebsitName = this.createWebsitList.find(item => item.value == val).label
+              } else {
+                this.orderInfo.createWebsitName = ''
+              }
+            }
+          }
+        },
+        {
+          isShow: this.formOptions.serviceStatus.isShow,
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !this.formOptions.serviceStatus.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '服务状态',
+            prop: 'serviceStatus',
+            rules: this.formOptions.serviceStatus.isRules
+          }
+        },
+        // -------------------------------------------------
+        {
+          isShow: this.formOptions.orderSmallType.isShow && !this.id,
+          name: 'el-select',
+          md: 6,
+          options: this.orderSmallTypeData,
+          attributes: {
+            disabled: !this.formOptions.orderSmallType.isEdit,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '工单类型',
+            prop: 'orderSmallType',
+            rules: this.formOptions.orderSmallType.isRules
+          },
+          events: {
+            change: val => {
+              if (val) {
+                this.orderInfo.orderSmallTypeText = this.orderSmallTypeData.find(item => item.value == val).label
+              } else {
+                this.orderInfo.orderSmallTypeText = ''
+              }
+              this.getWebsitFun(true)
+            }
+          }
+        },
+        {
+          isShow: this.formOptions.orderSmallType.isShow && this.id,
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !this.formOptions.orderSmallType.isEdit
+          },
+          formItemAttributes: {
+            label: '工单类型',
+            prop: 'orderSmallTypeText',
+            rules: this.formOptions.orderSmallType.isRules
+          }
+        },
+        // ...(() => {
+        //   if (this.workOrderType == 1) {
+        //     // 普通工单
+        //     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 == 4) {
+        //     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',
+          md: 6,
+          attributes: {
+            'picker-options': 'pickerOptions11',
+            'popper-class': 'custom-popper11',
+            'append-to-body': true,
+            disabled: !this.formOptions.appointmentTime.isEdit,
+            style: { width: '100%' },
+            type: 'datetime',
+            placeholder: '请选择',
+            'value-format': 'yyyy-MM-dd HH:mm:ss',
+            'picker-options': {
+              disabledDate: time => {
+                return time.getTime() < Date.now() - 86400000
+              }
+            }
+          },
+          events: {
+            change: value => {
+              if (value && new Date(value).getTime() < new Date().getTime() - 2000) {
+                this.orderInfo.appointmentTime = ''
+                this.$message.warning('必须大于当前时间')
+              } else {
+                this.orderInfo.appointmentEndTime = ''
+              }
+            }
+          },
+          formItemAttributes: {
+            label: '预约上门开始时间',
+            prop: 'appointmentTime',
+            rules: this.formOptions.appointmentTime.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.appointmentTime.isShow,
+          name: 'el-date-picker',
+          md: 6,
+          attributes: {
+            'picker-options': 'pickerOptions11',
+            'popper-class': 'custom-popper11',
+            'append-to-body': true,
+            disabled: !this.formOptions.appointmentTime.isEdit,
+            style: { width: '100%' },
+            type: 'datetime',
+            placeholder: '请选择',
+            'value-format': 'yyyy-MM-dd HH:mm:ss',
+            'picker-options': {
+              disabledDate: time => {
+                var data = this.orderInfo?.appointmentTime?.split(' ')?.[0]
+                return (
+                  time.getTime() < new Date(data ? `${data} 00:00:00` : '').getTime() ||
+                  time.getTime() > new Date(data ? `${data} 23:59:59` : '').getTime()
+                )
+              }
+            }
+          },
+          events: {
+            change: value => {
+              if (value && new Date(value).getTime() < new Date().getTime() - 2000) {
+                this.orderInfo.appointmentEndTime = ''
+                this.$message.warning('必须大于当前时间')
+              } else if (value && new Date(value).getTime() < new Date(this.orderInfo?.appointmentTime).getTime()) {
+                this.orderInfo.appointmentTime = value
+              }
+            }
+          },
+          formItemAttributes: {
+            label: '预约上门结束时间',
+            prop: 'appointmentEndTime',
+            rules: this.formOptions.appointmentTime.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.orderChannelId.isShow,
+          name: 'el-select',
+          md: 6,
+          options: this.orderChannels,
+          echoInsertion: true,
+          attributes: {
+            disabled: !this.formOptions.orderChannelId.isEdit,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '工单渠道',
+            prop: 'orderChannelId',
+            propName: 'orderChannelText',
+            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 = ''
+              }
+              this.getWebsitFun(true)
+            }
+          }
+        },
+        {
+          isShow: this.formOptions.saleType.isShow,
+          name: 'el-select',
+          md: 6,
+          options: this.SALES_TYPE_LIST,
+          attributes: {
+            disabled: !this.formOptions.saleType.isEdit,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '销售类型',
+            prop: 'saleType',
+            rules: this.formOptions.saleType.isRules
+          },
+          events: {
+            change: val => {
+              this.orderInfo.salesTypeName = this.SALES_TYPE_LIST.find(item => item.value == val)?.label
+            }
+          }
+        },
+        {
+          isShow: this.formOptions.saleCompany.isShow,
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !this.formOptions.saleCompany.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '销售单位',
+            prop: 'saleCompany',
+            rules: this.formOptions.saleCompany.isRules
+          }
+        },
+
+        {
+          isShow: this.formOptions.source.isShow,
+          name: 'el-select',
+          md: 6,
+          options: this.WORKER_ORDER_SOURCE,
+          echoInsertion: true,
+          attributes: {
+            disabled: !this.formOptions.source.isEdit,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '工单来源',
+            prop: 'source',
+            propName: 'source',
+            rules: this.formOptions.source.isRules
+          },
+          events: {
+            change: val => {
+              this.getWebsitFun(true)
+            }
+          }
+        },
+
+        // {
+        //   isShow: this.formOptions.source.isShow,
+        //   name: 'el-input',
+        //   md: 6,
+        //   attributes: {
+        //     disabled: !this.formOptions.source.isEdit,
+        //     placeholder: '请输入'
+        //   },
+        //   formItemAttributes: {
+        //     label: '工单来源',
+        //     prop: 'source',
+        //     rules: this.formOptions.source.isRules
+        //   }
+        // },
+        {
+          isShow: this.formOptions.salesPlatform.isShow,
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !this.formOptions.salesPlatform.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '销售平台',
+            prop: 'salesPlatform',
+            rules: this.formOptions.salesPlatform.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.salesOrderId.isShow,
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !this.formOptions.salesOrderId.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '销售单号',
+            prop: 'salesOrderId',
+            rules: this.formOptions.salesOrderId.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.serviceOrderId.isShow,
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !this.formOptions.serviceOrderId.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '服务单号',
+            prop: 'serviceOrderId',
+            rules: this.formOptions.serviceOrderId.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.urgent.isShow,
+          name: 'el-select',
+          md: 6,
+          options: [
+            { value: '一般', label: '一般' },
+            { value: '急', label: '急' },
+            { value: '紧急', label: '紧急' }
+          ],
+          echoInsertion: true,
+          attributes: {
+            clearable: true,
+            filterable: true,
+            disabled: !this.formOptions.urgent.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '紧急程度',
+            prop: 'urgent',
+            propName: 'urgent',
+            rules: this.formOptions.urgent.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.complaint.isShow,
+          name: 'el-select',
+          md: 6,
+          options: [
+            { value: '特级', label: '特级' },
+            { value: '一级', label: '一级' },
+            { value: '二级', label: '二级' },
+            { value: '三级', label: '三级' }
+          ],
+          echoInsertion: true,
+          attributes: {
+            clearable: true,
+            filterable: true,
+            disabled: !this.formOptions.complaint.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '投诉等级',
+            prop: 'complaint',
+            propName: 'complaint',
+            rules: this.formOptions.complaint.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.evaluate.isShow,
+          name: 'el-select',
+          md: 6,
+          options: [
+            { value: '满意(默认)', label: '满意(默认)' },
+            { value: '好评', label: '好评' },
+            { value: '满意', label: '满意' },
+            { value: '中评', label: '中评' },
+            { value: '差评', label: '差评' }
+          ],
+          echoInsertion: true,
+          attributes: {
+            clearable: true,
+            filterable: true,
+            disabled: !this.formOptions.evaluate.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '评价结果',
+            prop: 'evaluate',
+            propName: 'evaluate',
+            rules: this.formOptions.evaluate.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.reqStatus.isShow,
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !this.formOptions.reqStatus.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '要求状态',
+            prop: 'reqStatus',
+            rules: this.formOptions.reqStatus.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.reqType.isShow,
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !this.formOptions.reqType.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '要求类型',
+            prop: 'reqType',
+            rules: this.formOptions.reqType.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.reqText.isShow,
+          name: 'el-input',
+          md: 12,
+          attributes: {
+            disabled: !this.formOptions.reqText.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '要求内容',
+            prop: 'reqText',
+            rules: this.formOptions.reqText.isRules
+          }
+        }
+      ]
+    }
+  },
+  created() {
+    // 普通工单选择网点数据
+    if (!!~[1, 2, 3].indexOf(this?.workOrderType)) {
+      // 获取工单类型
+      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: '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({
+      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: 'WORKER_ORDER_SOURCE' }
+      ]
+    }).then(res => {
+      this.WORKER_ORDER_SOURCE = res.data.records.map(item => ({
+        value: item.dictValue,
+        label: item.dictValue
+      }))
+    })
+
+    getWebsit({ status: true }).then(res => {
+      this.createWebsitList = res.data.map(item => ({
+        value: item.websitId,
+        label: item.name
+      }))
+    })
+  }
+}

+ 493 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/wb_productColumns.js

@@ -0,0 +1,493 @@
+import { getClassifyList } from '@/api/goods'
+import { getDataDictionary } from '@/api/dataDictionary.js'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+import {
+  orderBaseProductList,
+  orderBaseProductAdd,
+  orderBaseProductUpdate,
+  orderBaseProductDelete
+} from '@/api/workOrderPool.js'
+export default {
+  data() {
+    return {
+      isEditIndex: -1,
+      productList_wb: []
+    }
+  },
+  computed: {
+    productColumns_wb() {
+      return [
+        {
+          columnAttributes: {
+            label: '产品品牌',
+            prop: 'brandId'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      if (val) {
+                        var data = this.huoquweiyi('brandId', 'brandName').find(item => item.value == val)
+                        row.brandName = data.label
+                      } else {
+                        row.brandName = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.huoquweiyi('brandId', 'brandName').map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row.brandName}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品大类',
+            prop: 'mainId'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      row.smallId = ''
+                      row.smallName = ''
+                      if (val) {
+                        var data = this.huoquweiyi('mainId', 'mainName')
+                          .filter(item => {
+                            return !!this.productList_wb
+                              .filter(v => v.mainId == item.value)
+                              .find(v2 => v2.brandId == row.brandId)
+                          })
+                          .find(item => item.value == val)
+                        row.mainName = data.label
+                      } else {
+                        row.mainName = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.huoquweiyi('mainId', 'mainName')
+                      .filter(item => {
+                        return !!this.productList_wb
+                          .filter(v => v.mainId == item.value)
+                          .find(v2 => v2.brandId == row.brandId)
+                      })
+                      .map((item, index_) => (
+                        <el-option key={index_} label={item.label} value={item.value}></el-option>
+                      ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row.mainName}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品小类',
+            prop: 'smallId'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      if (val) {
+                        var data = this.huoquweiyi('smallId', 'smallName', 'smallImg')
+                          .filter(item => {
+                            return !!this.productList_wb
+                              .filter(v => v.smallId == item.value)
+                              .find(v2 => v2.brandId == row.brandId && v2.mainId == row.mainId)
+                          })
+                          .find(item => item.value == val)
+                        row.smallName = data.label
+                        row.imgUrl = data.smallImg
+                      } else {
+                        row.smallName = ''
+                        row.imgUrl = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.huoquweiyi('smallId', 'smallName', 'smallImg')
+                      .filter(item => {
+                        return !!this.productList_wb
+                          .filter(v => v.smallId == item.value)
+                          .find(v2 => v2.brandId == row.brandId && v2.mainId == row.mainId)
+                      })
+                      .map((item, index_) => (
+                        <el-option key={index_} label={item.label} value={item.value}></el-option>
+                      ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row.smallName}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品机型',
+            prop: 'productName'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
+                >
+                  <el-input
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '内机条码',
+            prop: 'insideCode'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item label="" label-width="0px">
+                  <el-input
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '数量',
+            prop: 'num'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`orderProducts.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '备注',
+            prop: 'remark'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item label="" label-width="0px">
+                  <el-input
+                    disabled={!this.formOptions.orderProducts.isEdit}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        ...(() => {
+          if (this.formOptions.orderProducts.isEdit) {
+            return [
+              {
+                columnAttributes: {
+                  label: '操作'
+                },
+                render: (h, { row, column, index }) => {
+                  return (
+                    <div style="padding-left:10px">
+                      <el-button
+                        type="text"
+                        onClick={() => {
+                          this.delProduct_wb(row, index)
+                        }}
+                      >
+                        删除
+                      </el-button>
+                      {this.isEditIndex == index && (
+                        <el-button
+                          type="text"
+                          onClick={() => {
+                            this.eidtProduct_wb(row, index)
+                          }}
+                        >
+                          确定
+                        </el-button>
+                      )}
+                      {this.isEditIndex == -1 && (
+                        <el-button
+                          type="text"
+                          onClick={() => {
+                            this.isEditIndex = index
+                          }}
+                        >
+                          编辑
+                        </el-button>
+                      )}
+                    </div>
+                  )
+                }
+              }
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    product_wb() {
+      return [
+        {
+          isShow: this.formOptions.orderProducts.isShow,
+          name: 'slot-component',
+          md: 24,
+          formItemAttributes: {
+            label: '',
+            'label-width': '0px',
+            prop: 'orderProducts',
+            errLabel: '产品信息',
+            rules: this.formOptions.orderProducts.isRules
+          },
+          render: (h, { props }) => {
+            return (
+              <div>
+                {this.formOptions.orderProducts.isEdit ? (
+                  <div>
+                    <el-button
+                      size="mini"
+                      type="primary"
+                      onClick={() => {
+                        this.appointVerify(this.getVfyKey_wb(this.isEditIndex, false), v => {
+                          if (v) {
+                            try {
+                              this.orderInfo.orderProducts.map((item, index_) => {
+                                var row = this.orderInfo.orderProducts[index_ + 1]
+                                if (row) {
+                                  if (
+                                    `${row.brandId}_${row.mainId}_${row.smallId}_${row.productName}` ==
+                                    `${item.brandId}_${item.mainId}_${item.smallId}_${item.productName}`
+                                  ) {
+                                    throw new Error('')
+                                  }
+                                }
+                              })
+                            } catch (error) {
+                              this.$message.warning('产品机型重复')
+                              return
+                            }
+                            this.isEditIndex = 0
+                            this.orderInfo.orderProducts.unshift({
+                              brandId: '',
+                              brandName: '',
+                              createBy: '',
+                              createTime: '',
+                              mainId: '',
+                              mainName: '',
+                              num: '',
+                              insideCode: '',
+                              orderBaseId: this.id || '',
+                              productId: '',
+                              productName: '',
+                              remark: '',
+                              smallId: '',
+                              smallName: '',
+                              imgUrl: ''
+                            })
+                          }
+                        })
+                      }}
+                    >
+                      新增
+                    </el-button>
+                  </div>
+                ) : null}
+                <zj-table columns={this.productColumns_wb} table-data={this.orderInfo.orderProducts} />
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    huoquweiyi(value, label, ...keys) {
+      var obj = {}
+      this.productList_wb.map(item => {
+        obj[item[value]] = {
+          label: item[label]
+        }
+        for (var key of keys) {
+          obj[item[value]][key] = item[key]
+        }
+      })
+      return Object.keys(obj).map(value => {
+        return {
+          value: value,
+          ...obj[value]
+        }
+      })
+    },
+    getVfyKey_wb(index, bool = true) {
+      return [
+        ...(() => {
+          if (bool) {
+            return [`orderProducts`]
+          }
+          return []
+        })(),
+        ...(() => {
+          if (index > -1) {
+            return [
+              `orderProducts.${index}.brandId`,
+              `orderProducts.${index}.mainId`,
+              `orderProducts.${index}.smallId`,
+              `orderProducts.${index}.productName`,
+              `orderProducts.${index}.num`,
+              `orderProducts.${index}.remark`
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    // 重新获取赋值
+    getOrderBaseProduct_wb() {
+      if (this.id) {
+        orderBaseProductList({
+          orderBaseId: this.id
+        }).then(res => {
+          this.orderInfo.orderProducts = res.data || []
+        })
+      }
+    },
+    eidtProduct_wb(row, index) {
+      try {
+        this.orderInfo.orderProducts.map((item, index_) => {
+          if (
+            `${row.brandId}_${row.mainId}_${row.smallId}_${row.productName}` ==
+              `${item.brandId}_${item.mainId}_${item.smallId}_${item.productName}` &&
+            index_ != index
+          ) {
+            throw new Error('')
+          }
+        })
+      } catch (error) {
+        this.$message.warning('产品机型重复')
+        return
+      }
+      this.appointVerify(this.getVfyKey_wb(this.isEditIndex), v => {
+        if (v) {
+          if (this.id) {
+            ;[orderBaseProductAdd, orderBaseProductUpdate][row.id ? 1 : 0](row).then(res => {
+              this.isEditIndex = -1
+              this.getOrderBaseProduct_wb()
+              this.getOrderBaseLogList()
+            })
+          } else {
+            this.isEditIndex = -1
+          }
+        }
+      })
+    },
+    delProduct_wb(row, index) {
+      this.appointVerify(this.getVfyKey_wb(this.isEditIndex), v => {
+        if (v && this.id && row.id) {
+          orderBaseProductDelete({
+            orderProductId: row.id
+          }).then(res => {
+            this.getOrderBaseProduct_wb()
+            this.getOrderBaseLogList()
+          })
+        } else {
+          this.orderInfo.orderProducts.splice(index, 1)
+        }
+      })
+    }
+  }
+}

+ 502 - 0
src/views/workOrder/workOrderPool2/detailModule/workOrderInfo/mixins/workOrderLogic.js

@@ -0,0 +1,502 @@
+import {
+  required,
+  mobileRequired,
+  mobileRequired2,
+  mobileRequired3,
+  mobile,
+  httpUrl,
+  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_ = {
+  // 基础信息--------------------
+  // 维保项目
+  rpProjectRepairId: '',
+  // 工程编号
+  projectNo: '',
+  // 工程名称
+  projectName: '',
+  // 客户名称
+  userName: '',
+  // 联系人
+  linkName: '',
+  // 客户电话
+  userMobile: '',
+  // 客户电话2
+  userMobile2: '',
+  // 省
+  provinceId: '',
+  // 市
+  cityId: '',
+  // 区
+  areaId: '',
+  // 街道
+  streetId: '',
+  // gps地址
+  gpsAddress: '',
+  // 详细地址
+  address: '',
+  // 服务信息--------------------------------
+  createWebsitId: '',
+  // 工单类型
+  orderSmallType: '',
+  // 工单来源
+  orderChannelId: '',
+  // 预约上门日期
+  appointmentTime: '',
+  appointmentEndTime: '',
+  // 销售单位
+  saleCompany: '',
+  source: '',
+  saleType: '',
+  // 产品信息------------------------
+  orderProducts: [],
+  // 其它信息------------------------
+  // 备注
+  remark: '',
+  // 派单信息-----------------------------
+  // 服务商网点
+  websitId: '',
+  // 是否抢单
+  isQd: false,
+  // 主要工程师id
+  workerId: '',
+  // 工程师列表
+  orderWorkers: [],
+  orderWorkers_cp: [],
+
+  isCj: false
+}
+
+export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null
+    },
+    workOrderType: {
+      type: Number,
+      default: 1 // 1普通工单, 4维保工单
+    },
+    cloneWorkOrder: {
+      type: Object,
+      default: null
+    }
+  },
+  data() {
+    return {
+      orderInfo: null,
+      provinceList_cp: [],
+      cityList_cp: [],
+      areaList_cp: [],
+      streetList_cp: []
+    }
+  },
+  watch: {
+    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(() => {
+              // 获取地址信息
+              this.getinitlbslist()
+              // 获取可选师傅
+              this.getWorkers()
+              this.getWebsitFun()
+            })
+          } else if (this.workOrderType == 4) {
+            this.$nextTick(() => {
+              // 获取维保单详情
+              this.getWeiBaoDetail()
+              this.getWebsitFun()
+            })
+          }
+        })
+        this.getOrderBaseLogList()
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  computed: {
+    // 用户信息
+    userInfo() {
+      return JSON.parse(localStorage.getItem('greemall_user'))
+    },
+    // 判断工单状态
+    orderType() {
+      if (this.orderInfo) {
+      }
+      return -1
+    },
+    // 处理操作按钮是否可以操作
+    btnRestrict() {
+      // 1,保存 2,过程反馈 3,设为异常 4,加急 5,不加急 6,取消工单 7,回访 8,新建工单 9,工单驳回 10,激活工单 21,总部下载
+      var btns = []
+
+      if (['DYY'].includes(this?.orderInfo?.orderStatus)) {
+        // 待预约
+        btns = [20]
+      } else if (['DQD'].includes(this?.orderInfo?.orderStatus)) {
+        // 待抢单
+        btns = [1, 2, 4, 5, 6, 20]
+      } else if (
+        [
+          'DSHPG',
+          'CJ',
+          'YPD',
+          'DXSPD',
+          'DZBPG',
+          'DWDSPGP',
+          'DXSSPGP',
+          'DTJXSSPGP',
+          'DZBSPGP',
+          'DFZXPD',
+          'DFZXSPGP',
+          'XSBH',
+          'TJXSBH',
+          'ZBBH',
+          'FZXBH',
+          'FL'
+        ].includes(this?.orderInfo?.orderStatus)
+      ) {
+        // 待商户派工
+        btns = [1, 2, 4, 5, 6, 20]
+      } else if (['DWDPG', 'DWDPD', 'WDBH'].includes(this?.orderInfo?.orderStatus)) {
+        // 待网点派工
+        btns = [1, 2, 4, 5, 6, 20]
+      } else if (['DJD', 'DSM', 'YZP'].includes(this?.orderInfo?.orderStatus)) {
+        // 待接单
+        btns = [1, 2, 4, 5, 6, 20]
+      } else if (['FWZ', 'GCSZT', 'BFWG'].includes(this?.orderInfo?.orderStatus)) {
+        // 服务中
+        btns = [1, 2, 3, 4, 5, 6, 20]
+      } else if (['YCD'].includes(this?.orderInfo?.orderStatus)) {
+        // 异常单
+        btns = [1, 2, 6, 20]
+      } else if (['YWG', 'GCSZX', 'WDWG', 'YWGO'].includes(this?.orderInfo?.orderStatus)) {
+        // 已完工待结算
+        btns = [7, 8, 9, 20]
+      } else if (['YJS', 'LRCD'].includes(this?.orderInfo?.orderStatus)) {
+        // 已结算
+        btns = [20]
+      } else if (['YQX', 'FWZT', 'YCGB', 'FWQX'].includes(this?.orderInfo?.orderStatus)) {
+        // 已取消
+        btns = [10, 20]
+      }
+      // 已经加急
+      if ((this.orderInfo.orderFlags || []).find(item => item.tag == 'JIA_JI')) {
+        btns = btns.filter(item => !new Set([4]).has(item))
+      } else {
+        btns = btns.filter(item => !new Set([5]).has(item))
+      }
+      // 已经异常
+      if ((this.orderInfo.orderFlags || []).find(item => item.tag == 'YI_CHANGE')) {
+        btns = btns.filter(item => !new Set([3]).has(item))
+      }
+      return btns
+    },
+    // 处理每个字段是否可编辑
+    formOptions() {
+      // 已完工, 已结算, 已取消
+      var finish =
+        ['YWG', 'GCSZX', 'WDWG', 'YWGO'].includes(this?.orderInfo?.orderStatus) ||
+        ['YJS', 'LRCD'].includes(this?.orderInfo?.orderStatus) ||
+        ['YQX', 'FWZT', 'YCGB', 'FWQX'].includes(this?.orderInfo?.orderStatus)
+
+      // 待商户派工, 待网点派工, 待接单, 待预约
+      var isQD =
+        [
+          'DSHPG',
+          'CJ',
+          'YPD',
+          'DXSPD',
+          'DZBPG',
+          'DWDSPGP',
+          'DXSSPGP',
+          'DTJXSSPGP',
+          'DZBSPGP',
+          'DFZXPD',
+          'DFZXSPGP',
+          'XSBH',
+          'TJXSBH',
+          'ZBBH',
+          'FZXBH',
+          'FL'
+        ].includes(this?.orderInfo?.orderStatus) ||
+        ['DWDPG', 'DWDPD', 'WDBH'].includes(this?.orderInfo?.orderStatus) ||
+        ['DJD', 'DSM', 'YZP'].includes(this?.orderInfo?.orderStatus) ||
+        ['DQD'].includes(this?.orderInfo?.orderStatus) ||
+        undefined === this?.orderInfo?.orderStatus
+
+      // 非新创建
+      var notNewOrder = this.id ? false : true
+
+      return {
+        // 基础信息--------------------
+        // 维保项目
+        rpProjectRepairId: {
+          isEdit: notNewOrder,
+          isShow: this.workOrderType == 4,
+          isRules: [...required]
+        },
+        // 工程项目
+        projectNo: {
+          isEdit: notNewOrder,
+          isShow: this.workOrderType == 2,
+          isRules: [...required]
+        },
+        projectName: {
+          isEdit: notNewOrder,
+          isShow: this.workOrderType == 2,
+          isRules: [...required]
+        },
+        // 客户名称
+        userName: {
+          isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
+          isShow: true,
+          isRules: [...required]
+        },
+        // 联系人
+        linkName: {
+          isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
+          isShow: true,
+          isRules: [...required]
+        },
+        // 客户电话
+        userMobile: {
+          isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
+          isShow: true,
+          isRules: [...mobileRequired2]
+        },
+        // 客户电话2
+        userMobile2: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: [...mobileRequired3]
+        },
+        // gps地址
+        gpsAddress: {
+          isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
+          isShow: true,
+          isRules: [...required]
+        },
+        // 详细地址
+        address: {
+          isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
+          isShow: true,
+          isRules: []
+        },
+        // 服务信息--------------------------------
+        createWebsitId: {
+          isEdit: !this.orderInfo.createWebsitId_cp,
+          isShow: true,
+          isRules: [...required]
+        },
+        // 工单类型
+        orderSmallType: {
+          isEdit: notNewOrder,
+          isShow: true,
+          isRules: [...required]
+        },
+        orderChannelId: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: [...required]
+        },
+        // 预约上门日期
+        appointmentTime: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: this.orderInfo.appointmentTime || this.orderInfo.appointmentEndTime ? [...required] : []
+        },
+        saleType: {
+          isEdit:
+            !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]
+        },
+        saleCompany: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        source: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        // 产品信息------------------------
+        orderProducts: {
+          isEdit: !finish && !this.orderInfo.isCj,
+          isShow: true,
+          isRules: [...required]
+        },
+        // 其它信息------------------------
+        // 备注
+        remark: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        // 派单信息-----------------------------
+        // 服务商网点
+        websitId: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: [...required]
+        },
+        isQd: {
+          isEdit: isQD,
+          isShow: true,
+          isRules: [...required]
+        },
+        workerId: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: this.userInfo.type != 1 && !this.orderInfo.isQd ? [...required] : []
+        },
+        orderWorkers: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: this.userInfo.type != 1 && !this.orderInfo.isQd ? [...required] : []
+        },
+        // ------------------------------
+        serviceStatus: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        salesPlatform: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        salesOrderId: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        serviceOrderId: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        urgent: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        complaint: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        evaluate: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        reqStatus: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        reqType: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        },
+        reqText: {
+          isEdit: !finish,
+          isShow: true,
+          isRules: []
+        }
+      }
+    },
+    // 表单校验规则
+    formRules() {
+      return {}
+    }
+  },
+  methods: {
+    // 获取工单详情
+    getorderDetail(cb) {
+      if (this.id) {
+        // 编辑详情
+        Promise.all([
+          orderBaseDetail({
+            orderBaseId: this.id
+          }),
+          orderBaseProductList({
+            orderBaseId: this.id
+          })
+        ]).then(([res, res1]) => {
+          if (res.data.province && (md5(res.data.province) == res.data.provinceId || res.data.provinceId == 0)) {
+            res.data.provinceId = md5(res.data.province)
+            this.provinceList_cp = [{ value: res.data.provinceId, label: res.data.province }]
+          }
+          if (res.data.city && (md5(res.data.city) == res.data.cityId || res.data.cityId == 0)) {
+            res.data.cityId = md5(res.data.city)
+            this.cityList_cp = [{ value: res.data.cityId, label: res.data.city }]
+          }
+          if (res.data.area && (md5(res.data.area) == res.data.areaId || res.data.areaId == 0)) {
+            res.data.areaId = md5(res.data.area)
+            this.areaList_cp = [{ value: res.data.areaId, label: res.data.area }]
+          }
+          if (res.data.street && (md5(res.data.street) == res.data.streetId || res.data.streetId == 0)) {
+            res.data.streetId = md5(res.data.street)
+            this.streetList_cp = [{ value: res.data.streetId, label: res.data.street }]
+          }
+          this.orderInfo = {
+            ...res.data,
+            orderWorkers_cp: [...(res.data.orderWorkers || []).map(item => ({ ...item }))],
+            orderProducts: res1.data || [],
+            workerId_fz: '',
+            createWebsitId_cp: res.data.createWebsitId
+          }
+          cb && cb(this.orderInfo)
+        })
+      }
+      if (this.cloneWorkOrder) {
+        // 创建工单
+        this.orderInfo = Object.assign({}, JSON.parse(JSON.stringify(this.cloneWorkOrder)), {
+          workerId_fz: ''
+        })
+        cb && cb(this.orderInfo)
+      } else {
+        // 创建工单
+        this.orderInfo = Object.assign({}, JSON.parse(JSON.stringify(initdata_)), {
+          workerId_fz: ''
+        })
+        cb && cb(this.orderInfo)
+      }
+    }
+  }
+}

+ 736 - 0
src/views/workOrder/workOrderPool2/index.vue

@@ -0,0 +1,736 @@
+<template>
+  <div style="width: 100%; height: 100%; position: relative">
+    <!-- 工单池 -->
+    <template-page
+      v-if="!(!!~['detail'].indexOf(pageType) && pageCode != '') && showTableBool"
+      ref="pageRef"
+      :getList="getList"
+      :operation="operation()"
+      :exportList="exportList"
+      :optionsEvensGroup="optionsEvensGroup"
+      :columnParsing="columnParsing"
+      :tableAttributes="tableAttributes"
+      :tableEvents="tableEvents"
+      :moreParameters="moreParameters"
+      :screeningAnalysis="screeningAnalysis"
+      :filterMethod="filterMethod"
+      :replaceOrNotMap="true"
+      :defaultSearchData="defaultSearchData"
+    >
+      <div slot="moreSearch">
+        <div style="margin-bottom: 10px">
+          <span
+            style="
+              font-size: 12px;
+              font-weight: 400;
+              text-align: left;
+              color: #666;
+              line-height: 28px;
+              margin-right: 10px;
+            "
+            >选择年份</span
+          >
+          <el-date-picker
+            style="width: 130px"
+            v-model="value1"
+            format="yyyy"
+            size="mini"
+            type="year"
+            placeholder="选择日期"
+          >
+          </el-date-picker>
+        </div>
+      </div>
+      <!-- 创建工单 -->
+      <div class="cartographer_big" v-if="!(!!~['detail'].indexOf(pageType) && pageCode != '')">
+        <el-dialog
+          title="创建工单"
+          width="100%"
+          :modal="false"
+          :visible.sync="createFormBool"
+          :before-close="handleClose"
+        >
+          <workOrderInfo :workOrderType="workOrderType" v-if="createFormBool" :cloneWorkOrder="cloneWorkOrder" />
+        </el-dialog>
+      </div>
+      <!-- 批量预约/改约 -->
+      <div class="cartographer_big" v-if="!(!!~['detail'].indexOf(pageType) && pageCode != '')">
+        <el-dialog
+          title="批量约单"
+          width="100%"
+          :modal="false"
+          :visible.sync="rescheduleBool"
+          :before-close="rescheduleClose"
+        >
+          <Reschedule v-if="rescheduleBool" :recordSelected="recordSelected" @close="rescheduleClose" />
+        </el-dialog>
+      </div>
+      <!-- 批量派工/改派 -->
+      <div class="cartographer_big" v-if="!(!!~['detail'].indexOf(pageType) && pageCode != '')">
+        <el-dialog
+          title="批量派单"
+          width="100%"
+          :modal="false"
+          :visible.sync="reassignmentBool"
+          :before-close="reassignmentClose"
+        >
+          <Reassignment v-if="reassignmentBool" :recordSelected="recordSelected" @close="reassignmentClose" />
+        </el-dialog>
+      </div>
+      <div class="tubiao">
+        <span style="margin-right: 4px; font-weight: bold; font-size: 12px">工单标识说明:</span>
+        <img :src="v4" style="width: 20px; height: 20px; margin: 0 3px" />
+        <span style="margin-right: 4px; font-size: 12px; display: inline-block; width: 76px">【4.0工单】</span>
+        <img :src="gc" style="width: 20px; height: 20px; margin: 0 3px" />
+        <span style="margin-right: 4px; font-size: 12px; display: inline-block; width: 76px">【工程】</span>
+        <img :src="jj" style="width: 20px; height: 20px; margin: 0 3px" />
+        <span style="margin-right: 4px; font-size: 12px; display: inline-block; width: 76px">【加急】</span>
+        <img :src="ls" style="width: 20px; height: 20px; margin: 0 3px" />
+        <span style="margin-right: 4px; font-size: 12px; display: inline-block; width: 76px">【零售】</span>
+        <img :src="yjs" style="width: 20px; height: 20px; margin: 0 3px" />
+        <span style="margin-right: 4px; font-size: 12px; display: inline-block; width: 76px">【已结算】</span>
+      </div>
+      <div class="tubiao2">
+        <span style="margin-right: 4px; font-weight: bold; font-size: 12px; opacity: 0">工单标识说明:</span>
+        <img :src="ywg" style="width: 20px; height: 20px; margin: 0 3px" />
+        <span style="margin-right: 4px; font-size: 12px; display: inline-block; width: 76px">【已完工】</span>
+        <img :src="yc" style="width: 20px; height: 20px; margin: 0 3px" />
+        <span style="margin-right: 4px; font-size: 12px; display: inline-block; width: 76px">【异常】</span>
+        <img :src="zj" style="width: 20px; height: 20px; margin: 0 3px" />
+        <span style="margin-right: 4px; font-size: 12px; display: inline-block; width: 76px">【自建工单】</span>
+        <img :src="pjsq" style="width: 20px; height: 20px; margin: 0 3px" />
+        <span style="margin-right: 4px; font-size: 12px; display: inline-block; width: 76px">【配件申请】</span>
+        <img :src="pjdh" style="width: 20px; height: 20px; margin: 0 3px" />
+        <span style="margin-right: 4px; font-size: 12px; display: inline-block; width: 76px">【配件到货】</span>
+        <img :src="pjqx" style="width: 20px; height: 20px; margin: 0 3px" />
+        <span style="margin-right: 4px; font-size: 12px; display: inline-block; width: 76px">【配件取消】</span>
+      </div>
+    </template-page>
+    <!-- 工单详情 -->
+    <div class="cartographer_big haidhead__" v-if="!!~['detail'].indexOf(pageType) && pageCode != ''">
+      <el-dialog
+        class="noinonnlinin"
+        :title="'工单详情-' + id"
+        width="100%"
+        :modal="false"
+        :visible.sync="detailFormBool"
+        :before-close="handleClose"
+      >
+        <Detail v-if="detailFormBool" :id="id" :workOrderType="workOrderType" />
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import { EventBus } from '@/utils/eventBus'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import { listPageV2 } from '@/api/workOrder/orderType'
+import {
+  orderBaseList,
+  orderBaseListExport,
+  orderBaseStatusCount,
+  orderBaseImport,
+  orderBaseImport2,
+  orderBaseImport3,
+  orderBaseDetail,
+  changeOrderChangWebsit
+} from '@/api/workOrderPool.js'
+import workOrderInfo from './detailModule/workOrderInfo/index.vue'
+import Detail from './detail'
+import Reassignment from './components/reassignment/index.vue'
+import Reschedule from './components/reschedule/index.vue'
+import { commonTemplateDownload } from '@/api/common.js'
+import orderListColumn from '@/mixin/orderListColumn'
+// -----------------------
+import v4 from '@/assets/order/4.0@2x.png'
+import gc from '@/assets/order/工程@2x.png'
+import jj from '@/assets/order/加急@2x.png'
+import ls from '@/assets/order/零售@2x.png'
+import yjs from '@/assets/order/已结算@2x.png'
+import ywg from '@/assets/order/已完工待结算@2x@2x.png'
+import yc from '@/assets/order/异常@2x.png'
+import zj from '@/assets/order/自建@2x.png'
+import pjsq from '@/assets/order/配件申请中@2x.png'
+import pjdh from '@/assets/order/配件已到货@2x.png'
+import pjqx from '@/assets/order/配件已取消@2x.png'
+import { orderStatus_v_fh } from '@/views/workOrder/workOrderPool/mixins/orderStatus_FH.js'
+export default {
+  components: {
+    TemplatePage,
+    workOrderInfo,
+    Detail,
+    Reassignment,
+    Reschedule
+  },
+  mixins: [import_mixin, operation_mixin, orderListColumn],
+  data() {
+    return {
+      v4,
+      gc,
+      jj,
+      ls,
+      yjs,
+      ywg,
+      yc,
+      zj,
+      pjsq,
+      pjdh,
+      pjqx,
+      id: this.$route.query.id || '',
+      // 创建表单
+      createFormBool: false,
+      // 详情
+      detailFormBool: true,
+      // 批量改约
+      rescheduleBool: false,
+      // 批量派工/改派
+      reassignmentBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true,
+        selectable: this.selectable
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      orderTypeList: [],
+      orderStatusList: [],
+      defaultSearchData: [],
+      workOrderType: 1,
+      cloneWorkOrder: null,
+      value1: new Date(),
+      showTableBool: true,
+      fuhezhuangtai: {
+        DSHPG: [
+          'DSHPG',
+          'CJ',
+          'YPD',
+          'DXSPD',
+          'DZBPG',
+          'DWDSPGP',
+          'DXSSPGP',
+          'DTJXSSPGP',
+          'DZBSPGP',
+          'DFZXPD',
+          'DFZXSPGP'
+        ],
+        DWDPG: ['DWDPG', 'DWDPD'],
+        FWZ: ['FWZ', 'GCSZT', 'BFWG', 'DSM', 'YZP', 'WDBH', 'XSBH', 'TJXSBH', 'ZBBH', 'FZXBH'],
+        YWG: ['YWG', 'GCSZX', 'WDWG', 'YWGO'],
+        YJS: ['YJS', 'LRCD'],
+        YQX: ['YQX', 'FWZT', 'YCGB', 'FWQX', 'FL']
+      }
+    }
+  },
+  watch: {
+    value1() {
+      this.showTableBool = false
+      this.$nextTick(() => {
+        this.showTableBool = true
+      })
+    }
+  },
+  computed: {
+    moreParameters() {
+      return [
+        {
+          name: '工单类型',
+          key: 'orderSmallTypeText',
+          value: '',
+          conditions: [
+            {
+              label: '全部',
+              value: ''
+            },
+            ...this.orderTypeList
+          ]
+        },
+        {
+          name: '工单状态',
+          key: 'orderStatus',
+          value: this.pageType == 'orderStatus' && this.pageCode ? this.pageCode : '',
+          conditions: [
+            {
+              label: '全部',
+              value: ''
+            },
+            ...this.orderStatusList
+          ]
+        }
+      ]
+    },
+    // 用户信息
+    userInfo() {
+      return JSON.parse(localStorage.getItem('greemall_user'))
+    },
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth(['createWorkOrder', 'createWbWorkOrder'], {
+              name: '创建工单',
+              click: () => {}
+            }),
+            this.optionsEvensAuth('createWorkOrder', {
+              click: () => {
+                this.workOrderType = 1
+                this.createFormBool = true
+              }
+            }),
+            this.optionsEvensAuth('createGCWorkOrder', {
+              click: () => {
+                this.workOrderType = 2
+                this.createFormBool = true
+              }
+            }),
+            this.optionsEvensAuth('createWbWorkOrder', {
+              click: () => {
+                this.workOrderType = 4
+                this.createFormBool = true
+              }
+            })
+          ],
+          [
+            this.optionsEvensAuth(
+              [
+                'import4',
+                'importTemplate',
+                'downloadImportTemplate',
+                'downloadImportTemplate4',
+                'importTemplate2',
+                'downloadImportTemplate2'
+              ],
+              {
+                name: '导入工单',
+                click: () => {}
+              }
+            ),
+            this.optionsEvensAuth('import4', ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(orderBaseImport3, moduleName)
+                }
+              }
+            }),
+            this.optionsEvensAuth('downloadImportTemplate4', {
+              click: () => {
+                commonTemplateDownload({ name: '4.0工单导入模板.xlsx' }, `4.0工单导入模板`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            }),
+            this.optionsEvensAuth('importTemplate', ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(orderBaseImport, moduleName)
+                }
+              }
+            }),
+            this.optionsEvensAuth('downloadImportTemplate', {
+              click: () => {
+                commonTemplateDownload({ name: '工单导入模板.xlsx' }, `工单导入模板`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            }),
+            this.optionsEvensAuth('importTemplate2', ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(orderBaseImport2, moduleName)
+                }
+              }
+            }),
+            this.optionsEvensAuth('downloadImportTemplate2', {
+              click: () => {
+                commonTemplateDownload({ name: '工单导入模板2.xlsx' }, `${this.$route.meta.title}`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            })
+          ],
+          [
+            this.optionsEvensAuth(['bulkOrder', 'lotOrder'], {
+              name: '批量操作',
+              click: () => {}
+            }),
+            this.optionsEvensAuth('bulkOrder', {
+              click: () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.warning('请勾选工单')
+                  return
+                }
+                this.reassignmentBool = true
+              }
+            }),
+            this.optionsEvensAuth('lotOrder', {
+              click: () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.warning('请勾选工单')
+                  return
+                }
+                this.rescheduleBool = true
+              }
+            })
+          ],
+          [
+            this.optionsEvensAuth('changeOrderChangWebsit', {
+              click: () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.warning('请勾选工单')
+                  return
+                }
+                changeOrderChangWebsit({
+                  ids: this.recordSelected.map(item => item.id)
+                }).then(res => {
+                  this.$message({
+                    type: 'success',
+                    message: '操作成功!'
+                  })
+                  this.$refs?.pageRef?.refreshList()
+                })
+              }
+            })
+          ]
+        ]
+      ]
+    }
+  },
+  created() {
+    this.initFun()
+    EventBus.$on('handleOrderClone', () => {
+      if (!(!!~['detail'].indexOf(this.pageType) && this.pageCode != '')) {
+        this.handleClose()
+      }
+    })
+    EventBus.$on('cloneWorkOrder', data => {
+      if (!(!!~['detail'].indexOf(this.pageType) && this.pageCode != '')) {
+        this.handleClose(() => {
+          this.cloneWorkOrder = data
+          this.workOrderType = data.saleType
+          this.createFormBool = false
+          this.$nextTick(() => {
+            this.createFormBool = true
+          })
+        })
+      }
+    })
+    if (!(!!~['detail'].indexOf(this.pageType) && this.pageCode != '')) {
+      // 获取工单类型
+      listPageV2({ pageNum: 1, pageSize: -1, params: [{ param: 'a.status', compare: '=', value: 'true' }] }).then(
+        res => {
+          var obj = {}
+          res.data.records.map(item => {
+            if (!obj[item.orderSmallTypeText]) {
+              obj[item.orderSmallTypeText] = {
+                value: item.orderSmallTypeText,
+                label: item.orderSmallTypeText
+              }
+            }
+          })
+          this.orderTypeList = Object.values(obj)
+        }
+      )
+    }
+  },
+  methods: {
+    initFun() {
+      if (this.pageType == 'detail') {
+        this.id = this.pageCode
+        orderBaseDetail({
+          orderBaseId: this.id
+        }).then(res => {
+          this.workOrderType = Number(res?.data?.saleType)
+          this.$nextTick(() => {
+            this.detailFormBool = true
+          })
+        })
+      }
+      if (this.pageType == 'saleOrderId') {
+        this.defaultSearchData = [{ param: 'a.sale_order_id', compare: '=', value: this.pageCode, label: '销售订单号' }]
+      }
+      if (this.pageType == 'pgIncreItemId') {
+        this.defaultSearchData = [
+          { param: 'a.pg_incre_order_id', compare: '=', value: this.pageCode, label: '增置服务订单ID' }
+        ]
+      }
+      if (this.pageType == 'rpProjectRepairId') {
+        this.defaultSearchData = [
+          { param: 'a.rp_project_repair_id', compare: '=', value: this.pageCode, label: '维保配置ID' }
+        ]
+      }
+      if (this.pageType == 'projectNo') {
+        this.defaultSearchData = [{ param: 'a.project_no', compare: '=', value: this.pageCode, label: '工程编号' }]
+      }
+    },
+
+    selectable(row, index) {
+      var orderStatus = Object.entries(row.selectMapData.orderStatus).find(([key, val]) => val == row.orderStatus)?.[0]
+      return (
+        !row.isThreeOrder &&
+        !['YWG', 'GCSZX', 'WDWG', 'YWGO'].includes(orderStatus) &&
+        !['YJS', 'LRCD'].includes(orderStatus) &&
+        !['YQX', 'FWZT', 'YCGB', 'FWQX', 'FL'].includes(orderStatus) &&
+        !row.rpProjectRepairId &&
+        !row.isImportExcel
+      )
+    },
+
+    screeningAnalysis(jname, val) {
+      if (jname == 'orderFlags') {
+        return (val || []).map(item => item.tagName).join(',')
+      } else {
+        return val
+      }
+    },
+
+    filterMethod(value, row, column) {
+      if (column['property'] == 'orderFlags') {
+        return (row[column['property']] || []).map(item => item.tagName).join(',') === value
+      }
+      return row[column['property']] === value
+    },
+
+    // 获取统计
+    getOrderBaseStatusCount(...p) {
+      orderBaseStatusCount(...p).then(res => {
+        this.orderStatusList = [
+          {
+            label: '待预约',
+            value: 'DYY'
+          },
+          {
+            label: '待抢单',
+            value: 'DQD'
+          },
+          {
+            label: '待商户派工',
+            value: 'DSHPG'
+          },
+          {
+            label: '待网点派工',
+            value: 'DWDPG'
+          },
+          {
+            label: '待接单',
+            value: 'DJD'
+          },
+          {
+            label: '服务中',
+            value: 'FWZ'
+          },
+          {
+            label: '异常单',
+            value: 'YCD'
+          },
+          {
+            label: '已完工',
+            value: 'YWG'
+          },
+          {
+            label: '已结算',
+            value: 'YJS'
+          },
+          {
+            label: '已取消',
+            value: 'YQX'
+          },
+          {
+            label: '配件申请中',
+            value: 'PJSQZ'
+          },
+          {
+            label: '配件已到货',
+            value: 'PJYDH'
+          },
+          {
+            label: '配件已取消',
+            value: 'PJYQX'
+          }
+        ].map(item => {
+          if (this.fuhezhuangtai[item.value]) {
+            var num = 0
+            this.fuhezhuangtai[item.value].map(status => {
+              num += res.data.find(val => val.orderStatus == status)?.total || 0
+            })
+            item.label = `${item.label}(${num || 0})`
+          } else {
+            var data = res.data.find(val => val.orderStatus == item.value)
+            item.label = `${item.label}(${data?.total || 0})`
+          }
+          return item
+        })
+      })
+    },
+
+    // 列表请求函数
+    getList(p, cb) {
+      var pam = JSON.parse(JSON.stringify(p))
+      try {
+        if (pam.orderStatus) {
+          if (this.fuhezhuangtai[pam.orderStatus]) {
+            pam.params.push({ param: 'a.order_status', compare: '=', value: this.fuhezhuangtai[pam.orderStatus] })
+            pam.orderStatus = ''
+          } else {
+            pam.params.push({ param: 'a.order_status', compare: '=', value: pam.orderStatus })
+          }
+        }
+        if (pam.orderSmallTypeText) {
+          pam.params.push({ param: 'a.order_small_type_text', compare: '=', value: pam.orderSmallTypeText })
+        }
+        if (this.value1) {
+          pam.params.push(
+            { param: 'a.create_time', compare: '>=', value: `${new Date(this.value1).getFullYear()}-01-01 00:00:00` },
+            { param: 'a.create_time', compare: '<=', value: `${new Date(this.value1).getFullYear()}-12-31 23:59:59` }
+          )
+        }
+        cb && cb(pam)
+        return orderBaseList(pam)
+      } catch (err) {
+      } finally {
+        this.$nextTick(() => {
+          this.getOrderBaseStatusCount({
+            orderSmallTypeText: pam.orderSmallTypeText || '',
+            ...(() => {
+              if (this.value1) {
+                return {
+                  startTime: `${new Date(this.value1).getFullYear()}-01-01 00:00:00`,
+                  endTime: `${new Date(this.value1).getFullYear()}-12-31 23:59:59`
+                }
+              }
+              return {}
+            })()
+          })
+        })
+      }
+    },
+
+    // 列表导出函数
+    exportList: orderBaseListExport,
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        edit: {
+          click: ({ row, index, column }) => {
+            this.$router.push({
+              name: 'workOrderPool',
+              params: {
+                pageName: row.id,
+                pageType: 'detail',
+                pageCode: row.id
+              }
+            })
+          }
+        }
+      })
+    },
+
+    handleClose(cb) {
+      this.$router.push({
+        name: 'workOrderPool',
+        params: {},
+        query: {}
+      })
+      this.$nextTick(() => {
+        this.cloneWorkOrder = null
+        this.createFormBool = false
+        this.detailFormBool = false
+        this.recordSelected = []
+        this.$refs?.pageRef?.refreshList()
+        if (cb && typeof cb === 'function') {
+          cb()
+        }
+      })
+    },
+
+    rescheduleClose() {
+      this.rescheduleBool = false
+      this.recordSelected = []
+      this.$refs?.pageRef?.refreshList()
+    },
+
+    reassignmentClose() {
+      this.reassignmentBool = false
+      this.recordSelected = []
+      this.$refs?.pageRef?.refreshList()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.haidhead__ {
+  ::v-deep .noinonnlinin {
+    & > div > .el-dialog__header {
+      display: none !important;
+    }
+    & > div > .el-dialog__body {
+      width: 100%;
+      height: 100% !important;
+      position: relative;
+      box-sizing: border-box;
+      padding: 0px;
+      overflow-y: auto;
+    }
+  }
+}
+.tubiao {
+  position: absolute;
+  bottom: 35px;
+  left: 20px;
+  z-index: 10;
+  width: 60%;
+  height: auto;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  z-index: -1;
+}
+.tubiao2 {
+  position: absolute;
+  bottom: 5px;
+  left: 20px;
+  z-index: 10;
+  width: 60%;
+  height: auto;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  z-index: -1;
+}
+</style>

+ 53 - 0
src/views/workOrder/workOrderPool2/mixins/orderStatus_FH.js

@@ -0,0 +1,53 @@
+export function orderStatus_v_fh(orderStatus) {
+  if (['DYY'].includes(orderStatus)) {
+    // 待预约
+    return 'DYY'
+  } else if (['DQD'].includes(orderStatus)) {
+    // 待抢单
+    return 'DQD'
+  } else if (
+    [
+      'DSHPG',
+      'CJ',
+      'YPD',
+      'DXSPD',
+      'DZBPG',
+      'DWDSPGP',
+      'DXSSPGP',
+      'DTJXSSPGP',
+      'DZBSPGP',
+      'DFZXPD',
+      'DFZXSPGP',
+      'XSBH',
+      'TJXSBH',
+      'ZBBH',
+      'FZXBH',
+      'FL'
+    ].includes(orderStatus)
+  ) {
+    // 待商户派工
+    return 'DSHPG'
+  } else if (['DWDPG', 'DWDPD', 'WDBH'].includes(orderStatus)) {
+    // 待网点派工
+    return 'DWDPG'
+  } else if (['DJD'].includes(orderStatus)) {
+    // 待接单
+    return 'DJD'
+  } else if (['FWZ', 'GCSZT', 'BFWG', 'DSM', 'YZP'].includes(orderStatus)) {
+    // 服务中
+    return 'FWZ'
+  } else if (['YCD'].includes(orderStatus)) {
+    // 异常单
+    return 'YCD'
+  } else if (['YWG', 'GCSZX', 'WDWG', 'YWGO'].includes(orderStatus)) {
+    // 已完工待结算
+    return 'YWG'
+  } else if (['YJS', 'LRCD'].includes(orderStatus)) {
+    // 已结算
+    return 'YJS'
+  } else if (['YQX', 'FWZT', 'YCGB', 'FWQX'].includes(orderStatus)) {
+    // 已取消
+    return 'YQX'
+  }
+  return ''
+}