Browse Source

fix: 调拨单

zh 2 years ago
parent
commit
ab96167729
1 changed files with 226 additions and 20 deletions
  1. 226 20
      src/views/supply/transferOrder/transferOrderForm.vue

+ 226 - 20
src/views/supply/transferOrder/transferOrderForm.vue

@@ -3,6 +3,21 @@
     <zj-form-container ref="formRef" :form-data="formData" :form-rules="formRules">
     <zj-form-container ref="formRef" :form-data="formData" :form-rules="formRules">
       <zj-form-module title="调拨单" :form-data="formData" :form-items="formItems" label-width="100px" :column="3" />
       <zj-form-module title="调拨单" :form-data="formData" :form-items="formItems" label-width="100px" :column="3" />
       <zj-form-module title="调拨单明细" :form-items="detailData" label-width="0" :column="3" />
       <zj-form-module title="调拨单明细" :form-items="detailData" label-width="0" :column="3" />
+      <zj-form-module
+        v-if="moduleType === 2"
+        title="物流费用"
+        :form-items="formLogisticsData"
+        label-width="0"
+        :column="3"
+      />
+      <zj-form-module
+        v-if="moduleType === 3"
+        title="审核信息"
+        :form-data="formData"
+        :form-items="formExamine"
+        label-width="100px"
+        :column="3"
+      />
     </zj-form-container>
     </zj-form-container>
     <el-dialog title="添加产品" :visible.sync="visible" width="60%" :append-to-body="true" @close="visible = false">
     <el-dialog title="添加产品" :visible.sync="visible" width="60%" :append-to-body="true" @close="visible = false">
       <div style="height: 600px">
       <div style="height: 600px">
@@ -41,6 +56,8 @@
 <script>
 <script>
 import TemplatePage from '@/components/template/template-page-1.vue'
 import TemplatePage from '@/components/template/template-page-1.vue'
 import { getcustomerFrontList } from '@/api/stock'
 import { getcustomerFrontList } from '@/api/stock'
+import { getListCostBillV2 } from '@/api/logisticsBill'
+
 import { getStagecustomerListV2, getDealerListV2 } from '@/api/basic_data/dealer'
 import { getStagecustomerListV2, getDealerListV2 } from '@/api/basic_data/dealer'
 import {
 import {
   addCustomerTransfer,
   addCustomerTransfer,
@@ -82,6 +99,13 @@ export default {
         'selection-change': this.selectionChange
         'selection-change': this.selectionChange
       },
       },
       itemTableEvents: { 'selection-change': this.itemSelectionChange },
       itemTableEvents: { 'selection-change': this.itemSelectionChange },
+      defaultTableAttributes: {
+        border: true,
+        headerCellClassName: 'headerRowColor',
+        size: 'mini',
+        'summary-method': this.$getSummaries,
+        'show-summary': true
+      },
       recordSelected: [],
       recordSelected: [],
       formData: {
       formData: {
         customerNumber: '',
         customerNumber: '',
@@ -113,7 +137,8 @@ export default {
       authList: [],
       authList: [],
       selectData: [],
       selectData: [],
       itemRecordSelected: [],
       itemRecordSelected: [],
-      sonCustomerList: []
+      sonCustomerList: [],
+      logisticsData: []
     }
     }
   },
   },
   computed: {
   computed: {
@@ -189,12 +214,34 @@ export default {
         },
         },
         {
         {
           name: 'el-input',
           name: 'el-input',
-          md: 12,
+          md: 24,
           attributes: { type: 'textarea', style: { width: '100%' }, disabled: this.comDisabled, placeholder: '请输入' },
           attributes: { type: 'textarea', style: { width: '100%' }, disabled: this.comDisabled, placeholder: '请输入' },
           formItemAttributes: { label: '备注', prop: 'notes' }
           formItemAttributes: { label: '备注', prop: 'notes' }
         }
         }
       ]
       ]
     },
     },
+    formExamine() {
+      return [
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true },
+          formItemAttributes: { label: '审核人', prop: 'approvalName' }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true },
+          formItemAttributes: { label: '审核时间', prop: 'approvalTime' }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: { type: 'textarea', style: { width: '100%' }, placeholder: '请输入' },
+          formItemAttributes: { label: '备注', prop: 'approvalRemark' }
+        }
+      ]
+    },
     columns() {
     columns() {
       return [
       return [
         {
         {
@@ -273,15 +320,19 @@ export default {
           },
           },
           render: (h, { column, row, index }) => {
           render: (h, { column, row, index }) => {
             return (
             return (
-              <el-button
-                type="text"
-                size="default"
-                onClick={() => {
-                  this.handleDel(index)
-                }}
-              >
-                删除
-              </el-button>
+              <div>
+                {!this.comDisabled ? (
+                  <el-button
+                    type="text"
+                    size="default"
+                    onClick={() => {
+                      this.handleDel(index)
+                    }}
+                  >
+                    删除
+                  </el-button>
+                ) : null}
+              </div>
             )
             )
           }
           }
         }
         }
@@ -336,6 +387,135 @@ export default {
           }
           }
         }
         }
       ]
       ]
+    },
+    formLogistics() {
+      return [
+        {
+          columnAttributes: {
+            label: '序号',
+            prop: 'materialName',
+            type: 'index'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '结算状态',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '调拨单号',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '嘉贤单据号',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '存货编码',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料代码',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品名称',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格型号',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '单价',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '数量',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物流费用',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '仓储费用',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '合计费用',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '对账人',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '对账日期',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '结算人',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '结算日期',
+            prop: 'materialName'
+          }
+        }
+      ]
+    },
+    formLogisticsData() {
+      return [
+        {
+          name: 'slot-component',
+          md: 24,
+          attributes: { disabled: false },
+          formItemAttributes: { label: '', prop: '' },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <zj-table
+                tableAttributes={{ ...this.defaultTableAttributes }}
+                isDrop={true}
+                columns={this.formLogistics}
+                tableData={this.logisticsData}
+                tableEvents={this.itemTableEvents}
+              ></zj-table>
+            )
+          }
+        }
+      ]
     }
     }
   },
   },
   mounted() {
   mounted() {
@@ -345,11 +525,32 @@ export default {
         this.formData = res.data
         this.formData = res.data
         this.selectData = res.data.orders.map(k => {
         this.selectData = res.data.orders.map(k => {
           k.disabledId = k.customerStockId
           k.disabledId = k.customerStockId
+          k.stockName = '嘉贤前置仓'
+
           return k
           return k
         })
         })
         delete this.formData.orders
         delete this.formData.orders
       })
       })
     }
     }
+    if (this.detailsId && this.moduleType === 2) {
+      getListCostBillV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          {
+            param: 'order_code',
+            compare: '=',
+            value: this.detailsId
+          }
+        ]
+      }).then(res => {
+        res.data.records.forEach(item => {
+          item.sums1 = ['orderHasSendQty', 'subsidyCoefficient', 'unloadUpstairsCoefficient', 'coefficient']
+          item.sums2 = ['cost', 'unitPrice', 'totalCost', 'allowanceCost']
+        })
+        this.logisticsData = res.data.records
+      })
+    }
   },
   },
   methods: {
   methods: {
     // 列表请求函数
     // 列表请求函数
@@ -427,10 +628,12 @@ export default {
     },
     },
     handleAllDel() {
     handleAllDel() {
       if (this.itemRecordSelected.length) {
       if (this.itemRecordSelected.length) {
-        for (let i = 0; i < this.$refs.pageRef.$children[0].tableData.length; i++) {
-          for (let j = 0; j < this.itemRecordSelected.length; j++) {
-            if (this.$refs.pageRef.$children[0].tableData[i].id === this.itemRecordSelected[j].disabledId) {
-              this.$set(this.$refs.pageRef.$children[0].tableData[i], 'disabledId', null)
+        if (this.$refs.pageRef) {
+          for (let i = 0; i < this.$refs.pageRef.$children[0].tableData.length; i++) {
+            for (let j = 0; j < this.itemRecordSelected.length; j++) {
+              if (this.$refs.pageRef.$children[0].tableData[i].id === this.itemRecordSelected[j].disabledId) {
+                this.$set(this.$refs.pageRef.$children[0].tableData[i], 'disabledId', null)
+              }
             }
             }
           }
           }
         }
         }
@@ -447,9 +650,11 @@ export default {
       }
       }
     },
     },
     handleDel(index) {
     handleDel(index) {
-      for (let i = 0; i < this.$refs.pageRef.$children[0].tableData.length; i++) {
-        if (this.$refs.pageRef.$children[0].tableData[i].id === this.selectData[index].disabledId) {
-          this.$set(this.$refs.pageRef.$children[0].tableData[i], 'disabledId', null)
+      if (this.$refs.pageRef) {
+        for (let i = 0; i < this.$refs.pageRef.$children[0].tableData.length; i++) {
+          if (this.$refs.pageRef.$children[0].tableData[i].id === this.selectData[index].disabledId) {
+            this.$set(this.$refs.pageRef.$children[0].tableData[i], 'disabledId', null)
+          }
         }
         }
       }
       }
       this.selectData.splice(index, 1)
       this.selectData.splice(index, 1)
@@ -457,7 +662,8 @@ export default {
     },
     },
     handleClearSelection() {
     handleClearSelection() {
       this.recordSelected = []
       this.recordSelected = []
-      this.$refs.pageRef.$children[0].$children[0].$children[2].$children[0].$children[0].clearSelection()
+      this.$refs.pageRef &&
+        this.$refs.pageRef.$children[0].$children[0].$children[2].$children[0].$children[0].clearSelection()
     },
     },
     handlerefreshList() {
     handlerefreshList() {
       this.$emit('refresh')
       this.$emit('refresh')
@@ -507,7 +713,7 @@ export default {
       })
       })
     },
     },
     onInvoice(type) {
     onInvoice(type) {
-      examineCustomerTransfer({
+      invoiceCustomerTransfer({
         id: this.detailsId,
         id: this.detailsId,
         status: type
         status: type
       }).then(res => {
       }).then(res => {