Просмотр исходного кода

feat(质检报告): 添加嘉实判断选择审批流程的功能

liujt 8 месяцев назад
Родитель
Сommit
46d60fc266
2 измененных файлов с 33 добавлено и 4 удалено
  1. 9 0
      src/api/main/index.js
  2. 24 4
      src/views/inspectionWork/index.vue

+ 9 - 0
src/api/main/index.js

@@ -57,4 +57,13 @@ export async function parameterGetByCode(data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
+}
+
+
+export async function getCategoryByCode(code) {
+  const res = await request.get(`/main/category/getByCode/${code}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 24 - 4
src/views/inspectionWork/index.vue

@@ -98,8 +98,8 @@
             :businessId="row.id"
             businessCode="qmsqualityinspectionprint"
           ></jimureportBrowse>
-
-          <el-link v-if="row.status == 1 && isReportApproval == 1 && row.reportApprovalStatus == 0" type="primary" :underline="false" @click="reportApprovalSubmit(row)"
+          <!-- 质检报告审批  -->
+          <el-link v-if="row.status == 1 && isReportApproval == 1 && !row.reportApprovalStatus" type="primary" :underline="false" @click="reportApprovalSubmit(row)"
             >质检报告审批</el-link
           >
 
@@ -181,6 +181,7 @@ import { getFile } from '@/api/system/file';
 import { getByCode } from '@/api/system/dictionary-data';
 import { parameterGetByCode } from '@/api/main/index';
 import tabMixins from '@/mixins/tableColumnsMixin';
+import { getCategoryByCode } from '@/api/main/index';
 
 export default {
   mixins: [dictMixins,tabMixins],
@@ -409,9 +410,9 @@ export default {
     this.requestDict('质检计划类型');
     this.requestDict('不良品处理类型');
     this.requestDict('取样类型');
+    this.getCode()
     this.getTnspectionPlanType();
     this.getQualityMethodCode();
-    this.getCode()
   },
   computed: {
     seekList() {
@@ -474,13 +475,16 @@ export default {
           planList: this.statusList
         }
       ];
+    },
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
     }
   },
   methods: {
     reportApprovalSubmit(res) {
       console.log(res, 'res');
       this.processSubmitDialogFlag = true;
-      this.$nextTick(() => {
+      this.$nextTick(async () => {
         let params = {
           businessId: res.id,
           businessKey: 'qms_report_approval',
@@ -491,7 +495,20 @@ export default {
             businessType: '质检报告单'
           }
         };
+        console.log(this.clientEnvironmentId, 'parathis.clientEnvironmentIdms');
+        if (this.clientEnvironmentId == 5) {
+            // 嘉实环境
+            const data = await getCategoryByCode(res.productCode);
 
+            // 判断品类
+            if (data && data.categoryLevelCodePath?.includes('W3-209')) {
+              // 药品
+              params.businessKey = 'qms_report_approval1';
+            } else {
+              // 器械
+              params.businessKey = 'qms_report_approval';
+            }
+          }
         this.$refs.processSubmitDialogRef.init(params);
       });
     },
@@ -500,7 +517,10 @@ export default {
       parameterGetByCode({
         code: 'qms_report_approval'
       }).then((res) => {
+        console.log(res, 'qms_report_approval');
+        console
         this.isReportApproval = res.value;
+        console.log('isReportApproval', this.isReportApproval)
       });
     },
     datasource({ page, where, limit }) {