linwenxin пре 9 месеци
родитељ
комит
0805b54935

+ 0 - 1
src/api/workOrderPool.js

@@ -284,4 +284,3 @@ export function orderPartsApplyItemModify(data) {
     data
   })
 }
-

+ 289 - 9
src/views/workOrder/workOrderPool/detailModule/CompletionDetails/index.vue

@@ -1,6 +1,29 @@
 <template>
-  <zj-page-container>
-    <zj-page-fill class="neibuview">
+  <zj-page-container v-if="orderBaseDetail">
+    <zj-page-fill class="neibuview" v-if="orderBaseDetail.orderType == 'RECYCLE'">
+      <zj-form-container v-if="!detailId" key="completeDetail">
+        <zj-form-module title="完工明细">
+          <zj-table :columns="completeDetailColumnsHs" :table-data="completeDetailData" />
+        </zj-form-module>
+        <zj-form-module
+          title="收款凭证"
+          label-width="140px"
+          :form-data="orderBaseDetail"
+          :form-items="shoukuanpingzheng"
+        >
+        </zj-form-module>
+      </zj-form-container>
+      <zj-form-container v-else key="details">
+        <zj-form-module title="产品信息" :form-data="formData" :form-items="huishouchanpxinxi" />
+        <zj-form-module
+          title="完工明细"
+          label-width="140px"
+          :form-data="formData"
+          :form-items="huishouchanpwangongxinxi"
+        />
+      </zj-form-container>
+    </zj-page-fill>
+    <zj-page-fill class="neibuview" v-else>
       <zj-form-container v-if="!detailId" key="completeDetail">
         <zj-form-module title="完工明细">
           <zj-table :columns="completeDetailColumns" :table-data="completeDetailData" />
@@ -24,6 +47,7 @@
 <script>
 import { changeOrderGetOrderProduct, changeOrderProductDetail } from '@/api/workOrderPool.js'
 import ImageUpload from '@/components/file-upload'
+import { orderBaseDetail } from '@/api/workOrderPool.js'
 export default {
   components: {
     ImageUpload
@@ -37,6 +61,7 @@ export default {
   data() {
     return {
       completeDetailData: [],
+      orderBaseDetail: null,
       detailId: '',
       formData: {
         bugRemark: '',
@@ -47,6 +72,226 @@ export default {
     }
   },
   computed: {
+    completeDetailColumnsHs() {
+      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: 'bigName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品大类',
+            prop: 'mainName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品规格',
+            prop: 'productName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '数量',
+            prop: 'num'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '鉴定结果',
+            prop: 'isRecyc'
+          },
+          render: (h, { row, column, index }) => {
+            return <div style="padding-left:10px">{row.isRecyc ? '回收' : '不回收'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '应付货款',
+            prop: 'recycPayAmount'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '导购员',
+            prop: 'serviceName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '导购分佣',
+            prop: 'serviceAmount'
+          }
+        },
+        {
+          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
+          }
+        }
+      ]
+    },
+    huishouchanpxinxi() {
+      return [
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '',
+            prop: '',
+            'label-width': '0px'
+          },
+          render: (h, { props, onInput }) => {
+            return (
+              <zj-table
+                isDrop={true}
+                columns={[
+                  {
+                    columnAttributes: {
+                      label: '产品大类',
+                      prop: 'mainName'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '产品规格',
+                      prop: 'productName'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '数量',
+                      prop: 'num'
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '属性',
+                      prop: 'isRecyc'
+                    },
+                    render: (h, { row, column, index }) => {
+                      return <div style="padding-left:10px">{row.isRecyc ? '回收' : '不回收'}</div>
+                    }
+                  },
+                  {
+                    columnAttributes: {
+                      label: '预估金额',
+                      prop: 'estimatePrice'
+                    }
+                  }
+                ]}
+                tableData={[this.formData]}
+              ></zj-table>
+            )
+          }
+        }
+      ]
+    },
+    huishouchanpwangongxinxi() {
+      return [
+        {
+          name: 'el-radio',
+          options: [
+            { label: '回收', value: true },
+            { label: '不回收', value: false }
+          ],
+          md: 8,
+          attributes: { disabled: true, placeholder: '' },
+          formItemAttributes: { label: '鉴定结果', prop: 'isRecyc' }
+        },
+        {
+          name: 'el-input',
+          md: 8,
+          attributes: { disabled: true, type: 'textarea', placeholder: '' },
+          formItemAttributes: { label: '应付货款(元)', prop: 'recycPayAmount' }
+        },
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '',
+            prop: '',
+            'label-width': '0px'
+          },
+          render: (h, { props, onInput }) => {
+            return (
+              <ImageUpload
+                fileList={this.formData?.pgOrderProductDetails.map(item => ({
+                  url: item.fileUrl,
+                  name: item.fileName
+                }))}
+                limit={1000}
+                isEdit={false}
+                viewOnline={false}
+                download={false}
+                showName={true}
+              />
+            )
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: { disabled: true, type: 'textarea', placeholder: '' },
+          formItemAttributes: { label: '备注', prop: 'remark' }
+        }
+      ]
+    },
     completeDetailColumns() {
       return [
         {
@@ -220,20 +465,55 @@ export default {
           }
         }
       ]
+    },
+    shoukuanpingzheng() {
+      return [
+        {
+          name: 'el-input',
+          md: 14,
+          attributes: { disabled: true, placeholder: '' },
+          formItemAttributes: { label: '合计应付货款(元)', prop: 'recycAmount' }
+        },
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '收款凭证',
+            prop: 'purlfile'
+          },
+          render: (h, { props, onInput }) => {
+            return (
+              <ImageUpload
+                fileList={this.orderBaseDetail?.purlfile}
+                limit={1}
+                isEdit={false}
+                viewOnline={false}
+                download={false}
+                showName={true}
+              />
+            )
+          }
+        }
+      ]
     }
   },
   watch: {
     id: {
       handler(newVal, oldVal) {
         if (this.id) {
-          changeOrderGetOrderProduct({
-            id: this.id
+          orderBaseDetail({
+            orderBaseId: this.id
           }).then(res => {
-            this.completeDetailData = res.data.map(item => {
-              return {
-                ...item,
-                status: { WAIT: '待采集', WAIT_SAVE: '待完善', WAIT_OK: '临时采集', OK: '已采集' }[item.status]
-              }
+            this.orderBaseDetail = { ...res.data, purlfile: res.data.purl ? [{ url: res.data.purl }] : [] }
+            changeOrderGetOrderProduct({
+              id: this.id
+            }).then(res => {
+              this.completeDetailData = res.data.map(item => {
+                return {
+                  ...item,
+                  status: { WAIT: '待采集', WAIT_SAVE: '待完善', WAIT_OK: '临时采集', OK: '已采集' }[item.status]
+                }
+              })
             })
           })
         }

+ 26 - 9
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/buttons/processFeedback.vue

@@ -37,6 +37,7 @@ import ImageUpload from '@/components/file-upload'
 import { required } from '@/components/template/rules_verify.js'
 import { orderBaseLogAdd } from '@/api/workOrderPool.js'
 import { serviceCategoryListMinus } from '@/api/recycleCategoryCenter.js'
+import { changeOrderGetOrderProduct } from '@/api/workOrderPool.js'
 export default {
   mixins: [buttonMixin],
   components: {
@@ -159,7 +160,7 @@ export default {
                           columns={[
                             {
                               columnAttributes: {
-                                label: '产品大类',
+                                label: '回收类目',
                                 prop: 'bigName'
                               }
                             },
@@ -350,15 +351,29 @@ export default {
     },
     open() {
       this.formDialog = true
-      this.huishouwangongList = (this.orderInfo?.orderProducts || []).map(item => {
-        return {
-          ...item,
-          isRecyc: true,
-          recycPayAmount: '',
-          completeMachineImg: [],
-          otherImgs: []
-        }
+
+      changeOrderGetOrderProduct({
+        id: this.orderInfo.id
+      }).then(res => {
+        this.huishouwangongList = res.data.map(item => {
+          return {
+            ...item,
+            isRecyc: true,
+            recycPayAmount: '',
+            completeMachineImg: [],
+            otherImgs: []
+          }
+        })
       })
+      // this.huishouwangongList = (this.orderInfo?.orderProducts || []).map(item => {
+      //   return {
+      //     ...item,
+      //     isRecyc: true,
+      //     recycPayAmount: '',
+      //     completeMachineImg: [],
+      //     otherImgs: []
+      //   }
+      // })
     },
     formCancel() {
       this.formDialog = false
@@ -422,6 +437,7 @@ export default {
                         return {
                           type: 'RECYC_MASTER',
                           fileUrl: item2.url,
+                          fileName: '整机图片',
                           orderBaseId: this.orderInfo.id,
                           productDetailId: item.id
                         }
@@ -429,6 +445,7 @@ export default {
                       ...(item.otherImgs || []).map(item2 => {
                         return {
                           type: 'RECYC_OTHER',
+                          fileName: '其他图片',
                           fileUrl: item2.url,
                           orderBaseId: this.orderInfo.id,
                           productDetailId: item.id

+ 29 - 26
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/hs_productColumns.js

@@ -47,7 +47,7 @@ export default {
                       row.estimatePrice = ''
                       row.serviceAmount = ''
                       row.pgOrderProductRecycles = []
-                      this.jisuanjiage(row, index)
+                      this.jisuanjiage()
                     }}
                     placeholder="请选择"
                   >
@@ -93,7 +93,7 @@ export default {
                       row.estimatePrice = ''
                       row.serviceAmount = ''
                       row.pgOrderProductRecycles = []
-                      this.jisuanjiage(row, index)
+                      this.jisuanjiage()
                     }}
                     placeholder="请选择"
                   >
@@ -134,7 +134,7 @@ export default {
                       row.productName = this.serviceCategoryListSpecData.find(
                         item => item.serviceCategoryItemId == val
                       )?.dictName
-                      this.jisuanjiage(row, index)
+                      this.jisuanjiage()
                     }}
                     placeholder="请选择"
                   >
@@ -170,7 +170,7 @@ export default {
                     value={row[column.columnAttributes.prop]}
                     onInput={val => {
                       row[column.columnAttributes.prop] = val
-                      this.jisuanjiage(row, index)
+                      this.jisuanjiage()
                     }}
                     placeholder="请输入内容"
                   ></el-input>
@@ -203,7 +203,7 @@ export default {
                     }}
                     placeholder="请选择"
                     onChange={val => {
-                      this.jisuanjiage(row, index)
+                      this.jisuanjiage()
                     }}
                     multiple={true}
                   >
@@ -422,28 +422,31 @@ export default {
         return false
       }
     },
-    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
-          })
+    jisuanjiage() {
+      for (var index = 0; index < this.orderInfo.orderProducts.length; index++) {
+        var row = this.orderInfo.orderProducts[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: Number(estimatePrice.toFixed(2)),
+          serviceAmount: Number(serviceAmount.toFixed(2))
+        })
       }
-      this.orderInfo.orderProducts.splice(index, 1, {
-        ...row,
-        estimatePrice: Number(estimatePrice.toFixed(2)),
-        serviceAmount: Number(serviceAmount.toFixed(2))
-      })
       this.orderInfo.serviceAmount = Number(
         this.orderInfo.orderProducts
           .map(item => item.serviceAmount || 0)

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

@@ -211,6 +211,13 @@ export default {
             label: '导购员',
             prop: 'serviceId',
             rules: this.formOptions.serviceId.isRules
+          },
+          events: {
+            change: val => {
+              if (val) {
+                this.orderInfo.serviceName = this.memberListServiceData.find(item => item.value == val).label || ''
+              }
+            }
           }
         },
         {