From 2293a1b58a3227a4870466e3699b6baf0af29303 Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期一, 11 八月 2025 17:19:53 +0800 Subject: [PATCH] - --- src/views/system/dept/form.vue | 39 ++++++++++++++++++++++++++++----------- 1 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/views/system/dept/form.vue b/src/views/system/dept/form.vue index 98fd3eb..2e46642 100644 --- a/src/views/system/dept/form.vue +++ b/src/views/system/dept/form.vue @@ -8,13 +8,15 @@ import { Operation } from "@element-plus/icons-vue"; import { getCaigoufangshiList } from "@/api/item/index"; -const { state } = useDept(); +const { state } = useDept(ref({})); const props = withDefaults(defineProps<FormProps>(), { formInline: () => ({ + id: "", projectCode: "", // 椤圭洰缂栧彿锛堝繀濉級 projectName: "", // 椤圭洰鍚嶇О锛堝繀濉級 hangyepinmu: null, // 琛屼笟鍝佺洰锛堝彲閫夛級 caigoufangshi: null, // 閲囪喘鏂瑰紡锛堝彲閫夛級 + caigoufangshiName: null, caigouyusuan: null, // 閲囪喘棰勭畻锛堝彲閫夛級 dingbiaoguize: null, // 瀹氭爣瑙勫垯锛堝彲閫夛級 baomingfei: null, // 鎶ュ悕璐癸紙鍙�夛級 @@ -24,7 +26,7 @@ shifoufenbao: "false", // 鏄惁鍒嗗寘锛堝彲閫夛級 shifoutuisongxuanchuan: "true", // 鏄惁鎺ㄩ�佸浼狅紙鍙�夛級 caigourenmingcheng: null, // 閲囪喘浜哄悕绉帮紙鍙�夛級 - xingzhengquyu: null, // 琛屾斂鍖哄煙锛堝彲閫夛級 + xingzhengquyu: [], // 琛屾斂鍖哄煙锛堝彲閫夛級 xingzhengquyuName: null, // 琛屾斂鍖哄煙鍚嶇О锛堝彲閫夛級 jigoudaima: null, // 鏈烘瀯浠g爜锛堝彲閫夛級 daimaleixing: null, // 浠g爜绫诲瀷锛堝彲閫夛級 @@ -52,6 +54,15 @@ function getRef() { return ruleFormRef.value; } +const handleChange = value => { + console.log(value); +}; +const selectChange = value => { + let obj = state.caigoufangshiList.find(item => { + return item.value == value; + }); + newFormInline.value.caigoufangshiName = obj.label; +}; defineExpose({ getRef }); onMounted(async () => {}); @@ -85,9 +96,10 @@ </el-form-item> </re-col> <re-col :value="6" :xs="24" :sm="24"> - <el-form-item label="椤圭洰缂栧彿" prop="projectCode"> + <el-form-item label="椤圭洰缂栧彿"> <el-input v-model="newFormInline.projectCode" + disabled clearable placeholder="璇疯緭鍏ラ」鐩紪鍙�" /> @@ -111,11 +123,12 @@ </el-form-item> </re-col> <re-col :value="6" :xs="24" :sm="24"> - <el-form-item label="閲囪喘鏂瑰紡"> + <el-form-item label="閲囪喘鏂瑰紡" prop="caigoufangshi"> <el-select v-model="newFormInline.caigoufangshi" placeholder="璇烽�夋嫨閲囪喘鏂瑰紡" style="width: 240px" + @change="selectChange" > <el-option v-for="item in state.caigoufangshiList" @@ -138,15 +151,19 @@ </re-col> <re-col :value="6" :xs="24" :sm="24"> <el-form-item label="瀹氬埗瑙勫垝" prop="dingbiaoguize"> - <el-checkbox-group + <!-- <el-checkbox-group v-model="newFormInline.dingbiaoguize" placeholder="璇烽�夋嫨鐘舵��" clearable class="w-[100%]!" > - <el-checkbox label="鏈�浣庝环" :value="1" /> - <el-checkbox label="缁煎悎璇勫垎" :value="0" /> - </el-checkbox-group> + <el-checkbox label="鏈�浣庝环" value="鏈�浣庝环" /> + <el-checkbox label="缁煎悎璇勫垎" value="缁煎悎璇勫垎" /> + </el-checkbox-group> --> + <el-radio-group v-model="newFormInline.dingbiaoguize"> + <el-radio value="鏈�浣庝环">鏈�浣庝环</el-radio> + <el-radio value="缁煎悎璇勫垎">缁煎悎璇勫垎</el-radio> + </el-radio-group> </el-form-item> </re-col> <re-col :value="6" :xs="24" :sm="24"> @@ -226,14 +243,14 @@ class="w-full" :options="state.regionList" :props="{ - value: 'id', + value: 'code', label: 'name', - emitPath: false, children: 'regions' }" clearable filterable placeholder="璇烽�夋嫨鍖哄煙" + @change="handleChange" /> </el-form-item> </re-col> @@ -345,7 +362,7 @@ </el-form-item> </re-col> <re-col :value="6" :xs="24" :sm="24"> - <el-form-item label="鑱旂郴浜轰汉" prop="dailiLianxiren"> + <el-form-item label="鑱旂郴浜�" prop="dailiLianxiren"> <el-input v-model="newFormInline.dailiLianxiren" clearable -- Gitblit v1.9.1