|
|
@@ -0,0 +1,478 @@
|
|
|
+<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-dropdown
|
|
|
+ trigger="click"
|
|
|
+ v-if="
|
|
|
+ pageName == 'management' &&
|
|
|
+ $hasPermission('qms:qmscertificatemanagement:save')
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-button size="small" type="primary" class="ele-btn-icon">
|
|
|
+ 新增
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item
|
|
|
+ v-for="item in reportTemplateList"
|
|
|
+ :key="item.id"
|
|
|
+ @click.native="open(item, 'add')"
|
|
|
+ >{{ item.name
|
|
|
+ }}{{
|
|
|
+ '(' +
|
|
|
+ item.versionSymbol +
|
|
|
+ item.bigVersion +
|
|
|
+ item.versionMark +
|
|
|
+ item.smallVersion +
|
|
|
+ ')'
|
|
|
+ }}</el-dropdown-item
|
|
|
+ >
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:code="{ row }">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ @click="open(row, 'print')"
|
|
|
+ >{{ row.code }}</el-link
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template v-slot:type="{ row }">{{
|
|
|
+ getDictValue('质检计划类型', row.type)
|
|
|
+ }}</template>
|
|
|
+ <!-- 操作列 -->
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ @click="open(row, 'edit')"
|
|
|
+ v-if="
|
|
|
+ ![1, 2, 3].includes(row.status) &&
|
|
|
+ pageName == 'management' &&
|
|
|
+ $hasPermission('qms:qmscertificatemanagement:update')
|
|
|
+ "
|
|
|
+ >修改</el-link
|
|
|
+ >
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ @click="approvalSubmit(row)"
|
|
|
+ v-if="
|
|
|
+ ![1, 2, 3].includes(row.status) &&
|
|
|
+ pageName == 'management' &&
|
|
|
+ $hasPermission('qms:qmscertificatemanagement:save')
|
|
|
+ "
|
|
|
+ >提交</el-link
|
|
|
+ >
|
|
|
+ <el-link
|
|
|
+ type="danger"
|
|
|
+ :underline="false"
|
|
|
+ @click="cancel(row)"
|
|
|
+ v-if="
|
|
|
+ ![1, 2, 3].includes(row.status) &&
|
|
|
+ pageName == 'management' &&
|
|
|
+ $hasPermission('qms:qmscertificatemanagement:cancel')
|
|
|
+ "
|
|
|
+ >作废</el-link
|
|
|
+ >
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ @click="withdraw(row)"
|
|
|
+ v-if="[1].includes(row.status) && pageName == 'management'"
|
|
|
+ >撤回</el-link
|
|
|
+ >
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="open(row, 'print')"
|
|
|
+ >
|
|
|
+ 打印
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <certificate ref="certificateREf" @reload="reload" />
|
|
|
+ <processSubmitDialog
|
|
|
+ :processSubmitDialogFlag.sync="processSubmitDialogFlag"
|
|
|
+ v-if="processSubmitDialogFlag"
|
|
|
+ ref="processSubmitDialogRef"
|
|
|
+ @reload="reload"
|
|
|
+ ></processSubmitDialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import search from './search.vue';
|
|
|
+ import certificate from './certificate.vue';
|
|
|
+ import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
|
|
|
+ import { getQmsReportTemplatePageList } from '@/api/inspectionWork';
|
|
|
+
|
|
|
+ import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
+ import { getList, getById, cancel } from '@/api/certificateManagement';
|
|
|
+ import { withdraw } from '@/api/bpm';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
+ export default {
|
|
|
+ props: {
|
|
|
+ pageName: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ type: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ search,
|
|
|
+ certificate,
|
|
|
+ processSubmitDialog
|
|
|
+ },
|
|
|
+ mixins: [dictMixins, tabMixins],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ cacheKeyUrl: 'qsm-c2e9664a-certificateManagement',
|
|
|
+ processSubmitDialogFlag: false,
|
|
|
+ orderTypeList: [
|
|
|
+ {
|
|
|
+ id: 0,
|
|
|
+ label: '库存性订单'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ label: '生产性订单'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ label: '无客户生产性订单'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 4,
|
|
|
+ label: '不定向订单'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ processSubmitDialogFlag: false,
|
|
|
+ // 表格列配置
|
|
|
+ reportTemplateList:[],
|
|
|
+ columns: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.requestDict('质检计划类型');
|
|
|
+ this.requestDict('取样类型');
|
|
|
+ this.setColumns();
|
|
|
+ this.getReportTemplateList();
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ setColumns() {
|
|
|
+ this.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: 'type',
|
|
|
+ label: '类型',
|
|
|
+ slot: 'type',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ // {
|
|
|
+ // prop: 'remark',
|
|
|
+ // minWidth: 180,
|
|
|
+ // label: '重要记事',
|
|
|
+ // align: 'center',
|
|
|
+ // showOverflowTooltip: true
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ prop: 'produceTaskName',
|
|
|
+ minWidth: 110,
|
|
|
+ label: '工序名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'produceTaskCode',
|
|
|
+ minWidth: 110,
|
|
|
+ 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: 'workAme',
|
|
|
+ minWidth: 110,
|
|
|
+ label: '作业名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'contractor',
|
|
|
+ minWidth: 110,
|
|
|
+ label: '承制单位',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'orderType',
|
|
|
+ minWidth: 110,
|
|
|
+ label: '订单类型',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ let obj = this.orderTypeList.find(
|
|
|
+ (el) => el.id == _row.orderType
|
|
|
+ );
|
|
|
+ return obj ? obj.label : '';
|
|
|
+ },
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'status',
|
|
|
+ minWidth: 110,
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ isNone: this.pageName == 'list',
|
|
|
+ formatter: (row) => {
|
|
|
+ return row.status == 0
|
|
|
+ ? '待提交'
|
|
|
+ : row.status == 1
|
|
|
+ ? '审核中'
|
|
|
+ : row.status == 2
|
|
|
+ ? '已审核'
|
|
|
+ : row.status == 3
|
|
|
+ ? '已作废'
|
|
|
+ : row.status == 4
|
|
|
+ ? '驳回'
|
|
|
+ : '撤回';
|
|
|
+ },
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createUserName',
|
|
|
+ minWidth: 110,
|
|
|
+ label: '创建人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ minWidth: 110,
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'approvalUserName',
|
|
|
+ minWidth: 110,
|
|
|
+ label: '审批人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'approvalTime',
|
|
|
+ minWidth: 110,
|
|
|
+ label: '审批时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 220,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ isNone: this.type == 'add',
|
|
|
+ slot: 'action',
|
|
|
+ fixed: 'right',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ].filter((el) => !el.isNone);
|
|
|
+ },
|
|
|
+ /*回显类型 */
|
|
|
+
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource({ page, where, limit }) {
|
|
|
+ if (this.pageName == 'management') {
|
|
|
+ where['generateType'] = 2;
|
|
|
+ }
|
|
|
+ return getList({
|
|
|
+ ...where,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.$refs.table.reload({ page: 1, where: where });
|
|
|
+ },
|
|
|
+ approvalSubmit(res) {
|
|
|
+ this.processSubmitDialogFlag = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let params = {
|
|
|
+ businessId: res.id,
|
|
|
+ businessKey: 'qms_certificate',
|
|
|
+ formCreateUserId: res.createUserId,
|
|
|
+ variables: {
|
|
|
+ businessCode: res.code,
|
|
|
+ businessName: res.productName,
|
|
|
+ businessType: '合格证'
|
|
|
+ }
|
|
|
+ };
|
|
|
+ this.$refs.processSubmitDialogRef.init(params);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /* 报工 */
|
|
|
+ async open(row, type) {
|
|
|
+ this.$refs.certificateREf.open(row, type);
|
|
|
+ // this.$refs.addRef.open(row, type);
|
|
|
+ },
|
|
|
+ getReportTemplateList() {
|
|
|
+ getQmsReportTemplatePageList({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 999,
|
|
|
+ isEnabled: 1,
|
|
|
+ type: 1
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.reportTemplateList = res.list;
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error('获取报表模板列表失败:', err);
|
|
|
+ // this.$message.error('获取报表模板列表失败:' + (err.message || '操作异常'));
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /* 删除 */
|
|
|
+ cancel(row) {
|
|
|
+ cancel([row.id])
|
|
|
+ .then((msg) => {
|
|
|
+ this.$message.success('作废成功');
|
|
|
+ this.reload();
|
|
|
+ })
|
|
|
+ .catch((e) => {});
|
|
|
+ },
|
|
|
+ withdraw(row) {
|
|
|
+ withdraw({
|
|
|
+ processInstanceId: row.processInstanceId,
|
|
|
+ businessId: row.id,
|
|
|
+ processDefinitionKey: 'qms_certificate'
|
|
|
+ })
|
|
|
+ .then((msg) => {
|
|
|
+ this.$message.success('撤回成功');
|
|
|
+ this.reload();
|
|
|
+ })
|
|
|
+ .catch((e) => {});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|