Prechádzať zdrojové kódy

1.明细增加采购需求单号字段,控制复制时清空
2.新增批量提交功能

002390 1 rok pred
rodič
commit
f40836661f

+ 8 - 0
src/views/purchase/purchase-order/add/column.js

@@ -515,6 +515,14 @@ export const TabColumns = [
         disabled:true,
         require:false,
       },
+      { 
+        key: "demandCode",
+        title:"采购需求单号",
+        inputType: "Input", 
+        width: 180,
+        disabled:true,
+        require:false,
+      },
       // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
       // {key: "material",title: "物料",inputType: "Input",   },
       {

+ 14 - 1
src/views/purchase/purchase-order/add/index.vue

@@ -126,6 +126,7 @@ export default {
             if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
               this.params[key].forEach((v) => {
                 v.id = "";
+                v.demandCode = "";
               });
 
             }
@@ -311,7 +312,7 @@ export default {
           }
         ]
 
-      await  relevanceRefer.forEach(async (refer) =>{
+        await relevanceRefer.forEach(async (refer) =>{
 
           try {
 
@@ -333,6 +334,18 @@ export default {
           } catch (error) {}
           
         })
+
+        // 明细不为空的情况下进行询价
+        let detailList = this.params['puOrderItemList'].filter(item => (
+          item.material && item.material != '' 
+        ))
+        // && item.qty && item.qty != ''
+        
+        if(detailList.length){
+
+          this.handleGetPrice();
+
+        }
         
       }
 

+ 1 - 0
src/views/purchase/purchase-order/column.js

@@ -139,6 +139,7 @@ export const TabColumns = [
     tableColumns: [
       { key: "rowNo", title: "行号",width:80, },
       // { key: "orderId", title: "采购订单ID" },
+      { key: "demandCode", title:"采购需求单号"},
       { key: "material", title: "物料ID" },
       { key: "materialName", title: "物料名称",  },
       { key: "materialCode", title: "物料编码",  },

+ 55 - 7
src/views/purchase/purchase-order/index.vue

@@ -216,26 +216,73 @@ export default {
         this.loading = false;
       }
     },
+    // 批量提交
+    handleBatchSubmit(){
+
+      let inconformity = this.checkedList.filter(row => !(row.status == '0' || row.status == '3'));
+
+      console.log(inconformity,'inconformity--------');
+
+      if(!inconformity.length && this.checkedList.length){
+
+        let puOrderIds = this.checkedList.map( item => Number(item.id));
+
+        this.fetchSubmit(puOrderIds);
+      
+      }else{
+        this.$message({
+          message: '当前选中存在不满足提交条件的数据!',
+          type: 'warning'
+        });
+      }
+
+      
+    },
     // 提交
     handleSubmit(row) {
 
-      try {
+      let puOrderIds = [Number(row.id)];
+
+      this.fetchSubmit(puOrderIds);
+
+      // try {
 
-       this.handleConfirmTips(async()=>{
+      //  this.handleConfirmTips(async()=>{
 
-         let { code } = await orderApi.submit({ puOrderId: row.id });
+      //    let { code } = await orderApi.submit({ puOrderId: row.id });
  
-         if (code == 200) {
+      //    if (code == 200) {
  
-          this.handleRefreshList();
+      //     this.handleRefreshList();
  
-         }
+      //    }
+
+      //  })
+      // } catch (error) {
+      // } finally {
+      // }
+    },
+    fetchSubmit(puOrderIds){
+
+      try {
+
+        this.handleConfirmTips(async()=>{
+
+          let { code } = await orderApi.submit({ puOrderIds});
 
-       })
+          if (code == 200) {
+
+          this.handleRefreshList();
+
+          }
+
+        })
       } catch (error) {
       } finally {
       }
+      
     },
+
     // 判断“整单退回”按钮
     judgeIsAllReturn() {
       if (this.checkedList.length == 1) {
@@ -528,6 +575,7 @@ export default {
 
         <el-button-group style="margin-left: 10px">
           <el-button size="mini" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
+          <el-button size="mini" @click="handleBatchSubmit">批量提交</el-button>
         </el-button-group>
 
         <el-button-group style="margin-left: 10px" :key="checkedList.length + 1">

+ 1 - 0
src/views/purchase/purchase-order/purchaseReturn/index.vue

@@ -90,6 +90,7 @@ export default{
     handleDetailSelect(selection, row){
 
     },
+    handleReferChange(){}
 
 
   },