linwenxin 9 miesięcy temu
rodzic
commit
d5e8f91416

+ 2 - 1
src/views/workOrder/basicConfiguration/orderType/index.vue

@@ -116,7 +116,8 @@ export default {
           name: 'el-select',
           options: [
             { label: '安装', value: 'INSTALL' },
-            { label: '维修', value: 'REPAIR' }
+            { label: '维修', value: 'REPAIR' },
+            { label: '回收单', value: 'RECYCLE' }
           ],
           attributes: { placeholder: '请选择' },
           formItemAttributes: {

+ 8 - 8
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/buttons/button_mixin.js

@@ -5,16 +5,16 @@ export default {
       default: () => ({})
     },
     orderType: {
-      type: Number,
+      type: [Number, String],
       default: null
-    },
+    }
   },
-  data(){
+  data() {
     return {
       disabled: false
     }
   },
-  methods:{
+  methods: {
     acquireVerify(v, name) {
       if (v.$parent[name]) {
         return v.$parent[name]
@@ -22,14 +22,14 @@ export default {
         return this.acquireVerify(v.$parent, name)
       }
     },
-    lockBtn(){
+    lockBtn() {
       this.disabled = true
-      setTimeout(()=>{
+      setTimeout(() => {
         this.disabled = false
       }, 5000)
     },
-    unlockBtn(){
+    unlockBtn() {
       this.disabled = false
-    },
+    }
   }
 }

+ 3 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/index.vue

@@ -30,7 +30,7 @@
         <zj-form-module
           title="产品信息"
           :form-data="orderInfo"
-          :form-items="workOrderType == 4 ? product_wb : product"
+          :form-items="orderType == 'RECYCLE' ? hs_product : workOrderType == 4 ? product_wb : product"
         />
         <!-- 其它信息 -->
         <!-- <zj-form-module title="其它信息" :form-data="orderInfo" :form-items="otherInfo" /> -->
@@ -92,6 +92,7 @@ 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 hs_productColumns from './mixins/hs_productColumns.js'
 import serviceInfo from './mixins/serviceInfo.js'
 import pandanxinxi from './mixins/pandanxinxi.js'
 import copyInfo from './buttons/copyInfo.vue'
@@ -127,6 +128,7 @@ export default {
     otherInfo,
     productColumns,
     wb_productColumns,
+    hs_productColumns,
     serviceInfo,
     pandanxinxi
   ],

+ 492 - 0
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/hs_productColumns.js

@@ -0,0 +1,492 @@
+import { required } from '@/components/template/rules_verify.js'
+import {
+  orderBaseProductList,
+  orderBaseProductAdd,
+  orderBaseProductUpdate,
+  orderBaseProductDelete
+} from '@/api/workOrderPool.js'
+import { serviceCategoryList, serviceCategoryListSpec, serviceCategoryListMinus } from '@/api/recycleCategoryCenter.js'
+import { listToTree } from '@/utils/util'
+export default {
+  data() {
+    return {
+      isEditIndex_hs: -1,
+      serviceCategoryListData: []
+    }
+  },
+  computed: {
+    hs_productColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '回收类目',
+            prop: 'bigId' //bigName
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex_hs == 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.bigName = this.serviceCategoryListData.find(item => item.id == val)?.name || ''
+                      row.mainId = ''
+                      row.mainName = ''
+                      row.productId = ''
+                      row.productName = ''
+                      row.num = ''
+                      row.estimatePrice = ''
+                      row.serviceAmount = ''
+                      row.pgOrderProductRecycles = []
+                      this.jisuanjiage(row, index)
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.serviceCategoryListData.map((item, index_) => (
+                      <el-option key={index_} label={item.name} value={item.id}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row.brandName}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品大类',
+            prop: 'mainId' //mainName
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex_hs == 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.mainName =
+                        (this.serviceCategoryListData.find(item => item.id == row?.bigId)?.children || []).find(
+                          item => item.id == val
+                        )?.name || ''
+                      row.productId = ''
+                      row.productName = ''
+                      row.num = ''
+                      row.estimatePrice = ''
+                      row.serviceAmount = ''
+                      row.pgOrderProductRecycles = []
+                      this.jisuanjiage(row, index)
+                    }}
+                    placeholder="请选择"
+                  >
+                    {(this.serviceCategoryListData.find(item => item.id == row?.bigId)?.children || []).map(
+                      (item, index_) => (
+                        <el-option key={index_} label={item.name} value={item.id}></el-option>
+                      )
+                    )}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row.mainName}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品规格',
+            prop: 'productId' //productName
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex_hs == 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.productName = this.serviceCategoryListSpecData.find(
+                        item => item.serviceCategoryItemId == val
+                      )?.dictName
+                      this.jisuanjiage(row, index)
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.serviceCategoryListSpecData
+                      .filter(item => item.mainId === row.mainId)
+                      .map((item, index_) => (
+                        <el-option key={index_} label={item.dictName} value={item.serviceCategoryItemId}></el-option>
+                      ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row.smallName}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '数量',
+            prop: 'num'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex_hs == 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
+                      this.jisuanjiage(row, index)
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '属性',
+            prop: 'pgOrderProductRecycles'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex_hs == 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
+                    }}
+                    placeholder="请选择"
+                    onChange={val => {
+                      this.jisuanjiage(row, index)
+                    }}
+                    multiple={true}
+                  >
+                    {this.serviceCategoryListMinusData
+                      .filter(item => item.mainId === row.mainId)
+                      .map((item, index_) => (
+                        <el-option
+                          key={index_}
+                          label={`${item.categoryName}-${item.dictName}`}
+                          value={item.serviceCategoryItemId}
+                        ></el-option>
+                      ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding-left:10px">{row.smallName}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '预估金额(元)',
+            prop: 'estimatePrice'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '导购分佣',
+            prop: 'serviceAmount'
+          }
+        },
+        ...(() => {
+          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_hs(row, index)
+                        }}
+                      >
+                        删除
+                      </el-button>
+                      {this.isEditIndex_hs == index && (
+                        <el-button
+                          type="text"
+                          onClick={() => {
+                            this.eidtProduct_hs(row, index)
+                          }}
+                        >
+                          确定
+                        </el-button>
+                      )}
+                      {this.isEditIndex_hs == -1 && (
+                        <el-button
+                          type="text"
+                          onClick={() => {
+                            this.isEditIndex_hs = index
+                          }}
+                        >
+                          编辑
+                        </el-button>
+                      )}
+                    </div>
+                  )
+                }
+              }
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    hs_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_hs(this.isEditIndex_hs, false), v => {
+                          if (v) {
+                            try {
+                              this.orderInfo.orderProducts.map((item, index_) => {
+                                var row = this.orderInfo.orderProducts[index_ + 1]
+                                if (row) {
+                                  if (
+                                    `${row.bigId}_${row.mainId}_${row.productId}` ==
+                                    `${item.bigId}_${item.mainId}_${item.productId}`
+                                  ) {
+                                    throw new Error('')
+                                  }
+                                }
+                              })
+                            } catch (error) {
+                              this.$message.warning('产品机型重复')
+                              return
+                            }
+                            this.isEditIndex_hs = 0
+                            this.orderInfo.orderProducts.unshift({
+                              bigId: '',
+                              bigName: '',
+                              brandId: '',
+                              brandName: '',
+                              bugRemark: '',
+                              detailRemark: '',
+                              estimatePrice: '',
+                              giveAddress: '',
+                              giveTime: '',
+                              imgUrl: '',
+                              insideCode: '',
+                              isDefend: '',
+                              mainId: '',
+                              mainName: '',
+                              num: '',
+                              outCode: '',
+                              pgOrderProductRecycles: [],
+                              productId: '',
+                              productName: '',
+                              remark: '',
+                              smallId: '',
+                              smallName: '',
+                              status: '',
+                              sumbitAddress: '',
+                              workerId: '',
+                              workerMobile: '',
+                              workerName: '',
+                              orderBaseId: this.id || ''
+                            })
+                          }
+                        })
+                      }}
+                    >
+                      新增
+                    </el-button>
+                  </div>
+                ) : null}
+                <zj-table columns={this.hs_productColumns} table-data={this.orderInfo.orderProducts} />
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  created() {
+    serviceCategoryList({ pageNum: 1, pageSize: -1, params: [{ param: 'status', compare: '=', value: 'ON' }] }).then(
+      res => {
+        this.serviceCategoryListData = listToTree(res.data.records, 'pid')
+      }
+    )
+    serviceCategoryListSpec({
+      pageNum: 1,
+      pageSize: -1,
+      params: [
+        { param: 'type_attribute', compare: '=', value: 'SPEC' },
+        { param: 'status', compare: '=', value: 'ON' }
+      ]
+    }).then(res => {
+      this.serviceCategoryListSpecData = res.data.records
+    })
+    serviceCategoryListMinus({
+      pageNum: 1,
+      pageSize: -1,
+      params: [
+        { param: 'type_attribute', compare: '=', value: 'DED' },
+        { param: 'status', compare: '=', value: 'ON' }
+      ]
+    }).then(res => {
+      this.serviceCategoryListMinusData = res.data.records
+    })
+  },
+  methods: {
+    jisuanjiage(row, index) {
+      var estimatePrice = 0
+      var serviceAmount = 0
+      if (row.productId) {
+        var { servicePrice, price } = this.serviceCategoryListSpecData.find(
+          item => item.serviceCategoryItemId == row.productId
+        )
+        estimatePrice += price * row.num
+        serviceAmount += servicePrice * row.num
+      }
+      if (row?.pgOrderProductRecycles?.length) {
+        this.serviceCategoryListMinusData
+          .filter(item => row.pgOrderProductRecycles.includes(item.serviceCategoryItemId))
+          .map(item => {
+            estimatePrice += item.priceMinus * row.num
+          })
+      }
+      this.orderInfo.orderProducts.splice(index, 1, {
+        ...row,
+        estimatePrice: estimatePrice,
+        serviceAmount: serviceAmount
+      })
+      this.orderInfo.serviceAmount = this.orderInfo.orderProducts
+        .map(item => item.serviceAmount || 0)
+        .reduce((a, b) => a + b, 0)
+    },
+    getVfyKey_hs(index, bool = true) {
+      return [
+        ...(() => {
+          if (bool) {
+            return [`orderProducts`]
+          }
+          return []
+        })(),
+        ...(() => {
+          if (index > -1) {
+            return [
+              `orderProducts.${index}.mainId`,
+              `orderProducts.${index}.productId`,
+              `orderProducts.${index}.num`,
+              `orderProducts.${index}.remark`
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    eidtProduct_hs(row, index) {
+      try {
+        this.orderInfo.orderProducts.map((item, index_) => {
+          if (
+            `${row.bigId}_${row.mainId}_${row.productId}` == `${item.bigId}_${item.mainId}_${item.productId}` &&
+            index_ != index
+          ) {
+            throw new Error('')
+          }
+        })
+      } catch (error) {
+        this.$message.warning('产品机型重复')
+        return
+      }
+      this.appointVerify(this.getVfyKey_hs(this.isEditIndex_hs), v => {
+        if (v) {
+          if (this.id) {
+            ;[orderBaseProductAdd, orderBaseProductUpdate][row.id ? 1 : 0](row).then(res => {
+              this.isEditIndex_hs = -1
+              this.getOrderBaseProduct()
+              this.getOrderBaseLogList()
+            })
+          } else {
+            this.isEditIndex_hs = -1
+          }
+        }
+      })
+    },
+    delProduct_hs(row, index) {
+      this.appointVerify(this.getVfyKey_hs(this.isEditIndex_hs), v => {
+        if (v && this.id && row.id) {
+          orderBaseProductDelete({
+            orderProductId: row.id
+          }).then(res => {
+            this.getOrderBaseProduct()
+            this.getOrderBaseLogList()
+          })
+        } else {
+          this.orderInfo.orderProducts.splice(index, 1)
+        }
+      })
+    }
+  }
+}

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

@@ -138,10 +138,12 @@ export default {
               {
                 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)
+                options: this.workerList.filter(item =>
+                  (this.orderInfo.workerId == item.value ||
+                    !~this.orderInfo.orderWorkers.map(item => item.workerId).indexOf(item.value)) &&
+                  this.orderType == 'RECYCLE'
+                    ? item.isRecycler
+                    : true
                 ),
                 md: 8,
                 attributes: {
@@ -197,8 +199,11 @@ export default {
               {
                 isShow: this.formOptions.orderWorkers.isEdit,
                 name: 'el-select',
-                options: this.workerList.filter(
-                  item => !~this.orderInfo.orderWorkers.map(item => item.workerId).indexOf(item.value)
+                options: this.workerList.filter(item =>
+                  !~this.orderInfo.orderWorkers.map(item => item.workerId).indexOf(item.value) &&
+                  this.orderType == 'RECYCLE'
+                    ? item.isRecycler
+                    : true
                 ),
                 md: 8,
                 attributes: {
@@ -274,10 +279,11 @@ export default {
           ]
         }).then(res => {
           this.workerList = res.data.records.map(item => {
-            var { id, userId, ...data } = item
+            var { id, userId, isRecycler, ...data } = item
             return {
               value: userId,
               label: data.nickName,
+              isRecycler: isRecycler,
               data: {
                 workerId: userId,
                 workerName: data.nickName,

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

@@ -1,11 +1,12 @@
 import { listPageV2 } from '@/api/workOrder/orderType'
 import { getDataDictionary } from '@/api/dataDictionary.js'
-
+import { memberListService2 } from '@/api/distributorManagement'
 export default {
   data() {
     return {
       orderSmallTypeData: [],
-      orderChannels: []
+      orderChannels: [],
+      memberListServiceData: []
     }
   },
   computed: {
@@ -193,6 +194,37 @@ export default {
             prop: 'source',
             rules: this.formOptions.source.isRules
           }
+        },
+        {
+          isShow: this.formOptions.serviceId.isShow,
+          name: 'el-select',
+          md: 6,
+          options: this.memberListServiceData,
+          attributes: {
+            disabled: !this.formOptions.serviceId.isEdit,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '导购员',
+            prop: 'serviceId',
+            rules: this.formOptions.serviceId.isRules
+          }
+        },
+        {
+          isShow: this.formOptions.serviceAmount.isShow,
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !this.formOptions.serviceAmount.isEdit,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '导购分佣',
+            prop: 'serviceAmount',
+            rules: this.formOptions.serviceAmount.isRules
+          }
         }
       ]
     }
@@ -205,11 +237,23 @@ export default {
         res => {
           this.orderSmallTypeData = res.data.records.map(item => ({
             value: item.id,
-            label: item.orderSmallTypeText
+            label: item.orderSmallTypeText,
+            data: { ...item }
           }))
         }
       )
     }
+    memberListService2({
+      orderBy: '',
+      pageNum: 1,
+      pageSize: -1,
+      params: [{ param: 'a.examine_status', compare: '=', value: 'OK' }]
+    }).then(res => {
+      this.memberListServiceData = res.data.records.map(item => ({
+        value: item.userId,
+        label: item.nickName
+      }))
+    })
     // 获取工单来源
     getDataDictionary({
       pageNum: 1,

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

@@ -10,7 +10,7 @@ import {
 export default {
   data() {
     return {
-      isEditIndex: -1,
+      isEditIndex_wb: -1,
       productList_wb: []
     }
   },
@@ -23,7 +23,7 @@ export default {
             prop: 'brandId'
           },
           render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
+            return this.isEditIndex_wb == index ? (
               <div class="redbordererr">
                 <el-form-item
                   label=""
@@ -64,7 +64,7 @@ export default {
             prop: 'mainId'
           },
           render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
+            return this.isEditIndex_wb == index ? (
               <div class="redbordererr">
                 <el-form-item
                   label=""
@@ -119,7 +119,7 @@ export default {
             prop: 'smallId'
           },
           render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
+            return this.isEditIndex_wb == index ? (
               <div class="redbordererr">
                 <el-form-item
                   label=""
@@ -174,7 +174,7 @@ export default {
             prop: 'productName'
           },
           render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
+            return this.isEditIndex_wb == index ? (
               <div class="redbordererr">
                 <el-form-item
                   label=""
@@ -202,7 +202,7 @@ export default {
             prop: 'insideCode'
           },
           render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
+            return this.isEditIndex_wb == index ? (
               <div class="redbordererr">
                 <el-form-item label="" label-width="0px">
                   <el-input
@@ -226,7 +226,7 @@ export default {
             prop: 'num'
           },
           render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
+            return this.isEditIndex_wb == index ? (
               <div class="redbordererr">
                 <el-form-item
                   label=""
@@ -255,7 +255,7 @@ export default {
             prop: 'remark'
           },
           render: (h, { row, column, index }) => {
-            return this.isEditIndex == index ? (
+            return this.isEditIndex_wb == index ? (
               <div class="redbordererr">
                 <el-form-item label="" label-width="0px">
                   <el-input
@@ -291,7 +291,7 @@ export default {
                       >
                         删除
                       </el-button>
-                      {this.isEditIndex == index && (
+                      {this.isEditIndex_wb == index && (
                         <el-button
                           type="text"
                           onClick={() => {
@@ -301,11 +301,11 @@ export default {
                           确定
                         </el-button>
                       )}
-                      {this.isEditIndex == -1 && (
+                      {this.isEditIndex_wb == -1 && (
                         <el-button
                           type="text"
                           onClick={() => {
-                            this.isEditIndex = index
+                            this.isEditIndex_wb = index
                           }}
                         >
                           编辑
@@ -343,7 +343,7 @@ export default {
                       size="mini"
                       type="primary"
                       onClick={() => {
-                        this.appointVerify(this.getVfyKey_wb(this.isEditIndex, false), v => {
+                        this.appointVerify(this.getVfyKey_wb(this.isEditIndex_wb, false), v => {
                           if (v) {
                             try {
                               this.orderInfo.orderProducts.map((item, index_) => {
@@ -361,7 +361,7 @@ export default {
                               this.$message.warning('产品机型重复')
                               return
                             }
-                            this.isEditIndex = 0
+                            this.isEditIndex_wb = 0
                             this.orderInfo.orderProducts.unshift({
                               brandId: '',
                               brandName: '',
@@ -461,22 +461,22 @@ export default {
         this.$message.warning('产品机型重复')
         return
       }
-      this.appointVerify(this.getVfyKey_wb(this.isEditIndex), v => {
+      this.appointVerify(this.getVfyKey_wb(this.isEditIndex_wb), v => {
         if (v) {
           if (this.id) {
             ;[orderBaseProductAdd, orderBaseProductUpdate][row.id ? 1 : 0](row).then(res => {
-              this.isEditIndex = -1
+              this.isEditIndex_wb = -1
               this.getOrderBaseProduct_wb()
               this.getOrderBaseLogList()
             })
           } else {
-            this.isEditIndex = -1
+            this.isEditIndex_wb = -1
           }
         }
       })
     },
     delProduct_wb(row, index) {
-      this.appointVerify(this.getVfyKey_wb(this.isEditIndex), v => {
+      this.appointVerify(this.getVfyKey_wb(this.isEditIndex_wb), v => {
         if (v && this.id && row.id) {
           orderBaseProductDelete({
             orderProductId: row.id

+ 22 - 5
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/workOrderLogic.js

@@ -54,8 +54,9 @@ var initdata_ = {
   // 工程师列表
   orderWorkers: [],
   orderWorkers_cp: [],
-
-  isCj: false
+  isCj: false,
+  serviceAmount: '',
+  serviceId: ''
 }
 
 export default {
@@ -100,6 +101,11 @@ export default {
       },
       deep: true,
       immediate: true
+    },
+    orderType(n, o) {
+      if (n !== o && this.orderInfo.orderProducts) {
+        this.orderInfo.orderProducts = []
+      }
     }
   },
   computed: {
@@ -109,9 +115,10 @@ export default {
     },
     // 判断工单状态
     orderType() {
-      if (this.orderInfo) {
+      if (this.orderInfo && this.orderInfo.orderSmallType && this.orderSmallTypeData) {
+        return this.orderSmallTypeData?.find(item => item.value == this?.orderInfo?.orderSmallType)?.data?.orderType
       }
-      return -1
+      return null
     },
     // 处理操作按钮是否可以操作
     btnRestrict() {
@@ -235,7 +242,7 @@ export default {
         },
         saleType: {
           isEdit: false,
-          isShow: true,
+          isShow: this.orderType != 'RECYCLE',
           isRules: [...required]
         },
         saleCompany: {
@@ -282,6 +289,16 @@ export default {
           isEdit: !finish,
           isShow: true,
           isRules: this.userInfo.type != 1 && !this.orderInfo.isQd ? [...required] : []
+        },
+        serviceAmount: {
+          isEdit: false,
+          isShow: this.orderType == 'RECYCLE',
+          isRules: []
+        },
+        serviceId: {
+          isEdit: this.id ? false : true,
+          isShow: this.orderType == 'RECYCLE',
+          isRules: []
         }
       }
     },