diff --git a/src/components/UseCouponAddEdit/index.jsx b/src/components/UseCouponAddEdit/index.jsx index b2fe1c80..90893ffb 100644 --- a/src/components/UseCouponAddEdit/index.jsx +++ b/src/components/UseCouponAddEdit/index.jsx @@ -947,6 +947,11 @@ const UseCouponAddEdit = forwardRef((props, ref) => { table_index: index, }); } else { + // 如果是复制删除 code_batch_id + if (state.isState === "1") { + delete rowData.code_batch_id; + } + console.log("rowData =>", rowData); setState({ product_title: "编辑商品", productData: rowData, diff --git a/src/pages/coupon/list/index.jsx b/src/pages/coupon/list/index.jsx index dcf42ae2..f1f44c5e 100644 --- a/src/pages/coupon/list/index.jsx +++ b/src/pages/coupon/list/index.jsx @@ -55,11 +55,11 @@ const tableColumn = [ name: "plan_title", }, { - title: "归属key批次名称", + title: "归属key批次id", width: "auto", type: "normal", - prop: "keyBatch.batch_name", - name: "keyBatch.batch_name", + prop: "key_batch_id", + name: "key_batch_id", }, { title: "启用/暂停", diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js index d41b02cc..d2bdbb12 100644 --- a/src/pages/exchangepage/edittemplate/main.js +++ b/src/pages/exchangepage/edittemplate/main.js @@ -24,6 +24,12 @@ import CouponGoodsDetailForm from './couponCard/couponDetailconfig'; //优惠券 import CouponReduceDetailForm from './couponCard/couponReduceDetail'; //优惠券立减金详情页 import CouponComLib from './couponCard/goodsPage/componentLib/main'; //优惠券组件库 import CouponGoodsListForm from './couponCard/goodsPage/config/main'; //优惠券商品列表页 +let typeList={//1 白名单 3 兑换码 4优惠券 8 优惠券白名单 + '1':'whiteList', + '3':'exchange', + '4':'coupon', + '8':'coupon', +} //落地页 let model = { title: '落地页标题', @@ -274,25 +280,11 @@ export default class edittemplate extends React.Component { newEditor.exchangeList = exchangeList newEditor.whiteList = whiteList newEditor.coupon = coupon; - if (template == 1) { //1-白名单 3-兑换码 - this.setState({ - model: newEditor.whiteList.land, - product_list: newEditor.whiteList.product_list, - product_detail: newEditor.whiteList.product_detail - }) - } else if (template == 3) { - this.setState({ - model: newEditor.exchangeList.land, - product_list: newEditor.exchangeList.product_list, - product_detail: newEditor.exchangeList.product_detail - }) - } else { - this.setState({ - model: newEditor.coupon.land, - product_list: newEditor.coupon.product_list, - product_detail: newEditor.coupon.product_detail - }) - } + this.setState({//编辑回显 + model: newEditor[typeList[template]].land, + product_list: newEditor[typeList[template]].product_list, + product_detail: newEditor[typeList[template]].product_detail + }) sessionStorage.setItem('editorConfig', JSON.stringify(newEditor)) if (mouldType != 0 && pageChange == 1) { this.setState({ pagedisable: true }) @@ -323,10 +315,9 @@ export default class edittemplate extends React.Component { let self = this let mouldType = sessionStorage.getItem('mouldType') let myInfoData = JSON.parse(sessionStorage.getItem('pageInfo'))//判断是否有数据 - let editorList = JSON.parse(sessionStorage.getItem('editorConfig')) - let addSystemData = _.cloneDeep(editorList) - let infoWhite = addSystemData.whiteList - let infoCoupon = addSystemData.coupon//优惠券 + let addSystemData = _.cloneDeep(JSON.parse(sessionStorage.getItem('editorConfig'))) + let infoWhite = _.omit(addSystemData.whiteList,['land[sort]','land[title]','land[type_id]','land[thumb]']) + let infoCoupon = _.omit(addSystemData.coupon,['land[sort]','land[title]',,'land[thumb]'])//优惠券 if (!this.state.model.top_image) { Notify.clear() Notify.error('请上传落地页顶部banner') @@ -355,16 +346,15 @@ export default class edittemplate extends React.Component { return } this.setState({ loading_visible: true, activeNavStatus: 1 }) - let thumbresult = null if (mouldType == 0) { //系统模板 this.setState({ activeNavStatus: 1 }) if (this.state.showType != 3) { - let exchangeFlag = await this.onmodelChange({ target: { value: 3 } }) + this.onmodelChange({ target: { value: 3 } }) } } this.canvasImg.style.display = 'block' - thumbresult = await this.canvasImgFn() + let thumbresult = await this.canvasImgFn() let formdata = { title: exchangeStateData.model.title, page: exchangeStateData.showType, @@ -373,16 +363,16 @@ export default class edittemplate extends React.Component { } if (mouldType == 0) { //系统模板新增 - formdata.sort = exchangeStateData.model.sort; + formdata.sort = exchangeStateData.model.sort;//权重 formdata.type_id = exchangeStateData.model.type_id.key; let infoExchange = {} infoExchange.land = exchangeStateData.model infoExchange.product_list = exchangeStateData.product_list infoExchange.product_detail = exchangeStateData.product_detail - formdata.exchange = infoExchange + formdata.exchange = _.omit(infoExchange,['land[sort]','land[title]','thumb'])//优惠券 formdata.access_conf = infoWhite formdata.coupon = infoCoupon - console.log(387,exchangeStateData); + console.log(387,formdata); if (myInfoData) { //编辑 putSystemTemplate(myInfoData.id, formdata).then((res) => { diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index 4b2fedb7..6d34754d 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -540,21 +540,8 @@ export default class acclist extends React.Component { window.location.hash, "#/home/plan-edit" ); - window.open(link, "_blank"); - - sessionStorage.setItem("showflag", true); - let arr = [ - { - pagetitle: "编辑", - items: [ - { path: "/home/key-list", name: "营销计划管理" }, - { path: "/home/key-list", name: "编辑:" + row.title }, - ], - }, - ]; - sessionStorage.setItem("breaknav", JSON.stringify(arr)); - sessionStorage.setItem("linkshowname", "营销计划管理"); sessionStorage.setItem("isState", "2"); + window.open(link, "_blank"); } // 一键复制 onCopy(e, row) { @@ -578,21 +565,8 @@ export default class acclist extends React.Component { window.location.hash, "#/home/plan-edit-copy" ); - window.open(link, "_blank"); - - sessionStorage.setItem("showflag", true); - let arr = [ - { - pagetitle: "复制", - items: [ - { path: "/home/plan-edit-copy", name: "营销计划管理" }, - { path: "/home/plan-edit-copy", name: "复制:" + row.title }, - ], - }, - ]; - sessionStorage.setItem("breaknav", JSON.stringify(arr)); - sessionStorage.setItem("linkshowname", "营销计划管理"); sessionStorage.setItem("isState", "1"); + window.open(link, "_blank"); } onFilterClose(prop) { let data = {}; @@ -956,7 +930,7 @@ export default class acclist extends React.Component { this.onCopy(e, rowData); }} > - 复制 + 复制1111 )}