修改
This commit is contained in:
parent
295ba6123e
commit
1afb367b26
@ -355,6 +355,7 @@ import {
|
||||
listInformationCategory,
|
||||
} from "@/api/system/informationInfo";
|
||||
import stationAcatar from "../stationAvatar/index.vue";
|
||||
import { updatePicture } from "@/api/system/station";
|
||||
export default {
|
||||
components: { stationAcatar },
|
||||
name: "InformationInfo",
|
||||
@ -450,17 +451,14 @@ export default {
|
||||
// ],
|
||||
},
|
||||
infolist: [],
|
||||
imgone: "",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.addopen = false;
|
||||
// this.reset();
|
||||
},
|
||||
|
||||
|
||||
innerVisiblecancel() {
|
||||
this.innerVisible = false;
|
||||
@ -520,16 +518,28 @@ export default {
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
var obj = { pictureUrlList: [] };
|
||||
if (this.imgone != this.form.leadThumbnailUrl) {
|
||||
if (this.form.leadThumbnailUrl) {
|
||||
obj.pictureUrlList.push(this.form.leadThumbnailUrl);
|
||||
}
|
||||
}
|
||||
if (obj.pictureUrlList.length > 0) {
|
||||
updatePicture(obj).then((res) => {});
|
||||
}
|
||||
// var obj = { pictureUrlList: [] };
|
||||
// if (this.form.leadThumbnailUrl != this.leadThumbnailUrl) {
|
||||
// obj.pictureUrlList.push(this.leadThumbnailUrl);
|
||||
// }
|
||||
// updatePicture(obj).then((res) => {
|
||||
// this.open = false;
|
||||
// });
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
nurseclick(row) {
|
||||
console.log(row);
|
||||
// if (this.homenumber) {
|
||||
// console.log(this.homenumber);
|
||||
// this.form.hospitalName = row.hospitalName;
|
||||
// this.form.hospitalId = row.id;
|
||||
// } else {
|
||||
|
||||
this.form.informationCategoryId = row.id;
|
||||
this.form.informationCategoryName = row.informationCategoryName;
|
||||
|
||||
@ -595,6 +605,7 @@ export default {
|
||||
const id = row.id || this.ids;
|
||||
getInformationInfo(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.imgone = this.form.leadThumbnailUrl;
|
||||
this.open = true;
|
||||
this.title = "修改资讯信息管理";
|
||||
});
|
||||
@ -606,6 +617,13 @@ export default {
|
||||
if (this.form.id != null) {
|
||||
updateInformationInfo(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
var obj = { pictureUrlList: [] };
|
||||
if (this.imgone != this.form.leadThumbnailUrl) {
|
||||
obj.pictureUrlList.push(this.imgone);
|
||||
}
|
||||
if (obj.pictureUrlList.length > 0) {
|
||||
updatePicture(obj).then((res) => {});
|
||||
}
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
|
||||
@ -510,7 +510,7 @@
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="classifylist"
|
||||
@cell-dblclick="choiceclassify"
|
||||
@cell-dblclick="setCheckedData"
|
||||
>
|
||||
<el-table-column label="请选择" width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
@ -518,15 +518,15 @@
|
||||
type="primary"
|
||||
style="width: 15px; height: 15px"
|
||||
circle
|
||||
@click="choiceclassify(scope.row)"
|
||||
v-if="form.nurseStationClassifyIds.find((e) => e == scope.row.id)"
|
||||
@click="setCheckedData(scope.row)"
|
||||
v-if="checkedDataList.find((e) => e == scope.row.id)"
|
||||
></el-button>
|
||||
|
||||
<el-button
|
||||
style="width: 15px; height: 15px"
|
||||
circle
|
||||
v-else
|
||||
@click="choiceclassify(scope.row)"
|
||||
@click="setCheckedData(scope.row)"
|
||||
>
|
||||
</el-button>
|
||||
</template>
|
||||
@ -554,7 +554,7 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="cancelClassifyshow"
|
||||
@click="choiceclassify"
|
||||
style="
|
||||
margin-top: 30px;
|
||||
margin-left: 85%;
|
||||
|
||||
@ -124,6 +124,12 @@ export default {
|
||||
resid: null,
|
||||
// 表单校验
|
||||
rules: {
|
||||
morningOpenStartTime: [
|
||||
{ required: true, message: "请选择上午营业时间", trigger: "blur" },
|
||||
],
|
||||
afternoonOpenStartTime: [
|
||||
{ required: true, message: "请选择下午营业时间", trigger: "blur" },
|
||||
],
|
||||
agencyIntroduce: [
|
||||
{ required: true, message: "请输入护理站简介", trigger: "blur" },
|
||||
],
|
||||
@ -166,6 +172,8 @@ export default {
|
||||
{ required: true, message: "请选择护理站类型", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
|
||||
checkedDataList: []// 选择的护理机构分类
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -312,7 +320,9 @@ export default {
|
||||
//护理机构分类
|
||||
clickinnerVisible() {
|
||||
this.classifylistInfo();
|
||||
// this.form.classifyNameList=this.form.classifyName
|
||||
// 回显数据
|
||||
this.checkedDataList = JSON.parse(JSON.stringify(this.form.nurseStationClassifyIds));
|
||||
|
||||
this.Classifyshow = true;
|
||||
},
|
||||
|
||||
@ -325,30 +335,31 @@ export default {
|
||||
};
|
||||
this.classifylistInfo();
|
||||
},
|
||||
choiceclassify(e) {
|
||||
console.log(e)
|
||||
if (this.form.classifyNameList == '请选择护理站所属机构分类') {
|
||||
this.form.classifyNameList = e.classifyName;
|
||||
} else {
|
||||
this.form.classifyNameList = this.form.classifyNameList + e.classifyName;
|
||||
}
|
||||
// 设置已选数据
|
||||
setCheckedData(e) {
|
||||
// 若已存在id 则为删除
|
||||
if (this.form.nurseStationClassifyIds.find(el => el == e.id)) {
|
||||
this.form.nurseStationClassifyIds = this.form.nurseStationClassifyIds.filter(ele => ele != e.id)
|
||||
if (this.checkedDataList.find(el => el == e.id)) {
|
||||
this.checkedDataList = this.checkedDataList.filter(ele => ele != e.id)
|
||||
}
|
||||
else {
|
||||
// 不存在 添加进id
|
||||
this.form.nurseStationClassifyIds.push(e.id);
|
||||
this.checkedDataList.push(e.id);
|
||||
}
|
||||
|
||||
},
|
||||
// 完成选择
|
||||
choiceclassify() {
|
||||
this.form.nurseStationClassifyIds = JSON.parse(JSON.stringify(this.checkedDataList));
|
||||
// 根据id获取到所有name
|
||||
console.log(this.classifylist)
|
||||
this.form.classifyNameList = "";
|
||||
this.form.nurseStationClassifyIds.forEach(f => {
|
||||
let classify = this.classifylist.find(d => d.id == f)
|
||||
this.form.classifyNameList += classify.classifyName
|
||||
})
|
||||
|
||||
if (this.form.nurseStationClassifyIds.length == 0) {
|
||||
this.form.classifyNameList = '请选择护理站所属机构分类'
|
||||
} else {
|
||||
this.form.classifyNameList = "";
|
||||
this.form.nurseStationClassifyIds.forEach(f => {
|
||||
let classify = this.classifylist.find(d => d.id == f)
|
||||
this.form.classifyNameList += classify.classifyName + ","
|
||||
})
|
||||
}
|
||||
this.cancelClassifyshow();
|
||||
},
|
||||
/** 查询护理机构分类信息列表 */
|
||||
classifylistInfo() {
|
||||
@ -359,7 +370,7 @@ export default {
|
||||
});
|
||||
},
|
||||
cancelClassifyshow() {
|
||||
this.classifylistInfo();
|
||||
// this.classifylistInfo();
|
||||
this.Classifyshow = false;
|
||||
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user