فهرست منبع

feat(inspection): 优化检验项目列表及报工状态展示

- 添加质检项目和报工审核状态列
- 调整操作按钮的显示条件以包含委托状态
- 修复 bpm 详情打开时实例 ID 传递错误的问题
- 将多处“计量数量”列名更改为“样品数量”
- 优化检验报告中的检测项名称样式
- 移除样品报告详情中多余的重复打开逻辑
yusheng 6 روز پیش
والد
کامیت
d5480a5e4a

+ 70 - 7
src/views/inspectionProjectRequest/components/inspectionProjectRequestList.vue

@@ -35,12 +35,38 @@
           v-if="row.processInstanceId"
           type="primary"
           :underline="false"
-          @click="bpmDetailOpen(row, 'detail')"
+          @click="bpmDetailOpen({ id: row.processInstanceId }, 'detail')"
           >{{ reviewStatus[row.approvalStatus] }}
         </el-link>
         <span v-else> {{ reviewStatus[row.approvalStatus] }}</span>
       </template>
+      <template v-slot:entrustedStatus="{ row }">
+        <el-link
+          v-if="row.entrustedProcessInstanceId"
+          type="primary"
+          :underline="false"
+          @click="
+            bpmDetailOpen({ id: row.entrustedProcessInstanceId }, 'detail')
+          "
+          >{{ reviewStatus[row.entrustedStatus] }}
+        </el-link>
+        <span v-else> {{ reviewStatus[row.entrustedStatus] }}</span>
+      </template>
 
+      <template v-slot:templateList="{ row }">
+        <div style="width: 250px; max-height: 60px; overflow: auto">
+          <el-tag
+            v-for="(item, index) in row.templateList"
+            :key="item.inspectionName + index"
+            effect="dark"
+            style="margin-top: 4px"
+          >
+            <span>
+              {{ item.inspectionName }}
+            </span>
+          </el-tag>
+        </div>
+      </template>
       <!-- 操作列 -->
       <template v-slot:action="{ row }">
         <el-link
@@ -50,7 +76,8 @@
           @click="openEdit(row)"
           v-if="
             [0, 3].includes(row.approvalStatus) &&
-            pageName == 'inspectionProjectRequest'
+            pageName == 'inspectionProjectRequest' &&
+            [0, 3].includes(row.entrustedStatus)
           "
         >
           编辑
@@ -60,7 +87,8 @@
           :underline="false"
           v-if="
             [0, 3].includes(row.approvalStatus) &&
-            pageName == 'inspectionProjectRequest'
+            pageName == 'inspectionProjectRequest' &&
+            [0, 3].includes(row.entrustedStatus)
           "
           @click="approvalSubmit(row)"
           >提交</el-link
@@ -71,7 +99,8 @@
           v-if="
             [2].includes(row.approvalStatus) &&
             pageName == 'inspectionProjectEntrusted' &&
-            row.status == 1
+            row.status == 1 &&
+            [0, 3].includes(row.entrustedStatus)
           "
           @click="report(row, 'edit')"
           >报工</el-link
@@ -82,7 +111,8 @@
           v-if="
             [2].includes(row.approvalStatus) &&
             pageName == 'inspectionProjectEntrusted' &&
-            row.status == 1
+            row.status == 1 &&
+            [0, 3].includes(row.entrustedStatus)
           "
           @click="openTransfer(row)"
           >转派</el-link
@@ -152,6 +182,7 @@
           @click="remove(row)"
           v-if="
             [0, 3].includes(row.approvalStatus) &&
+            [0, 3].includes(row.entrustedStatus) &&
             pageName == 'inspectionProjectRequest'
           "
         >
@@ -290,7 +321,7 @@
     methods: {
       bpmDetailOpen(row) {
         this.bpmDetailShow = true;
-        this.processInstanceId = row.processInstanceId;
+        this.processInstanceId = row.id;
       },
       getColumns() {
         this.columns = [
@@ -311,6 +342,13 @@
             align: 'center',
             minWidth: 130
           },
+          {
+            label: '质检项目',
+            prop: 'templateList',
+            slot: 'templateList',
+            align: 'center',
+            width: 250
+          },
           {
             prop: 'name',
             label: '任务名称',
@@ -486,6 +524,14 @@
             minWidth: 110,
             showOverflowTooltip: true
           },
+          {
+            prop: 'entrustedStatus',
+            slot: 'entrustedStatus',
+            label: '报工审核状态',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
           {
             prop: 'createUserName',
             minWidth: 110,
@@ -595,7 +641,8 @@
         }
 
         const res = await getById(row.id);
-        if (row.recordingMethod == 1) {
+
+        if (row.recordingMethod == 1 && !res.sampleTranscriptList?.length) {
           this.$refs.inspectionProjectReportRef.open(
             {
               workData: {
@@ -609,6 +656,22 @@
             'inspectionProjectRequest'
           );
         } else {
+          // if (res.sampleTranscriptList.length) {
+          //   res.sampleList = res.sampleTranscriptList.map((item) => {
+          //     return {
+          //       ...item,
+          //       qualitySampleTemplateList: item.selfCheckList.map(
+          //         (selfCheck) => {
+          //           return {
+          //             ...selfCheck,
+          //             qualityResultContent: selfCheck.selfCheckContent
+          //           };
+          //         }
+          //       )
+          //     };
+          //   });
+          // }
+          console.log(res, 'res');
           this.$refs.sampleReportRef.open(
             res,
             type,

+ 21 - 1
src/views/inspectionProjectTask/components/inspectionProjectTaskList.vue

@@ -28,7 +28,20 @@
           >{{ row.code }}</el-link
         >
       </template>
-
+      <template v-slot:templateList="{ row }">
+        <div style="width: 250px; max-height: 60px; overflow: auto">
+          <el-tag
+            v-for="(item, index) in row.templateList"
+            :key="item.inspectionName + index"
+            effect="dark"
+            style="margin-top: 4px"
+          >
+            <span>
+              {{ item.inspectionName }}
+            </span>
+          </el-tag>
+        </div>
+      </template>
       <!-- 操作列 -->
       <template v-slot:action="{ row }">
         <el-dropdown
@@ -191,6 +204,13 @@
             align: 'center',
             minWidth: 110
           },
+          {
+            label: '质检项目',
+            prop: 'templateList',
+            slot: 'templateList',
+            align: 'center',
+            width: 250
+          },
           {
             prop: 'executeDeptName',
             label: '执行部门',

+ 3 - 7
src/views/inspectionProjectTask/components/inspectionProjectTaskSend.vue

@@ -120,11 +120,7 @@
           <el-form-item
             label="接收人"
             prop="receiveUserId"
-            :rules="{
-              required: clientEnvironmentId != 9 ? true : false,
-              message: '请选择人员',
-              trigger: 'change'
-            }"
+ 
           >
             <el-select
               v-model="form.receiveUserId"
@@ -386,7 +382,7 @@
                 align: 'center'
               },
               { label: '包装单位', prop: 'packingUnit', align: 'center' },
-              { label: '计量数量', prop: 'measureQuantity', align: 'center' },
+              { label: '样品数量', prop: 'measureQuantity', align: 'center' },
               { label: '计量单位', prop: 'measureUnit', align: 'center' },
               {
                 label: '供应商名称',
@@ -634,7 +630,7 @@
               };
             });
           }
-     
+
           api(data)
             .then((msg) => {
               this.loading = false;

+ 5 - 2
src/views/inspectionWork/components/inspectionProjectReport.vue

@@ -232,7 +232,7 @@
         <fileMain v-model="row.imgUrl" type="view"></fileMain>
       </template>
       <template v-slot:defaultValue="{ row }">
-        <div style="display: flex; justify-content: center">
+        <div style="display: flex; justify-content: center; color: #409eff">
           <span v-if="row.textType != 8">{{ row.symbol }}</span>
           <span v-if="row.textType == 3">
             {{ row.minValue }}-{{ row.maxValue }}
@@ -251,7 +251,9 @@
           </span>
         </div>
       </template>
-
+      <template v-slot:inspectionName="{ row }">
+        <span style="color: #409eff">{{ row.inspectionName }}</span>
+      </template>
       <template v-slot:isRequired="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
@@ -604,6 +606,7 @@
           {
             minWidth: 120,
             prop: 'inspectionName',
+            slot: 'inspectionName',
             align: 'center',
             label: '检测项名称',
             showOverflowTooltip: true

+ 23 - 2
src/views/inspectionWork/components/inspectionWorkList.vue

@@ -41,7 +41,20 @@
       </template>
 
       <template v-slot:sourceCode="{ row }">
-        {{ row.qualityPlanCode ? row.qualityPlanCode : row.workOrderCode }}
+        <span>
+          {{
+            row.qualityPlanCode ? row.qualityPlanCode : row.workOrderCode
+          }}</span
+        >
+        <!-- <el-link
+          type="primary"
+          :underline="false"
+          @click="openWorkDetails(row)"
+        >
+          {{
+            row.qualityPlanCode ? row.qualityPlanCode : row.workOrderCode
+          }}</el-link
+        > -->
       </template>
 
       <template v-slot:files="scope">
@@ -311,6 +324,7 @@
     sampleCollection,
     checkByQualityWorkOrderId
   } from '@/api/inspectionWork';
+  import { planDetails } from '@/api/inspectionPlan';
   import { getList as getCertificate } from '@/api/certificateManagement';
 
   import { queryTodo } from '@/api/bpm/task';
@@ -324,6 +338,7 @@
   import { inspectionProjectStatus } from '@/enum/dict.js';
   import { recordingMethodList } from '@/utils/util.js';
   import certificate from '@/views/certificateManagement/components/certificate.vue';
+
   export default {
     name: 'InspectionWorkList',
     mixins: [dictMixins, tabMixins],
@@ -937,8 +952,14 @@
           query: { id, path: '/inspectionWork', name: '工单' }
         });
       },
-      openWorkDetails(row) {
+      async openWorkDetails(row) {
         if (row.qualityPlanCode) {
+          const data = await planDetails(row.qualityPlanId);
+          window.history.pushState(
+            null,
+            '',
+            `/page-eos/purchaseOrder?isView=true&id=${data.data.planSourceId}&activeComp=invoice`
+          );
         } else {
           this.$refs.mesWorkOrderRef.open(row);
         }

+ 1 - 1
src/views/inspectionWork/components/newQualityContentTabs.vue

@@ -805,7 +805,7 @@
           { label: '包装编码', prop: 'packageNo', align: 'center' },
           { label: '包装数量', prop: 'packingQuantity', align: 'center' },
           { label: '包装单位', prop: 'packingUnit', align: 'center' },
-          { label: '计量数量', prop: 'measureQuantity', align: 'center' },
+          { label: '样品数量', prop: 'measureQuantity', align: 'center' },
           { label: '计量单位', prop: 'measureUnit', align: 'center' },
           {
             label: '供应商名称',

+ 1 - 1
src/views/inspectionWork/components/sampleListDialog.vue

@@ -279,7 +279,7 @@
           { label: '样品编码', prop: 'sampleCode', align: 'center' },
           { label: '包装数量', prop: 'packingQuantity', align: 'center' },
           // { label: '包装单位', prop: 'packingUnit', align: 'center' },
-          { label: '计量数量', prop: 'measureQuantity', align: 'center' },
+          { label: '样品数量', prop: 'measureQuantity', align: 'center' },
           // { label: '计量单位', prop: 'measureUnit', align: 'center' },
           { label: '物料代号', prop: 'materielDesignation', align: 'center' },
           { label: '客户代号', prop: 'clientCode', align: 'center' },

+ 1 - 12
src/views/inspectionWork/components/sampleReport.vue

@@ -563,7 +563,7 @@
           { label: '包装编码', prop: 'packageNo', align: 'center' },
           { label: '包装数量', prop: 'packingQuantity', align: 'center' },
           { label: '包装单位', prop: 'packingUnit', align: 'center' },
-          { label: '计量数量', prop: 'measureQuantity', align: 'center' },
+          { label: '样品数量', prop: 'measureQuantity', align: 'center' },
           { label: '计量单位', prop: 'measureUnit', align: 'center' },
           {
             label: '供应商名称',
@@ -723,17 +723,6 @@
       },
       handleDetail(index, row, type) {
         if (type) {
-          if (!index) {
-            this.$refs.detailRef.openDia(
-              null,
-              null,
-              type,
-              this.sampleList,
-              null,
-              [],
-              this.pageName
-            );
-          }
           this.$refs.detailRef.openDia(
             index,
             row,