黄梓星 %!s(int64=2) %!d(string=hai) anos
pai
achega
93e88d0ab4

+ 27 - 1
src/views/purchase/DemandSummary/index.vue

@@ -263,11 +263,12 @@
           :data="tableList" 
           fit
           show-summary
+          :summary-method="getSummaries"
           max-height="480"
           @selection-change="handleSelectionChange"
           :key="isUpdate"
         >
-          <el-table-column type="selection" width="55" />
+          <el-table-column type="selection" width="60" />
           <el-table-column label="行状态" align="center" prop="status" width="120px" :formatter="hangStatus"/>
           <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
           <el-table-column label="物料编码" align="center" prop="materialCode" width="180px"/>
@@ -499,6 +500,31 @@ export default {
     this.getList(this.queryParams)
   },
   methods: {
+    // 指定列合计
+    getSummaries(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计';
+          return;
+        }
+        const values = data.map(item => Number(item[column.property]));
+        if (column.property === 'demandNum' || column.property === 'netDemandNum' || column.property === 'artificialAdjust' || column.property === 'suggestBuyQty' || column.property === 'finalBuyQty') {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index];
+
+        }
+      });
+      return sums
+    },
     // 搜索
     search() {
       this.getList(this.queryParams)

+ 16 - 10
src/views/purchase/PurchaseDemandList/add.vue

@@ -219,7 +219,7 @@
           <el-table-column label="预留数量" align="center"  prop="reservedQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.reservedQty"/>
+                <el-input readonly size="small" v-model="scope.row.reservedQty"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -364,7 +364,7 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>
+          <el-table-column label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>yu
           <el-table-column label="默认采购组织编码" align="center"  prop="puOrg" width="200px"/>
           <!-- <el-table-column label="末级供应调拨待入量" align="center"  prop="lastStockQty" width="150px"/> -->
           <!-- <el-table-column label="上级供应中心现存量" align="center"  prop="superiorCenterQty" width="200px"/> -->
@@ -387,8 +387,8 @@
           <el-table-column label="补单供应商编码" align="center"  prop="additionalSupplier" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.additionalSupplier" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
-                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
+                <el-input clearable :disabled="sonDisable || BDZT" size="small" v-model="scope.row.additionalSupplier" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
+                  <el-button size="small" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
@@ -500,6 +500,8 @@ export default {
       // 不能直接改变props传来的值
       sonPageStu: this.pageStu,
       sonDisable: this.disable,
+      // BDZT是补单供应商是否可以编辑条件
+      BDZT: true,
       dialog: {
         config: false
       },
@@ -560,9 +562,15 @@ export default {
     // 更改业务类型调整明细行内补单或紧急标识
     changeBillType() {
       if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
+        this.BDZT = false
         this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
       } else {
-        this.basicForm.puDemandItemList.forEach(item => { item.isReplenishment = 'N' })
+        this.BDZT = true
+        this.basicForm.puDemandItemList.forEach(item => { 
+          item.isReplenishment = 'N' 
+          item.additionalSupplier = null
+          item.additionalSupplierName = null
+        })
       }
       if (this.basicForm.billType == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
         this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'Y'})
@@ -650,8 +658,6 @@ export default {
         status: null,
         businessDept: null,
         businessDeptName: null,
-        customer: this.basicForm.customer,
-        customerName: this.basicForm.customerName,
         materialCategory: null,
         buyer: null,
         buyerName: null,
@@ -717,8 +723,8 @@ export default {
         additionalSupplier: null,
         additionalSupplierName: null,
         periodUnit: null,
-        demandCustomer: null,
-        demandCustomerName: null,
+        demandCustomer: this.basicForm.customer,
+        demandCustomerName: this.basicForm.customerName,
         lastStockOrg: null,
         lastStockOrgName: null,
         superiorStockOrg: null,
@@ -855,7 +861,7 @@ export default {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
       }
       if(this.referConditionMx.title == '选择补单供应商') {
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].id
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].code
         this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
       }
       if(this.referConditionMx.title == '选择收货地址') {

+ 3 - 1
src/views/purchase/transferOrder/add.vue

@@ -158,7 +158,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入仓库">
-              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventory, 'N', 'N')" style="width: 200px">
                 <el-option v-for="item in ruHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -606,6 +606,7 @@ export default {
         deliveryCode: '',
         storageCode: '',
         storageInventoryOrg: '',
+        storageInventory: '',
         storageInventoryOrgName: '',
         businessPersonal: '',
         businessPersonalName: '',
@@ -842,6 +843,7 @@ export default {
       if (this.referCondition.title == '调入库存组织') {
         this.ruOrgOptions = selection
         this.basicForm.storageInventoryOrg = selection[0].id
+        this.basicForm.storageInventory = selection[0].code
         this.basicForm.storageInventoryOrgName = selection[0].name
         this.basicForm.onRouteAffilliation = selection[0].name
         // 选择调入库存组织时判断调拨方式

+ 1 - 0
vue.config.js

@@ -46,6 +46,7 @@ module.exports = {
         // target: `http://172.16.13.47:8000/drp-admin`, //石杨本地
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
+        // target: `http://127.0.0.1:8000/drp-admin`, //
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",