diff --git a/src/views/system/poser/index.vue b/src/views/system/poser/index.vue index 69ec9cc..66fe7d5 100644 --- a/src/views/system/poser/index.vue +++ b/src/views/system/poser/index.vue @@ -516,6 +516,9 @@ export default { nurseItemlist: [], // 泉医到家系统海报模块信息(包含咨询简介信息)表格数据 poserList: [], + // 存储新上传的图片数组 + deletNewImgs:[], + objitem:[], nurseItemList: [], // 弹出层判断新增还是修改 isEditFlag: false, @@ -605,6 +608,7 @@ export default { // label: "护理机构简介模块", // }, ], + imgsurl: { pictureUrlList: [] }, jumpTypes: [ { value: "NEW_PEOPLE_WELFARE", @@ -621,6 +625,7 @@ export default { ], //页面链接 stationid: "", + imgone:"", nurseitemid: "", homenumber: false, videourl: "", @@ -629,6 +634,7 @@ export default { videoUploadPercent: "", //进度条的进度, isShowUploadVideo: false, + //显示上传按钮 videoForm: { showVideoPath: "" //回显的变量 @@ -806,7 +812,13 @@ export default { }, //图片传值过来接收 imgUrl(imgUrl) { - console.log(imgUrl); + console.log(JSON.parse(imgUrl),'url'); + let imgUrlData=JSON.parse(imgUrl) + // 存贮新上传的图片数组 + this.deletNewImgs.push(imgUrlData.posterPictureUrl) + console.log(this.deletNewImgs,'触发了上传时间') + // this.objitem.push(imgUrlData.posterPictureUrl) + // console.log(this.objitem) }, imgUrl2(imgUrl) { this.videoForm.showVideoPath = baseurl + imgUrl; @@ -821,16 +833,22 @@ export default { this.loading = false; }); }, - // 取消按钮 cancel() { + console.log(this.objitem) var obj = { pictureUrlList: [] }; - if (obj.pictureUrlList.length > 0) { - updatePicture(obj).then(res => {}); - } - if (this.imgs.pictureUrlList.length > 0) { - updatePicture(this.imgs).then(res => {}); - } - this.nurseItemnuser = null; + if (this.form.posterPictureUrlLists) { + this.form.posterPictureUrlLists.forEach((e) => { + obj.pictureUrlList.push(e.posterPictureUrl); + }); + } + console.log(this.deletNewImgs) + if(obj.pictureUrlList.length>0){ + updatePicture({pictureUrlList:this.deletNewImgs}).then((res) => { + this.open = false; + }); + } + + this.nurseItemquery.nurseStationId = null; this.imgs = { pictureUrlList: [] }; this.open = false; @@ -910,11 +928,21 @@ export default { }, /** 提交按钮 */ submitForm() { - this.$refs["form"].validate(valid => { + this.$refs["form"].validate((valid) => { if (valid) { if (this.form.id != null) { - updatePoser(this.form).then(response => { - var obj = { pictureUrlList: [] }; + updatePoser(this.form).then((response) => { + // var obj = { pictureUrlList: [] }; + // var obj = { pictureUrlList: [] }; + // if (this.form.posterPictureUrlLists) { + // this.form.posterPictureUrlLists.forEach((e) => { + // obj.pictureUrlList.push(e.posterPictureUrl); + // }); + // } + + // updatePicture(obj).then((res) => { + // this.open = false; + // }); this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); @@ -923,10 +951,7 @@ export default { if (this.form.poserSort) { this.form.poserSort = parseInt(this.form.poserSort); } - addPoser(this.form).then(response => { - if (this.form.poserSort) { - this.form.poserSort = parseInt(this.form.poserSort); - } + addPoser(this.form).then((response) => { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList();