|
|
@@ -0,0 +1,392 @@
|
|
|
+<template>
|
|
|
+ <div class="ele-body">
|
|
|
+ <el-card shadow="never">
|
|
|
+ <!-- 搜索表单 -->
|
|
|
+ <seekPage
|
|
|
+ :seekList="seekList"
|
|
|
+ :formLength="3"
|
|
|
+ @search="reload"
|
|
|
+ ></seekPage>
|
|
|
+
|
|
|
+ <!-- 数据表格 -->
|
|
|
+ <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :columns="columns"
|
|
|
+ :datasource="datasource"
|
|
|
+ row-key="code"
|
|
|
+ :page-size="20"
|
|
|
+ @columns-change="handleColumnChange"
|
|
|
+ :cache-key="cacheKeyUrl"
|
|
|
+ >
|
|
|
+ <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"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="open(row, 'print')"
|
|
|
+ >
|
|
|
+ 打印
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </el-card>
|
|
|
+ <ele-modal
|
|
|
+ title="合格证"
|
|
|
+ :visible.sync="QRvisible"
|
|
|
+ v-if="QRvisible"
|
|
|
+ width="90%"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <div id="printSection">
|
|
|
+ <component
|
|
|
+ :is="form.reportTemplateCode"
|
|
|
+ ref="template"
|
|
|
+ :key="form.reportTemplateCode"
|
|
|
+ v-if="!form.reportTemplateJson?.template"
|
|
|
+ ></component>
|
|
|
+ <div v-else v-html="form.reportTemplateJson?.template"> </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div slot="footer">
|
|
|
+ <el-button @click="print">打印预览</el-button>
|
|
|
+
|
|
|
+ <el-button @click="QRvisible = false">关闭</el-button></div
|
|
|
+ >
|
|
|
+ </ele-modal>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
+ import { getCertificatetList } from '@/api/qms/index.js';
|
|
|
+ import certificate_conformity_jangnan_template from './certificateTemplate/certificate_conformity_jangnan_template.vue';
|
|
|
+
|
|
|
+ export default {
|
|
|
+ mixins: [dictMixins, tabMixins],
|
|
|
+ components: {
|
|
|
+ certificate_conformity_jangnan_template
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ tableQuery: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ cacheKeyUrl: 'qsm-c2e9664a-certificateManagement',
|
|
|
+
|
|
|
+ orderTypeList: [
|
|
|
+ {
|
|
|
+ id: 0,
|
|
|
+ label: '库存性订单'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ label: '生产性订单'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ label: '无客户生产性订单'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 4,
|
|
|
+ label: '不定向订单'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ form: {},
|
|
|
+ QRvisible: false,
|
|
|
+ // 表格列配置
|
|
|
+ columns: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ seekList() {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ label: '订单号:',
|
|
|
+ value: 'orderNo',
|
|
|
+ type: 'input',
|
|
|
+ placeholder: '请输入'
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.requestDict('质检计划类型');
|
|
|
+ this.requestDict('取样类型');
|
|
|
+ this.setColumns();
|
|
|
+ },
|
|
|
+
|
|
|
+ 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: '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: 120,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ isNone: this.type == 'add',
|
|
|
+ slot: 'action',
|
|
|
+ fixed: 'right',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ].filter((el) => !el.isNone);
|
|
|
+ },
|
|
|
+ /*回显类型 */
|
|
|
+
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource({ page, where, limit }) {
|
|
|
+ return getCertificatetList({
|
|
|
+ ...where,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit,
|
|
|
+ ...this.tableQuery
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.$refs.table.reload({ page: 1, where: where });
|
|
|
+ },
|
|
|
+ print() {
|
|
|
+ const printSection = document.getElementById('printSection');
|
|
|
+ const printWindow = window.open('', '_blank');
|
|
|
+ printWindow.document.open();
|
|
|
+ printWindow.document.write('<html><head><title>打印预览</title>');
|
|
|
+ printWindow.document.write(
|
|
|
+ '<style>table { border-collapse: collapse; width: 100%; } td { border: 1px solid black; padding: 5px; text-align: center; }</style>'
|
|
|
+ );
|
|
|
+ printWindow.document.write('</head><body>');
|
|
|
+ printWindow.document.write(printSection.innerHTML);
|
|
|
+ printWindow.document.write('</body></html>');
|
|
|
+ printWindow.document.close();
|
|
|
+ printWindow.onload = function () {
|
|
|
+ printWindow.print();
|
|
|
+ };
|
|
|
+ },
|
|
|
+ /* 打印 */
|
|
|
+ open(row) {
|
|
|
+ this.form = row;
|
|
|
+ this.QRvisible = true;
|
|
|
+ if (!row.reportTemplateJson.template) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ console.log(this.$refs,'this.$refs')
|
|
|
+ this.$refs.template.init(row);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|