| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- <template>
- <div>
- <seek-page :seekList="seekList" @search="search"></seek-page>
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- :cache-key="cacheKeyUrl"
- :needPage="false"
- height="calc(86vh - 230px)"
- >
- <template v-slot:selfCheck="{ row }">
- <el-button
- type="primary"
- v-if="row.status == 2 || row.status == 3"
- @click="reportClick(row, 1, 'detail')"
- >详情</el-button
- >
- </template>
- <template v-slot:specialInspection="{ row }">
- <el-button
- type="primary"
- v-if="row.status == 3"
- @click="reportClick(row, 2, 'detail')"
- >详情</el-button
- >
- </template>
- <template v-slot:status="{ row }">
- <el-tag v-if="row.status == 0">待自检</el-tag>
- <el-tag v-if="row.status == 2">待专检</el-tag>
- <el-tag v-if="row.status == 3">已完成</el-tag>
- </template>
- </ele-pro-table>
- <self-inspection-reporting
- ref="selfReportingRef"
- @refreshData="reload"
- ></self-inspection-reporting>
- </div>
- </template>
- <script>
- import dictMixins from '@/mixins/dictMixins';
- import tableColumnsMixin from '@/mixins/tableColumnsMixin';
- import selfInspectionReporting from '@/views/produce/components/qualityInspection/components/selfInspectionReporting.vue';
- import { getBatchRecordList } from '@/api/produce/qualityInspection';
- import { produceTask } from '@/api/InTheSystem/index';
- export default {
- mixins: [dictMixins, tableColumnsMixin],
- components: {
- selfInspectionReporting
- },
- props: {
- tableQuery: {
- type: Object,
- default: () => {
- return {};
- }
- }
- },
- data() {
- return {
- columns: [
- {
- width: 50,
- type: 'index',
- columnKey: 'index',
- label: '序号',
- align: 'center'
- },
- {
- prop: 'name',
- label: '名称',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 150
- },
- {
- prop: 'workstationName',
- label: '工位名称',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 150
- },
- {
- prop: 'deviceName',
- label: '设备名称',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 150
- },
- {
- prop: 'produceTaskName',
- label: '工序名称',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 150
- },
- {
- prop: 'selfCheckUserName',
- label: '自检报工人',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 120
- },
- {
- prop: 'selfCheckTime',
- label: '自检时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 120
- },
- {
- prop: 'specialCheckUserName',
- label: '专检报工人',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 120
- },
- {
- prop: 'specialCheckTime',
- label: '专检时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 120
- },
- {
- prop: 'status',
- slot: 'status',
- label: '状态',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 100
- },
- {
- label: '自检报工',
- align: 'center',
- width: 150,
- fixed: 'right',
- slot: 'selfCheck'
- },
- {
- label: '专检报工',
- align: 'center',
- width: 150,
- fixed: 'right',
- slot: 'specialInspection'
- }
- ],
- cacheKeyUrl: 'batchRecord-qualityInspection-2025-12-17',
- routList: []
- };
- },
- computed: {
- seekList() {
- return [
- {
- label: '工序:',
- value: 'produceTaskId',
- type: 'select',
- placeholder: '请选择',
- planList: this.routList
- }
- ];
- }
- },
- created() {
- this.getTaskList();
- },
- methods: {
- reload(where = {}) {
- this.$refs.table.reload({
- where,
- ...this.tableQuery
- });
- },
- async getTaskList() {
- let params = {
- pageNum: 1,
- size: -1
- };
- await produceTask(params).then((res) => {
- this.routList = res.list.map((item) => {
- return {
- label: item.name,
- value: item.id
- };
- });
- });
- },
- search(where) {
- this.reload(where);
- },
- datasource({ page, limit, where, order }) {
- // 参数
- const body = {
- ...where,
- ...order,
- pageNum: page,
- size: limit,
- ...this.tableQuery
- };
- return getBatchRecordList(body);
- },
- reportClick(row, type, mode) {
- this.$refs.selfReportingRef.open(row, type, mode);
- }
- }
- };
- </script>
- <style></style>
|