Преглед изворни кода

feat(bpm): 添加质检任务单和受托单详情获取功能,优化详情弹窗逻辑

yusheng пре 4 месеци
родитељ
комит
93afc6f9e3

+ 9 - 1
src/api/bpm/components/inspectionProjectRequest/index.js

@@ -30,10 +30,18 @@ export async function updateRequestentrust(data) {
 }
 
 // 获取详情
-export async function getById(id) {
+export async function requestentrustGetById(id) {
   const res = await request.get(`/qms/requestentrust/getById/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
+// 获取详情
+export async function taskmonadGetById(id) {
+  const res = await request.get(`/qms/taskmonad/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 14 - 3
src/views/bpm/handleTask/components/qualityReportApproval/detailDialog.vue

@@ -23,7 +23,10 @@
   import browse from '@/components/jimureport/browse.vue';
   import { getJmPrintViewUrl } from '@/components/jimureport//api.js';
   import { getToken } from '@/utils/token-util';
-
+  import {
+    requestentrustGetById,
+    taskmonadGetById
+  } from '@/api/bpm/components/inspectionProjectRequest';
   export default {
     props: {
       taskDefinitionKey: {
@@ -38,7 +41,8 @@
       },
       businessCode: {
         default: ''
-      }
+      },
+      businessType: ''
     },
     components: {
       browse
@@ -55,7 +59,14 @@
     },
     methods: {
       async open() {
-        const detail = await getDetailById(this.businessId);
+        let api = getDetailById;
+        if (this.businessType.includes('质检任务单')) {
+          api = taskmonadGetById;
+        }
+        if (this.businessType.includes('质检受托单')) {
+          api = requestentrustGetById
+        }
+        const detail = await api(this.businessId);
         // this.reportData = detail;
         // this.showEditFlag = true;
         if (detail.data.reportTemplateJson?.template) {

+ 2 - 1
src/views/bpm/handleTask/index.vue

@@ -24,6 +24,7 @@
             :businessId="listData?.businessId"
             :businessCode="listData?.businessCode"
             :id="listData?.id"
+            :businessType="listData?.businessType"
             :processDefinitionId="processInstance.processDefinition.id"
             :taskDefinitionKey="listData?.taskDefinitionKey"
             @activeCompChange="activeCompChange"
@@ -349,7 +350,7 @@
           businessId: '', // 业务id
           businessCode: '', //业务编码
           taskDefinitionKey: '',
-
+          businessType:'',
           taskId: '' //任务编码
         },
 

+ 10 - 1
src/views/bpm/tickets/components/signingUpWork.vue

@@ -194,6 +194,8 @@
 <script>
   import { report } from '@/api/tickets';
   import { getById } from '@/api/tickets';
+  const dayjs = require('dayjs');
+  import { getWordOrderDetail } from '@/api/maintenance/patrol_maintenance';
   export default {
     data() {
       return {
@@ -253,7 +255,8 @@
         });
       },
       handleStatusChange(row) {
-        row.result =row.status == '-1' ? '异常' : row.status == '1' ? '正常' : '';
+        row.result =
+          row.status == '-1' ? '异常' : row.status == '1' ? '正常' : '';
       },
       open(row) {
         console.log(row);
@@ -300,6 +303,12 @@
         });
         this.infoData = res.data;
         this.infoData.workOrderId = row.id;
+        getWordOrderDetail(row.id).then((res) => {
+          this.time = [
+            res.acceptTime,
+            dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          ];
+        });
       }
     }
   };

+ 1 - 0
src/views/bpm/todo/index.vue

@@ -315,6 +315,7 @@
               id: row.processInstance.id,
               businessId: row.businessId,
               businessCode: row.businessCode,
+              businessType: row.businessType,
               taskId: row.id,
               taskDefinitionKey: row.taskDefinitionKey,
               pcHandleRouter: row.pcHandleRouter,

+ 1 - 1
vue.config.js

@@ -38,7 +38,7 @@ module.exports = {
         // target: 'http://124.71.68.31:50001', // 测试环境
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.105:18086',
-        target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.3:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.3:18086',