update 质量检测信息

This commit is contained in:
lb 2023-08-03 11:19:06 +08:00
parent a402a8bf63
commit c357ab8005
2 changed files with 37 additions and 130 deletions

View File

@ -49,9 +49,6 @@
prop: 'typeId', prop: 'typeId',
url: '/base/quality-inspection-type/listAll', url: '/base/quality-inspection-type/listAll',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }], rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
// bind: {
// disabled: true, // some condition, like detail mode...
// }
}, },
], ],
[ [
@ -66,32 +63,6 @@
[{ input: true, label: '备注', prop: 'remark' }], [{ input: true, label: '备注', prop: 'remark' }],
]" /> ]" />
</base-dialog> </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> </div>
</template> </template>
@ -108,9 +79,12 @@ import {
import moment from 'moment'; import moment from 'moment';
import DialogForm from '../../components/dialogForm.vue'; import DialogForm from '../../components/dialogForm.vue';
import basicPageMixin from '../../mixin/basicPageMixin';
export default { export default {
name: 'QualityInspectionDet', name: 'QualityInspectionDet',
components: { DialogForm }, components: { DialogForm },
mixins: [basicPageMixin],
data() { data() {
return { return {
typeList: [], // typeList: [], //
@ -125,8 +99,9 @@ export default {
type: 'datePicker', type: 'datePicker',
label: '创建时间', label: '创建时间',
dateType: 'daterange', // datetimerange dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd HH:mm:ss', // format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-ddTHH:mm:ss', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始日期', startPlaceholder: '开始日期',
endPlaceholder: '结束日期', endPlaceholder: '结束日期',
@ -180,7 +155,6 @@ export default {
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableData: [],
tableProps: [ tableProps: [
{ {
prop: 'createTime', prop: 'createTime',
@ -194,20 +168,6 @@ export default {
{ prop: 'code', label: '检测编码', align: 'center' }, { prop: 'code', label: '检测编码', align: 'center' },
{ prop: 'remark', label: '备注', align: 'center' }, { prop: 'remark', label: '备注', align: 'center' },
], ],
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: '',
//
open: false,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
@ -215,16 +175,14 @@ export default {
content: null, content: null,
createTime: [], createTime: [],
}, },
// // keys
form: {}, searchBarKeys: ['content', 'createTime'],
// form: {
rules: { id: undefined,
typeId: [ typeId: undefined,
{ required: true, message: '检测类型id不能为空', trigger: 'change' }, content: undefined,
], code: undefined,
content: [ remark: undefined,
{ required: true, message: '检测内容不能为空', trigger: 'blur' },
],
}, },
}; };
}, },
@ -233,49 +191,6 @@ export default {
this.getTypeList(); this.getTypeList();
}, },
methods: { 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 */ /** 获取检测类型id */
getTypeList() { getTypeList() {
this.$axios('/base/quality-inspection-type/listAll').then((response) => { this.$axios('/base/quality-inspection-type/listAll').then((response) => {
@ -313,16 +228,6 @@ export default {
}; };
this.resetForm('form'); this.resetForm('form');
}, },
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm');
this.handleQuery();
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();

View File

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