diff --git a/src/views/system/OperateGoodsInfo/index.vue b/src/views/system/OperateGoodsInfo/index.vue index 9e0fe93..d2e1226 100644 --- a/src/views/system/OperateGoodsInfo/index.vue +++ b/src/views/system/OperateGoodsInfo/index.vue @@ -884,9 +884,11 @@ export default { if(this.imgone !=this.form.goodsPictureUrl ){ obj.pictureUrlList.push(this.form.goodsPictureUrl); } - updatePicture(obj).then((res) => { - console.log(res); - }); + if (obj.pictureUrlList.length > 0) { + updatePicture(obj).then((res) => { + console.log(res); + }); + } this.open = false; this.reset(); this.StationName = "请选择所属护理站"; @@ -1031,6 +1033,7 @@ export default { this.StationName = row.nurseStationName; getGoodsInfo(id).then((response) => { this.form = response.data[0]; + this.imgone = this.form.goodsPictureUrl; if (response.data[0].goodAttributeDetailsLists) { this.goodDetailsLists = response.data[0].goodAttributeDetailsLists; } diff --git a/src/views/system/goodsCategory/index.vue b/src/views/system/goodsCategory/index.vue index 3fcd0fd..1214cc6 100644 --- a/src/views/system/goodsCategory/index.vue +++ b/src/views/system/goodsCategory/index.vue @@ -296,9 +296,11 @@ export default { if(this.imgone !=this.form.goodsCategoryPicture ){ obj.pictureUrlList.push(this.form.goodsCategoryPicture); } - updatePicture (obj).then((res) => { - console.log(res); - }); + if (obj.pictureUrlList.length > 0) { + updatePicture(obj).then((res) => { + console.log(res); + }); + } this.open = false; this.reset(); }, @@ -346,6 +348,7 @@ export default { const id = row.id || this.ids; getGoodsCategory(id).then((response) => { this.form = response.data; + this.imgone = this.form.goodsCategoryPicture; this.open = true; this.title = "修改商品分类信息"; console.log(this.form); diff --git a/src/views/system/goodsInfo/index.vue b/src/views/system/goodsInfo/index.vue index 3e1b03d..5495c9d 100644 --- a/src/views/system/goodsInfo/index.vue +++ b/src/views/system/goodsInfo/index.vue @@ -34,7 +34,10 @@ /> - + 删除 - @@ -237,7 +239,6 @@ " >{{ StationName }} - { - console.log(res); - }); + if (obj.pictureUrlList.length > 0) { + updatePicture(obj).then((res) => { + console.log(res); + }); + } this.open = false; this.reset(); this.StationName = "请选择所属护理站"; @@ -718,7 +723,7 @@ export default { ]; }, clickinnerVisible() { - this.innerVisible = true + this.innerVisible = true; }, nurseclick(row) { console.log(this.form); @@ -727,9 +732,9 @@ export default { this.StationName = row.nurseStationName; this.innerVisible = false; }, - handleQuery2(){ + handleQuery2() { this.queryParams.pageNum = 1; - this.info() + this.info(); }, // getList2(){ // getListByUser(this.nurseStationqueryParams).then((res) => { @@ -737,20 +742,18 @@ export default { // this.nurseStationlist = res.rows; // }); // }, - resetQuery2() { + resetQuery2() { this.resetForm("queryForm"); - this.getListByUserquery={ - pageNum:1, - pageSize:10 - }, - this.handleQuery2(); - + (this.getListByUserquery = { + pageNum: 1, + pageSize: 10, + }), + this.handleQuery2(); }, - addcancel() { + addcancel() { this.innerVisible = false; // this.innerVisiblexg = false; this.resetQuery2(); - }, // 表单重置 @@ -805,28 +808,29 @@ export default { /** 新增按钮操作 */ handleAdd() { this.reset(); - this.nurseStationId="" + this.nurseStationId = ""; this.title = "商品基本信息"; // this.nurseName = "请选择护理员"; this.StationName = "请选择所属护理站"; - this.goodDetailsLists = [ - { - attributePitureUrl: "", - goodsPrice: "", - goodsStock: "", - sort: "", - ids: 9999999, - }, - ]; + this.goodDetailsLists = [ + { + attributePitureUrl: "", + goodsPrice: "", + goodsStock: "", + sort: "", + ids: 9999999, + }, + ]; this.open = true; }, /** 修改按钮操作 */ handleUpdate(row) { this.reset(); const id = row.goodsInfoId || this.ids; - this.StationName = row.nurseStationName; + this.StationName = row.nurseStationName; getGoodsInfo(id).then((response) => { this.form = response.data[0]; + this.imgone = this.form.goodsPictureUrl; if (response.data[0].goodAttributeDetailsLists) { this.goodDetailsLists = response.data[0].goodAttributeDetailsLists; } @@ -837,7 +841,7 @@ export default { /** 提交按钮 */ submitForm() { - console.log(this.form); + console.log(this.form); console.log(this.goodDetailsLists); this.form.goodAttributeDetailsLists = []; this.form.goodDetailsLists = this.goodDetailsLists; @@ -858,7 +862,7 @@ export default { this.$modal.msgSuccess("新增成功"); this.StationName = "请选择所属护理站"; - this.open = false; + this.open = false; this.getList(); }); } @@ -880,7 +884,7 @@ export default { // console.log('this.OrderDetailsList :>> ', this.OrderDetailsList); }); }) - .catch(() => { }); + .catch(() => {}); }, // handleDelete(row) { // const ids = row.id || this.ids; diff --git a/src/views/system/station/index.vue b/src/views/system/station/index.vue index c9a9b40..82e1c3a 100644 --- a/src/views/system/station/index.vue +++ b/src/views/system/station/index.vue @@ -853,15 +853,17 @@ export default { cancel() { console.log(this.form); var obj = { pictureUrlList: [] }; - if(this.imgone !=this.form.stationIntroducePcitureUrl ){ + if(this.imgone!=this.form.stationIntroducePcitureUrl ){ obj.pictureUrlList.push(this.form.stationIntroducePcitureUrl); } - if(this.imgtwo !=this.form.stationPictureUrl ){ + if(this.imgtwo!=this.form.stationPictureUrl ){ obj.pictureUrlList.push(this.form.stationPictureUrl); } - updatePicture(obj).then((res) => { - console.log(res); - }); + if (obj.pictureUrlList.length > 0) { + updatePicture(obj).then((res) => { + console.log(res); + }); + } this.open = false; this.reset(); this.value3 = ""; @@ -972,6 +974,8 @@ export default { getStation(id).then((response) => { console.log(response); this.form = response.data; + this.imgone = this.form.stationIntroducePcitureUrl; + this.imgtwo = this.form.stationPictureUrl; this.looknurseStationLabel = response.data.nurseStationLabel; console.log(this.list); this.open = true; diff --git a/src/views/system/stationItem/index.vue b/src/views/system/stationItem/index.vue index 89ee433..8039eb4 100644 --- a/src/views/system/stationItem/index.vue +++ b/src/views/system/stationItem/index.vue @@ -728,7 +728,7 @@ export default { data() { return { imageUrl: "", - img1:"", + imgone:"", // 用户导入参数 upload: { // 是否显示弹出层(用户导入) @@ -776,11 +776,7 @@ export default { pageNum: 1, pageSize: 10, }, - pictureList: { - pictureUrlList: [ - ], - }, // 查询参数 queryParams: { pageNum: 1, @@ -1010,12 +1006,14 @@ export default { cancel() { console.log(this.form.nurseStationItem); var obj = { pictureUrlList: [] }; - if (this.img1 != this.form.nurseStationItem.itemPictureUrl) { + if (this.imgone!= this.form.nurseStationItem.itemPictureUrl) { obj.pictureUrlList.push(this.form.nurseStationItem.itemPictureUrl); } - updatePicture(obj).then((res) => { - console.log(res); - }); + if (obj.pictureUrlList.length > 0) { + updatePicture(obj).then((res) => { + console.log(res); + }); + } this.open = false; this.reset(); @@ -1126,11 +1124,12 @@ export default { }, /** 修改按钮操作 */ handleUpdate(row) { - this.reset(); + this.reset();s const id = row.id || this.ids; getNurseItem(id).then((response) => { console.log(response); this.form = response.data; + this.imgone = this.form.nurseStationItem.itemPictureUrl; if (this.form.nurseStationItemPrices == []) { var obj = { serveDurationUnit: "",