Parcourir la source

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-aps into dengfei

695593266@qq.com il y a 6 mois
Parent
commit
8b5db04844

+ 13 - 4
src/components/processSubmitDialog/processSubmitDialog.vue

@@ -7,7 +7,7 @@
     append-to-body
     :close-on-click-modal="false"
     width="50%"
-    :before-close="cancel"
+    :before-close="isCloseRefresh ? cancel : cancel1"
   >
     <!--    <el-steps :active="active" align-center style="transform: scale(0.8)">-->
     <!--      <el-step title="流程发起"></el-step>-->
@@ -160,7 +160,7 @@
         v-click-once
         >提交并发布</el-button
       >
-      <el-button size="small" @click="cancel">关闭</el-button>
+      <el-button size="small" @click="isCloseRefresh ? cancel() : cancel1()">关闭</el-button>
     </div>
   </ele-modal>
 </template>
@@ -199,7 +199,12 @@
       apiFunName: {
         type: String,
         default: ''
-      }
+      },
+      // 关闭弹窗时是否刷新列表
+      isCloseRefresh: {
+        type: Boolean,
+        default: true
+      },
     },
     data() {
       return {
@@ -438,8 +443,12 @@
         this.cancel();
       },
       cancel() {
+        this.$emit('reload');
         this.$emit('update:processSubmitDialogFlag', false);
-      }
+      },
+      cancel1() {
+        this.$emit('update:processSubmitDialogFlag', false);
+      },
     }
   };
 </script>

+ 53 - 5
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -381,6 +381,14 @@
     ></ProductionVersion>
 
     <timeDialog ref="timeDialogRef" @chooseTime="chooseTime"></timeDialog>
+    <!-- 提交 -->
+    <process-submit-dialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+      :isNotNeedProcess="false"
+    ></process-submit-dialog>
 
     <ele-modal
       :visible.sync="batchVisible"
@@ -454,6 +462,7 @@
   import ProductionVersion from '@/components/CreatePlan/ProductionVersion2.vue';
 
   import { getCode } from '@/api/codeManagement';
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
 
   // import fileUpload from '@/components/addDoc/index.vue';
   import timeDialog from './timeDialog.vue';
@@ -464,7 +473,8 @@
       ProductModal,
       ProductionVersion,
       // fileUpload,
-      timeDialog
+      timeDialog,
+      processSubmitDialog
     },
     mixins: [dictMixins],
     data() {
@@ -474,6 +484,8 @@
           requireDeliveryTime: '',
           timeList: []
         },
+        businessId: '',
+        processSubmitDialogFlag: false,
         batchVisible: false,
         multipleSelection: [],
         visible: false,
@@ -877,6 +889,7 @@
 
       getDetail(id) {
         getById(id).then((res) => {
+          this.businessId = res.id;
           this.$set(this.formData, 'demandType', res.demandType);
           this.$set(this.formData, 'name', res.name);
           this.$set(this.formData, 'remark', res.remark);
@@ -1307,20 +1320,55 @@
               return;
             }
             if (type == 'submit') {
-              await saveAndSubmit(this.formData);
-              this.$message.success('保存并提交成功!');
+              save(this.formData).then((res) => {
+                this.todo(res);
+              });
+              // await saveAndSubmit(this.formData);
+              // this.$message.success('保存并提交成功!');
             } else if (type == 'publish') {
               await submitAndPublish(this.formData);
               this.$message.success('保存并发布成功!');
+              this.$emit('success');
+              this.cancel();
             } else {
               await save(this.formData);
               this.$message.success('保存成功!');
+              this.$emit('success');
+              this.cancel();
             }
-            this.$emit('success');
-            this.cancel();
+            
           }
         });
       },
+      reload() {
+        this.$emit('success');
+        this.cancel();
+      },
+      async todo(res) {
+        const data = await getById(this.businessId || res);
+        console.log('data~~~', data);
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: data.id,
+            businessKey: 'release_purchase_plan',
+            formCreateUserId: data.createUserId,
+            variables: {
+              businessCode: data.code,
+              businessName: data.name,
+              businessType:
+                data.demandType == 1
+                  ? '生产性物资采购'
+                  : data.demandType == 6
+                  ? '外协自供料采购'
+                  : data.demandType == 7
+                  ? '外协客供料采购'
+                  : ''
+            }
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
       cancel() {
         this.visible = false;
 

+ 53 - 10
src/views/materialPlan/components/producePlan.vue

@@ -428,7 +428,14 @@
     ></ProductionVersion>
 
     <timeDialog ref="timeDialogRef" @chooseTime="chooseTime"></timeDialog>
-
+    <!-- 提交 -->
+    <process-submit-dialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+      :isNotNeedProcess="false"
+    ></process-submit-dialog>
     <ele-modal
       :visible.sync="batchVisible"
       title="批量选择"
@@ -502,7 +509,7 @@
   // import fileUpload from '@/components/addDoc/index.vue';
   import timeDialog from './timeDialog';
   import dictMixins from '@/mixins/dictMixins';
-
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
   import { getCode } from '@/api/codeManagement';
   export default {
     components: {
@@ -510,7 +517,8 @@
       ProductModal,
       ProductionVersion,
       // fileUpload,
-      timeDialog
+      timeDialog,
+      processSubmitDialog
     },
     mixins: [dictMixins],
     data() {
@@ -528,7 +536,7 @@
         multipleSelection: [],
         visible: false,
         type: 'add',
-
+        processSubmitDialogFlag: false,
         tableData: [],
 
         xsId: null,
@@ -575,7 +583,8 @@
           ]
         },
         gysList: [],
-        sourceType: 1
+        sourceType: 1,
+        businessId: ''
       };
     },
 
@@ -918,6 +927,7 @@
 
       getDetail(id) {
         getById(id).then((res) => {
+          this.businessId = res.id;
           this.$set(this.formData, 'demandType', res.demandType);
           this.$set(this.formData, 'name', res.name);
           this.$set(this.formData, 'remark', res.remark);
@@ -1308,21 +1318,54 @@
             this.formData.baitingType = 2;
 
             if (type == 'submit') {
-              await saveAndSubmit(this.formData);
-              this.$message.success('保存并提交成功!');
+              save(this.formData).then((res) => {
+                this.todo(res);
+              });
+              // await saveAndSubmit(this.formData);
+              // this.$message.success('保存并提交成功!');
             } else if (type == 'publish') {
               await submitAndPublish(this.formData);
               this.$message.success('提交并发布成功!');
+              this.$emit('success');
+              this.cancel();
             } else {
               await save(this.formData);
               this.$message.success('保存成功!');
+              this.$emit('success');
+              this.cancel();
             }
-
-            this.$emit('success');
-            this.cancel();
           }
         });
       },
+      reload() {
+        this.$emit('success');
+        this.cancel();
+      },
+      async todo(res) {
+        const data = await getById(this.businessId || res);
+        console.log('data~~~', data);
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: data.id,
+            businessKey: 'release_purchase_plan',
+            formCreateUserId: data.createUserId,
+            variables: {
+              businessCode: data.code,
+              businessName: data.name,
+              businessType:
+                data.demandType == 1
+                  ? '生产性物资采购'
+                  : data.demandType == 6
+                  ? '外协自供料采购'
+                  : data.demandType == 7
+                  ? '外协客供料采购'
+                  : ''
+            }
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
       cancel() {
         this.visible = false;
         this.sourceType = 1;

+ 1 - 0
src/views/materialPlan/index.vue

@@ -137,6 +137,7 @@
       ref="processSubmitDialogRef"
       @reload="reload"
       :isNotNeedProcess="false"
+      :isCloseRefresh="false"
     ></process-submit-dialog>
   </div>
 </template>