|
|
@@ -28,8 +28,58 @@
|
|
|
>{{ row.code }}</el-link
|
|
|
>
|
|
|
</template>
|
|
|
+
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
+ <el-dropdown
|
|
|
+ trigger="click"
|
|
|
+ v-if="
|
|
|
+ (!row.reportApprovalStatus || row.reportApprovalStatus == 0) &&
|
|
|
+ isEmptyObject(row.reportTemplateJson) &&
|
|
|
+ $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 &&
|
|
|
+ !isEmptyObject(row.reportTemplateJson) &&
|
|
|
+ $hasPermission('qms:quality_work_order:generateReport')
|
|
|
+ "
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ @click="openReport(row)"
|
|
|
+ >查看质检报告</el-link
|
|
|
+ >
|
|
|
+ <!-- 质检报告审批 -->
|
|
|
+ <el-link
|
|
|
+ v-if="
|
|
|
+ !row.reportApprovalStatus &&
|
|
|
+ $hasPermission('qms:quality_work_order:qualityReportApproval')
|
|
|
+ "
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ @click="reportApprovalSubmit(row)"
|
|
|
+ >质检报告审批</el-link
|
|
|
+ >
|
|
|
+
|
|
|
<el-link
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
@@ -47,9 +97,27 @@
|
|
|
ref="inspectionProjectReportRef"
|
|
|
@reload="reload"
|
|
|
/>
|
|
|
-
|
|
|
+ <component
|
|
|
+ :is="targetComponent"
|
|
|
+ ref="targetComponentRef"
|
|
|
+ v-if="targetComponent"
|
|
|
+ :key="targetComponent"
|
|
|
+ :isView="isView"
|
|
|
+ :visible.sync="targetVisible"
|
|
|
+ :row="currentRow"
|
|
|
+ :item="currentItem"
|
|
|
+ @reload="search"
|
|
|
+ :type="type"
|
|
|
+ ></component>
|
|
|
<sampleReport ref="sampleReportRef" @reload="reload"></sampleReport>
|
|
|
- <!-- <fileList ref="fileListRef"></fileList> -->
|
|
|
+ <process-submit-dialog
|
|
|
+ api-fun-name="qmsReportApprovalAPI"
|
|
|
+ :processSubmitDialogFlag.sync="processSubmitDialogFlag"
|
|
|
+ :isCloseRefresh="false"
|
|
|
+ v-if="processSubmitDialogFlag"
|
|
|
+ ref="processSubmitDialogRef"
|
|
|
+ @reload="search"
|
|
|
+ ></process-submit-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -67,19 +135,30 @@
|
|
|
} from '@/api/inspectionProjectTask';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import { recordingMethodList } from '@/utils/util.js';
|
|
|
+ import { getQmsReportTemplatePageList } from '@/api/inspectionWork';
|
|
|
+ import inspection_report1 from '../inspectionReport/template/inspection_report1.vue';
|
|
|
+ import inspection_report2 from '../inspectionReport/template/inspection_report2.vue';
|
|
|
+ import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
search,
|
|
|
inspectionProjectReport,
|
|
|
- sampleReport
|
|
|
+ sampleReport,
|
|
|
+ inspection_report2,
|
|
|
+ inspection_report1,processSubmitDialog
|
|
|
// fileList,
|
|
|
// wokePopup
|
|
|
},
|
|
|
mixins: [dictMixins, tabMixins],
|
|
|
data() {
|
|
|
return {
|
|
|
+ targetComponent: '',
|
|
|
cacheKeyUrl: 'qsm-c2e9664a-inspectionProjectTask',
|
|
|
+ reportTemplateList: [],
|
|
|
+ targetVisible: false,
|
|
|
+ processSubmitDialogFlag:false,
|
|
|
+ type: '1',
|
|
|
// 表格列配置
|
|
|
columns: [
|
|
|
{
|
|
|
@@ -268,7 +347,7 @@
|
|
|
{
|
|
|
columnKey: 'action',
|
|
|
label: '操作',
|
|
|
- width: 220,
|
|
|
+ width: 280,
|
|
|
align: 'center',
|
|
|
resizable: false,
|
|
|
slot: 'action',
|
|
|
@@ -281,6 +360,7 @@
|
|
|
created() {
|
|
|
this.requestDict('质检计划类型');
|
|
|
this.requestDict('取样类型');
|
|
|
+ this.getReportTemplateList();
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
@@ -328,10 +408,76 @@
|
|
|
'inspectionProjectTask'
|
|
|
);
|
|
|
} else {
|
|
|
- this.$refs.sampleReportRef.open(res.data, type, 'inspectionProjectTask');
|
|
|
+ this.$refs.sampleReportRef.open(
|
|
|
+ res.data,
|
|
|
+ type,
|
|
|
+ 'inspectionProjectTask'
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ 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);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ openReport(row) {
|
|
|
+ console.log('openReport', row);
|
|
|
+ this.targetComponent = row.reportTemplateCode;
|
|
|
+ this.isView = true;
|
|
|
+ this.currentRow = row;
|
|
|
+ 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_task_monad',
|
|
|
+ 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);
|
|
|
+ });
|
|
|
+ },
|
|
|
/* 删除 */
|
|
|
remove(row) {
|
|
|
const loading = this.$loading({ lock: true });
|