Преглед на файлове

优化取样流程并添加提交审批功能

yusheng преди 6 месеца
родител
ревизия
f262e2e07f

+ 1 - 0
src/components/processSubmitDialog/processSubmitDialog.vue

@@ -498,6 +498,7 @@
       },
       cancel() {
         this.$emit('update:processSubmitDialogFlag', false);
+        this.$emit('reload');
       }
     }
   };

+ 8 - 3
src/components/releaseRules/index.vue

@@ -68,7 +68,11 @@
 <script>
   import search from './search.vue';
   import dictMixins from '@/mixins/dictMixins';
-  import { recordrulesPage, recordrulesTypePage,recordrulesGetById } from '@/api/main/index';
+  import {
+    recordrulesPage,
+    recordrulesTypePage,
+    recordrulesGetById
+  } from '@/api/main/index';
   export default {
     components: { search },
     mixins: [dictMixins],
@@ -399,7 +403,7 @@
         tree.forEach(clean);
 
         this.typeTree = tree; // 结果树
-        console.log(this.typeTree,'this.treeNode')
+        console.log(this.typeTree, 'this.treeNode');
 
         if (!this.treeNode) {
           // 默认选中第一个节点
@@ -450,7 +454,8 @@
           pageNum: page,
           size: limit,
           ...where,
-          ...typeWhere
+          ...typeWhere,
+          enable: 1
         });
       },
       // 单击获取id

+ 6 - 1
src/views/inspectionWork/components/experimentReport.vue

@@ -314,6 +314,10 @@
         <template v-slot:remark="{ row, $index }">
           <el-input type="textarea" v-model="row.remark"></el-input>
         </template>
+        <template v-slot:batchNo="{ row, $index }">
+          <el-input v-model="row.batchNo"></el-input>
+        </template>
+
         <template v-slot:action="{ row, $index }">
           <el-popconfirm
             class="ele-action"
@@ -487,6 +491,7 @@
           {
             minWidth: 200,
             prop: 'batchNo',
+            slot: 'batchNo',
             align: 'center',
             label: '批次号',
             showOverflowTooltip: true
@@ -500,7 +505,7 @@
           },
           {
             minWidth: 200,
-            prop: 'batchNo',
+            prop: 'gys',
             align: 'center',
             label: '来源',
             showOverflowTooltip: true

+ 50 - 15
src/views/sample/sampleRecord/components/addSample.vue

@@ -323,7 +323,14 @@
         @click="save()"
         v-loading="loading"
         v-if="type != 'view'"
-        >确认</el-button
+        >保存</el-button
+      >
+      <el-button
+        type="primary"
+        @click="save('submit')"
+        v-loading="loading"
+        v-if="type != 'view'"
+        >提交</el-button
       >
 
       <el-button @click="cancel">关闭</el-button>
@@ -332,10 +339,17 @@
       ref="inspectionWorkDialog"
       @changeParent="changeParent"
     ></inspectionWorkDialog>
+    <processSubmitDialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="search"
+    ></processSubmitDialog>
   </ele-modal>
 </template>
 
 <script>
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
   const defForm = {
     code: '', //编码
     name: '', //名称
@@ -368,7 +382,7 @@
   import inspectionWorkDialog from '@/views/inspectionWork/components/inspectionWorkDialog.vue';
   import { getCodeList, getCode } from '@/api/login';
   export default {
-    components: { bpmDetail, inspectionWorkDialog },
+    components: { bpmDetail, inspectionWorkDialog, processSubmitDialog },
     props: {
       isSampleRecord: {
         default: false
@@ -376,6 +390,7 @@
     },
     data() {
       return {
+        processSubmitDialogFlag: false,
         form: { ...defForm },
         activeComp: 'main',
         tabOptions: [
@@ -401,7 +416,9 @@
           quantity: [{ required: true, message: '请输入', trigger: 'change' }],
           portion: [{ required: true, message: '请输入', trigger: 'change' }],
           unit: [{ required: true, message: '请选择', trigger: 'change' }],
-          packingUnit: [{ required: true, message: '请选择', trigger: 'change' }],
+          packingUnit: [
+            { required: true, message: '请选择', trigger: 'change' }
+          ]
         },
         sampleQuantityList: [
           { label: '批样', value: 1 },
@@ -1202,7 +1219,7 @@
         return res;
       },
       /* 保存编辑 */
-      save() {
+      save(type) {
         if (this.type == 'add') {
           [
             'id',
@@ -1232,19 +1249,11 @@
               //取整样
               if (data.conditionType == 1) {
                 data.quantity = data.portion;
-                // if (data.unit != data.measureUnit) {
-                //   data.quantity = this.sampleList.reduce(
-                //     (total, el) => total + Number(el.measureQuantity),
-                //     0
-                //   );
-                // } else {
-                //   data.quantity = this.form.portion;
-                // }
+
                 data.measureUnit = this.tableList[0].measureUnit;
               } else {
                 data.measureUnit = data.unit;
                 data.copies = data.portion;
-                // data.quantity = data.quantity * data.copies;
               }
             }
             this.loading = true;
@@ -1255,14 +1264,40 @@
             })
               .then((res) => {
                 this.$message.success('操作成功');
-                this.cancel();
-                this.$emit('reload');
+
+                if (type == 'submit') {
+                  this.approvalSubmit(this.type == 'add' ? res : data.id);
+                } else {
+                  this.cancel();
+                  this.$emit('reload');
+                }
               })
               .finally(() => {
                 this.loading = false;
               });
           }
         });
+      },
+      async approvalSubmit(id) {
+        const res = await getById(id);
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: res.id,
+            businessKey: 'sampling_approval_process',
+            formCreateUserId: res.createUserId,
+            variables: {
+              businessCode: res.code,
+              businessName: '取样',
+              businessType: res.conditionType == 1 ? '整样' : '小样'
+            }
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
+      search() {
+        this.cancel();
+        this.$emit('reload');
       }
     }
   };