|
|
@@ -7,6 +7,7 @@
|
|
|
:columns="columns"
|
|
|
:datasource="datasource"
|
|
|
:cache-key="cacheKeyUrl"
|
|
|
+ :selection.sync="selection"
|
|
|
autoAmendPage
|
|
|
height="calc(86vh - 230px)"
|
|
|
>
|
|
|
@@ -14,9 +15,6 @@
|
|
|
<el-link type="primary" :underline="false" @click="goToDetail(row)">
|
|
|
详情
|
|
|
</el-link>
|
|
|
- <!-- <el-link type="primary" :underline="false" @click="openPrint(row)">
|
|
|
- 打印
|
|
|
- </el-link> -->
|
|
|
</template>
|
|
|
<template v-slot:code="{ row }">
|
|
|
<el-link type="primary" @click="goToDetail(row)">{{
|
|
|
@@ -28,13 +26,20 @@
|
|
|
fileName="生产记录"
|
|
|
apiUrl="/mes/producetaskrulerecord/exportBatchRecordPage"
|
|
|
:params="params"
|
|
|
- ></exportButton
|
|
|
- ></template>
|
|
|
+ ></exportButton>
|
|
|
+ <print-selector :options="printOptions" @select="handlePrint" />
|
|
|
+ </template>
|
|
|
</ele-pro-table>
|
|
|
|
|
|
<editModal ref="editModalRef"></editModal>
|
|
|
|
|
|
<batchPecordPrint ref="batchPecordPrintRef"></batchPecordPrint>
|
|
|
+
|
|
|
+ <cleaning-record ref="cleaningRecord" />
|
|
|
+ <label-print-record ref="labelPrintRecord" />
|
|
|
+ <product-label-record ref="productLabelRecord" />
|
|
|
+ <packaging-record ref="packagingRecord" />
|
|
|
+ <process-inspection-record ref="processInspectionRecord" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -45,10 +50,26 @@
|
|
|
import editModal from '../editModal.vue';
|
|
|
import batchPecordPrint from './batchPecordPrint.vue';
|
|
|
import exportButton from '@/components/upload/exportButton.vue';
|
|
|
+ import printSelector from '../printSelector.vue';
|
|
|
+ import cleaningRecord from '../../print/electrodeBatchRecord/cleaningRecord.vue';
|
|
|
+ import labelPrintRecord from '../../print/electrodeBatchRecord/labelPrintRecord.vue';
|
|
|
+ import productLabelRecord from '../../print/electrodeBatchRecord/productLabelRecord.vue';
|
|
|
+ import packagingRecord from '../../print/electrodeBatchRecord/packagingRecord.vue';
|
|
|
+ import processInspectionRecord from '../../print/electrodeBatchRecord/processInspectionRecord.vue';
|
|
|
|
|
|
export default {
|
|
|
mixins: [dictMixins, tableColumnsMixin],
|
|
|
- components: { editModal, batchPecordPrint, exportButton },
|
|
|
+ components: {
|
|
|
+ editModal,
|
|
|
+ batchPecordPrint,
|
|
|
+ exportButton,
|
|
|
+ printSelector,
|
|
|
+ cleaningRecord,
|
|
|
+ labelPrintRecord,
|
|
|
+ productLabelRecord,
|
|
|
+ packagingRecord,
|
|
|
+ processInspectionRecord
|
|
|
+ },
|
|
|
props: {
|
|
|
tableQuery: {
|
|
|
type: Object,
|
|
|
@@ -60,6 +81,13 @@
|
|
|
data() {
|
|
|
return {
|
|
|
columns: [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
{
|
|
|
width: 50,
|
|
|
type: 'index',
|
|
|
@@ -154,7 +182,16 @@
|
|
|
}
|
|
|
],
|
|
|
cacheKeyUrl: 'mes-259231507-batchRecord-table',
|
|
|
- params: {}
|
|
|
+ params: {},
|
|
|
+ tableData: [],
|
|
|
+ selection: [],
|
|
|
+ printOptions: [
|
|
|
+ { key: 'cleaningRecord', label: '清场清洁记录表', code: 'SC-033' },
|
|
|
+ { key: 'labelPrintRecord', label: '标签打印记录', code: 'SC-102' },
|
|
|
+ { key: 'productLabelRecord', label: '产品贴标记录', code: 'SC-050' },
|
|
|
+ { key: 'packagingRecord', label: '产品中外包装工序记录', code: 'SC-019' },
|
|
|
+ { key: 'processInspectionRecord', label: '过程检验记录', code: 'A0' }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -225,7 +262,11 @@
|
|
|
recordOrder: 1
|
|
|
};
|
|
|
this.params = body;
|
|
|
- return producetaskrulerecordPage(body);
|
|
|
+ const res = producetaskrulerecordPage(body);
|
|
|
+ Promise.resolve(res).then((data) => {
|
|
|
+ this.tableData = data?.list || data?.records || [];
|
|
|
+ });
|
|
|
+ return res;
|
|
|
},
|
|
|
search(where) {
|
|
|
this.reload(where);
|
|
|
@@ -235,6 +276,46 @@
|
|
|
},
|
|
|
openPrint(row) {
|
|
|
this.$refs.batchPecordPrintRef.open(row);
|
|
|
+ },
|
|
|
+ handlePrint(key) {
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message.warning('请先勾选要打印的生产记录');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const r = this.selection[0];
|
|
|
+ const today = this.$util?.toDateString
|
|
|
+ ? this.$util.toDateString(new Date(), 'yyyy-MM-dd')
|
|
|
+ : new Date().toISOString().slice(0, 10);
|
|
|
+ const data = {
|
|
|
+ batchNo: this.tableQuery.batchNo,
|
|
|
+ productCode: this.tableQuery.productCode,
|
|
|
+ productName: r.productName || '',
|
|
|
+ specification: r.specification || '',
|
|
|
+ processOrderCode: r.workOrderCode || '',
|
|
|
+ processOrderNo: r.workOrderCode || '',
|
|
|
+ moCode: r.workOrderCode || '',
|
|
|
+ code: r.code || '',
|
|
|
+ recorder: r.createUserName || '',
|
|
|
+ checker: r.checkerName || '',
|
|
|
+ reviewer: r.reviewerName || '',
|
|
|
+ inspector: r.inspectorName || '',
|
|
|
+ operator: r.createUserName || '',
|
|
|
+ date: r.createTime || today,
|
|
|
+ createDate: r.createTime || today,
|
|
|
+ operateYear: today.slice(0, 4),
|
|
|
+ operateMonth: today.slice(5, 7),
|
|
|
+ operateDay: today.slice(8, 10),
|
|
|
+ startHour: '08',
|
|
|
+ startMinute: '00',
|
|
|
+ endHour: '17',
|
|
|
+ endMinute: '30',
|
|
|
+ equipmentCode: r.equipmentCode || '',
|
|
|
+ equipmentName: r.equipmentName || '',
|
|
|
+ remark: r.remark || ''
|
|
|
+ };
|
|
|
+ if (this.$refs[key]) {
|
|
|
+ this.$refs[key].open(data);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|