Forráskód Böngészése

调拨订单bug修改

黄梓星 2 éve
szülő
commit
febf8cb401
1 módosított fájl, 44 hozzáadás és 9 törlés
  1. 44 9
      src/views/purchase/transferOrder/add.vue

+ 44 - 9
src/views/purchase/transferOrder/add.vue

@@ -158,14 +158,14 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入仓库">
-              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable || isOrg" @change="controlDCHW" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable || isOrg" @change="controlDRHW" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')" style="width: 200px">
                 <el-option v-for="item in ruHouseOptions" :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 size="small" v-model="basicForm.deliveryWarehouse" :disabled="sonDisable || isOrg" @change="controlDRHW" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调出仓库')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.deliveryWarehouse" :disabled="sonDisable || isOrg" @change="controlDCHW" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调出仓库')" style="width: 200px">
                 <el-option v-for="item in chuHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -271,8 +271,8 @@
           <el-table-column show-overflow-tooltip label="调出货位" align="center" prop="deliveryAllocationName" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable || isCk" size="small" v-model="scope.row.deliveryAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)">
-                  <el-button size="small" :disabled="sonDisable || isCk" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)"></el-button>
+                <el-input clearable :disabled="sonDisable || isDCCk" size="small" v-model="scope.row.deliveryAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)">
+                  <el-button size="small" :disabled="sonDisable || isDCCk" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)"></el-button>
                 </el-input>
               </el-form-item>
             </template>
@@ -289,8 +289,8 @@
           <el-table-column show-overflow-tooltip label="调入货位" align="center" prop="storageAllocationName" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable || isCk" size="small" v-model="scope.row.storageAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)">
-                  <el-button size="small" :disabled="sonDisable || isCk" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)"></el-button>
+                <el-input clearable :disabled="sonDisable || isDRCk" size="small" v-model="scope.row.storageAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)">
+                  <el-button size="small" :disabled="sonDisable || isDRCk" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)"></el-button>
                 </el-input>
               </el-form-item>
             </template>
@@ -706,7 +706,8 @@ export default {
         }
       },
       isOrg: true,
-      isCk: false
+      isDRCk: true,
+      isDCCk: true,
     }
   },
   created() {
@@ -728,11 +729,27 @@ export default {
         this.basicForm.storageWarehouse = ''
         this.basicForm.deliveryWarehouse = ''
         this.isOrg = true
+      // 选择调入库存组织时判断调拨方式
+        this.basicForm.allotType = ''
       }
     },
     // 控制子表内货位是否可以填写,根据选择仓库内csFlag
-    controlDCHW() {},
-    controlDRHW() {},
+    controlDCHW() {
+      console.log("🚀 ~ file: add.vue:735 调出货位")
+      this.isDCCk = true
+      this.materialInfo.forEach(item => {
+        item.deliveryAllocation = null
+        item.deliveryAllocationName = null
+      })
+    },
+    controlDRHW() {
+      console.log("🚀 ~ file: add.vue:735 调入货位")
+      this.isDRCk = true
+      this.materialInfo.forEach(item => {
+        item.storageAllocation = null
+        item.storageAllocationName = null
+      })
+    },
     // 输入数量或者主数量同步改变
     getZSL(scope) {
       scope.row.qty = scope.row.mainQty
@@ -912,6 +929,12 @@ export default {
         this.basicForm.deliveryInventoryOrg = selection[0].id
         this.basicForm.deliveryInventoryOrgCode = selection[0].code
         this.basicForm.deliveryInventoryOrgName = selection[0].name
+        // 选择调入库存组织时判断调拨方式
+        if (this.basicForm.storageInventoryOrg == this.basicForm.deliveryInventoryOrg) {
+          this.basicForm.allotType = '4'
+        } else {
+          this.basicForm.allotType = '2'
+        }
       }
       if (this.referCondition.title == '调入库存组织') {
         this.ruOrgOptions = selection
@@ -945,12 +968,24 @@ export default {
         this.ruHouseOptions = selection
         this.basicForm.storageWarehouse = selection[0].id
         this.basicForm.storageWarehouseName = selection[0].name
+        console.log('1111', selection[0].csFlag)
+        if(selection[0].csFlag == 'N') {
+          this.isDRCk = true
+        } else {
+          this.isDRCk = false
+        }
       }
       if (this.referCondition.title == '调出仓库') {
         this.chuHouseOptions = selection
         this.basicForm.deliveryWarehouse = selection[0].id
         this.basicForm.deliveryWarehouseCode = selection[0].code
         this.basicForm.deliveryWarehouseName = selection[0].name
+        console.log('2222', selection[0].csFlag)
+        if (selection[0].csFlag == 'N') {
+          this.isDCCk = true
+        } else {
+          this.isDCCk = false
+        }
       }
       if (this.referCondition.title == '调出货位') {
         this.materialInfo[this.tableIndex].deliveryAllocationName = selection[0].name