优化添加耗材

This commit is contained in:
gyq 2024-07-11 19:14:58 +08:00
parent f6b0bcc5f1
commit ea8c0021db
1 changed files with 16 additions and 3 deletions

View File

@ -108,11 +108,9 @@
</el-form-item>
<el-form-item label="耗材类型" prop="conTypeId" v-if="dialogtitle == '添加'">
<el-select v-model="ruleForm.conTypeId" placeholder="请选择">
<el-option v-for="item in this.tableData.data" :key="item.conTypeId" :label="item.conTypeName"
:value="item.id">
<el-option v-for="item in consTypeList" :key="item.conTypeId" :label="item.conTypeName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item
label="耗材类型"
@ -256,6 +254,7 @@ export default {
data() {
return {
dayjs,
consTypeList: [],
query: {
conTypeId: "",
conTypeName: "",
@ -435,6 +434,19 @@ export default {
}
},
//
async gettbConsType() {
try {
const res = await gettbConsType({
page: 0,
size: 100,
shopId: localStorage.getItem("shopId")
})
this.consTypeList = res.content
} catch (error) {
console.log(error);
}
},
//
async getTableDatatype() {
this.tableDatatype.loading = true;
try {
@ -493,6 +505,7 @@ export default {
if (type == "add") {
//
this.dialogtitle = "添加";
this.gettbConsType()
this.$nextTick(() => {
this.$refs.refruleForm.resetFields();
});