Commit bdacb43f authored by v-yuchenglong's avatar v-yuchenglong

update:信息编辑添加商品Bug修改

parent 409ceb67
......@@ -36,7 +36,7 @@
<el-table-column prop="total_amount_sold" label="已售数量">
</el-table-column>
<el-table-column prop="inventory_rest" label="剩余库存"></el-table-column>
<el-table-column label="操作">
<el-table-column label="操作" width="120">
<template #default="scope">
<el-button
type="text"
......@@ -65,15 +65,17 @@
>
<el-form-item label="图片:">
<el-upload
:class="{hide:hideUpload}"
:data="{ type: 1 }"
:action="uploadUrl"
:on-preview="previewImage"
:on-success="handleDetailSuccess"
:on-change = "handleDetailChange"
:before-remove="removeDetailFiles"
:file-list="picUrlList"
auto-upload
ref="picUpload"
:limit="1"
:limit="limitCount"
list-type="picture-card"
multiple
>
......@@ -181,7 +183,7 @@
></el-option>
</el-select>
</div>
<span class="dioFor">已选:{{ multipleSelection.length }}</span>
<span class="dioFor">已选:{{ multipleSelection.length }}</span>
<el-table
:data="comLibTableData"
class="comLibTableData"
......@@ -279,6 +281,8 @@ export default {
picUploadList: [], // 上传详情图片列表
isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址
hideUpload: false,
limitCount:"1",
// 商品库添加
selCommodityPopup: false, // 商品库添加弹窗状态
......@@ -330,6 +334,10 @@ export default {
this.isShowPopver = true;
},
handleDetailChange(){
this.hideUpload = this.picUploadList.length >= this.limitCount;
},
// 图片上传成功时
handleDetailSuccess(res) {
this.picUploadList.push(res.result.image_id);
......@@ -342,6 +350,7 @@ export default {
this.picUploadList.splice(i, 1);
}
}
this.hideUpload = this.picUploadList.length >= this.limitCount;
},
// 获取商家
......@@ -519,6 +528,7 @@ export default {
}
});
});
ElMessage.error("商品添加重复,已过滤掉重复选项");
}
},
......@@ -578,4 +588,8 @@ export default {
.price /deep/ .el-input__inner {
text-align: left;
}
.hide /deep/ .el-upload--picture-card {
display: none;
}
</style>
\ No newline at end of file
......@@ -14,15 +14,17 @@
</el-form-item>
<el-form-item label="图片:">
<el-upload
:class="{ hide: hideUpload }"
:data="{ type: 1 }"
:action="uploadUrl"
:on-preview="previewImage"
:on-success="handleDetailSuccess"
:on-change="handleDetailChange"
:before-remove="removeDetailFiles"
:file-list="infoEditForm.picUrlList"
auto-upload
ref="picUpload"
:limit="9"
:limit="limitCount"
list-type="picture-card"
multiple
>
......@@ -45,8 +47,8 @@ export default {
props: {
infoEditArr: {
type: Object,
defult: () => {}
}
defult: () => {},
},
},
data() {
return {
......@@ -54,19 +56,21 @@ export default {
title: "", // 标题
desc: "", // 介绍
picUploadList: [], // 上传详情图片列表
picUrlList: [] // 图片回显列表
picUrlList: [], // 图片回显列表
},
propData: {},
isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload` // 金山云上传地址
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址
hideUpload: false,
limitCount: "9",
};
},
watch: {
infoEditArr: {
// 监听props属性 展示自提点列表
handler: async function(newVal) {
handler: async function (newVal) {
if (this.$route.query.marketing_id) {
this.propData = newVal;
this.infoEditForm.title = this.propData.marketing_name;
......@@ -74,14 +78,14 @@ export default {
this.infoEditForm.picUrlList = [];
for (var i in this.propData.pindan_pic_url) {
this.infoEditForm.picUrlList.push({
url: this.propData.pindan_pic_url[i]
url: this.propData.pindan_pic_url[i],
});
}
}
},
deep: true
deep: true,
// immediate: true
}
},
},
methods: {
// 展示商品大图
......@@ -90,6 +94,10 @@ export default {
this.isShowPopver = true;
},
handleDetailChange() {
this.hideUpload = this.infoEditForm.picUploadList.length >= this.limitCount;
},
// 图片上传成功时
handleDetailSuccess(res) {
this.infoEditForm.picUploadList.push(res.result.image_id);
......@@ -102,6 +110,7 @@ export default {
this.infoEditForm.picUploadList.splice(i, 1);
}
}
this.hideUpload = this.infoEditForm.picUploadList.length >= this.limitCount;
},
// 获取营销活动详情
......@@ -115,14 +124,14 @@ export default {
this.infoEditForm.desc = this.propData.pindan_desc;
for (var i in this.propData.pindan_pic_url) {
this.infoEditForm.picUrlList.push({
url: this.propData.pindan_pic_url[i]
url: this.propData.pindan_pic_url[i],
});
}
}
},
},
created() {
// this.marketingInfoMet();
}
},
};
</script>
......@@ -131,4 +140,7 @@ export default {
width: 64%;
margin: 0 auto;
}
.hide /deep/ .el-upload--picture-card {
display: none;
}
</style>
const headerConfig = [
{
name: "活动管理",
path: "/op/activity/manage"
},
{
name: "订单管理",
path: "/op/groupmeal/orderManagement"
......
......@@ -324,8 +324,8 @@
<el-input-number
v-model="item.refundableQuantity"
@change="handleChange"
:min="0"
:max="item.goods_num - item.refund_count"
:min="1"
:max="1"
></el-input-number>
</el-row>
<el-row>
......@@ -438,7 +438,7 @@ export default {
totalNum: null, //总条数
// 退款
refundShow: false, // 退款状态
refundShow:false, // 退款状态
checkAll: false, // 全选
isIndeterminate: false,
refundGoods: [
......@@ -491,20 +491,20 @@ export default {
marketing_id: val,
};
const res = await newGetGoodsList(params); // 商品名称
this.getSubShopListMet(val) //自提点
this.getSubShopListMet(val); //自提点
// const res = await getSubShopList(params);
this.tradeNameArr = res.result;
// this.selLiftPoinArr = res.result;
// this.selLiftPoinArr = res.result;
},
// 获取自提点
async getSubShopListMet(params) {
try {
let marketing_id = ''
if(params){
marketing_id = params
let marketing_id = "";
if (params) {
marketing_id = params;
}
const res = await newGetSubShopList({'marketing_id':marketing_id});
const res = await newGetSubShopList({ marketing_id: marketing_id });
this.selLiftPoinArr = res.result;
} catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~");
......@@ -608,11 +608,12 @@ export default {
// 获取订单列表
async getOrderListMet() {
if(this.$route.query.marketing_type == "4"){
this.orderQueryObj.marketing_id = this.$route.query.marketing_id;
if (this.$route.query.marketing_type == "4") {
this.orderQueryObj.marketing_id = this.$route.query.marketing_id;
}
try {
const res = await newGetOrderList(this.orderQueryObj);
console.log(res);
this.goodsNum = res.goods_num; // 商品共计
this.totalNum = res.count; // 商品总数
this.orderTableData = res.result;
......@@ -739,19 +740,23 @@ export default {
},
created() {
this.getMarketingListMet(); // 活动名称
this.getSubShopListMet(); // 自提点
this.getOrderListMet(); // table列表
this.getSubShopListMet(); // 自提点
this.getOrderListMet(); // table列表
},
};
</script>
<style lang="less" src="../orderManagement/index.less" scope></style>
<style lang="less" src="../orderManagement/index.less" scoped></style>
<style lang="less" scoped>
.check-wrap{
/deep/ .el-checkbox__label {
white-space: normal;
word-break: break-all;
.check-wrap {
/deep/ .el-checkbox__label {
white-space: normal;
word-break: break-all;
}
}
.refundCon /deep/ .el-row{
margin-bottom: 15px;
display: flex;
align-items: center;
}
</style>
......@@ -15,9 +15,3 @@
display: block;
text-align: center;
}
.refundCon /deep/ .el-row {
margin-bottom: 15px;
display: flex;
align-items: center;
}
\ No newline at end of file
......@@ -513,20 +513,20 @@ export default {
marketing_id: val,
};
const res = await getGoodsList(params); // 商品名称
this.getSubShopListMet(val) //自提点
this.getSubShopListMet(val); //自提点
// const res = await getSubShopList(params);
this.tradeNameArr = res.result;
// this.selLiftPoinArr = res.result;
// this.selLiftPoinArr = res.result;
},
// 获取自提点
async getSubShopListMet(params) {
try {
let marketing_id = ''
if(params){
marketing_id = params
let marketing_id = "";
if (params) {
marketing_id = params;
}
const res = await getSubShopList({'marketing_id':marketing_id});
const res = await getSubShopList({ marketing_id: marketing_id });
this.selLiftPoinArr = res.result;
} catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~");
......@@ -630,8 +630,8 @@ export default {
// 获取订单列表
async getOrderListMet() {
if(this.$route.query.marketing_type == "4"){
this.orderQueryObj.marketing_id = this.$route.query.marketing_id;
if (this.$route.query.marketing_type == "4") {
this.orderQueryObj.marketing_id = this.$route.query.marketing_id;
}
try {
const res = await getOrderList(this.orderQueryObj);
......@@ -761,19 +761,23 @@ export default {
},
created() {
this.getMarketingListMet(); // 活动名称
this.getSubShopListMet(); // 自提点
this.getOrderListMet(); // table列表
this.getSubShopListMet(); // 自提点
this.getOrderListMet(); // table列表
},
};
</script>
<style lang="less" src="./index.less" scope></style>
<style lang="less" scoped>
.check-wrap{
/deep/ .el-checkbox__label {
white-space: normal;
word-break: break-all;
.check-wrap {
/deep/ .el-checkbox__label {
white-space: normal;
word-break: break-all;
}
}
.refundCon /deep/ .el-row{
margin-bottom: 15px;
display: flex;
align-items: center;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment