更新页面

This commit is contained in:
zy_zr 2025-04-23 16:11:07 +08:00
parent 0bc8b03047
commit 94f20163f0
4 changed files with 33 additions and 13 deletions

View File

@ -9,8 +9,8 @@
</div>
<div class="form_cnt">
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules">
<template #bqDlId>
<el-input readonly @click="showDialog = true" v-model="listQuery.bqDlId" placeholder="请选择标签大类" clearable />
<template #bqDlMc>
<el-input readonly @click="showDialog = true" v-model="listQuery.bqDlMc" placeholder="请选择标签大类" clearable />
</template>
</FormMessage>
</div>
@ -48,7 +48,7 @@ const formData = reactive([
const rules = reactive({
bqMc: [{ required: true, message: "请输入标签名称", trigger: "blur" }],
bqDm: [{ required: true, message: "请输入标签代码", trigger: "blur" }],
bqDlId: [{ required: true, message: "请输入标签大类", trigger: ['blur','change'] }],
bqDlMc: [{ required: true, message: "请输入标签大类", trigger: ['blur','change'] }],
});
watchEffect(()=>{
@ -62,13 +62,13 @@ watchEffect(()=>{
const init = (type, row,) => {
title.value = type == 'add' ? "新增" : "编辑";
dialogForm.value = true;
if(props.type == '标签细类') formData.push({ label: "标签大类", prop: "bqDlId", width: '100%' , type: "slot" })
if(props.type == '标签细类') formData.push({ label: "标签大类", prop: "bqDlMc", width: '100%' , type: "slot" })
if (row) getDataById(row.id);
};
// id
const getDataById = (id) => {
qcckGet({}, '/mosty-gsxt/tbGsxtBqgl/'+id).then((res) => {
qcckGet({}, '/mosty-gsxt/tbGsxtBqgl/selectVoById/'+id).then((res) => {
listQuery.value = res;
});
};
@ -91,6 +91,7 @@ const submit = () => {
const chooseDate = (val) => {
if(!val && val.length == 0) return;
listQuery.value.bqDlId = val[0].id;
listQuery.value.bqDlMc = val[0].bqMc;
}
//

View File

@ -113,8 +113,17 @@ onMounted(() => {
//
const chooseListType = (val) => {
type.value = val;
pageData.keyCount++;
pageData.pageConfiger.pageCurrent = 1;
switch (val) {
case '标签大类':
pageData.tableColumn = pageData.tableColumn.filter((it) => it.prop != "bqDlMc");
break;
case '标签细类':
let obj = { label: "标签大类名称", prop: "bqDlMc" };
pageData.tableColumn.splice(3, 0, obj);
break;
}
pageData.keyCount++;
getList()
};

View File

@ -9,8 +9,8 @@
</div>
<div class="form_cnt">
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules">
<template #bqDlId>
<el-input readonly @click="showDialog = true" v-model="listQuery.bqDlId" placeholder="请选择标签大类" clearable />
<template #bqDlMc>
<el-input readonly @click="showDialog = true" v-model="listQuery.bqDlMc" placeholder="请选择标签大类" clearable />
</template>
</FormMessage>
</div>
@ -48,7 +48,7 @@ const formData = reactive([
const rules = reactive({
bqMc: [{ required: true, message: "请输入标签名称", trigger: "blur" }],
bqDm: [{ required: true, message: "请输入标签代码", trigger: "blur" }],
bqDlId: [{ required: true, message: "请输入标签大类", trigger: ['blur','change'] }],
bqDlMc: [{ required: true, message: "请输入标签大类", trigger: ['blur','change'] }],
});
watchEffect(()=>{
@ -62,13 +62,13 @@ watchEffect(()=>{
const init = (type, row,) => {
title.value = type == 'add' ? "新增" : "编辑";
dialogForm.value = true;
if(props.type == '标签细类') formData.push({ label: "标签大类", prop: "bqDlId", width: '100%' , type: "slot" })
if(props.type == '标签细类') formData.push({ label: "标签大类", prop: "bqDlMc", width: '100%' , type: "slot" })
if (row) getDataById(row.id);
};
// id
const getDataById = (id) => {
qcckGet({}, '/mosty-gsxt/tbGsxtBqgl/'+id).then((res) => {
qcckGet({}, '/mosty-gsxt/tbGsxtBqgl/selectVoById/'+id).then((res) => {
listQuery.value = res;
});
};
@ -89,8 +89,8 @@ const submit = () => {
//
const chooseDate = (val) => {
if(!val && val.length == 0) return;
listQuery.value.bqDlId = val[0].id;
listQuery.value.bqDlMc = val[0].bqMc;
}
//

View File

@ -112,8 +112,18 @@ onMounted(() => {
//
const chooseListType = (val) => {
type.value = val;
pageData.keyCount++;
pageData.pageConfiger.pageCurrent = 1;
switch (val) {
case '标签大类':
pageData.tableColumn = pageData.tableColumn.filter((it) => it.prop != "bqDlMc");
break;
case '标签细类':
let obj = { label: "标签大类名称", prop: "bqDlMc" };
pageData.tableColumn.splice(3, 0, obj);
break;
}
pageData.keyCount++;
getList()
};