From 1521cdb45a85c038ab566c7e30d6883cd389c843 Mon Sep 17 00:00:00 2001 From: feige <feige@qq.com> Date: 星期二, 08 八月 2023 15:48:38 +0800 Subject: [PATCH] 增加了婚姻模块的性别下拉菜单 --- ruoyi-ui/src/views/honor/honorInfo.vue | 167 +++++++++++++++++++++++++++++-------------------------- 1 files changed, 87 insertions(+), 80 deletions(-) diff --git a/ruoyi-ui/src/views/honor/honorInfo.vue b/ruoyi-ui/src/views/honor/honorInfo.vue index 429a7a9..63737c6 100644 --- a/ruoyi-ui/src/views/honor/honorInfo.vue +++ b/ruoyi-ui/src/views/honor/honorInfo.vue @@ -17,26 +17,41 @@ <div> <el-container> <el-row> - <el-cow :span="8"> - <el-form-item label="鏃堕棿" prop="createTime" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> - <el-input v-model="formData.createTime" placeholder="璇疯緭鍏ユ椂闂�" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - </el-cow> +<!-- <el-cow :span="8">--> +<!-- <el-form-item label="鏃堕棿" prop="createTime" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;">--> +<!-- <el-input v-model="formData.createTime" placeholder="璇疯緭鍏ユ椂闂�" clearable :style="{width: '100%'}" :disabled="dsb">--> +<!-- </el-input>--> +<!-- </el-form-item>--> +<!-- </el-cow>--> <el-cow :span="8"> <el-form-item label="绫诲埆" prop="type" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> - <el-input v-model="formData.type" placeholder="璇疯緭鍏ョ被鍒�" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> + <el-select v-model="formData.type" placeholder="璇烽�夋嫨绫诲埆" clearable style="width: 300px"> + <el-option v-for="dict in typeOption" :key="dict.value" + :label="dict.label" :value="dict.value"/> + </el-select> </el-form-item> </el-cow> <el-cow :span="8"> <el-form-item label="鍚嶇О" prop="name" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> - <el-input v-model="formData.name" placeholder="璇疯緭鍏ュ悕绉�" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> + <el-select v-model="formData.name" placeholder="璇烽�夋嫨绫诲埆" clearable style="width: 300px"> + <el-option v-for="dict in typeOptions" :key="dict.value" + :label="dict.label" :value="dict.value"/> + </el-select> +<!-- <template v-if="dsb" >--> +<!-- <el-input v-if="formData.name==0" placeholder="鏈"></el-input>--> +<!-- <el-input v-if="formData.name==1" placeholder="宸插"></el-input>--> +<!-- <el-input v-if="formData.name==2" placeholder="瀛︾敓璇�"></el-input>--> +<!-- </template>--> +<!-- <template v-else>--> +<!-- <el-select v-model="formData.name" placeholder="璇烽�夋嫨绫诲埆" clearable style="width: 300px" :disabled="dsb">--> +<!-- <el-option v-for="dict in typeOptions" :key="dict.value"--> +<!-- :label="dict.label" :value="dict.value"/>--> +<!-- </el-select>--> +<!-- </template>--> </el-form-item> </el-cow> <el-cow :span="8"> - <el-form-item label="璇佸彿/涓撲笟" prop="idNo" label-width="90px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> + <el-form-item label="璇佸彿/涓撲笟" prop="idNo" label-width="90px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;" :disabled="dsb"> <el-input v-model="formData.idNo" placeholder="璇疯緭鍏ヨ瘉鍙�/涓撲笟" clearable :style="{width: '100%'}" :disabled="dsb"> </el-input> </el-form-item> @@ -60,13 +75,13 @@ <el-row> <el-cow :span="8"> <el-form-item label="鏈夋晥鏃堕棿" prop="validityDate" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> - <el-input v-model="formData.validityDate" placeholder="璇疯緭鍏ユ湁鏁堟椂闂�" clearable :style="{width: '100%'}" :disabled="dsb"> + <el-input v-model="formData.validityDate" type="date" placeholder="璇疯緭鍏ユ湁鏁堟椂闂�" clearable :style="{width: '100%'}" :disabled="dsb"> </el-input> </el-form-item> </el-cow> <el-cow :span="8"> <el-form-item label="鑾峰緱鏃堕棿" prop="getDate" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> - <el-input v-model="formData.getDate" placeholder="璇疯緭鍏ヨ幏寰楁椂闂�" clearable :style="{width: '100%'}" :disabled="dsb"> + <el-input v-model="formData.getDate" type="date" placeholder="璇疯緭鍏ヨ幏寰楁椂闂�" clearable :style="{width: '100%'}" :disabled="dsb"> </el-input> </el-form-item> </el-cow> @@ -195,8 +210,7 @@ import errorCode from "@/utils/errorCode"; import {Message} from "element-ui"; import { download,uploadPic} from "@/api/doctor/index"; -import {listHonor,updateHonor,getHonor} from "@/api/honor/index"; -import {listRoot} from "@/api/root"; +import {updateHonor,getHonor,getCategory} from "@/api/honor/index"; export default { components: {}, @@ -282,6 +296,10 @@ }], }, typeOptions: [], + typeOption:[ + {value:'1',label:'鑽h獕'}, + {value:'0',label:'璇佷欢'}, + {value:'2',label:'璧勮川'},] } }, computed: {}, @@ -307,72 +325,33 @@ let _this = this if (id) { this.loading = true; - // getHonor(id).then((response) => { - // this.formData = response.data; - // let paths = response.data.url.split(","); - // for(let i = 0; i < paths.length; i++) - // { - // if(paths[i]!="") { - // - // let pth = paths[i].substr(paths[i].length - 4, paths[i].length) - // - // if (_this.fot.includes(pth) === true) - // _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]}) - // else { - // // alert(paths[i]) - // let nms = paths[i].split("\/") - // let nm = nms[nms.length - 1] - // _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]}) - // } - // } - // } - // this.loading = false; - // }); + getHonor({id}).then((response) => { + this.formData = response.data; + let paths = response.data.url.split(","); + for(let i = 0; i < paths.length; i++) + { + if(paths[i]!="") { + + let pth = paths[i].substr(paths[i].length - 4, paths[i].length) + + if (_this.fot.includes(pth) === true) + _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]}) + else { + // alert(paths[i]) + let nms = paths[i].split("\/") + let nm = nms[nms.length - 1] + _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]}) + } + } + } + this.loading = false; + }); this.fetchData() this.getCateInfor() } - //浠ヤ笅涓簍est - // if (id){ - // this.loading =true; - // getHonor(id).then((response)=> { - // this.formData =response.data; - // let paths=response.data.url.split(" "); - // for(let i = 0; i < paths.length; i++){ - // if(paths[i]!=""){ - // let pth = paths[i].substr(paths[i].length - 4, paths[i].length); - // if (_this.fot.includes(pth)) { - // _this.fileList.push({ - // name: paths[i], - // url: process.env.VUE_APP_BASE_TRUE_API + paths[i], - // }); - // } else { - // // alert(paths[i]) - // let nms = paths[i].split("\/") - // let nm = nms[nms.length - 1] - // _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]}) - // } - // } - // } - // this.loading = false; - // }); - // - // // getHonor(id).then(response => { - // // // alert(123) - // // // alert(123) - // // // console.log(response.data) - // // // alert(90) - // // this.formData = response.data; - // // this.isShow_1=true - // // // alert(this.rootList[0].url) - // // // this.total = response.data.total; - // // this.loading = false; - // // } - // // ); - // this.getCateInfor() - // - // } + }, mounted() {}, methods: { @@ -388,16 +367,44 @@ console.error('Error:', error); // 澶勭悊閿欒 }); }, - + //绫诲埆閫夋嫨 + getSrc(type) { + if (type === 1){ + return '鍑虹敓璇�' + }else if(type === 2){ + return '瀛︾敓璇�' + }else if(type === 3){ + return '姣曚笟璇�' + }else if(type === 4){ + return '缁撳璇�' + }else if(type === 5){ + return '鎴峰彛绨�' + }else if(type === 6){ + return '鐙敓瀛愬コ璇�' + }else if(type === 7){ + return '楂樼骇鑱岀О' + }else if(type === 8){ + return '鎶ょ収' + }else if(type === 9){ + return '閫氳璇�' + }else { + return '鍏跺畠' + } + }, /** 鏌ヨ绫诲埆淇℃伅 */ getCateInfor() { let _this = this getCategory().then(response=>{ - response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{ - _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]}) - }) + // response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{ + // _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]}) + // + response.data.itemValues.replace("{", "").replace("}", "").split(",").map(elem => { + const label = elem.split(":")[0].trim(); + const value = parseInt(elem.split(":")[1].trim()); + _this.typeOptions.push({ "label": label, "value": value }); + }) }) }, submitForm() { -- Gitblit v1.9.1