Merge remote-tracking branch 'origin/sdl_20220916_护理站人员功能' into dev
This commit is contained in:
commit
dd4e28954e
@ -402,7 +402,7 @@
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品属性图片" align="center">
|
||||
<el-table-column label="商品属性图片" align="center" width="300">
|
||||
<template slot-scope="scope">
|
||||
<stationAcatar
|
||||
@imgUrl="attributePitureUrl"
|
||||
@ -668,16 +668,8 @@ export default {
|
||||
},
|
||||
],
|
||||
// goodAttributeDetailsLists:[],
|
||||
goodDetailsLists: [
|
||||
{
|
||||
attributePitureUrl: "",
|
||||
goodsPrice: "",
|
||||
goodsStock: "",
|
||||
sort: "",
|
||||
ids: 9999,
|
||||
},
|
||||
],
|
||||
ids: 9999,
|
||||
goodDetailsLists: [],
|
||||
ids: 9999999,
|
||||
// 查询参数
|
||||
shangjia: {
|
||||
id: null,
|
||||
@ -794,14 +786,13 @@ export default {
|
||||
sort: "",
|
||||
ids: this.ids,
|
||||
};
|
||||
|
||||
this.goodDetailsLists.push(obj);
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
delgoodAttributeDetail(item) {
|
||||
console.log(item);
|
||||
if (item.ids && !item.id) {
|
||||
if (item.ids && !item.attributeDetailsId) {
|
||||
if (this.goodDetailsLists.length == 1) {
|
||||
this.$message.error("最后一条不可删除");
|
||||
} else {
|
||||
@ -809,12 +800,12 @@ export default {
|
||||
(e) => e.ids != item.ids
|
||||
);
|
||||
}
|
||||
} else if (!item.ids && item.id) {
|
||||
} else if (!item.ids && item.attributeDetailsId) {
|
||||
if (this.goodDetailsLists.length == 1) {
|
||||
this.$message.error("最后一条不可删除");
|
||||
} else {
|
||||
this.goodDetailsLists = this.goodDetailsLists.filter(
|
||||
(e) => e.id != item.id
|
||||
(e) => e.attributeDetailsId != item.attributeDetailsId
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -824,7 +815,6 @@ export default {
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
|
||||
this.goodDetailsLists = [
|
||||
{
|
||||
attributeName: "",
|
||||
@ -891,23 +881,23 @@ export default {
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "商品基本信息";
|
||||
console.log(this.ids);
|
||||
this.goodDetailsLists = [
|
||||
{
|
||||
attributePitureUrl: "",
|
||||
goodsPrice: "",
|
||||
goodsStock: "",
|
||||
sort: "",
|
||||
ids: 99999999999999999999,
|
||||
ids: 9999999,
|
||||
},
|
||||
];
|
||||
this.open = true;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.goodsInfoId || this.ids;
|
||||
|
||||
getGoodsInfo(id).then((response) => {
|
||||
this.form = response.data[0];
|
||||
this.goodDetailsLists = response.data[0].goodAttributeDetailsLists;
|
||||
@ -929,6 +919,8 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
console.log(this.goodDetailsLists);
|
||||
this.form.goodAttributeDetailsLists = [];
|
||||
this.form.goodDetailsLists = this.goodDetailsLists;
|
||||
console.log(this.form);
|
||||
this.$refs["form"].validate((valid) => {
|
||||
@ -991,9 +983,9 @@ export default {
|
||||
e.attributePitureUrl = items.attributePitureUrl;
|
||||
}
|
||||
});
|
||||
} else if (!items.ids && items.id) {
|
||||
} else if (!items.ids && items.attributeDetailsId) {
|
||||
this.goodDetailsLists.forEach((e) => {
|
||||
if (e.id == items.id) {
|
||||
if (e.attributeDetailsId == items.attributeDetailsId) {
|
||||
e.attributePitureUrl = items.attributePitureUrl;
|
||||
}
|
||||
});
|
||||
|
||||
@ -131,13 +131,12 @@ export default {
|
||||
fixedBox: true, // 固定截图框大小 不允许改变
|
||||
},
|
||||
previews: {},
|
||||
rows: {},
|
||||
items: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.types = this.type;
|
||||
this.rows = this.item;
|
||||
|
||||
this.items = this.item;
|
||||
if (this.img == null) {
|
||||
this.options.img = null;
|
||||
} else if (this.img == "") {
|
||||
@ -145,19 +144,11 @@ export default {
|
||||
} else {
|
||||
this.options.img = baseurl + this.img;
|
||||
}
|
||||
console.log(this.item);
|
||||
},
|
||||
watch: {
|
||||
item: {
|
||||
handler(newimg, oldimg) {
|
||||
console.log(newimg,oldimg)
|
||||
if (this.item == null) {
|
||||
this.rows = null;
|
||||
} else if (this.img == "") {
|
||||
this.rows = null;
|
||||
} else {
|
||||
this.rows = this.item;
|
||||
}
|
||||
this.items = this.item;
|
||||
},
|
||||
},
|
||||
img: {
|
||||
@ -225,10 +216,11 @@ export default {
|
||||
updateNurseStationHeads(formData).then((response) => {
|
||||
this.options.img = baseurl + response.imgUrl;
|
||||
this.$emit("imgUrl", response.imgUrl);
|
||||
console.log(this.rows);
|
||||
console.log(this.items);
|
||||
console.log(this.types);
|
||||
if (this.types == "attributePitureUrl") {
|
||||
this.rows.attributePitureUrl = response.imgUrl;
|
||||
this.$emit("item", JSON.stringify(this.rows));
|
||||
this.items.attributePitureUrl = response.imgUrl;
|
||||
this.$emit("item", JSON.stringify(this.items));
|
||||
}
|
||||
this.openimg = false;
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user