瀏覽代碼

1.供应商业务联系人值显示问题
2.编辑点击增行更新,将必填项未填写抛出
3.折扣金额更新

002390 2 年之前
父節點
當前提交
44767a9de8

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

@@ -555,6 +555,13 @@ export const TabColumns = [
         queryParams: () => ({}),
         width: 180,
       },
+      {
+        key: "priceType",
+        title: "价格类型",
+        inputType: "Select",
+        referName: "sys_price_type", // 字典名
+        width: 180,
+      },
       { 
         key: "taxPrice", 
         title: "含税单价", 
@@ -570,7 +577,7 @@ export const TabColumns = [
         inputType: "Input",
         disabled:true,
       },
-      { key: "taxDeductMoneya", title: "折扣金额", inputType: "Input", },
+      { key: "taxDeductMoneya", title: "折扣金额", inputType: "Input",disabled:true, },
       { key: "arrivalQty", title: "已到货数量", inputType: "Input", },
       { key: "unarrivedQty", title: "未到货数量", inputType: "Input", },
       { 
@@ -684,13 +691,7 @@ export const TabColumns = [
       { key: "sourceId", title: "上游单据ID", inputType: "Input", width: 180 },
       { key: "demandCode", title: "采购需求单号", inputType: "Input", width: 180 },
       { key: "arrivalDatePlan", title: "计划到货日期", inputType: "Input", width: 180 },
-      {
-        key: "priceType",
-        title: "价格类型",
-        inputType: "Select",
-        referName: "sys_price_type", // 字典名
-        width: 180,
-      },
+     
       { key: "isDistributionPrice", title: "配送价", inputType: "Input", },
      
       { //threeClass

+ 24 - 10
src/views/purchase/purchase-order/add/index.vue

@@ -244,6 +244,7 @@ export default {
          console.log(isPrice,'isPrice');
           cb();
         } else {
+          this.$message.error('存在必填项未填写');
           console.log('error submit!!');
           return false;
         }
@@ -292,7 +293,8 @@ export default {
       })
     },
     // 主表参照改变之后
-    handleReferChange(val, source, type){
+   async handleReferChange(val, source, type){
+     console.log(val,'val-------------------');
       // 供应商选择  
       if( type === 'SUPPLIER_PARAM' ){
 
@@ -304,7 +306,7 @@ export default {
             key:'supplierContacts',
             params:{
               type:'SUPPLIERCONTACTS_PARAM',
-              supplierId:val.supplier,
+              supplierId:val.id,
             }
           },
           {
@@ -312,13 +314,13 @@ export default {
             key:'supplierPersonal',
             params:{
               type:'PSNLICENSE_PARAM',
-              supplierId:val.supplier,
+              supplierId:val.id,
               pkOrg: source.puOrg,
             }
           }
         ]
 
-        relevanceRefer.forEach(async (refer) =>{
+      await  relevanceRefer.forEach(async (refer) =>{
 
           try {
 
@@ -357,20 +359,27 @@ export default {
 
 
     // 子表参照改变之后
-    handleTabReferChange(val, source, type) {
+   async handleTabReferChange(val, source, type) {
 
       // 触发物料参照询价
       if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
-        this.handleGetPrice();
+
+        source['whetherCompleteInquiry'] = false;
+
+        await this.handleGetPrice();
+
       }
 
     },
 
     // 子表下拉框改变
-    handleTabSelectChange(type,row){
-
+    async handleTabSelectChange(type,row){
+     
       if(type == 'priceType' && row.material && row.qty && row.qty != ""){
-        this.handleGetPrice();
+
+        row['whetherCompleteInquiry'] = false;
+
+        await this.handleGetPrice();
       }
     },
 
@@ -378,7 +387,11 @@ export default {
     handleInputChange(row, type) {
       // 物料数量变化----询价
       if (type == "qty" && row.material) {
+
+        row['whetherCompleteInquiry'] = false;
+
         this.handleGetPrice();
+
       }
     },
 
@@ -661,12 +674,13 @@ export default {
                     <el-select
                       v-if="cColumn.inputType === 'Select'"
                       v-model="scope.row[cColumn.key]"
+                      
                       size="mini"
                       :disabled="cColumn.disabled"
                       :clearable="cColumn.clearable"
                       :placeholder="cColumn.placeholder"
                       style="width: 100%"
-                      @change="handleTabSelectChange(cColumn,scope.row)"
+                      @change="handleTabSelectChange(cColumn.key,scope.row)"
                     >
                       <el-option
                         v-for="item in dict.type[cColumn.referName]"

+ 20 - 3
src/views/purchase/purchase-order/edit/index.vue

@@ -131,6 +131,7 @@ export default {
             }
           // 是否完成询价,新增明细行需默认明细为false
           rowData['whetherCompleteInquiry'] = false;
+          rowData['delFlag'] = '0';
 
           this.params[key].push(rowData);
         }
@@ -146,8 +147,11 @@ export default {
       // prop.splice(index, 1);
       for (const key in this.params) {
 
-        if (Array.isArray(this.params[key])) {
-          this.params[key].splice(index, 1);
+        // if (Array.isArray(this.params[key])) {
+        if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
+
+          this.params[key][index].id ? (this.params[key][index]['delFlag'] = '2') :this.params[key].splice(index, 1);
+
         }
       }
     },
@@ -184,6 +188,7 @@ export default {
           cb();
 
         } else {
+          this.$message.error('存在必填项未填写');
           console.log('error submit!!');
           return false;
         }
@@ -191,6 +196,7 @@ export default {
     },
     // 保存
      handleSava() {
+      console.log(this.params,'this.params---------');
       this.judgeSaveCondition(async()=>{
         try {
             this.loading = true;
@@ -215,6 +221,8 @@ export default {
       // 触发物料参照
       if (type == 'MATERIAL_PARAM' && source.qty && source.qty != '') {
 
+        source['whetherCompleteInquiry'] = false;
+
         this.handleGetPrice();
       }
 
@@ -239,15 +247,24 @@ export default {
      handleTabSelectChange(type,row){
 
       if(type == 'priceType' && row.material && row.qty && row.qty != ""){
+
+        row['whetherCompleteInquiry'] = false;
+
         this.handleGetPrice();
+
       }
     },
     // 子表inputNumber
     handleInputChange(row, type) {
       // 物料数量变化----询价
       if (type == 'qty' && row.material) {
+
+        row['whetherCompleteInquiry'] = false;
+
         this.handleGetPrice();
+
       }
+
     },
     // 子表多选框改变
     handleTabCheckbox(type,source){
@@ -438,7 +455,7 @@ export default {
             :label="column.title" 
             :name="column.key"
             >
-            <el-table :data="params[column.key]" style="width: 100%">
+            <el-table :data="params[column.key].filter(item => item.delFlag === '0')" style="width: 100%">
               <el-table-column label="序号">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}

+ 2 - 1
src/views/purchase/purchase-order/edit/initColumn.js

@@ -6,7 +6,8 @@ import deepCopy from "@gby/deep-copy";
 
 export const editColumns = initColumns(Columns);
 
-export const editTabColumns = TabColumns.map((element) => ({
+export const editTabColumns = TabColumns.map((element) => 
+({
   ...element,
   tableColumns: initColumns(element.tableColumns),
 }));