更新页面
This commit is contained in:
parent
0bc8b03047
commit
94f20163f0
|
@ -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;
|
||||
}
|
||||
|
||||
// 关闭
|
||||
|
|
|
@ -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()
|
||||
};
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
// 关闭
|
||||
|
|
|
@ -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()
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user