This commit is contained in:
闫晓茹 2023-04-28 13:52:50 +08:00
parent 5114554e4d
commit 9ba32ef0f8

View File

@ -283,41 +283,84 @@
</template>
</el-form-item>
<el-form-item label="海报图片" :required="true">
<el-table label-width="50px" style="margin-top: 20px" :data="form.posterPictureUrlLists">
<el-table-column label="图片" align="center" width="300">
<template slot-scope="scope">
<!-- <el-form-item label="海报图片" prop="posterPictureUrl"> -->
<el-table
label-width="50px"
style="margin-top: 20px"
:data="form.posterPictureUrlLists"
>
<el-table-column label="图片" align="center" width="300">
<template slot-scope="scope">
<el-form-item
:prop="
'posterPictureUrlLists.' + scope.$index + '.posterPictureUrl'
"
:rules="[
{
required: true,
message: '请上传海报图片',
trigger: 'blur',
},
]"
>
<stationAcatar
@item="imgUrl"
:img="scope.row.posterPictureUrl"
:type="'posterPictureUrl'"
:item="scope.row"
/>
</template>
</el-table-column>
<el-table-column label="图片跳转标识" align="center" width="300">
<template slot-scope="scope">
</el-form-item>
</template>
</el-table-column>
<el-table-column label="图片跳转标识" align="center" width="300">
<template slot-scope="scope">
<el-form-item
:prop="'posterPictureUrlLists.' + scope.$index + '.jumpType'"
:rules="[
{
required: true,
message: '请选择图片跳转标识',
trigger: 'blur',
},
]"
>
<el-select
v-model="scope.row.jumpType"
placeholder="请选择"
clearable
style="width: 208px"
clearable
>
<el-option
v-for="item in jumpTypes"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
@click.native="taptypes(scope.row,item)"
@click.native="taptypes(scope.row, item)"
></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="图片跳转链接" align="center" width="300">
<template slot-scope="scope">
<el-input v-model="scope.row.jumpLink" placeholder="请输入跳转链接" style="widt h:250px"></el-input>
</template>
</el-table-column>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="图片跳转链接" align="center" width="300">
<template slot-scope="scope">
<el-form-item
:prop="'posterPictureUrlLists.' + scope.$index + '.jumpLink'"
:rules="[
{
required: true,
message: '请输入跳转链接',
trigger: 'blur',
},
]"
>
<el-input
v-model="scope.row.jumpLink"
placeholder="请输入跳转链接"
style="widt h:250px"
></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="addPictureUrl">新增</el-button>
@ -485,7 +528,7 @@ import {
getListBy,
updatePoser,
updatePicture,
selectPosterImageJump
selectPosterImageJump,
} from "@/api/system/poser";
import { list } from "@/api/system/nurseItem";
import stationAcatar from "../stationAvatar/index.vue";
@ -499,7 +542,7 @@ export default {
loading: true,
getListByUserquery: {
pageNum: 1,
pageSize: 10
pageSize: 10,
},
nurseStationlist: [],
nurseStationshow: false,
@ -541,7 +584,7 @@ export default {
pageNum: 1,
pageSize: 10,
nurseItemCode: null,
nurseItemName: null
nurseItemName: null,
},
//
queryParams: {
@ -558,7 +601,7 @@ export default {
moduleType: null,
poserSort: null,
jumpLink: null,
jumpType: null
jumpType: null,
},
//
form: {
@ -570,42 +613,42 @@ export default {
nurseStationId: null,
nurseStationName: "请选择所属护理站",
nurseItemName: "请选择所属护理项目",
nurseItemId: null
nurseItemId: null,
},
//
rules: {
moduleType: [
{ required: true, message: "请选择海报所属模块", trigger: "blur" }
{ required: true, message: "请选择海报所属模块", trigger: "blur" },
],
poserName: [
{ required: true, message: "请输入海报名称", trigger: "blur" }
{ required: true, message: "请输入海报名称", trigger: "blur" },
],
nurseStationId: [
{ required: true, message: "请选择所属护理站", trigger: "blur" }
{ required: true, message: "请选择所属护理站", trigger: "blur" },
],
posterIntroduce: [
{ required: true, message: "请输入海报简介", trigger: "blur" }
{ required: true, message: "请输入海报简介", trigger: "blur" },
],
posterVideoUrl: [
{ required: true, message: "请选择海报视频", trigger: "blur" }
{ required: true, message: "请选择海报视频", trigger: "blur" },
],
poserSort: [
{ required: true, message: "请输入海报顺序", trigger: "blur" }
{ required: true, message: "请输入海报顺序", trigger: "blur" },
],
nurseItemId: [
{ required: true, message: "请选择所属护理项目", trigger: "blur" }
]
{ required: true, message: "请选择所属护理项目", trigger: "blur" },
],
},
options: [
{
value: "NURSE_AGENCY_MODULE",
label: "护理机构模块"
label: "护理机构模块",
},
{
value: "NURSE_ITEM_MODULE",
label: "护理项目模块"
}
label: "护理项目模块",
},
// {
// value: "HEALTH_CONSUTION_MODULE",
// label: "",
@ -633,8 +676,8 @@ export default {
isShowUploadVideo: false,
//
videoForm: {
showVideoPath: "" //
}
showVideoPath: "", //
},
};
},
created() {
@ -648,7 +691,7 @@ export default {
},
//
PosterImageJump() {
selectPosterImageJump().then(res => {
selectPosterImageJump().then((res) => {
this.jumpTypes = res.data;
});
},
@ -664,17 +707,15 @@ export default {
if (this.form.posterPictureUrlLists.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.form.posterPictureUrlLists = this.form.posterPictureUrlLists.filter(
e => e.idd != item.idd
);
this.form.posterPictureUrlLists =
this.form.posterPictureUrlLists.filter((e) => e.idd != item.idd);
}
} else if (!item.idd && item.id) {
if (this.form.posterPictureUrlLists.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.form.posterPictureUrlLists = this.form.posterPictureUrlLists.filter(
e => e.id != item.id
);
this.form.posterPictureUrlLists =
this.form.posterPictureUrlLists.filter((e) => e.id != item.id);
}
}
},
@ -686,7 +727,7 @@ export default {
jumpType: null,
idd: this.idd,
jumpLink: null,
jumpDictId: null
jumpDictId: null,
};
if (this.form.posterPictureUrlLists.length >= 5) {
this.$message.error("最多新增5条");
@ -727,7 +768,7 @@ export default {
},
//
nurseItemlistInfo() {
list(this.nurseItemquery).then(res => {
list(this.nurseItemquery).then((res) => {
this.nurseItemlist = res.rows;
this.nurseItemtotal = res.total;
});
@ -768,12 +809,12 @@ export default {
},
//list
getlistinfo() {
getListBy(this.queryParams).then(res => {
getListBy(this.queryParams).then((res) => {
this.nurseStationlist = res.rows;
});
},
info() {
getListBy(this.queryParams).then(res => {
getListBy(this.queryParams).then((res) => {
this.nurseStationlist = res.rows;
this.queryParams.nurseStationId = res.rows[0].id;
this.nurseItemquery.nurseStationId = res.rows[0].id;
@ -790,7 +831,7 @@ export default {
stationcancel() {
this.getListByUserquery = {
pageNum: 1,
pageSize: 10
pageSize: 10,
};
this.info();
},
@ -832,7 +873,7 @@ export default {
/** 查询泉医到家系统海报模块信息(包含咨询简介信息)列表 */
getList() {
this.loading = true;
listPoser(this.queryParams).then(response => {
listPoser(this.queryParams).then((response) => {
this.poserList = response.rows;
this.total = response.total;
this.loading = false;
@ -842,12 +883,12 @@ export default {
cancel() {
var obj = { pictureUrlList: [] };
if (this.form.posterPictureUrlLists) {
this.form.posterPictureUrlLists.forEach(e => {
this.form.posterPictureUrlLists.forEach((e) => {
obj.pictureUrlList.push(e.posterPictureUrl);
});
}
if (obj.pictureUrlList.length > 0) {
updatePicture({ pictureUrlList: this.deletNewImgs }).then(res => {
updatePicture({ pictureUrlList: this.deletNewImgs }).then((res) => {
this.open = false;
});
}
@ -866,8 +907,8 @@ export default {
jumpType: null,
idd: this.idd,
jumpLink: null,
jumpDictId: null
}
jumpDictId: null,
},
],
moduleType: null,
id: null,
@ -878,7 +919,7 @@ export default {
nurseStationName: "请选择所属护理站",
nurseStationId: null,
nurseItemName: "请选择所属护理项目",
nurseItemId: null
nurseItemId: null,
};
this.deletNewImgs = [];
this.resetForm("form");
@ -903,9 +944,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.nurseStationId);
this.itemids = selection.map(item => item.nurseItemId);
this.Types = selection.map(item => item.moduleType);
this.ids = selection.map((item) => item.nurseStationId);
this.itemids = selection.map((item) => item.nurseItemId);
this.Types = selection.map((item) => item.moduleType);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
@ -921,7 +962,7 @@ export default {
const id = row.nurseStationId || this.ids;
const itemid = row.nurseItemId || this.itemids;
const type = row.moduleType || this.Types;
getPoser(type, id, itemid).then(response => {
getPoser(type, id, itemid).then((response) => {
this.form = response.data;
if (response.data.goodAttributeDetailsLists) {
this.goodDetailsLists = response.data.goodAttributeDetailsLists;
@ -933,22 +974,22 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.form.posterPictureUrlLists.forEach(e => {
this.form.posterPictureUrlLists.forEach((e) => {
if (!e.jumpType || e.jumpType == "") {
e.jumpDictId = null;
}
});
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updatePoser(this.form).then(response => {
updatePoser(this.form).then((response) => {
var obj = { pictureUrlList: [] };
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPoser(this.form).then(response => {
addPoser(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -971,7 +1012,7 @@ export default {
}
this.$modal
.confirm("是否确认删除?")
.then(function() {
.then(function () {
return delPoser(nurseStationIds, moduleTypes, nurseItemIds);
})
.then(() => {
@ -985,12 +1026,12 @@ export default {
this.download(
"system/poser/export",
{
...this.queryParams
...this.queryParams,
},
`poser_${new Date().getTime()}.xlsx`
);
}
}
},
},
};
</script>
<style lang="scss" scoped>