瀏覽代碼

Merge remote-tracking branch 'origin/dev' into dev

001295 1 年之前
父節點
當前提交
c8e61f7411

+ 3 - 2
src/views/purchase/purchase-order/add/column.js

@@ -203,7 +203,7 @@ export const Columns = [
     referName: "WAREHOUSE_PARAM",
     dataMapping: {
       warehouse: 'id',
-      warehouseName: 'name'
+      warehouseName: 'name',
     },
     queryParams: (params) => ({
       pkOrg: params.puOrg,
@@ -220,7 +220,8 @@ export const Columns = [
     referName: "ALLOCATION_PARAM",
     dataMapping: {
       goodsAllocation: 'id',
-      goodsAllocationName: 'name'
+      goodsAllocationName: 'name',
+      
     },
      isShow:true,
     queryParams: (params) => ({

+ 34 - 8
src/views/purchase/purchase-order/add/index.vue

@@ -76,13 +76,8 @@ export default {
           this.rules.warehouseName = [
             { required: true, message: "WMS入库仓库不能为空", trigger: "change" },
           ];
-
-          this.rules.goodsAllocationName = [
-            { required: true, message: "货位不能为空", trigger: "change" },
-          ];
         }else{
           this.rules.warehouseName = null;
-          this.rules.goodsAllocationName = null;
         }
 
         this.count++;
@@ -145,6 +140,23 @@ export default {
 
           };
 
+          try {
+            const { code, rows} = await orderApi.REFER(
+              {
+                type:'WAREHOUSE_PARAM',
+                search:  this.params.warehouseName,
+                isPage: true,
+              }, {pageNum: 1 , pageSize: 10} );
+
+              if(code ==200){
+                this.judgeGoodsAllocation(rows[0].csFlag);
+              }
+
+
+          } catch (error) {
+            
+          }
+
           for (const key in this.params) {
             // if (Array.isArray(this.params[key])) {
             if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
@@ -320,13 +332,22 @@ export default {
           }
       })
     },
-   
+    judgeGoodsAllocation(porp){
+      if(porp === 'Y'){
+        this.rules.goodsAllocationName = [
+          { required: true, message: "货位不能为空", trigger: "change" },
+        ];
+      } else{ 
+        this.rules.goodsAllocationName = null;
+      }
+      this.count++;
+   },
     // 主表参照改变之后
    async handleReferChange(val, type, source){
+     let page = { pageNum: 1 , pageSize: 10 };
       // 供应商选择  
       if( type === 'SUPPLIER_PARAM' ){
 
-        let page = { pageNum: 1 , pageSize: 10 };
 
         let relevanceRefer = [
           {
@@ -421,6 +442,11 @@ export default {
         
 
       }
+
+      // WMS仓库
+      if(type === 'WAREHOUSE_PARAM'){
+        this.judgeGoodsAllocation(val.csFlag);
+      }
     },
 
     // 下拉框选择改变
@@ -597,7 +623,7 @@ export default {
     
     async handleTemDownload(){
 
-      this.download('/pu/order/downloadFailData',{}, `物料信息模板${new Date().getTime()}.xlsx`);
+      this.download('/pu/order/downloadFailData',{}, `采购订单物料信息模板${new Date().getTime()}.xlsx`);
     },
 
 

+ 34 - 5
src/views/purchase/purchase-order/edit/index.vue

@@ -66,13 +66,8 @@ export default {
           this.rules.warehouseName = [
             { required: true, message: "WMS入库仓库不能为空", trigger: "change" },
           ];
-
-          this.rules.goodsAllocationName = [
-            { required: true, message: "货位不能为空", trigger: "change" },
-          ];
         }else{
           this.rules.warehouseName = null;
-          this.rules.goodsAllocationName = null;
         }
 
         this.count++;
@@ -115,6 +110,23 @@ export default {
         let { updateColumns, updateTabColumns } = await forbidden(status != '2',source);
         this.columns = updateColumns;
         this.tabColumns = updateTabColumns;
+        try {
+
+            const { code, rows} = await orderApi.REFER(
+              {
+                type:'WAREHOUSE_PARAM',
+                search:  this.params.warehouseName,
+                isPage: true,
+              }, {pageNum: 1 , pageSize: 10} );
+
+              if(code ==200){
+                this.judgeGoodsAllocation(rows[0].csFlag);
+              }
+
+
+          } catch (error) {
+            
+          }
         this.count++;
     },
     // 查询详细
@@ -279,6 +291,17 @@ export default {
     beforeOpen() {
     },
 
+    judgeGoodsAllocation(porp){
+      if(porp === 'Y'){
+        this.rules.goodsAllocationName = [
+          { required: true, message: "货位不能为空", trigger: "change" },
+        ];
+      } else{ 
+        this.rules.goodsAllocationName = null;
+      }
+      this.count++;
+   },
+
      // 主表参照改变之后
    async handleReferChange(val, type, source){
       // 供应商选择  
@@ -380,6 +403,12 @@ export default {
 
 
       }
+
+      // WMS仓库
+      if(type === 'WAREHOUSE_PARAM'){
+        this.judgeGoodsAllocation(val.csFlag);
+        
+      }
     },
     // 子表参照改变之后
     async handleTabReferChange(val, type, source) {