فهرست منبع

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002390 2 سال پیش
والد
کامیت
18ce7f74b7

+ 3 - 6
src/views/material/basicFile/details.vue

@@ -1323,19 +1323,16 @@
       },
       // 除基本信息之后的修改
       handleOtherEdit() {
-        console.log('除基本信息之后的修改', this.otherDeatils.queryKey);
-
-        if ((this.otherDeatils.queryKey && this.otherDeatils.queryKey != '') || this.mainMsg.checkedList.length == 1) {
+        console.log('除基本信息之后的修改');
+        if (this.mainMsg.checkedList.length == 1) {
           this.otherDeatils.show = true;
           this.otherDeatils.isEdit = true;
           let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
+          this.otherDeatils.queryKey = this.mainMsg.checkedList[0].id;
           this.otherDeatils.title = activeTab.label;
-          this.otherDeatils.queryKey = this.otherDeatils.queryKey || this.mainMsg.checkedList[0].id;
           console.log(this.otherDeatils, 'this.otherDeatils');
           // 查询其他标签页列表详情
           this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
-
-
         } else {
           this.$message({
             message: '修改请选择单个数据!',

+ 11 - 4
src/views/purchase/PurchaseDemandList/add.vue

@@ -41,7 +41,7 @@
           </el-col>
 
          <el-col :span="1.5">
-            <el-form-item label="需求客户" prop="customer" :rules="{ required: true, message: '请选择需求客户', trigger: 'blur' }">
+            <el-form-item label="需求客户">
               <el-select clearable size="small" v-model="basicForm.customer" :disabled="sonDisable" @clear="cleanCustomer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
                 <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
@@ -247,7 +247,7 @@
             </el-table-column>
             <el-table-column show-overflow-tooltip label="预留周期" align="center" prop="reservedPeriod" width="150px">
               <template slot-scope="scope">
-                <el-form-item class="hang">
+                <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'reservedPeriod'" :rules="{ required: isYl, message: '请填写预留周期', trigger: 'blur' }">
                   <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.reservedPeriod"/>
                 </el-form-item>
               </template>
@@ -550,8 +550,7 @@ export default {
       deptOptions: [],
       customerOptions: [],
       isBDXQ: false,
-      // 刷新表格数据
-      refreshData: 0
+      isYl: false
     }
   },
   created() {
@@ -603,6 +602,12 @@ export default {
     // 获取预留数量
     getYLSL(scope) {
       scope.row.reservedQty = Math.ceil(scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty)
+      // 如果选择预留比例,预留周期必填
+      if(scope.row.reservedQty && scope.row.reservedQty !== 0) {
+        this.isYl = true
+      } else {
+        this.isYl = false
+      }
     },
     copy() {
       this.$modal.msgSuccess("复制成功");
@@ -980,6 +985,8 @@ export default {
       // 物料存储条件和运输条件
       this.basicForm.puDemandItemList[this.tableIndex].transportationCondition = selection[0].transportationCondition
       this.basicForm.puDemandItemList[this.tableIndex].storageCondition = selection[0].storageCondition
+      // 选中骨科耗材时候的物料,需求客户不必填
+      
     },
     // 明细行选择业务部门参照带出业务部门数据
     chooseDept(index, type, isPage, title) {

+ 73 - 10
src/views/purchase/transferOrder/add.vue

@@ -4,7 +4,7 @@
       <el-row :gutter="10">
         <el-col :span="1.5">
           <el-form-item label="调出库存组织">
-            <el-select clearable size="small" v-model="basicForm.deliveryInventoryOrg" :disabled="sonDisable" @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')" style="width: 200px">
+            <el-select clearable size="small" v-model="basicForm.deliveryInventoryOrg" :disabled="sonDisable" @change="controlCk" @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')" style="width: 200px">
               <el-option v-for="item in chuOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
           </el-form-item>
@@ -36,6 +36,7 @@
                 :disabled="sonDisable"
                 type="date"
                 clearable
+                @change="changeBillDate"
                 value-format="yyyy-MM-dd"
                 style="width: 200px">
               </el-date-picker>
@@ -73,7 +74,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入库存组织">
-              <el-select clearable size="small" v-model="basicForm.storageInventoryOrg" :disabled="sonDisable" @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.storageInventoryOrg" :disabled="sonDisable" @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>
@@ -87,7 +88,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调出部门">
-              <el-select clearable size="small" v-model="basicForm.deliveryDept" :disabled="sonDisable" @focus="chooseRefer('DEPT_PARAM', true, '调出部门', basicForm.deliveryInventoryOrg)" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.deliveryDept" :disabled="sonDisable || isOrg" @focus="chooseRefer('DEPT_PARAM', true, '调出部门', basicForm.deliveryInventoryOrg)" style="width: 200px">
                 <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -158,14 +159,14 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入仓库">
-              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @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" @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, '调出仓库', basicForm.deliveryInventoryOrg)" 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 +272,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" size="small" v-model="scope.row.deliveryAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)">
-                  <el-button size="small" :disabled="sonDisable" 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 +290,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" size="small" v-model="scope.row.storageAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)">
-                  <el-button size="small" :disabled="sonDisable" 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>
@@ -704,7 +705,10 @@ export default {
             );
           }
         }
-      }
+      },
+      isOrg: true,
+      isDRCk: true,
+      isDCCk: true,
     }
   },
   created() {
@@ -716,6 +720,43 @@ export default {
     }
   },
   methods: {
+    // 改变单据日期时清空子表的调拨日期
+    changeBillDate() {
+      this.materialInfo.forEach(item => {
+        item.allotDate = null
+      })
+    },
+    // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
+    controlCk() {
+      console.log('进了吗')
+      if (this.basicForm.deliveryInventoryOrg && this.basicForm.storageInventoryOrg) {
+        this.isOrg = false
+      } else {
+        this.basicForm.deliveryDept = ''
+        this.basicForm.storageWarehouse = ''
+        this.basicForm.deliveryWarehouse = ''
+        this.isOrg = true
+      // 选择调入库存组织时判断调拨方式
+        this.basicForm.allotType = ''
+      }
+    },
+    // 控制子表内货位是否可以填写,根据选择仓库内csFlag
+    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
@@ -788,6 +829,8 @@ export default {
           if(this.basicForm.storageWarehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.storageWarehouse, '调入仓库') }
           if(this.basicForm.deliveryWarehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.deliveryWarehouse, '调出仓库') }
           if(this.basicForm.liacenter) { this.reBackRefer('LIACENTER_PARAM', this.basicForm.liacenter) }
+          // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
+          this.controlCk()
         }
       })
     },
@@ -893,6 +936,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
@@ -926,12 +975,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
@@ -945,6 +1006,8 @@ export default {
         this.materialInfo[this.tableIndex].storageDeptName = selection[0].name
         this.materialInfo[this.tableIndex].storageDept = selection[0].id
       }
+      // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
+      this.controlCk()
     },
     chooseTreeRefer(type, isPage, title) {
       this.referCondition.type = type