黄梓星 1 rok pred
rodič
commit
3b246625f4
1 zmenil súbory, kde vykonal 154 pridanie a 151 odobranie
  1. 154 151
      src/views/purchase/PurchaseDemandList/add.vue

+ 154 - 151
src/views/purchase/PurchaseDemandList/add.vue

@@ -280,6 +280,7 @@
           <el-table-column show-overflow-tooltip label="集团预测分类" align="center"  prop="forecastClassify" width="120px"/>
           <el-table-column show-overflow-tooltip label="近一月需求" align="center"  prop="onemonthAvgVolume" width="120px"/>
           <el-table-column show-overflow-tooltip label="近三月需求" align="center"  prop="threemonthAvgVolume" width="120px"/>
+          <el-table-column show-overflow-tooltip label="采购在途" align="center"  prop="puFreight" width="120px"/>
           <el-table-column show-overflow-tooltip label="交货日期" align="center"  prop="deliveryDate" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'deliveryDate'" :rules="{ required: true, message: '请填写交货日期', trigger: 'blur' }">
@@ -764,6 +765,7 @@ export default {
         item.forecastClassify = ''
         item.onemonthAvgVolume = ''
         item.threemonthAvgVolume = ''
+        item.puFreight = ''
         item.superiorAllotQty = ''
         item.resDemandQty = ''
         item.executeQty = ''
@@ -907,6 +909,7 @@ export default {
         forecastClassify: null,
         onemonthAvgVolume: null,
         threemonthAvgVolume: null,
+        puFreight: null,
         deliveryDate: null,
         isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
         isReplenishment: this.basicForm.billType == 'BDXQ'? 'Y': 'N',
@@ -1105,6 +1108,7 @@ export default {
             item.forecastClassify = ''
             item.onemonthAvgVolume = ''
             item.threemonthAvgVolume = ''
+            item.puFreight = ''
             item.superiorAllotQty = ''
             item.resDemandQty = ''
             item.executeQty = ''
@@ -1196,160 +1200,158 @@ export default {
       })
       console.log('复制的数组',rows);
       console.log('列表的数组',this.basicForm.puDemandItemList)
-      let linArr = []
-      // for (let i = 0; i<rows.length; i++) {
-        // console.log('items',rows[i])
+      if (rows.length < 1000) {
         await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
-          // if (res.code === 200) {
-          //   let line = {
-          //     contacts: null,
-          //     id: null,
-          //     demandId: null,
-          //     status: null,
-          //     businessDept: null,
-          //     businessDeptName: null,
-          //     materialCategory: null,
-          //     buyer: null,
-          //     buyerName: null,
-          //     mateiralClassifyOne: null,
-          //     materialClassifyOneName: null,
-          //     materialClassifyTwo: null,
-          //     materialClassifyTwoName: null,
-          //     materialClassifyThree: null,
-          //     materialClassifyThreeName: null,
-          //     materialClassifyFour: null,
-          //     materialClassifyFourName: null,
-          //     materialCode: null,
-          //     material: null,
-          //     materialName: null,
-          //     classifyId: null,
-          //     specification: null,
-          //     unit: null,
-          //     unitName: null,
-          //     manufacturerName: null,
-          //     registrant: null,
-          //     puPeriod: null,
-          //     expiryUnit: null,
-          //     expiry: null,
-          //     minPackage: null,
-          //     minOrderQty: null,
-          //     minBatch: null,
-          //     safeStock: null,
-          //     averageQtyMonth: null,
-          //     qty: null,
-          //     adjustmentPersonal: null,
-          //     adjustmentTime: null,
-          //     manualRegulation: null,
-          //     updateCause: null,
-          //     reservedProportion: null,
-          //     reservedPeriod: null,
-          //     reservedQty: null,
-          //     demandPeriod: null,
-          //     forecastClassify: null,
-          //     onemonthAvgVolume: null,
-          //     threemonthAvgVolume: null,
-          //     deliveryDate: null,
-          //     isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
-          //     isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
-          //     isBatchLock: 'N',
-          //     remark: null,
-          //     puRemark: null,
-          //     lastWarehouseQty: null,
-          //     resDemandQty: null,
-          //     lastWarehouse: null,
-          //     lastWarehouseName: null,
-          //     deliveryWarehouse: null,
-          //     deliveryWarehouseName: null,
-          //     lastAllocation: null,
-          //     lastAllocationName: null,
-          //     deliveryAllocation: null,
-          //     deliveryAllocationName: null,
-          //     passageOn: null,
-          //     puOrg: null,
-          //     purOrgName: null,
-          //     lastStockQty: null,
-          //     superiorCenterQty: null,
-          //     superiorAllotQty: null,
-          //     availableQty: null,
-          //     statusAllot: 'N',
-          //     additionalSupplier: null,
-          //     additionalSupplierName: null,
-          //     periodUnit: null,
-          //     demandCustomer: this.basicForm.customer,
-          //     demandCustomerName: this.basicForm.customerName,
-          //     businessDept: this.basicForm.demandDept,
-          //     businessDeptName: null,
-          //     lastStockOrg: null,
-          //     lastStockOrgName: null,
-          //     superiorStockOrg: null,
-          //     superiorStockOrgName: null,
-          //     allotCode: null,
-          //     deliveryAddress: null,
-          //     deliveryAddressName: null,
-          //     contacts: null,
-          //     contactsPhone: null,
-          //     address: null,
-          //     source: null,
-          //     priceType: 'order',
-          //     puManagerApprover: null,
-          //     puManagerApproverName: null,
-          //     processTime: null,
-          //     affirmer: null,
-          //     tenantId: null,
-          //     revision: null,
-          //     createBy: null,
-          //     createByName: null,
-          //     createTime: null,
-          //     updateBy: null,
-          //     updateByName: null,
-          //     updateTime: null,
-          //     delFlag: 0,
-          //     // 新增字段
-          //     model: null,
-          //     storageCondition: null,
-          //     transportationCondition: null,
-          //   }
-          //   line.businessDept = res.rows[0].businessDepartment
-          //   line.businessDeptName = res.rows[0].businessDepartmentName
-          //   line.materialCode = res.rows[0].code
-          //   line.material = res.rows[0].id
-          //   line.materialName = res.rows[0].name
-          //   line.classifyId = res.rows[0].classifyId
-          //   line.materialClassifyOneName = res.rows[0].oneClass
-          //   line.materialClassifyTwoName = res.rows[0].twoClass
-          //   line.materialClassifyThreeName = res.rows[0].threeClass
-          //   line.materialClassifyFourName = res.rows[0].fourClass
-          //   line.specification = res.rows[0].specification
-          //   line.model = res.rows[0].model
-          //   line.unit = res.rows[0].unitId
-          //   line.unitName = res.rows[0].unitIdName
-          //   line.registrant = res.rows[0].registrant
-          //   line.manufacturerName = res.rows[0].manufacturerIdName
-          //   line.puPeriod = res.rows[0].deliveryPeriod
-          //   line.expiry = res.rows[0].usefulLife
-          //   line.expiryUnit = res.rows[0].expiryUnitIdName
-          //   // line.minPackage = res.rows[0].usefulLife
-          //   line.minPackage = res.rows[0].minPackQty
-          //   line.minOrderQty = res.rows[0].minOrderQty
-          //   line.minBatch = res.rows[0].minBatchQty
-          //   line.safeStock = res.rows[0].safeStock
-          //   line.purOrgName = res.rows[0].purchasingOrganizationName
-          //   line.puOrg = res.rows[0].purchasingOrganization
-          //   // 物料存储条件和运输条件
-          //   line.transportationCondition = res.rows[0].transportationCondition
-          //   line.storageCondition = res.rows[0].storageCondition
-          //   linArr[i] = line
-          // }
+          if (res.code === 200) {
+            let rowList = res.rows
+            for (let i = 0; i<rowList.length; i++) {
+            let line = {
+              contacts: null,
+              id: null,
+              demandId: null,
+              status: null,
+              businessDept: null,
+              businessDeptName: null,
+              materialCategory: null,
+              buyer: null,
+              buyerName: null,
+              mateiralClassifyOne: null,
+              materialClassifyOneName: null,
+              materialClassifyTwo: null,
+              materialClassifyTwoName: null,
+              materialClassifyThree: null,
+              materialClassifyThreeName: null,
+              materialClassifyFour: null,
+              materialClassifyFourName: null,
+              materialCode: null,
+              material: null,
+              materialName: null,
+              classifyId: null,
+              specification: null,
+              unit: null,
+              unitName: null,
+              manufacturerName: null,
+              registrant: null,
+              puPeriod: null,
+              expiryUnit: null,
+              expiry: null,
+              minPackage: null,
+              minOrderQty: null,
+              minBatch: null,
+              safeStock: null,
+              averageQtyMonth: null,
+              qty: null,
+              adjustmentPersonal: null,
+              adjustmentTime: null,
+              manualRegulation: null,
+              updateCause: null,
+              reservedProportion: null,
+              reservedPeriod: null,
+              reservedQty: null,
+              demandPeriod: null,
+              forecastClassify: null,
+              onemonthAvgVolume: null,
+              threemonthAvgVolume: null,
+              puFreight: null,
+              deliveryDate: null,
+              isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
+              isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
+              isBatchLock: 'N',
+              remark: null,
+              puRemark: null,
+              lastWarehouseQty: null,
+              resDemandQty: null,
+              lastWarehouse: null,
+              lastWarehouseName: null,
+              deliveryWarehouse: null,
+              deliveryWarehouseName: null,
+              lastAllocation: null,
+              lastAllocationName: null,
+              deliveryAllocation: null,
+              deliveryAllocationName: null,
+              passageOn: null,
+              puOrg: null,
+              purOrgName: null,
+              lastStockQty: null,
+              superiorCenterQty: null,
+              superiorAllotQty: null,
+              availableQty: null,
+              statusAllot: 'N',
+              additionalSupplier: null,
+              additionalSupplierName: null,
+              periodUnit: null,
+              demandCustomer: this.basicForm.customer,
+              demandCustomerName: this.basicForm.customerName,
+              businessDept: this.basicForm.demandDept,
+              businessDeptName: null,
+              lastStockOrg: null,
+              lastStockOrgName: null,
+              superiorStockOrg: null,
+              superiorStockOrgName: null,
+              allotCode: null,
+              deliveryAddress: null,
+              deliveryAddressName: null,
+              contacts: null,
+              contactsPhone: null,
+              address: null,
+              source: null,
+              priceType: 'order',
+              puManagerApprover: null,
+              puManagerApproverName: null,
+              processTime: null,
+              affirmer: null,
+              tenantId: null,
+              revision: null,
+              createBy: null,
+              createByName: null,
+              createTime: null,
+              updateBy: null,
+              updateByName: null,
+              updateTime: null,
+              delFlag: 0,
+              // 新增字段
+              model: null,
+              storageCondition: null,
+              transportationCondition: null,
+            }
+              line.businessDept = rowList[i].businessDepartment
+              line.businessDeptName = rowList[i].businessDepartmentName
+              line.materialCode = rowList[i].code
+              line.material = rowList[i].id
+              line.materialName = rowList[i].name
+              line.classifyId = rowList[i].classifyId
+              line.materialClassifyOneName = rowList[i].oneClass
+              line.materialClassifyTwoName = rowList[i].twoClass
+              line.materialClassifyThreeName = rowList[i].threeClass
+              line.materialClassifyFourName = rowList[i].fourClass
+              line.specification = rowList[i].specification
+              line.model = rowList[i].model
+              line.unit = rowList[i].unitId
+              line.unitName = rowList[i].unitIdName
+              line.registrant = rowList[i].registrant
+              line.manufacturerName = rowList[i].manufacturerIdName
+              line.puPeriod = rowList[i].deliveryPeriod
+              line.expiry = rowList[i].usefulLife
+              line.expiryUnit = rowList[i].expiryUnitIdName
+              // line.minPackage = rowList[i].usefulLife
+              line.minPackage = rowList[i].minPackQty
+              line.minOrderQty = rowList[i].minOrderQty
+              line.minBatch = rowList[i].minBatchQty
+              line.safeStock = rowList[i].safeStock
+              line.purOrgName = rowList[i].purchasingOrganizationName
+              line.puOrg = rowList[i].purchasingOrganization
+              // 物料存储条件和运输条件
+              line.transportationCondition = rowList[i].transportationCondition
+              line.storageCondition = rowList[i].storageCondition
+              this.basicForm.puDemandItemList.push(line)
+              // console.log('临时数组', line)
+            }
+          }
         })
-        console.log('临时数组', linArr)
-      // }
-      this.basicForm.puDemandItemList.push(...linArr)
       console.log('列表', this.basicForm.puDemandItemList)
-      // this.basicForm.puDemandItemList.forEach(e => {
-      //   rows.forEach(d => {
-      //     e.materialCode = d
-      //   })
-      // })
+      } else {
+        this.$modal.msgWarning("复制长度不能超过1000!");
+      }
     },
     // 明细行选择物料编码带出数据
     chooseMaterial(index) {
@@ -1496,6 +1498,7 @@ export default {
           item.forecastClassify = ''
           item.onemonthAvgVolume = ''
           item.threemonthAvgVolume = ''
+          item.puFreight = ''
           item.superiorAllotQty = ''
           item.resDemandQty = ''
           item.executeQty = ''