Kaynağa Gözat

修改调拨订单问题

黄梓星 1 yıl önce
ebeveyn
işleme
9de747a411
1 değiştirilmiş dosya ile 79 ekleme ve 55 silme
  1. 79 55
      src/views/purchase/transferOrder/add.vue

+ 79 - 55
src/views/purchase/transferOrder/add.vue

@@ -18,6 +18,19 @@
           </el-col>
 
           <el-col :span="1.5">
+            <el-form-item label="调入库存组织">
+              <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.storageInventoryOrg"
+                @clear="clean('调入库存组织')"
+                @change="controlCk('调入库存组织')"
+                @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')"
+                style="width: 200px"
+              >
+                <el-option v-for="item in ruOrgOptions" :key="item.id" :label="item.name" :value="item.id"/>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
             <el-form-item label="调出部门">
               <el-select clearable :disabled="sonDisable || isOrg"
                 size="mini"
@@ -60,19 +73,6 @@
           </el-col>
 
           <el-col :span="1.5">
-            <el-form-item label="调入库存组织">
-              <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.storageInventoryOrg"
-                @clear="clean('调入库存组织')"
-                @change="controlCk('调入库存组织')"
-                @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')"
-                style="width: 200px"
-              >
-                <el-option v-for="item in ruOrgOptions" :key="item.id" :label="item.name" :value="item.id"/>
-              </el-select>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="1.5">
             <el-form-item label="调入仓库">
               <el-select clearable :disabled="sonDisable || isOrg"
                 size="mini"
@@ -506,7 +506,7 @@
                   <el-form-item class="hang">
                     <el-input
                       clearable
-                      :disabled="sonDisable"
+                      :disabled="sonDisable || isOrg"
                       size="mini"
                       v-model="scope.row.storageDeptName"
                       @clear="cleanMx(scope.$index, '调入部门')"
@@ -522,7 +522,7 @@
                     >
                       <el-button
                         size="mini"
-                        :disabled="sonDisable"
+                        :disabled="sonDisable || isOrg"
                         slot="append"
                         icon="el-icon-more"
                         @click="
@@ -1478,8 +1478,6 @@ export default {
         title: "",
         // 仓库编码
         stordocId: "",
-      },
-      referConditionMx: {
         orgCode: "",
         materialCode: "",
         unitCode: "",
@@ -1896,21 +1894,7 @@ export default {
         this.basicForm.deliveryInventoryOrg = selection[0].id;
         this.basicForm.deliveryInventoryOrgCode = selection[0].code;
         this.basicForm.deliveryInventoryOrgName = selection[0].name;
-        // 清空调出仓库,部门
-        this.basicForm.deliveryWarehouse = "";
-        this.basicForm.deliveryWarehouseCode = "";
-        this.basicForm.deliveryWarehouseName = "";
-        this.basicForm.deliveryDept = "";
-        this.basicForm.deliveryDeptName = "";
-        // 选择调入库存组织时判断调拨方式
-        if (
-          this.basicForm.storageInventoryOrg ==
-          this.basicForm.deliveryInventoryOrg
-        ) {
-          this.basicForm.allotType = "4";
-        } else {
-          this.basicForm.allotType = "2";
-        }
+        this.clearDCZZ()
       }
       if (this.referCondition.title == "调入库存组织") {
         this.ruOrgOptions = selection;
@@ -1918,18 +1902,7 @@ export default {
         this.basicForm.storageInventory = selection[0].code;
         this.basicForm.storageInventoryOrgName = selection[0].name;
         this.basicForm.onRouteAffilliation = selection[0].name;
-        // 选择调入库存组织清空仓库
-        this.basicForm.storageWarehouse = "";
-        this.basicForm.storageWarehouseName = "";
-        // 选择调入库存组织时判断调拨方式
-        if (
-          this.basicForm.storageInventoryOrg ==
-          this.basicForm.deliveryInventoryOrg
-        ) {
-          this.basicForm.allotType = "4";
-        } else {
-          this.basicForm.allotType = "2";
-        }
+        this.clearDRZZ()
       }
       if (this.referCondition.title == "调出业务员") {
         this.manOptions = selection;
@@ -2001,6 +1974,56 @@ export default {
       // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
       this.controlCk();
     },
+    // 调出库存组织清空相关数据
+    clearDCZZ() {
+      // 清空调出仓库,部门
+      this.basicForm.deliveryWarehouse = "";
+      this.basicForm.deliveryWarehouseCode = "";
+      this.basicForm.deliveryWarehouseName = "";
+      this.basicForm.deliveryDept = "";
+      this.basicForm.deliveryDeptName = "";
+      // 清空调出货位且禁用
+      this.materialInfo.forEach((item) => {
+        item.deliveryAllocation = null;
+        item.deliveryAllocationName = null;
+      });
+      this.isDCCk = true;
+      // 选择调入库存组织时判断调拨方式
+      if (
+        this.basicForm.storageInventoryOrg ==
+        this.basicForm.deliveryInventoryOrg
+      ) {
+        this.basicForm.allotType = "4";
+      } else {
+        this.basicForm.allotType = "2";
+      }
+    },
+    // 调入库存组织清空相关数据
+    clearDRZZ() {
+      // 选择调入库存组织清空仓库
+      this.basicForm.storageWarehouse = "";
+      this.basicForm.storageWarehouseName = "";
+      // 清空调入部门
+      this.materialInfo.forEach((item) => {
+        item.storageDept = null;
+        item.storageDeptName = null;
+      });
+      // 清空调入货位且禁用
+      this.materialInfo.forEach((item) => {
+        item.storageAllocation = null;
+        item.storageAllocationName = null;
+      });
+      this.isDRCk = true
+      // 选择调入库存组织时判断调拨方式
+      if (
+        this.basicForm.storageInventoryOrg ==
+        this.basicForm.deliveryInventoryOrg
+      ) {
+        this.basicForm.allotType = "4";
+      } else {
+        this.basicForm.allotType = "2";
+      }
+    },
     chooseTreeRefer(type, isPage, title) {
       this.referCondition.type = type;
       this.referCondition.isPage = isPage;
@@ -2043,12 +2066,12 @@ export default {
     // 明细行选择批次号
     chooseBatch(index) {
       this.tableIndex = index;
-      this.referConditionMx.orgId = this.basicForm.deliveryInventoryOrg;
-      this.referConditionMx.materialCode =
+      this.referCondition.orgId = this.basicForm.deliveryInventoryOrg;
+      this.referCondition.materialCode =
       this.materialInfo[this.tableIndex].materialCode;
-      this.referConditionMx.unitId = this.materialInfo[this.tableIndex].unit;
-      this.referConditionMx.warehouseId = this.basicForm.deliveryWarehouse;
-      this.$refs.batchRefer.init(this.referConditionMx);
+      this.referCondition.unitId = this.materialInfo[this.tableIndex].unit;
+      this.referCondition.warehouseId = this.basicForm.deliveryWarehouse;
+      this.$refs.batchRefer.init(this.referCondition);
     },
     selectBatch(selection) {
       console.log("选中的批次号", selection);
@@ -2076,14 +2099,10 @@ export default {
     // 选择框彻底清空
     clean(val) {
       if (val == "调出库存组织") {
-        this.basicForm.deliveryInventoryOrg = "";
-        this.basicForm.deliveryInventoryOrgCode = "";
-        this.basicForm.deliveryInventoryOrgName = "";
+        this.clearDCZZ()
       }
       if (val == "调入库存组织") {
-        this.basicForm.storageInventoryOrg = "";
-        this.basicForm.storageInventory = "";
-        this.basicForm.storageInventoryOrgName = "";
+        this.clearDRZZ()
       }
       if (val == "调出业务员") {
         this.basicForm.businessPersonal = "";
@@ -2092,6 +2111,11 @@ export default {
       if (val == "调入仓库") {
         this.basicForm.storageWarehouse = "";
         this.basicForm.storageWarehouseName = "";
+        this.materialInfo.forEach((item) => {
+          item.storageAllocation = null;
+          item.storageAllocationName = null;
+        });
+        this.isDRCk = true
       }
       if (val == "调出仓库") {
         this.basicForm.deliveryWarehouse = "";