This commit is contained in:
zhangds 2022-09-30 13:38:23 +08:00
commit 0318356dfa
2 changed files with 16 additions and 9 deletions

View File

@ -60,7 +60,9 @@ export default class exchangeAdd extends React.Component {
/* 编辑和复制时才调用 */
if (isState) {
this.getDetailFunction(isState)
} else {
}
if (isState !== 2) {
sessionStorage.setItem("productData", [])
sessionStorage.setItem("knockGoldData", [])
this.getPlanSelect()
@ -258,7 +260,6 @@ export default class exchangeAdd extends React.Component {
handelResponse(
res,
(req, msg) => {
console.log("兑换码详情: =>", req)
let reqCopy = _.cloneDeep(req)
const resData = this.transFormData(reqCopy)
reqCopy.goods = resData
@ -272,11 +273,16 @@ export default class exchangeAdd extends React.Component {
range: reqCopy.goods
}
/* 复制状态改变code_name */
/* 复制状态改变code_name、回显计划、批次 */
if (this.state.isState === 1) {
codeInfo.code_name = `${reqCopy.title}_${
reqCopy.copy_count + 1
}`
codeInfo.planSelect = { key: req.plan.id, text: req.plan.title }
codeInfo.keyBatchSelect = {
key: req.key_batch_id,
text: req.key_batch.batch_name
}
}
this.setState({
@ -1101,7 +1107,7 @@ export default class exchangeAdd extends React.Component {
rules={codeInfo}
ref='code_info'
className='addform'>
{!this.state.isState ? (
{this.state.isState !== 2 ? (
<FormItem
labelname='归属计划'
prop='planSelect'
@ -1124,7 +1130,7 @@ export default class exchangeAdd extends React.Component {
</FormItem>
) : null}
{!this.state.isState ? (
{this.state.isState !== 2 ? (
<FormItem
labelname='归属key'
prop='keyBatchSelect'

View File

@ -218,11 +218,12 @@ export default class acclist extends React.Component {
条件一 如果兑换码状态为1进行中2暂停中3未开始可直接复制
条件二 如果兑换码状态为4已完结5已作废则判断key批次是否是 生效中暂停中审核驳回状态且营销计划是待生效进行中暂停中
*/
console.log(params)
const isCopy =
[1, 2, 3].includes(params.status) ||
([4, 5].includes(params.status) &&
[4, 5, 8].includes(params.keyBatch.status) &&
[3, 5, 4].includes(params.keyBatch.plan.status))
[1, 2, 3].includes(params?.status) ||
([4, 5].includes(params?.status) &&
[4, 5, 8].includes(params.keyBatch?.status) &&
[3, 5, 4].includes(params.keyBatch.plan?.status))
if (isCopy) {
element = (