2023-07-27 15:16:13 +08:00
|
|
|
<template>
|
2023-12-13 16:50:55 +08:00
|
|
|
<div class="app-container">
|
|
|
|
<!-- 搜索工作栏 -->
|
|
|
|
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="buttonClick" />
|
2023-07-27 15:16:13 +08:00
|
|
|
|
2023-12-13 16:50:55 +08:00
|
|
|
<!-- 列表 -->
|
|
|
|
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
|
|
|
|
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn"
|
|
|
|
@clickBtn="handleClick" />
|
|
|
|
</base-table>
|
2023-07-27 15:16:13 +08:00
|
|
|
|
2023-12-13 16:50:55 +08:00
|
|
|
<!-- 分页组件 -->
|
|
|
|
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
|
|
|
@pagination="getDataList" />
|
2023-07-27 15:16:13 +08:00
|
|
|
|
2023-12-13 16:50:55 +08:00
|
|
|
<!-- 对话框(添加 / 修改) -->
|
|
|
|
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" width="50%" @cancel="handleCancel"
|
|
|
|
@confirm="handleConfirm" :before-close="handleCancel">
|
|
|
|
<add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update>
|
|
|
|
</base-dialog>
|
|
|
|
</div>
|
2023-07-27 15:16:13 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-08-03 14:04:25 +08:00
|
|
|
import {
|
|
|
|
createQualityInspectionBoxBtn,
|
|
|
|
updateQualityInspectionBoxBtn,
|
|
|
|
deleteQualityInspectionBoxBtn,
|
|
|
|
getQualityInspectionBoxBtn,
|
|
|
|
getQualityInspectionBoxBtnPage,
|
|
|
|
exportQualityInspectionBoxBtnExcel,
|
|
|
|
} from '@/api/base/qualityInspectionBoxBtn';
|
2023-12-13 16:50:55 +08:00
|
|
|
import basicPage from '../../mixins/basic-page';
|
2023-08-03 14:04:25 +08:00
|
|
|
import moment from 'moment';
|
2023-12-13 16:50:55 +08:00
|
|
|
import addOrUpdate from './dialogForm.vue';
|
2023-07-27 15:16:13 +08:00
|
|
|
|
|
|
|
export default {
|
2023-08-03 14:04:25 +08:00
|
|
|
name: 'QualityInspectionBoxBtn',
|
2023-12-13 16:50:55 +08:00
|
|
|
mixins: [basicPage],
|
|
|
|
components: { addOrUpdate },
|
2023-08-03 14:04:25 +08:00
|
|
|
data() {
|
2023-12-13 16:50:55 +08:00
|
|
|
return {
|
|
|
|
urlOptions: {
|
|
|
|
getDataListURL: getQualityInspectionBoxBtnPage,
|
|
|
|
deleteURL: deleteQualityInspectionBoxBtn,
|
|
|
|
// exportURL: exportFactoryExcel,
|
|
|
|
},
|
2023-08-03 14:04:25 +08:00
|
|
|
searchBarFormConfig: [
|
|
|
|
{
|
|
|
|
type: 'input',
|
|
|
|
label: '检查内容',
|
|
|
|
placeholder: '请输入检查内容',
|
|
|
|
param: 'inspectionDetContent',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'button',
|
|
|
|
btnName: '查询',
|
|
|
|
name: 'search',
|
|
|
|
color: 'primary',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separate',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: this.$auth.hasPermi('base:quality-inspection-box-btn:create')
|
|
|
|
? 'button'
|
|
|
|
: '',
|
|
|
|
btnName: '新增',
|
|
|
|
name: 'add',
|
|
|
|
plain: true,
|
|
|
|
color: 'success',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
tableBtn: [
|
|
|
|
this.$auth.hasPermi('base:quality-inspection-box-btn:update')
|
|
|
|
? {
|
|
|
|
type: 'edit',
|
|
|
|
btnName: '修改',
|
|
|
|
}
|
|
|
|
: undefined,
|
|
|
|
this.$auth.hasPermi('base:quality-inspection-box-btn:delete')
|
|
|
|
? {
|
|
|
|
type: 'delete',
|
|
|
|
btnName: '删除',
|
|
|
|
}
|
|
|
|
: undefined,
|
2023-12-13 16:50:55 +08:00
|
|
|
].filter((v) => v),
|
|
|
|
tableData: [],
|
|
|
|
|
2023-08-03 14:04:25 +08:00
|
|
|
tableProps: [
|
2023-12-13 16:50:55 +08:00
|
|
|
// {
|
|
|
|
// prop: 'createTime',
|
|
|
|
// label: '添加时间',
|
|
|
|
// fixed: true,
|
|
|
|
// width: 180,
|
|
|
|
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
|
|
// },
|
2023-08-03 14:04:25 +08:00
|
|
|
{
|
2023-11-07 19:10:45 +08:00
|
|
|
prop: 'productionLineName',
|
2023-08-03 14:04:25 +08:00
|
|
|
label: '产线',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
prop: 'sectionName',
|
|
|
|
label: '工段',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
prop: 'inspectionDetContent',
|
|
|
|
label: '检测内容',
|
2023-12-13 16:50:55 +08:00
|
|
|
}
|
2023-08-03 14:04:25 +08:00
|
|
|
],
|
|
|
|
// 查询参数
|
2023-12-13 16:50:55 +08:00
|
|
|
listQuery: {
|
2023-08-03 14:04:25 +08:00
|
|
|
pageNo: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
inspectionDetContent: null,
|
2023-12-13 16:50:55 +08:00
|
|
|
},
|
|
|
|
addOrUpdateVisible: false,
|
|
|
|
addOrEditTitle:'',
|
|
|
|
// 搜索框需要的 keys, 与上面 listQuery 的除 pageNo, pageSize 之外的 key 一一对应
|
2023-08-03 14:04:25 +08:00
|
|
|
searchBarKeys: ['inspectionDetContent'],
|
|
|
|
form: {
|
2023-09-15 14:30:19 +08:00
|
|
|
id: null,
|
2023-09-15 14:49:31 +08:00
|
|
|
buttonId: null,
|
2023-12-13 16:50:55 +08:00
|
|
|
inspectionDetContent: [],
|
2023-11-07 19:10:45 +08:00
|
|
|
productionLineId: null,
|
2023-09-15 14:30:19 +08:00
|
|
|
sectionId: null,
|
|
|
|
model: null,
|
|
|
|
keyValue: null,
|
2023-08-03 14:04:25 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
created() {
|
2023-12-13 16:50:55 +08:00
|
|
|
// this.getList();
|
2023-08-03 14:04:25 +08:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
/** 查询列表 */
|
2023-12-13 16:50:55 +08:00
|
|
|
// getList() {
|
|
|
|
// this.loading = true;
|
|
|
|
// // 执行查询
|
|
|
|
// getQualityInspectionBoxBtnPage(this.listQuery).then((response) => {
|
|
|
|
// this.list = response.data.list;
|
|
|
|
// this.total = response.data.total;
|
|
|
|
// this.loading = false;
|
|
|
|
// });
|
|
|
|
// },
|
2023-08-03 14:04:25 +08:00
|
|
|
/** 表单重置 */
|
|
|
|
reset() {
|
|
|
|
this.form = {
|
2023-09-15 14:30:19 +08:00
|
|
|
id: null,
|
2023-09-15 14:49:31 +08:00
|
|
|
buttonId: null,
|
2023-09-15 14:30:19 +08:00
|
|
|
inspectionDetContent: null,
|
|
|
|
productionId: null,
|
|
|
|
sectionId: null,
|
|
|
|
model: null,
|
|
|
|
keyValue: null,
|
2023-08-03 14:04:25 +08:00
|
|
|
};
|
|
|
|
this.resetForm('form');
|
2023-12-13 16:50:55 +08:00
|
|
|
},
|
|
|
|
buttonClick(val) {
|
|
|
|
switch (val.btnName) {
|
|
|
|
case 'search':
|
|
|
|
this.listQuery.pageNo = 1;
|
|
|
|
this.listQuery.pageSize = 10;
|
|
|
|
this.listQuery.inspectionDetContent = val.inspectionDetContent ? val.inspectionDetContent : undefined;
|
|
|
|
// this.listQuery.teamId = val.teamId ? val.teamId : undefined;
|
|
|
|
this.getDataList()
|
|
|
|
break;
|
|
|
|
case 'add':
|
|
|
|
this.addOrEditTitle = '新增';
|
|
|
|
this.addOrUpdateVisible = true;
|
|
|
|
this.addOrUpdateHandle();
|
|
|
|
break;
|
|
|
|
case 'export':
|
|
|
|
this.handleExport();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
console.log(val);
|
|
|
|
}
|
|
|
|
},
|
2023-08-03 14:04:25 +08:00
|
|
|
},
|
2023-07-27 15:16:13 +08:00
|
|
|
};
|
|
|
|
</script>
|