From bd235ad6d99347b5280fbaf2584e93665a4ba847 Mon Sep 17 00:00:00 2001 From: hupeng Date: Wed, 23 Jun 2021 12:39:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8B=BC=E5=9B=A2=E7=A7=92?= =?UTF-8?q?=E6=9D=80=E7=BC=96=E8=BE=91=E4=B8=8E=E6=96=B0=E5=A2=9E=E4=BA=A4?= =?UTF-8?q?=E5=8F=89=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/activity/combination/form.vue | 10 ++++++++-- src/views/activity/seckill/form.vue | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/views/activity/combination/form.vue b/src/views/activity/combination/form.vue index 08cf606..8936356 100644 --- a/src/views/activity/combination/form.vue +++ b/src/views/activity/combination/form.vue @@ -396,6 +396,8 @@ export default { }, 'form1.good.productId': { handler(val,oldVal){ + console.info("val:"+val) + console.info("oldval:"+oldVal) if(val){ this.getInfoChooseGood (val) } @@ -521,6 +523,8 @@ export default { // 详情选择商品生成规格用 getInfoChooseGood (id) { let that = this; + let cid = that.$route.params.id || 0; + getInfo(id==null?0:id).then(async res => { let data = res.productInfo; if(data){ @@ -529,7 +533,8 @@ export default { Object.keys(that.formValidate).forEach(key=>{ if(data[key]) that.formValidate[key] = data[key]; }) - that.formValidate.id = 0; + that.formValidate.id = cid; + //that.formValidate.id = 0; that.formValidate.productId = id that.formValidate.title = data.store_name that.formValidate.info = data.store_info @@ -578,6 +583,7 @@ export default { getInfo () { let that = this; let id = that.$route.params.id || 0; + that.formValidate.id = id; getCombinationInfo(id).then(async res => { let data = res.productInfo; if(data){ @@ -640,7 +646,7 @@ export default { if(this.formValidate.spec_type === 1 && this.manyFormValidate.length===0){ return this.$message.warning('请点击生成规格!'); } - add(this.formValidate).then(async res => { + edit(this.formValidate).then(async res => { this.$message({ message:'操作成功', type: 'success' diff --git a/src/views/activity/seckill/form.vue b/src/views/activity/seckill/form.vue index a47ca29..31008d4 100644 --- a/src/views/activity/seckill/form.vue +++ b/src/views/activity/seckill/form.vue @@ -527,6 +527,7 @@ export default { // 详情选择商品生成规格用 getInfoChooseGood (id) { let that = this; + let cid = that.$route.params.id || 0; getInfo(id).then(async res => { let data = res.productInfo; console.log('data:'+data) @@ -537,7 +538,7 @@ export default { Object.keys(that.formValidate).forEach(key=>{ if(data[key]) that.formValidate[key] = data[key]; }) - that.formValidate.id = 0; + that.formValidate.id = cid; that.formValidate.productId = id that.formValidate.cate_id = cate_id; that.oneFormValidate = [data.attr]; @@ -652,7 +653,7 @@ export default { if(this.formValidate.spec_type === 1 && this.manyFormValidate.length===0){ return this.$message.warning('请点击生成规格!'); } - add(this.formValidate).then(async res => { + edit(this.formValidate).then(async res => { this.$message({ message:'操作成功', type: 'success'