From 9f3ead22a8198d33891a0f8f23faec15dcfc731a Mon Sep 17 00:00:00 2001 From: 移动系统liao <liaoxujun@qq.com> Date: 星期五, 25 七月 2025 09:10:11 +0800 Subject: [PATCH] no message --- Web/src/views/Customer/fBS_EnterpriseType/component/editDialog.vue | 67 ++++++++++++++++++++++++++------- 1 files changed, 52 insertions(+), 15 deletions(-) diff --git a/Web/src/views/Customer/fBS_EnterpriseType/component/editDialog.vue b/Web/src/views/Customer/fBS_EnterpriseType/component/editDialog.vue index 8630032..f560e34 100644 --- a/Web/src/views/Customer/fBS_EnterpriseType/component/editDialog.vue +++ b/Web/src/views/Customer/fBS_EnterpriseType/component/editDialog.vue @@ -1,4 +1,13 @@ -锘�<script lang="ts" name="fBS_EnterpriseType" setup> +锘�<!-- + * @FilePath: editDialog.vue + * @Author: 灏忛渚� + * @Date: 2025-06-25 11:22:03 + * @LastEditors: Please set LastEditors + * @LastEditTime: 2025-07-22 17:28:33 + * Copyright: 2025 MinTinge CO.,LTD. All Rights Reserved. + * @Descripttion: 鍐欏叆浣犵殑鎻忚堪 +--> +<script lang="ts" name="fBS_EnterpriseType" setup> import { ref, reactive, onMounted } from "vue"; import { ElMessage } from "element-plus"; import type { FormRules } from "element-plus"; @@ -17,13 +26,14 @@ ruleForm: {} as any, stores: {}, dropdownData: {} as any, + tableData: [] as any[], }); // 鑷娣诲姞鍏朵粬瑙勫垯 const rules = ref<FormRules>({ - name: [{required: true, message: '璇烽�夋嫨鍚嶇О锛�', trigger: 'blur',},], - code: [{required: true, message: '璇烽�夋嫨浠g爜锛�', trigger: 'blur',},], - parentId: [{required: true, message: '璇烽�夋嫨鐖讹紒', trigger: 'blur',},], + name: [{ required: true, message: '璇疯緭鍏ュ悕绉帮紒', trigger: 'blur', },], + code: [{ required: true, message: '璇疯緭鍏ヤ唬鐮侊紒', trigger: 'blur', },] + // parentId: [{ required: true, message: '璇烽�夋嫨鐖讹紒', trigger: 'blur', },], }); // 椤甸潰鍔犺浇鏃� @@ -31,16 +41,21 @@ }); // 鎵撳紑寮圭獥 -const openDialog = async (row: any, title: string) => { +const openDialog = async (row: any, data:any,title: string) => { + state.title = title; - row = row ?? { }; + row = row ?? {}; state.ruleForm = row.id ? await fBS_EnterpriseTypeApi.detail(row.id).then(res => res.data.result) : JSON.parse(JSON.stringify(row)); state.showDialog = true; + state.tableData = data; + }; // 鍏抽棴寮圭獥 const closeDialog = () => { emit("reloadTable"); + console.log("listdata",state.tableData); + state.showDialog = false; }; @@ -49,6 +64,8 @@ ruleFormRef.value.validate(async (isValid: boolean, fields?: any) => { if (isValid) { let values = state.ruleForm; + if(values.parentId==null) + values.parentId=0; await fBS_EnterpriseTypeApi[state.ruleForm.id ? 'update' : 'add'](values); closeDialog(); } else { @@ -59,6 +76,16 @@ } }); }; +const treeProps = reactive({ + + children: 'child', + label: 'name', + value: 'id', + disabled:(node:any)=>{ + return state.ruleForm?.id== node.id; + } + +}) //灏嗗睘鎬ф垨鑰呭嚱鏁版毚闇茬粰鐖剁粍浠� defineExpose({ openDialog }); @@ -76,19 +103,28 @@ <el-form-item v-show="false"> <el-input v-model="state.ruleForm.id" /> </el-form-item> - <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" > + <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-form-item label="鍚嶇О" prop="name"> - <el-input v-model="state.ruleForm.name" placeholder="璇疯緭鍏ュ悕绉�" maxlength="256" show-word-limit clearable /> + <el-input v-model="state.ruleForm.name" placeholder="璇疯緭鍏ュ悕绉�" maxlength="256" show-word-limit + clearable /> </el-form-item> </el-col> - <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" > + <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-form-item label="浠g爜" prop="code"> - <el-input v-model="state.ruleForm.code" placeholder="璇疯緭鍏ヤ唬鐮�" maxlength="36" show-word-limit clearable /> + <el-input v-model="state.ruleForm.code" placeholder="璇疯緭鍏ヤ唬鐮�" maxlength="36" show-word-limit + clearable /> </el-form-item> </el-col> - <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" > - <el-form-item label="鐖�" prop="parentId"> - <el-input-number v-model="state.ruleForm.parentId" placeholder="璇疯緭鍏ョ埗" clearable /> + <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> + <el-form-item label="浠g爜" prop="description"> + <el-input v-model="state.ruleForm.description" placeholder="璇疯緭鍏ヨ鏄�" maxlength="36" show-word-limit + clearable /> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> + <el-form-item label="涓婄骇" prop="parentId"> + <el-tree-select :props="treeProps" clearable v-model="state.ruleForm.parentId" :data="state.tableData" check-strictly :render-after-expand="false" + style="width: 240px" /> </el-form-item> </el-col> </el-row> @@ -103,7 +139,8 @@ </div> </template> <style lang="scss" scoped> -:deep(.el-select), :deep(.el-input-number) { - width: 100%; +:deep(.el-select), +:deep(.el-input-number) { + width: 100%; } </style> \ No newline at end of file -- Gitblit v1.9.1