Bläddra i källkod

1.编辑:除手工来源以外的物料与数量不可编辑
2.物料改变时,将数量置空

002390 2 år sedan
förälder
incheckning
f952bc9337

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

@@ -578,8 +578,8 @@ export const TabColumns = [
         disabled:true,
       },
       { key: "taxDeductMoneya", title: "折扣金额", inputType: "Input",disabled:true, },
-      { key: "arrivalQty", title: "已到货数量", inputType: "Input", },
-      { key: "unarrivedQty", title: "未到货数量", inputType: "Input", },
+      { key: "arrivalQty", title: "已到货数量", inputType: "Input", disabled:true,},
+      { key: "unarrivedQty", title: "未到货数量", inputType: "Input", disabled:true,},
       { 
         key: "price",
         title: "无税单价",
@@ -692,7 +692,7 @@ export const TabColumns = [
       { key: "demandCode", title: "采购需求单号", inputType: "Input", width: 180 },
       { key: "arrivalDatePlan", title: "计划到货日期", inputType: "Input", width: 180 },
      
-      { key: "isDistributionPrice", title: "配送价", inputType: "Input", },
+      { key: "isDistributionPrice", title: "配送价", inputType: "Checkbox", },
      
       { //threeClass
         key: "materialClassifyOneName", 

+ 6 - 2
src/views/purchase/purchase-order/add/index.vue

@@ -361,11 +361,15 @@ export default {
     // 子表参照改变之后
    async handleTabReferChange(val, source, type) {
 
-      // 触发物料参照询价
-      if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
+      // 触发物料参照询价   && source.qty && source.qty != ""
+      if (type == "MATERIAL_PARAM") {
+
+        source['qty'] = 0;
 
         source['whetherCompleteInquiry'] = false;
 
+        source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
+
         await this.handleGetPrice();
 
       }

+ 12 - 11
src/views/purchase/purchase-order/edit/index.vue

@@ -76,8 +76,8 @@ export default {
       })
     },
     // 判断属性是否禁用
-   async handleIsForbidden(status) {
-        let { updateColumns, updateTabColumns } = await forbidden(status != '2');
+   async handleIsForbidden(status,source) {
+        let { updateColumns, updateTabColumns } = await forbidden(status != '2',source);
         this.columns = updateColumns;
         this.tabColumns = updateTabColumns;
         this.count++;
@@ -89,7 +89,7 @@ export default {
         const { code, msg, data } = await orderApi.details(prop);
         if (code === 200) {
           this.params = { ...this.params, ...data };
-          this.handleIsForbidden(this.params.status);
+          this.handleIsForbidden(this.params.status,this.params.source);
         }
       } catch (err) {
         //
@@ -217,19 +217,20 @@ export default {
     beforeOpen() {
     },
     // 子表参照改变之后
-    handleReferChange(val, source, type) {
+    async handleTabReferChange(val, source, type) {
       // 触发物料参照
-      if (type == 'MATERIAL_PARAM' && source.qty && source.qty != '') {
+      if (type == "MATERIAL_PARAM") {
 
-        source['whetherCompleteInquiry'] = false;
+        source['qty'] = 0;
 
-        this.handleGetPrice();
-      }
+        source['whetherCompleteInquiry'] = false;
 
-      if(type == "MATERIAL_PARAM"){
         source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
-        // return source;
+        
+        await this.handleGetPrice();
+
       }
+
     },
 
     // 子表Select改变之后
@@ -501,7 +502,7 @@ export default {
                     :data-mapping="cColumn.dataMapping"
                     :query-params="cColumn.queryParams" 
                     size="mini" 
-                    @change="handleReferChange"
+                    @change="handleTabReferChange"
                   ></dr-popover-select>
 
                   <el-select v-if="cColumn.inputType === 'Select'" 

+ 23 - 4
src/views/purchase/purchase-order/edit/initColumn.js

@@ -22,16 +22,35 @@ editTabColumns.forEach(column => {
 
 
 // 禁用项
-export const forbidden = (isEdit) => {
+export const forbidden = (isEdit,source) => {
 
   // let updateColumns = deepCopy(editColumns);
   // let updateTabColumns = deepCopy(editTabColumns);
   let updateColumns = _.cloneDeep(editColumns);
   let updateTabColumns = _.cloneDeep(editTabColumns);
 
-  console.log(isEdit, 'isEdit');
-  
-  if(!isEdit){  
+  console.log(isEdit, 'isEdit',source,'source');
+  if(isEdit){
+    // 编辑
+    // 订单来源为:自动协议直采和协议直采
+    if(source === '1' || source === '2'){
+
+      updateTabColumns.forEach(tab =>{
+
+        tab.tableColumns.forEach(cColumn => {
+
+          if(cColumn.key === 'materialName' || cColumn.key === 'qty'){
+
+            cColumn.disabled = true;
+
+          }
+
+        })
+
+      })
+    }
+  }
+  else{  
 
     console.log('修订');
     // 修订