测试问题优化

This commit is contained in:
binbin_pan 2024-06-12 13:32:26 +08:00
parent a1b82aa005
commit 9e3b086f9e
2 changed files with 41 additions and 3 deletions

View File

@ -19,6 +19,7 @@ export const dialogConfig = {
{ t_width: '', t_props: 'num', t_label: '设备数量' }, { t_width: '', t_props: 'num', t_label: '设备数量' },
{ t_width: '', t_props: 'modelName', t_label: '入库人' }, { t_width: '', t_props: 'modelName', t_label: '入库人' },
{ t_width: '', t_props: 'createDate', t_label: '入库日期' }, { t_width: '', t_props: 'createDate', t_label: '入库日期' },
{ t_width: '', t_props: 'remark', t_label: '备注' },
], ],
} }

View File

@ -334,6 +334,7 @@
type="date" type="date"
placeholder="请输入检验时间" placeholder="请输入检验时间"
style="width: 400px" style="width: 400px"
@change="changeCheckTime"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -349,6 +350,15 @@
type="date" type="date"
placeholder="请输入检验时间" placeholder="请输入检验时间"
style="width: 13vw" style="width: 13vw"
:disabled="!codeForm.thisCheckTime"
:picker-options="{
disabledDate(time) {
if (codeForm.thisCheckTime) {
return time.getTime() < new Date(codeForm.thisCheckTime).getTime();
}
return false;
}
}"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -523,22 +533,25 @@
:stripe="true" :stripe="true"
> >
<!-- <el-table-column type="selection" width="55" align="center" /> --> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column <!-- <el-table-column
label="序号" label="序号"
align="center" align="center"
width="80" width="80"
type="index" type="index"
/> /> -->
<el-table-column <el-table-column
label="设备编码"
align="center" align="center"
prop="maCode" prop="maCode"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
<template v-slot:header>
<span style="color: red;">* </span>设备编码
</template>
<template v-slot:default="{ row }" v-if="!isNumCheck"> <template v-slot:default="{ row }" v-if="!isNumCheck">
<el-input <el-input
v-model="row.maCode" v-model="row.maCode"
placeholder="请输入设备编码" placeholder="请输入设备编码"
@blur="handleMaCodeBlur(row)"
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
@ -950,6 +963,7 @@ export default {
dialogConfig, dialogConfig,
getInventoryWarehousingApi, getInventoryWarehousingApi,
sendParams: {}, sendParams: {},
requiredMaCode: false,
} }
}, },
created() { created() {
@ -1224,6 +1238,13 @@ export default {
this.getList() this.getList()
}) })
} else { } else {
this.requiredMaCode = this.codeTableList.some(
(item) => !item.maCode,
)
if (this.requiredMaCode) {
this.$message.error('设备编码不能为空')
return
}
// yyyy-MM-dd // yyyy-MM-dd
this.codeTableList.forEach((item) => { this.codeTableList.forEach((item) => {
if (item.thisCheckTime) { if (item.thisCheckTime) {
@ -1492,6 +1513,19 @@ export default {
closeDialogOuter() { closeDialogOuter() {
this.dialogConfig.outerVisible = false this.dialogConfig.outerVisible = false
}, },
handleMaCodeBlur(row) {
if (!row.maCode) {
this.$message.warning('设备编码不能为空')
}
},
//
changeCheckTime() {
if (this.codeForm.thisCheckTime > this.codeForm.nextCheckTime) {
this.codeForm.nextCheckTime = ''
} else if (!this.codeForm.thisCheckTime) {
this.codeForm.nextCheckTime = ''
}
},
}, },
} }
</script> </script>
@ -1503,4 +1537,7 @@ export default {
::v-deep.el-form-item__label { ::v-deep.el-form-item__label {
padding: 0 20px !important; padding: 0 20px !important;
} }
::v-deep .el-input-number.is-without-controls .el-input__inner {
text-align: start;
}
</style> </style>