Browse Source

feat: 销售订单委托收货单增加客户标记字段,优化打印模板显示和合同变更逻辑

yusheng 9 months ago
parent
commit
e4df6eb7d9

+ 3 - 0
src/main.js

@@ -17,6 +17,9 @@ import Vue2OrgTree from 'vue2-org-tree';
 import seekPage from '@/BIZComponents/seekPage';
 import clickOnce from './utils/clickOnce.js';
 import noChinese from './utils/noChinese.js';
+import { VirtualScroller } from 'vue-virtual-scroller';
+import 'vue-virtual-scroller/dist/vue-virtual-scroller.css';
+Vue.component('virtual-scroller', VirtualScroller);
 import { all, create } from 'mathjs'; // 引入mathjs工具并初始化
 // 注册全局自定义指令
 Vue.directive('click-once', clickOnce);

+ 2 - 1
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -1183,7 +1183,8 @@
       changeContract(obj) {
         this.form = Object.assign({}, this.form, {
           contractId: obj.id,
-          contractName: obj.contractName
+          contractName: obj.contractName,
+          relationType:3
         });
         this.getDetailData(obj.id);
         this.$store.commit('order/setContractId', obj.id);

+ 19 - 5
src/views/saleManage/saleOrder/entrustedReceive/components/addOrEditDialog.vue

@@ -104,6 +104,7 @@
       :pricingWay="form.pricingWay"
       ref="inventoryTableref"
       :orderId="form.orderId"
+      :customerMark="this.customerMark"
     ></inventoryTable>
 
     <div slot="footer" class="footer">
@@ -152,7 +153,7 @@
   // import fileMain from '@/components/addDoc/index.vue';
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import { getCode } from '@/api/login/index';
-
+  import { contactDetail } from '@/api/saleManage/contact';
   export default {
     props: {
       addOrEditDialogFlag: Boolean
@@ -207,7 +208,7 @@
             { required: true, message: '请输入', trigger: 'change' }
           ]
         },
-
+        customerMark: '',
         // 提交状态
         loading: false,
         // 是否是修改
@@ -257,10 +258,18 @@
       changeOrder(obj) {
         this.getOrderDetail(obj.id);
       },
+      async getContactDetail(id) {
+        if (id) {
+          const { base } = await contactDetail(id);
+          this.customerMark = base.serialNo;
+        }
+      },
+
       //获取订单详情
       async getOrderDetail(id) {
         this.loading = true;
         let data = await getSaleOrderDetail(id);
+        this.getContactDetail(data.partaId);
 
         this.loading = false;
         if (data) {
@@ -276,9 +285,9 @@
               pricingWay
             } = data;
             if (productList && productList.length > 0) {
-              productList.forEach(async(v) => {
+              productList.forEach(async (v) => {
                 v.orderTotalCount = v.orderTotalCount || v.totalCount;
-                v.batchNo = await getCode('lot_number_code')
+                v.batchNo = await getCode('lot_number_code');
               });
             }
             this.form = Object.assign({}, this.form, {
@@ -304,6 +313,8 @@
 
         this.loading = true;
         let data = await getPSaleEntrustedReceiveDetailAPI(id);
+        this.getContactDetail(data.contactId);
+
         this.loading = false;
         if (data) {
           this.$nextTick(() => {
@@ -325,7 +336,10 @@
             list.find((key) => key.productCode == item.productCode) || {};
           item.receiveTotalCount = find.receiveTotalCount || 0;
           item.orderTotalCount = item.totalCount || 0;
-          item.totalCount = item.orderTotalCount - item.receiveTotalCount>=0?item.orderTotalCount - item.receiveTotalCount:0;
+          item.totalCount =
+            item.orderTotalCount - item.receiveTotalCount >= 0
+              ? item.orderTotalCount - item.receiveTotalCount
+              : 0;
         });
         return data;
       },

+ 14 - 1
src/views/saleManage/saleOrder/entrustedReceive/components/inventoryTable.vue

@@ -121,6 +121,15 @@
           ></el-input>
         </el-form-item>
       </template>
+      <template v-slot:customerMark="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.customerMark'"
+        >
+          <el-input v-model="scope.row.customerMark"></el-input>
+        </el-form-item>
+      </template>
+
       <template v-slot:warehouseId="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -184,6 +193,7 @@
           </DictSelection>
         </el-form-item>
       </template>
+
       <template v-slot:colorKey="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.' + 'colorKey'">
           <DictSelection
@@ -262,7 +272,8 @@
         type: Boolean,
         default: true
       },
-      pricingWay: [Number, String]
+      pricingWay: [Number, String],
+      customerMark:''
     },
     components: {
       warehouseAll,
@@ -797,6 +808,8 @@
           this.$set(parasm, 'pricingWay', 1);
           this.$set(parasm, 'goodsLevel', item.goodsLevel);
           this.$set(parasm, 'batchNo', await getCode('lot_number_code'));
+          this.$set(parasm, 'customerMark', this.customerMark);
+          
           if (item.modelKey) {
             this.$set(parasm, 'modelKey', item.modelKey.split(','));
           }

+ 7 - 4
src/views/saleManage/saleOrder/invoice/components/print-template-bs.vue

@@ -78,6 +78,7 @@
 
           联系电话:{{ formData.linkPhone }}
         </span>
+        <span> 车牌号:{{ formData.carNo }} </span>
       </div>
       <table
         cellspacing="0"
@@ -92,10 +93,10 @@
       >
         <tbody>
           <tr align="center">
-            <td style="padding: 5px"> 序号 </td>
-            <td style="padding: 5px"> 型号 </td>
+            <td style="padding: 5px; width: 35px"> 序号 </td>
+            <td style="padding: 5px"> 编码 </td>
             <td style="padding: 5px"> 零件名 </td>
-            <td style="padding: 5px"> 单位</td>
+            <td style="padding: 5px; width: 50px"> 单位</td>
             <td style="padding: 5px"> 送货数量</td>
             <td style="padding: 5px"> 验收数量</td>
             <td style="padding: 5px"> 备注</td>
@@ -106,7 +107,7 @@
           <tr align="center" v-for="(item, index) in formData.productList">
             <td style="padding: 5px"> {{ index + 1 }} </td>
             <td style="padding: 5px">
-              {{ item.modelType }}
+              {{ item.productCode }}
             </td>
             <td style="padding: 5px"> {{ item.productName }} </td>
             <td style="padding: 5px"> {{ item.measuringUnit }}</td>
@@ -134,6 +135,8 @@
           <div>送货人:</div>
         </div>
         <div style="flex: 1"> 收货人: </div>
+        <div style="flex: 1"> 托盘:{{   formData.trayNum }} </div>
+      
       </div>
     </div>