yusheng 11 bulan lalu
induk
melakukan
112c3de3ef

+ 25 - 12
src/views/purchasingManage/purchasePlanManage/components/addDialog.vue

@@ -12,7 +12,6 @@
     :maxable="true"
     :resizable="true"
   >
-
     <el-form ref="form" :model="form" :rules="rules" label-width="120px">
       <headerTitle title="基本信息"></headerTitle>
       <el-row>
@@ -22,8 +21,7 @@
             prop="sourceType"
             style="margin-bottom: 22px"
           >
-
-          <el-select
+            <el-select
               v-model="form.sourceType"
               placeholder="请选择"
               style="width: 100%"
@@ -38,8 +36,6 @@
               >
               </el-option>
             </el-select>
-
-
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -134,12 +130,10 @@
             </el-radio-group>
           </el-form-item>
         </el-col>
-      
 
         <el-col :span="12">
           <el-form-item prop="files" label="附件">
             <fileMain v-model="form.files"></fileMain>
-          
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -243,7 +237,7 @@
   import { getFile } from '@/api/system/file';
   // import fileMain from '@/components/addDoc/index.vue';
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
-  import { orderSourceType,requirementSourceType } from '@/enum/dict';
+  import { orderSourceType, requirementSourceType } from '@/enum/dict';
 
   export default {
     props: {
@@ -265,7 +259,7 @@
       inventoryTable,
       purchaseNeedList,
       personSelect,
-      staffSelection,
+      staffSelection
     },
     data() {
       let formDef = {
@@ -563,9 +557,12 @@
             let res = await isHasGeneratedPlanAPI(row.id);
             if (res) this.$message.warning('该需求已经生成过计划,请注意');
             await this.getDetailData(row.id);
-            
           }
-          this.$set(this.form,'planName',await getCode('purchase_plan_code_name'))
+          this.$set(
+            this.form,
+            'planName',
+            await getCode('purchase_plan_code_name')
+          );
         } else {
           this.isUpdate = true;
           await this.init(row.id);
@@ -695,11 +692,27 @@
       async submit(res) {
         console.log(res);
         let data = await getplanDetail(this.form.id || res);
+        let storemanIds = '';
+        if (['3', '4', '5'].includes(row.sourceType)) {
+          let ids = data.detailList.map((item) => item.warehouseId);
+          let warehouseList = await getWarehouseListByIds(ids || []);
+          storemanIds = warehouseList.map((item) => item.ownerId);
+        }
+
+        // this.$nextTick(() => {
+        //   let params = {
+        //     businessId: row.id,
+        //     businessKey: ['3', '4', '5'].includes(row.sourceType)
+        //       ? 'outsource_purchasePlan_approve'
+        //       : 'purchase_plan_approve',
+
         this.processSubmitDialogFlag = true;
         this.$nextTick(() => {
           let params = {
             businessId: data.id,
-            businessKey: 'purchase_plan_approve',
+            businessKey: ['3', '4', '5'].includes(row.sourceType)
+              ? 'outsource_purchasePlan_approve'
+              : 'purchase_plan_approve',
             formCreateUserId: data.createUserId,
             variables: {
               businessCode: data.planCode,

+ 9 - 4
src/views/purchasingManage/purchasePlanManage/components/detailDialog.vue

@@ -231,7 +231,11 @@
     ></inquiryManageIndex>
     <!--入库详情-->
     <innerBoundDetails
-      v-if="activeComp === 'store' && form.status == 2"
+      v-if="
+        activeComp === 'store' &&
+        form.status == 2 &&
+        ['3', '4', '5'].includes(form.sourceType)
+      "
       ref="innerBoundDetailsRef"
     ></innerBoundDetails>
   </ele-modal>
@@ -260,7 +264,8 @@
       bpmDetail,
       timeDialog,
       outsourcing,
-      inquiryManageIndex,innerBoundDetails
+      inquiryManageIndex,
+      innerBoundDetails
     },
     props: {
       isModal: {
@@ -277,7 +282,7 @@
           { key: 'main', name: '计划详情' },
           { key: 'bpm', name: '流程详情' },
           { key: 'inquiryManage', name: '核价清单' },
-          { key: 'store', name: '入库详情' },
+          { key: 'store', name: '入库详情' }
         ],
         activeName: '1',
         fullscreen: false,
@@ -530,7 +535,7 @@
       async open(row) {
         this.activeName = '1';
         this.activeComp = 'main';
-        
+
         this.sonPurchasePlanList = row.sonPurchasePlanList || [];
         this.visible = true;
         this.getPlanData(row.planId || row.id);