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

新增合格证管理模块,包含列表查询、新增、修改、作废和详情功能,优化质检报告相关操作按钮显示逻辑

yusheng 6 месяцев назад
Родитель
Сommit
2baf934769

+ 50 - 0
src/api/certificateManagement/index.js

@@ -0,0 +1,50 @@
+import request from '@/utils/request';
+
+// 列表
+
+export async function getList(params) {
+  const res = await request.get(`/qms/qmscertificatemanagement/page`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//修改
+
+export async function update(data) {
+  const res = await request.put(`/qms/qmscertificatemanagement/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 保存
+export async function save(data) {
+  const res = await request.post(`/qms/qmscertificatemanagement/save`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//作废
+export async function cancel(data) {
+  const res = await request.put(`/qms/qmscertificatemanagement/cancel`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取详情
+export async function getById(id) {
+  const res = await request.get(`/qms/qmscertificatemanagement/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 2 - 0
src/components/workList/wokePopup.vue

@@ -6,6 +6,7 @@
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     append-to-body
+    resizable
     :maxable="true"
     width="80%"
   >
@@ -32,6 +33,7 @@
     },
 
     watch: {},
+
     methods: {
       open(ids) {
         this.visible = true;

+ 258 - 0
src/views/certificateManagement/components/add.vue

@@ -0,0 +1,258 @@
+<template>
+  <ele-modal
+    width="70%"
+    :append-to-body="true"
+    :close-on-click-modal="false"
+    custom-class="ele-dialog-form"
+    title="新增"
+    :visible.sync="visible"
+    :maxable="true"
+    @close="cancel"
+  >
+    <ele-pro-table :needPage="false" :columns="columns" :datasource="list">
+      <template v-slot:sourceCode="{ row }">
+        <div>
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="openWorkDetails(row)"
+          >
+            {{
+              row.qualityPlanCode ? row.qualityPlanCode : row.workOrderCode
+            }}</el-link
+          >
+        </div>
+      </template>
+
+      <template v-slot:qualityType="{ row }">{{
+        getDictValue('质检计划类型', row.qualityType)
+      }}</template>
+      <template v-slot:qualityMode="{ row }">{{
+        getDictValue('取样类型', row.qualityMode)
+      }}</template>
+    </ele-pro-table>
+    <el-form
+      ref="form"
+      style="margin-top: 15px"
+      :model="form"
+      class="el-form-box"
+      label-width="100px"
+    >
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="重要记事:" prop="remark">
+            <el-input
+              style="height: 100px"
+              maxlength="200"
+              v-model="form.remark"
+              placeholder=" "
+              type="textarea"
+              show-word-limit
+            ></el-input> </el-form-item
+        ></el-col>
+      </el-row>
+    </el-form>
+    <template v-slot:footer>
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" :loading="loading" @click="save">
+        确认
+      </el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  const defaultForm = {
+    id: null,
+    remark: ''
+  };
+  export default {
+    components: {},
+
+    data() {
+      return {
+        form: { ...defaultForm },
+
+        list: [],
+        columns: [
+          // 新增多选列
+
+          {
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            label: '序号',
+            width: 55,
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '质检工单编码',
+            slot: 'code',
+            align: 'center',
+            width: 180,
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            slot: 'name',
+            width: 120,
+            label: '质检工单名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '来源单号',
+            prop: 'sourceCode',
+            slot: 'sourceCode',
+            align: 'center',
+            width: 160,
+            showOverflowTooltip: true
+          },
+          {
+            label: '类型',
+            prop: 'qualityType',
+            slot: 'qualityType',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            label: '质检方式',
+            prop: 'qualityMode',
+            slot: 'qualityMode',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'executeUserName',
+            label: '质检人',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return row.executeUserName || '';
+            }
+          },
+          {
+            prop: 'qualityTime',
+            label: '质检时间',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productCode',
+            width: 120,
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productName',
+            width: 120,
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'produceTaskName',
+            label: '工序',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'total',
+            label: '报检数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'qualifiedNumber',
+            label: '合格数',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            align: 'center',
+            width: 100,
+            resizable: false,
+            slot: 'action',
+            fixed: 'right'
+          }
+        ],
+        rules: {},
+
+        loading: false,
+        visible: false
+      };
+    },
+    computed: {},
+
+    created() {},
+    methods: {
+      async open(row, type) {
+        this.type = type;
+        this.visible = true;
+        if (type != 'add') {
+        }
+      },
+
+      save() {
+        return;
+        if (this.list.length == 0) {
+          return this.$message.warning('质检工单不能为空!');
+        }
+
+        api({
+          ...this.form,
+          detailList: this.list
+        })
+          .then((msg) => {
+            this.loading = false;
+            this.$emit('reload');
+            this.cancel();
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
+      },
+      cancel() {
+        this.visible = false;
+        this.form = { ...defaultForm };
+        this.list = [];
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 56 - 0
src/views/certificateManagement/components/search.vue

@@ -0,0 +1,56 @@
+<!-- 搜索表单 -->
+<template>
+  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
+</template>
+
+<script>
+  import { getList } from '@/api/inspectionStandard';
+  import { recordingMethodList } from '@/utils/util.js';
+
+  export default {
+    data() {
+      return {
+        qualityStandardList: []
+      };
+    },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '批次号:',
+            value: 'batchNo',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '订单号:',
+            value: 'orderNo',
+            type: 'input',
+            placeholder: '请输入'
+          },
+
+          {
+            label: '编号:',
+            value: 'productCode',
+            type: 'input',
+            placeholder: '请输入'
+          }
+        ];
+      }
+    },
+    created() {
+      getList({
+        pageNum: 1,
+        size: -1
+      }).then((res) => {
+        this.qualityStandardList = res.list;
+      });
+    },
+    methods: {
+      /* 搜索 */
+      search(e) {
+        this.$emit('search', { ...e });
+      }
+    }
+  };
+</script>

+ 279 - 0
src/views/certificateManagement/index.vue

@@ -0,0 +1,279 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <!-- 搜索表单 -->
+      <search @search="reload" />
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="code"
+        :page-size="20"
+        @columns-change="handleColumnChange"
+        :cache-key="cacheKeyUrl"
+      >
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            class="ele-btn-icon"
+            @click="open('', 'add')"
+          >
+            新增
+          </el-button>
+        </template>
+        <template v-slot:code="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="open(row, 'detail')"
+            >{{ row.code }}</el-link
+          >
+        </template>
+
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="open(row, 'edit')"
+          >
+            打印
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <!-- 编辑弹窗 -->
+    <add ref="addRef" @reload="reload" />
+  </div>
+</template>
+
+<script>
+  import search from './components/search.vue';
+  import add from './components/add.vue';
+
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import { getList, getById } from '@/api/certificateManagement';
+  import dictMixins from '@/mixins/dictMixins';
+
+  export default {
+    components: {
+      search,
+      add
+    },
+    mixins: [dictMixins, tabMixins],
+    data() {
+      return {
+        cacheKeyUrl: 'qsm-c2e9664a-certificateManagement',
+
+        processSubmitDialogFlag: false,
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            slot: 'code',
+            label: '合格证号',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 130
+          },
+          {
+            prop: 'quantity',
+            label: '报检数量',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 100
+          },
+          {
+            prop: 'qualifiedQuantity',
+            label: '合格数量',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'remark',
+            minWidth: 180,
+            label: '重要记事',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            minWidth: 110,
+            label: '批次号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'orderNo',
+            label: '订单号',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 140
+          },
+          {
+            prop: 'luxuryProductCode',
+            minWidth: 110,
+            label: '顶级产品编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'luxuryProductName',
+            minWidth: 110,
+            label: '顶级产品名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productCode',
+            minWidth: 110,
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productName',
+            minWidth: 110,
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'executeDeptName',
+            label: '下发数量',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'executeUserName',
+            minWidth: 110,
+            label: '计量单位',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'processingType',
+            minWidth: 110,
+            label: '加工类型',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'processingType',
+            minWidth: 110,
+            label: '作业名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'contractor',
+            minWidth: 110,
+            label: '承制单位',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'orderType',
+            minWidth: 110,
+            label: '订单类型',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'createUserName',
+            minWidth: 110,
+            label: '开证人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createTime',
+            minWidth: 110,
+            label: '开证时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'status',
+            minWidth: 110,
+            label: '状态',
+            align: 'center',
+            formatter: (row) => {
+              return row.status == 1 ? '正常' : '已作废';
+            },
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 220,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right',
+            showOverflowTooltip: true
+          }
+        ]
+      };
+    },
+    created() {
+      this.requestDict('质检计划类型');
+      this.requestDict('取样类型');
+    },
+
+    methods: {
+      /*回显类型 */
+
+      /* 表格数据源 */
+      datasource({ page, where, limit }) {
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+
+      /* 报工 */
+      async open(row, type) {
+        this.$refs.addRef.open(row, type);
+      },
+
+      /* 删除 */
+      remove(row) {
+        const loading = this.$loading({ lock: true });
+
+        removeItem([row.id])
+          .then((msg) => {
+            loading.close();
+            this.$message.success('删除' + msg);
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+          });
+      }
+    }
+  };
+</script>

+ 152 - 24
src/views/inspectionProjectRequest/index.vue

@@ -8,7 +8,6 @@
         ref="table"
         :columns="columns"
         :datasource="datasource"
-        :selection.sync="selection"
         row-key="code"
         :page-size="20"
         @columns-change="handleColumnChange"
@@ -98,13 +97,61 @@
             @click="openTransfer(row)"
             >转派</el-link
           >
-          <!-- <el-link
-            v-if="row.qualityWorkOrderId"
+          <el-dropdown
+            trigger="click"
+            v-if="
+              (!row.reportApprovalStatus || row.reportApprovalStatus == 0) &&
+              isEmptyObject(row.reportTemplateJson) &&
+              [2].includes(row.approvalStatus) &&
+              pageName == 'inspectionProjectEntrusted' &&
+              $hasPermission('qms:quality_work_order:generateReport')
+            "
+          >
+            <el-link type="primary" :underline="false">生成质检报告</el-link>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item
+                v-for="item in reportTemplateList"
+                :key="item.id"
+                @click.native="generateReportApproval(row, item)"
+                >{{ item.name
+                }}{{
+                  '(' +
+                  item.versionSymbol +
+                  item.bigVersion +
+                  item.versionMark +
+                  item.smallVersion +
+                  ')'
+                }}</el-dropdown-item
+              >
+            </el-dropdown-menu>
+          </el-dropdown>
+          <el-link
+            v-if="
+              row.reportApprovalStatus &&
+              row.reportApprovalStatus != 3 &&
+              !isEmptyObject(row.reportTemplateJson) &&
+              [2].includes(row.approvalStatus) &&
+              pageName == 'inspectionProjectEntrusted' &&
+              $hasPermission('qms:quality_work_order:generateReport')
+            "
             type="primary"
             :underline="false"
-            @click="craftFiles(row.qualityWorkOrderId)"
-            >工艺文件</el-link
-          > -->
+            @click="openReport(row)"
+            >查看质检报告</el-link
+          >
+
+          <el-link
+            v-if="
+              (!row.reportApprovalStatus || row.reportApprovalStatus == 3) &&
+              [2].includes(row.approvalStatus) &&
+              pageName == 'inspectionProjectEntrusted' &&
+              $hasPermission('qms:quality_work_order:qualityReportApproval')
+            "
+            type="primary"
+            :underline="false"
+            @click="reportApprovalSubmit(row)"
+            >质检报告审批</el-link
+          >
           <el-link
             type="danger"
             :underline="false"
@@ -136,7 +183,19 @@
       ref="processSubmitDialogRef"
       @reload="reload"
     ></processSubmitDialog>
-      <sampleReport ref="sampleReportRef" @reload="reload"></sampleReport>
+    <component
+      :is="targetComponent"
+      ref="targetComponentRef"
+      v-if="targetComponent"
+      :key="targetComponent"
+      :isView="isView"
+      :visible.sync="targetVisible"
+      :row="currentRow"
+      :item="currentItem"
+      @reload="reload"
+      :type="'2'"
+    ></component>
+    <sampleReport ref="sampleReportRef" @reload="reload"></sampleReport>
 
     <Transfer
       v-if="transferVisible"
@@ -172,7 +231,8 @@
   import tabMixins from '@/mixins/tableColumnsMixin';
   import inspectionProjectTaskSend from '@/views/inspectionProjectTask/components/inspectionProjectTaskSend.vue';
   import inspectionProjectReport from '@/views/inspectionWork/components/inspectionProjectReport.vue';
-
+  import inspection_report1 from '../inspectionReport/template/inspection_report1.vue';
+  import inspection_report2 from '../inspectionReport/template/inspection_report2.vue';
   import {
     getList,
     sampleCollection,
@@ -186,6 +246,7 @@
   import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
   import { recordingMethodList } from '@/utils/util.js';
+  import { getQmsReportTemplatePageList } from '@/api/inspectionWork';
 
   export default {
     components: {
@@ -195,7 +256,9 @@
       inspectionProjectReport,
       Transfer,
       bpmDetail,
-      sampleReport
+      sampleReport,
+      inspection_report1,
+      inspection_report2
     },
     props: {
       cacheKeyUrl: {
@@ -216,14 +279,21 @@
         transferId: '',
         processInstanceId: '',
         bpmDetailShow: false,
+        targetVisible: false,
+        reportTemplateList: [],
+        targetComponent: '',
         // 表格列配置
-        columns: []
+        columns: [],
+        currentItem: '',
+        currentRow: '',
+        currentRow: false
       };
     },
     created() {
       this.requestDict('质检计划类型');
       this.requestDict('取样类型');
       this.getColumns();
+      this.getReportTemplateList();
     },
     methods: {
       bpmDetailOpen(row) {
@@ -473,7 +543,7 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 220,
+            width: 280,
             align: 'center',
             resizable: false,
             slot: 'action',
@@ -541,6 +611,11 @@
             'inspectionProjectRequest'
           );
         } else {
+          if (type != 'detail') {
+            res.sampleList.forEach((item) => {
+              item.qualitySampleTemplateList = res.templateList;
+            });
+          }
           this.$refs.sampleReportRef.open(
             res,
             type,
@@ -548,19 +623,72 @@
           );
         }
       },
-      // async craftFiles(id) {
-      //   if (id) {
-      //     const data = await craftFiles(id);
-      //     if (data.length) {
-      //       this.$nextTick(() => {
-      //         this.$refs.fileListRef.open(
-      //           data.map((item) => item.id),
-      //           'view'
-      //         );
-      //       });
-      //     }
-      //   }
-      // },
+
+      getReportTemplateList() {
+        getQmsReportTemplatePageList({
+          pageNum: 1,
+          pageSize: 999,
+          isEnabled: 1
+        })
+          .then((res) => {
+            this.reportTemplateList = res.list;
+            console.log('reportTemplateList', this.reportTemplateList);
+          })
+          .catch((err) => {
+            console.error('获取报表模板列表失败:', err);
+            // this.$message.error('获取报表模板列表失败:' + (err.message || '操作异常'));
+          });
+      },
+      generateReportApproval(row, item) {
+        this.targetComponent = item.code;
+        this.isView = false;
+        this.currentRow = row;
+        this.currentItem = item;
+        // this.$refs.targetComponentRef.open(item, row);
+        this.$nextTick(() => {
+          //   this.$refs.targetComponentRef.open(row, isView);
+          this.targetVisible = true;
+          console.log('targetVisible~~~~', this.targetVisible);
+        });
+      },
+      async openReport(row) {
+        const data = await getById(row.id);
+        this.targetComponent = row.reportTemplateCode;
+        this.isView = true;
+        this.currentRow = row;
+        this.currentRow.reportApprovalTaskVos =
+          data.reportApprovalTaskVos || {};
+        this.$nextTick(() => {
+          this.targetVisible = true;
+        });
+      },
+      isEmptyObject(obj = {}) {
+        return Object.keys(obj).length === 0;
+      },
+      reportApprovalSubmit(res) {
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(async () => {
+          let params = {
+            businessId: res.id,
+            businessKey: 'qms_report_approval_request_entrust',
+            formCreateUserId: res.createUserId,
+            variables: {
+              businessCode: res.code,
+              businessName: res.name,
+              businessType: '质检报告单(质检受托单)'
+            }
+          };
+          // 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);
+        });
+      },
       async sampleCollection(row) {
         const code = await verificationQualityInspector(row.id);
         if (code == '-1') {

+ 29 - 17
src/views/inspectionProjectTask/index.vue

@@ -31,7 +31,7 @@
 
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-          <!-- <el-dropdown
+          <el-dropdown
             trigger="click"
             v-if="
               (!row.reportApprovalStatus || row.reportApprovalStatus == 0) &&
@@ -56,10 +56,11 @@
                 }}</el-dropdown-item
               >
             </el-dropdown-menu>
-          </el-dropdown> -->
-          <!-- <el-link
+          </el-dropdown>
+          <el-link
             v-if="
               row.reportApprovalStatus &&
+              row.reportApprovalStatus != 3 &&
               !isEmptyObject(row.reportTemplateJson) &&
               $hasPermission('qms:quality_work_order:generateReport')
             "
@@ -67,18 +68,18 @@
             :underline="false"
             @click="openReport(row)"
             >查看质检报告</el-link
-          > -->
-          <!-- 质检报告审批  -->
-          <!-- <el-link
+          >
+
+          <el-link
             v-if="
-              !row.reportApprovalStatus &&
+              (!row.reportApprovalStatus || row.reportApprovalStatus == 3) &&
               $hasPermission('qms:quality_work_order:qualityReportApproval')
             "
             type="primary"
             :underline="false"
             @click="reportApprovalSubmit(row)"
             >质检报告审批</el-link
-          > -->
+          >
 
           <el-link
             type="primary"
@@ -106,8 +107,8 @@
       :visible.sync="targetVisible"
       :row="currentRow"
       :item="currentItem"
-      @reload="search"
-      :type="type"
+      @reload="reload"
+      :type="'1'"
     ></component>
     <sampleReport ref="sampleReportRef" @reload="reload"></sampleReport>
     <process-submit-dialog
@@ -116,7 +117,7 @@
       :isCloseRefresh="false"
       v-if="processSubmitDialogFlag"
       ref="processSubmitDialogRef"
-      @reload="search"
+      @reload="reload"
     ></process-submit-dialog>
   </div>
 </template>
@@ -146,7 +147,8 @@
       inspectionProjectReport,
       sampleReport,
       inspection_report2,
-      inspection_report1,processSubmitDialog
+      inspection_report1,
+      processSubmitDialog
       // fileList,
       // wokePopup
     },
@@ -157,8 +159,10 @@
         cacheKeyUrl: 'qsm-c2e9664a-inspectionProjectTask',
         reportTemplateList: [],
         targetVisible: false,
-        processSubmitDialogFlag:false,
-        type: '1',
+        processSubmitDialogFlag: false,
+        currentItem: '',
+        currentRow: '',
+        currentRow: false,
         // 表格列配置
         columns: [
           {
@@ -408,6 +412,12 @@
             'inspectionProjectTask'
           );
         } else {
+          if (type != 'detail') {
+            res.data.sampleList.forEach((item) => {
+              item.qualitySampleTemplateList = res.data.templateList;
+            });
+          }
+
           this.$refs.sampleReportRef.open(
             res.data,
             type,
@@ -442,11 +452,13 @@
           console.log('targetVisible~~~~', this.targetVisible);
         });
       },
-      openReport(row) {
-        console.log('openReport', row);
+      async openReport(row) {
+        const data = await getById(row.id);
         this.targetComponent = row.reportTemplateCode;
         this.isView = true;
         this.currentRow = row;
+        this.currentRow.reportApprovalTaskVos =
+          data.data.reportApprovalTaskVos || {};
         this.$nextTick(() => {
           this.targetVisible = true;
         });
@@ -464,7 +476,7 @@
             variables: {
               businessCode: res.code,
               businessName: res.name,
-              businessType: '质检报告单'
+              businessType: '质检报告单(质检任务单)'
             }
           };
           // if (this.clientEnvironmentId == 5) {

+ 11 - 10
src/views/inspectionReport/template/inspection_report1.vue

@@ -374,9 +374,8 @@
     queryInspectionReportList,
     generateReport
   } from '@/api/inspectionReport';
-  import { getById } from '@/api/inspectionProjectTask';
+
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
-  import { getDetailById } from '@/api/inspectionWork/index';
   import { getCode } from '@/api/login';
 
   export default {
@@ -444,15 +443,17 @@
         this.currentRow = row;
         this.templateItem = item || row;
         console.log('currentRow~~~', this.currentRow, this.templateItem);
-        let api = this.type === '0' ? getDetailById : getById;
+        // let api = this.type === '0' ? getDetailById : getById;
+        this.processInstanceId = row.reportProcessInstanceId;
+        this.reportApprovalTaskVos = row.reportApprovalTaskVos;
 
-        try {
-          const res = await api(this.row.id);
-          this.processInstanceId = res.data.reportProcessInstanceId;
-          this.reportApprovalTaskVos = res.data.reportApprovalTaskVos;
-        } catch (error) {
-          console.log('error~~~~', error);
-        }
+        // try {
+        //   const res = await api(this.row.id);
+        //   this.processInstanceId = row.reportProcessInstanceId;
+        //   this.reportApprovalTaskVos = res.data.reportApprovalTaskVos;
+        // } catch (error) {
+        //   console.log('error~~~~', error);
+        // }
 
         // this.visible = true;
         if (this.currentRow.reportTemplateJson?.basicInfoData) {

+ 3 - 10
src/views/inspectionReport/template/inspection_report2.vue

@@ -395,8 +395,7 @@
     generateReport
   } from '@/api/inspectionReport';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
-  import { getDetailById } from '@/api/inspectionWork/index';
-  import { getById } from '@/api/inspectionProjectTask';
+
   import { getCode } from '@/api/login';
 
   export default {
@@ -464,14 +463,8 @@
         this.currentRow = row;
         this.templateItem = item || row;
         console.log('currentRow~~~', this.currentRow, this.templateItem);
-        let api = this.type === '0' ? getDetailById : getById;
-        try {
-          const res = await api(this.row.id);
-          this.processInstanceId = res.data.reportProcessInstanceId;
-          this.reportApprovalTaskVos = res.data.reportApprovalTaskVos;
-        } catch (error) {
-          console.log('error~~~~', error);
-        }
+        this.processInstanceId = row.reportProcessInstanceId;
+        this.reportApprovalTaskVos = row.reportApprovalTaskVos;
 
         // this.visible = true;
         if (this.currentRow.reportTemplateJson?.basicInfoData) {

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

@@ -8,6 +8,7 @@
     append-to-body
     width="80%"
     :maxable="true"
+
   >
     <header-title title="基础信息"> </header-title>
     <el-form
@@ -151,7 +152,7 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <header-title title="实验/实验设备"> </header-title>
+      <header-title title="实验/实验设备"> </header-title>
       <el-row>
         <el-col :span="8">
           <el-form-item label="实验室:" prop="workshopId">

+ 7 - 1
src/views/inspectionWork/components/inspectionProjectReport.vue

@@ -8,7 +8,10 @@
     :close-on-press-escape="false"
     append-to-body
     width="80%"
+    resizable
+
     :maxable="true"
+
   >
     <ele-pro-table
       :needPage="false"
@@ -705,7 +708,6 @@
             label: '质检结果',
             showOverflowTooltip: true,
             fixed: 'right'
-
           },
           {
             minWidth: 150,
@@ -903,6 +905,10 @@
 
       handleClose() {
         this.visible = false;
+        // console.log(this.visible, 'asd');
+        // if (this.$refs.wokePopupRef) {
+        //   this.$refs.wokePopupRef.visible = false;
+        // }
       },
       handleConfirm() {
         let isHandleConfirm = false;

+ 4 - 4
src/views/inspectionWork/edit.vue

@@ -398,10 +398,10 @@
         };
       }
     },
-    // p:{
-    //   sampletypeVal()=>{
-    //     return
-    //   }
+
+    // beforeRouteLeave(to, from, next) {
+    //   this.$refs.inspectionProjectReportRef.handleClose();
+    //   next();
     // },
     data() {
       const defaultForm = function () {

+ 8 - 5
src/views/inspectionWork/index.vue

@@ -301,7 +301,7 @@
       :row="currentRow"
       :item="currentItem"
       @reload="search"
-      :type="type"
+      :type="'0'"
     ></component>
     <mesWorkOrder ref="mesWorkOrderRef"></mesWorkOrder>
   </div>
@@ -318,7 +318,7 @@
   import {
     getList,
     removeItem,
-    updateCertificateNumber,
+    getDetailById,
     closeWorkList,
     verificationQualityInspector,
     closeWork,
@@ -363,7 +363,6 @@
         targetVisible: false,
         currentRow: {},
         currentItem: {},
-        type: '0',
         columns: [
           // 新增多选列
           {
@@ -763,11 +762,15 @@
           console.log('targetVisible~~~~', this.targetVisible);
         });
       },
-      openReport(row) {
-        console.log('openReport', row);
+      async openReport(row) {
+        // console.log('openReport', row);
+        const data = await getDetailById(row.id);
+        console.log(data, 'data');
         this.targetComponent = row.reportTemplateCode;
         this.isView = true;
         this.currentRow = row;
+        this.currentRow.reportApprovalTaskVos =
+          data.data.reportApprovalTaskVos || {};
         this.$nextTick(() => {
           this.targetVisible = true;
         });