From 747a3e7f0e127d1ddd178a2cda16fea4cd79696c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=91=E7=A8=BD=E5=88=98?= <1073236926@qq.com> Date: Sun, 13 Dec 2020 16:34:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E6=83=A0=E5=88=B8=E7=9C=8B=E4=B8=8D=E5=88=B0=20=E5=95=86?= =?UTF-8?q?=E5=93=81=E6=88=96=E7=B1=BB=E7=9B=AE=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litemall-admin/src/views/promotion/coupon.vue | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/litemall-admin/src/views/promotion/coupon.vue b/litemall-admin/src/views/promotion/coupon.vue index 885df1ca..9c1ed746 100644 --- a/litemall-admin/src/views/promotion/coupon.vue +++ b/litemall-admin/src/views/promotion/coupon.vue @@ -447,7 +447,18 @@ export default { }, handleUpdate(row) { this.dataForm = Object.assign({}, row) - + if (this.dataForm.goodsType === 1) { + this.couponCategoryList = [] + for (let i = 0, len = row.goodsValue.length; i < len; i++) { + this.couponCategoryList.push(this.getGoodsCategoryById(row.goodsValue[i])) + } + } + if (this.dataForm.goodsType === 2) { + this.couponGoodsList = [] + for (let i = 0, len = row.goodsValue.length; i < len; i++) { + this.couponGoodsList.push(this.getGoodsById(row.goodsValue[i])) + } + } this.dialogStatus = 'update' this.dialogFormVisible = true this.$nextTick(() => { @@ -601,6 +612,19 @@ export default { } }) }, + getGoodsCategoryById(id) { + let name + let parentName + for (let i = 0; i < this.goodsCategoryOptions.length; i++) { + for (let j = 0; j < this.goodsCategoryOptions[i].children.length; j++) { + if (this.goodsCategoryOptions[i].children[j].value === id) { + parentName = this.goodsCategoryOptions[i].label + name = this.goodsCategoryOptions[i].children[j].label + } + } + } + return { goodsCategoryId: id, goodsCategoryName: name, parentCategoryName: parentName } + }, getGoodsCategoryByIds(ids) { let name let parentName -- Gitee