区分兑换码编辑、新增、复制代码
This commit is contained in:
parent
72b4dae442
commit
bcd82a9b16
|
@ -285,12 +285,13 @@ export default class exchangeAdd extends React.Component {
|
|||
//获取分销商
|
||||
this.getResellerFunction(reqCopy.plan.reseller_id)
|
||||
|
||||
this.setState({ codeInfo: codeInfo })
|
||||
this.setState({ isload: true })
|
||||
this.setState({ codeInfo: codeInfo, isload: true })
|
||||
|
||||
_.map(reqCopy.goods, (res) => {
|
||||
res.checked = true
|
||||
return res
|
||||
})
|
||||
|
||||
this.setState({ tempdata: reqCopy.goods || [] })
|
||||
|
||||
let a1 = reqCopy.goods.map((item) => {
|
||||
|
@ -339,9 +340,9 @@ export default class exchangeAdd extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
/* 审核中转换数据 */
|
||||
transFormData1(req, type) {
|
||||
const newData = []
|
||||
/* 转换数据结构 */
|
||||
req.legal.map((item1) => {
|
||||
item1.type = 1
|
||||
item1.only = item1.product_id
|
||||
|
@ -362,6 +363,7 @@ export default class exchangeAdd extends React.Component {
|
|||
obj.id = item1?.goods_id
|
||||
}
|
||||
obj.product_id = item1?.goods_id
|
||||
obj.code_batch_id = item1?.code_batch_id
|
||||
obj.product_type_text = "立减金"
|
||||
obj.contract_price = item1.price
|
||||
obj.create_time = item1.create_time
|
||||
|
@ -392,12 +394,13 @@ export default class exchangeAdd extends React.Component {
|
|||
return newData
|
||||
}
|
||||
|
||||
/* 转换数据 */
|
||||
/* 无审核转换数据 */
|
||||
transFormData(reqCopy) {
|
||||
const resData = []
|
||||
reqCopy.goods.map((item) => {
|
||||
/* type 1为商品 2为立减金 转译字符方便处理 */
|
||||
/* 此处only 商品为product_id 立减金为channel_activity_id */
|
||||
if (this.state.isState === 1) delete item.entity.id /* 复制时删除id */
|
||||
if (item.type === 1) {
|
||||
item.entity.upstream = "直连天下"
|
||||
item.entity.only = item.entity.product_id
|
||||
|
@ -407,6 +410,7 @@ export default class exchangeAdd extends React.Component {
|
|||
resData.push(item.entity)
|
||||
} else if (item.type === 2) {
|
||||
item.entity.weight = item.weight
|
||||
item.entity.code_batch_id = item.code_batch_id
|
||||
resData.push({
|
||||
origin: item.entity,
|
||||
type: item.type,
|
||||
|
@ -646,7 +650,7 @@ export default class exchangeAdd extends React.Component {
|
|||
/* 复制\新增状态下数据提交 */
|
||||
submitCopyOrAddCodeData() {
|
||||
let data = this.copyOrAddBuildData()
|
||||
let id = sessionStorage.getItem("keybatch_id")
|
||||
let id = sessionStorage.getItem("keyBatch_id")
|
||||
|
||||
keyEditApproval(id, data).then((res) => {
|
||||
handelResponse(
|
||||
|
@ -1108,7 +1112,11 @@ export default class exchangeAdd extends React.Component {
|
|||
prop='keyBatchSelect'
|
||||
id='keyBatchSelect'>
|
||||
<Select
|
||||
onChange={(e) => this.handleChange(e, "keyBatchSelect")}
|
||||
onChange={(e) => {
|
||||
this.handleChange(e, "keyBatchSelect")
|
||||
/* 新增时保存key批次 */
|
||||
sessionStorage.setItem("keyBatch_id", e?.id)
|
||||
}}
|
||||
clearable
|
||||
value={this.state.codeInfo.keyBatchSelect}
|
||||
options={this.state.keyBatchSelectData}
|
||||
|
|
|
@ -161,8 +161,8 @@ export const init = () => {
|
|||
tableLoading: false,
|
||||
newGoldLoading: false,
|
||||
addIsType: "",
|
||||
isState: 0,
|
||||
planSelectData: [] /* 营销计划数据 */,
|
||||
keyBatchSelectData: [] /* 营销计划ID */
|
||||
isState: 0 /* 0:新增 1:复制 2:编辑 */,
|
||||
planSelectData: [] /* 归属计划数据 */,
|
||||
keyBatchSelectData: [] /* 归属key数据 */
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,12 +172,12 @@ export default class acclist extends React.Component {
|
|||
"knockGold_effectDate",
|
||||
JSON.stringify(param.keyBatch.plan)
|
||||
)
|
||||
sessionStorage.setItem("keybatch_id", param.key_batch_id)
|
||||
sessionStorage.setItem("key_reseller_id", param.keyBatch.plan.reseller_id)
|
||||
sessionStorage.setItem("approval_id", param.keyBatch.approval_id)
|
||||
/* 复制兑换码的key批次Id */
|
||||
sessionStorage.setItem("keyBatch_id", param.key_batch_id)
|
||||
} else if (type === 2) {
|
||||
activerou[0].pagetitle = "编辑"
|
||||
activerou[0].items[1].name = `编辑:${param.title}兑换码的商品范围列表`
|
||||
sessionStorage.setItem("approval_id", param.keyBatch.approval_id)
|
||||
sessionStorage.setItem("approval_status", param.status)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue