lxf před 1 rokem
rodič
revize
8bee1c4e4c

+ 20 - 3
src/views/production/warehouse/putInStorage/add.vue

@@ -10,9 +10,14 @@
                   label="采购合同"
                   prop="purchaseId"
                   :rules="[{ required: formData.data.detailType === '1' ? true : false, message: '请选择采购合同', trigger: 'change' }]"
-                  style="width: 100%; margin-bottom: 18px"
-                  @change="changePurchase()">
-                  <el-select v-model="formData.data.purchaseId" placeholder="请选择采购合同" clearable filterable style="width: 100%">
+                  style="width: 100%; margin-bottom: 18px">
+                  <el-select
+                    v-model="formData.data.purchaseId"
+                    placeholder="请选择采购合同"
+                    clearable
+                    filterable
+                    style="width: 100%"
+                    @change="changePurchase()">
                     <el-option v-for="item in purchaseContractList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
                   </el-select>
                 </el-form-item>
@@ -124,6 +129,7 @@ const formData = reactive({
   data: {
     type: 1,
     applicant: proxy.useUserStore().user.nickName,
+    departmentId: "0",
     inOutStorageBomList: [],
   },
 });
@@ -185,6 +191,7 @@ const getDemandData = () => {
     if (res && res.length > 0) {
       purchaseContractList.value = res.map((item) => {
         return {
+          ...item,
           dictKey: item.id,
           dictValue: item.code + "," + item.deliveryDate + "," + item.supplierName,
         };
@@ -195,6 +202,16 @@ const getDemandData = () => {
 getDemandData();
 const changePurchase = () => {
   formData.data.inOutStorageBomList = [];
+  if (formData.data.purchaseId) {
+    let list = purchaseContractList.value.filter((item) => item.id === formData.data.purchaseId);
+    if (list && list.length > 0) {
+      if (list[0].supplierId && list[0].supplierId === "1698993849235431426") {
+        formData.data.warehouseId = "1684037244354052098";
+      } else {
+        formData.data.warehouseId = "1684037201379213314";
+      }
+    }
+  }
 };
 const openBOM = ref(false);
 const clickAddBOM = () => {