|
|
@@ -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') {
|