update 质量检测信息

This commit is contained in:
lb 2023-08-03 11:19:06 +08:00
父節點 a402a8bf63
當前提交 c357ab8005
共有 2 個檔案被更改,包括 37 行新增130 行删除

查看文件

@ -49,9 +49,6 @@
prop: 'typeId',
url: '/base/quality-inspection-type/listAll',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
// bind: {
// disabled: true, // some condition, like detail mode...
// }
},
],
[
@ -66,32 +63,6 @@
[{ input: true, label: '备注', prop: 'remark' }],
]" />
</base-dialog>
<!-- <base-dialog
:dialogTitle="title"
:dialogVisible="open"
@cancel="cancel"
@confirm="submitForm">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="检测类型id" prop="typeId">
<el-select v-model="form.typeId" placeholder="请选择检测类型">
<el-option
v-for="opt in typeList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
<el-form-item label="检测内容" prop="content">
<el-input v-model="form.content" placeholder="请输入检测内容" />
</el-form-item>
<el-form-item label="检测编码" prop="code">
<el-input v-model="form.code" placeholder="请输入检测编码" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
</base-dialog> -->
</div>
</template>
@ -108,9 +79,12 @@ import {
import moment from 'moment';
import DialogForm from '../../components/dialogForm.vue';
import basicPageMixin from '../../mixin/basicPageMixin';
export default {
name: 'QualityInspectionDet',
components: { DialogForm },
mixins: [basicPageMixin],
data() {
return {
typeList: [], //
@ -125,8 +99,9 @@ export default {
type: 'datePicker',
label: '创建时间',
dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-ddTHH:mm:ss',
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
@ -180,7 +155,6 @@ export default {
}
: undefined,
].filter((v) => v),
tableData: [],
tableProps: [
{
prop: 'createTime',
@ -194,20 +168,6 @@ export default {
{ prop: 'code', label: '检测编码', align: 'center' },
{ prop: 'remark', label: '备注', align: 'center' },
],
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: '',
//
open: false,
//
queryParams: {
pageNo: 1,
@ -215,16 +175,14 @@ export default {
content: null,
createTime: [],
},
//
form: {},
//
rules: {
typeId: [
{ required: true, message: '检测类型id不能为空', trigger: 'change' },
],
content: [
{ required: true, message: '检测内容不能为空', trigger: 'blur' },
],
// keys
searchBarKeys: ['content', 'createTime'],
form: {
id: undefined,
typeId: undefined,
content: undefined,
code: undefined,
remark: undefined,
},
};
},
@ -233,49 +191,6 @@ export default {
this.getTypeList();
},
methods: {
/** base table related */
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleUpdate(data);
break;
case 'delete':
this.handleDelete(data);
break;
}
},
/** search bar related */
handleSearchBarBtnClick(btn) {
const keys = ['content', 'createTime']; // timeVal
switch (btn.btnName) {
case 'search':
keys.forEach((key) => {
if (key == 'timeVal') {
this.queryParams['startTime'] = btn.timeVal[0];
this.queryParams['endTime'] = btn.timeVal[1];
return;
}
console.log('key', key, btn[key])
this.queryParams[key] = btn[key] || null;
});
console.log('queryParams', this.queryParams)
this.handleQuery();
break;
case 'add':
this.handleAdd();
break;
case 'export':
this.handleExport();
break;
case 'reset':
this.$refs['search-bar'].resetForm();
this.resetQuery();
break;
}
},
handleEmitFun(val) {
console.log('emit unf', val);
},
/** 获取检测类型id */
getTypeList() {
this.$axios('/base/quality-inspection-type/listAll').then((response) => {
@ -313,16 +228,6 @@ export default {
};
this.resetForm('form');
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm');
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();

查看文件

@ -15,32 +15,24 @@ export default {
title: '',
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
},
// 列表数据
tableData: [],
tableProps: [], // 占位
tableBtn: [], // 占位
searchBarFormConfig: [], // 占位
// 弹窗表单配置
dialogFormConfig: [], // 占位
// 弹窗的表单
// form: {}, // 占位
// 搜索框需要的 keys
// searchBarKeys: [], // 占位
// tableProps: [], // 占位
// tableBtn: [], // 占位
// searchBarFormConfig: [], // 占位
// // 弹窗表单配置
// dialogFormConfig: [], // 占位
};
},
mounted() {
if (this.prepareSelectOptions) {
// 准备列表的options
// TODO: 也许需要挪到 dialogForm.vue 里
this.prepareSelectOptions();
}
},
mounted() {},
methods: {
// 处理搜索条件
handleSearchBarBtnClick() {},
// 处理表格按钮
// 处理表格按钮
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
@ -53,10 +45,10 @@ export default {
},
// 处理搜索栏按钮
handleSearchBarBtnClick(btn) {
const keys = ['name', 'createTime']; // timeVal
// const keys = ['name', 'createTime']; // timeVal // 已被 searchBarKeys 替代
switch (btn.btnName) {
case 'search':
keys.forEach((key) => {
this.searchBarKeys.forEach((key) => {
if (key == 'timeVal') {
this.queryParams['startTime'] = btn.timeVal[0];
this.queryParams['endTime'] = btn.timeVal[1];
@ -83,5 +75,15 @@ export default {
},
// 获取列表数据
getList() {},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm');
this.handleQuery();
},
},
};