From 67db1da645aeb60679370a5b95db1d2ebbc73a1d Mon Sep 17 00:00:00 2001
From: linwenling <3256558519@qq.com>
Date: 星期二, 08 八月 2023 20:16:59 +0800
Subject: [PATCH] 婚姻修改 可编辑
---
ruoyi-ui/src/views/honor/honorInfo.vue | 235 ++++++++++++++++++++++++++++++++++------------------------
1 files changed, 138 insertions(+), 97 deletions(-)
diff --git a/ruoyi-ui/src/views/honor/honorInfo.vue b/ruoyi-ui/src/views/honor/honorInfo.vue
index 7738e57..9ba7329 100644
--- a/ruoyi-ui/src/views/honor/honorInfo.vue
+++ b/ruoyi-ui/src/views/honor/honorInfo.vue
@@ -17,26 +17,40 @@
<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-form-item label="绫诲埆" prop="type" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;" :disabled="dsb">
+ <template v-if="!isEditing" >
+ <el-input v-if="formData.type===0" placeholder="璇佷欢"></el-input>
+ <el-input v-if="formData.type===1" placeholder="鑽h獕"></el-input>
+ <el-input v-if="formData.type===2" placeholder="璧勮川"></el-input>
+ </template>
+ <template v-else>
+ <el-select v-model="types" placeholder="璇烽�夋嫨绫诲埆" clearable :style="{width: '100%'}" >
+ <el-option label="璇佷欢" value='0'></el-option>
+ <el-option label="鑽h獕" value='1'></el-option>
+ <el-option label="璧勮川" value='2'></el-option>
+ </el-select>
+ </template>
</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: '100%'}" :disabled="dsb">
+ <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"
+ ></el-option>
+ </el-select>
+ <el-input v-model="newOption" v-if="showInput" placeholder="鑻ユ湭鍦ㄤ笂杩伴�夐」涓壘鍒板搴斿悕绉帮紝璇峰湪姝よ緭鍏ユ柊鐨勫悕绉�" @change="addNewOption"></el-input>
+
</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 +74,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>
@@ -100,14 +114,14 @@
>
<span class="el-upload-list__item-actions">
<span
- v-if="isShow"
+
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
- v-if="isShow"
+
class="el-upload-list__item-delete"
@click="handleDownload(file.url)"
>
@@ -134,7 +148,7 @@
multiple
list-type="picture-card"
:on-preview="handleFileCardPreview"
- :on-remove="handleRemove"
+ :on-remove="handleRemoveFile"
:http-request="requestUpload"
:show-file-list="true"
>
@@ -150,20 +164,19 @@
>
<span class="el-upload-list__item-actions">
<span
- v-if="isShow"
+
class="el-upload-list__item-preview"
@click="handleFileCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
- v-if="isShow"
- @click="handleRemove(file)"
- class="el-upload-list__item-delete"
+ class="el-upload-list__item-delete"
+ @click="handleDownload(file.url)"
>
- <i class="el-icon-download"></i>
- </span>
+ <i class="el-icon-download"></i>
+ </span>
<span
v-if="isShow"
class="el-upload-list__item-delete"
@@ -196,8 +209,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, listType} from "@/api/honor/index";
export default {
components: {},
@@ -206,18 +218,17 @@
return {
cdi:"鑽h獕璇佷功璇︾粏淇℃伅",
udi:"鑽h獕璇佷功淇℃伅璇︽儏",
- fot:[".jpg",".jif","png"],
- fileList:[
- ],
- fileListOther:[
-
- ],
+ fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx',
+ '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'],
+ fileList:[],
+ fileListOther:[],
dsb:true,
btn:false,
isShow:true,
+ isEditing: false,
// 鑽h獕琛ㄦ牸鏁版嵁
honorList: [],
-
+ typeList:[],
formData: {
//鑽h獕璇佷功璁板綍
id:undefined,
@@ -283,6 +294,13 @@
}],
},
typeOptions: [],
+ newOption: undefined,
+ showInput: false,
+ typeOption:[
+ {value:'0',label:'璇佷欢'},
+ {value:'1',label:'鑽h獕'},
+ {value:'2',label:'璧勮川'},],
+ types:undefined
}
},
computed: {},
@@ -290,12 +308,20 @@
created() {
const id = this.$route.params && this.$route.params.id;
let jd;
+ if(this.formData.type == 0)
+ this.types = '璇佷欢'
+ else if(this.formData.type== 1)
+ this.types = '鑽h獕'
+ else
+ this.types = '璧勮川'
if(this.$route.query.detail!=undefined)
{
jd = this.$route.query.detail
this.btn= jd
this.dsb = !jd
this.isShow=true
+ this.showInput=true
+ this.isEditing=true
document.title = "淇敼鑽h獕璇佷功璇︾粏淇℃伅";
this.$route.meta.title = "淇敼鑽h獕璇佷功璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉�
}
@@ -308,72 +334,41 @@
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;
+ });
+ listType(this.queryParams).then(response => {
+ this.typeList = response.data;
+ this.total = response.data.total;
+ // console.log( this.typeList )
+ // 鍦ㄥ洖璋冨嚱鏁颁腑璋冪敤 getTypeOptions()
+ this.getTypeOptions();
+ this.loading = false;
+ }
+ );
this.fetchData()
- this.getCateInfor()
+ // 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: {
@@ -389,19 +384,65 @@
console.error('Error:', error); // 澶勭悊閿欒
});
},
+ //绫诲埆
+ addNewOption() {
+ const newOption = this.newOption.trim();
+ if (newOption && !this.typeOptions.includes(newOption)) {
+ this.typeOptions.push(newOption);
+ this.$set(this.formData, 'type', newOption); // 鏇存柊formDat.type鐨勫�间负鏂扮殑閫夐」
+ }
+ },
+ getTypeOptions() {
+ const filteredOptions = this.typeList.filter(item => typeof item === 'string' && item !== '');
+ // 鍒涘缓涓�涓┖瀵硅薄鐢ㄤ簬瀛樺偍鍞竴鐨勫瓧绗︿覆閫夐」
+ const uniqueOptions = {};
+ // 鏋勫缓涓嬫媺閫夐」鍒楄〃
+ this.typeOptions = filteredOptions.reduce((options, option) => {
+ if (!uniqueOptions[option]) {
+ uniqueOptions[option] = true;
+ options.push({
+ label: option,
+ value: option
+ });
+ }
+ return options;
+ }, []);
+ },
+ //绫诲埆閫夋嫨
+ getSrc1(type){
+ if(type===0){
+ return '璇佷欢'
+ }else if(type===1){
+ return '鑽h獕'
+ }else if(type===2){
+ 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() {
+ if(this.types=='0')
+ this.formData.type = 0
+ else if(this.types == '1')
+ this.formData.type = 1
+ else if(this.types == '2')
+ this.formData.type = 2
+
let ul = this.fileList.map(function (elem){
return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
}).join(",")
--
Gitblit v1.9.1