黄梓星 2 سال پیش
والد
کامیت
8b209b051c
1فایلهای تغییر یافته به همراه28 افزوده شده و 1 حذف شده
  1. 28 1
      src/views/purchase/PurchaseDemandList/add.vue

+ 28 - 1
src/views/purchase/PurchaseDemandList/add.vue

@@ -816,7 +816,7 @@ export default {
       }
       if(this.referCondition.type == 'CONTACTS_PARAM') {
         this.personOptions = selection
-        this.basicForm.demandPersonal = selection[0].id
+        this.basicForm.demandPersonal = selection[0].code
       }
       if(this.referCondition.type == 'DEPT_PARAM') {
         this.deptOptions = selection
@@ -829,6 +829,8 @@ export default {
       if(this.referConditionMx.title == '选择收货仓库') {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = selection[0].id
         this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = selection[0].name
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = null
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = null
       }
       if(this.referConditionMx.title == '选择收货货位') {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = selection[0].id
@@ -855,6 +857,31 @@ export default {
     },
     selectMaterial(selection) {
       console.log('选中的物料', selection)
+      // 选择新物料时先清空行内其他信息
+      this.basicForm.puDemandItemList[this.tableIndex].reservedProportion = null
+      this.basicForm.puDemandItemList[this.tableIndex].reservedPeriod = null
+      this.basicForm.puDemandItemList[this.tableIndex].reservedQty = null
+      this.basicForm.puDemandItemList[this.tableIndex].qty = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryDate = null
+      this.basicForm.puDemandItemList[this.tableIndex].remark = null
+      this.basicForm.puDemandItemList[this.tableIndex].resDemandQty = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = null
+      this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = null
+      this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = null
+      this.basicForm.puDemandItemList[this.tableIndex].periodUnit = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = null
+      this.basicForm.puDemandItemList[this.tableIndex].contacts = null
+      this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = null
+      this.basicForm.puDemandItemList[this.tableIndex].address = null
+      this.basicForm.puDemandItemList[this.tableIndex].priceType = null
+      this.basicForm.puDemandItemList[this.tableIndex].lastWarehouseName = null
+      this.basicForm.puDemandItemList[this.tableIndex].lastWarehouse = null
+      this.basicForm.puDemandItemList[this.tableIndex].lastAllocation = null
+      this.basicForm.puDemandItemList[this.tableIndex].lastAllocationName = null
       // 通过选择物料查询采购员
       queryMan(selection[0].id).then(res => {
         if(res.code === 200 && res.rows.length !== 0) {