优化兑换码列表代码 兑换码新增复制生效时间做限制
This commit is contained in:
parent
a95eacc7a0
commit
1cfc91505c
|
@ -795,11 +795,14 @@ export default class exchangeAdd extends React.Component {
|
||||||
addProduct(type) {
|
addProduct(type) {
|
||||||
this.setState({ addIsType: type }) /* 类型 */
|
this.setState({ addIsType: type }) /* 类型 */
|
||||||
let direct_reseller_ids = this.state.direct_reseller_id
|
let direct_reseller_ids = this.state.direct_reseller_id
|
||||||
|
|
||||||
if (direct_reseller_ids <= 0) {
|
if (direct_reseller_ids <= 0) {
|
||||||
// 老数据不能进行新增商品操作
|
return Notify.error(`请添加映射分销商`)
|
||||||
Notify.error(`请添加映射分销商`)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
if (!this.state.isState && !this.state.codeInfo.keyBatchSelect.key) {
|
||||||
|
return Notify.error(`请选择归属key批次`)
|
||||||
|
}
|
||||||
|
|
||||||
if (type === "addProduct") {
|
if (type === "addProduct") {
|
||||||
this.setState({ product_title: "新建商品", newGoodsBtnLoading: true })
|
this.setState({ product_title: "新建商品", newGoodsBtnLoading: true })
|
||||||
} else {
|
} else {
|
||||||
|
@ -1074,10 +1077,10 @@ export default class exchangeAdd extends React.Component {
|
||||||
this.getResellerFunction(e.reseller_id)
|
this.getResellerFunction(e.reseller_id)
|
||||||
this.handleChange("", "keyBatchSelect")
|
this.handleChange("", "keyBatchSelect")
|
||||||
this.setState({
|
this.setState({
|
||||||
plan_time: [e.start_time, e.end_time]
|
plan_time: [e.begin_time, e.end_time]
|
||||||
})
|
})
|
||||||
const time = {
|
const time = {
|
||||||
start_time: e.start_time,
|
begin_time: e.begin_time,
|
||||||
end_time: e.end_time
|
end_time: e.end_time
|
||||||
}
|
}
|
||||||
sessionStorage.setItem("knockGold_effectDate", JSON.stringify(time))
|
sessionStorage.setItem("knockGold_effectDate", JSON.stringify(time))
|
||||||
|
|
|
@ -149,6 +149,7 @@ export default class acclist extends React.Component {
|
||||||
}
|
}
|
||||||
/* 新建/复制/编辑/兑换码 */
|
/* 新建/复制/编辑/兑换码 */
|
||||||
addCodeFunction(type, param) {
|
addCodeFunction(type, param) {
|
||||||
|
sessionStorage.setItem("knockGold_effectDate", JSON.stringify({}))
|
||||||
let activerou = [
|
let activerou = [
|
||||||
{
|
{
|
||||||
pagetitle: "新建兑换码",
|
pagetitle: "新建兑换码",
|
||||||
|
@ -185,7 +186,6 @@ export default class acclist extends React.Component {
|
||||||
sessionStorage.setItem("isState", type)
|
sessionStorage.setItem("isState", type)
|
||||||
sessionStorage.setItem("breaknav", JSON.stringify(activerou))
|
sessionStorage.setItem("breaknav", JSON.stringify(activerou))
|
||||||
sessionStorage.setItem("pathname2", "/home/exchangecode-exchangecodeAdd")
|
sessionStorage.setItem("pathname2", "/home/exchangecode-exchangecodeAdd")
|
||||||
|
|
||||||
this.props.history.push("/home/exchangecode-exchangecodeAdd")
|
this.props.history.push("/home/exchangecode-exchangecodeAdd")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,65 +247,6 @@ export default class acclist extends React.Component {
|
||||||
return element
|
return element
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 编辑 */
|
|
||||||
editinfo(e, rowData) {
|
|
||||||
sessionStorage.setItem("pathname2", "/home/exchangecode-edit")
|
|
||||||
let activerou = [
|
|
||||||
{
|
|
||||||
pagetitle: "编辑",
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
path: "/home/exchangecode-list",
|
|
||||||
name: "兑换码管理"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "/home/exchangecode-add",
|
|
||||||
name: "编辑:" + rowData.title
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
sessionStorage.setItem(
|
|
||||||
"knockGold_effectDate",
|
|
||||||
JSON.stringify(rowData.keyBatch.plan)
|
|
||||||
)
|
|
||||||
sessionStorage.setItem("code_id", rowData.id)
|
|
||||||
sessionStorage.setItem("breaknav", JSON.stringify(activerou))
|
|
||||||
sessionStorage.setItem("approval_id", rowData.approval_id)
|
|
||||||
sessionStorage.setItem("approval_status", rowData.status)
|
|
||||||
window.open("#/home/exchangecode-edit")
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 复制 */
|
|
||||||
copyFunction(key_batch_id, id, keyBatch, title) {
|
|
||||||
sessionStorage.setItem("keybatch_id", key_batch_id)
|
|
||||||
sessionStorage.setItem("copy_code_id", id)
|
|
||||||
sessionStorage.setItem("key_reseller_id", keyBatch.plan.reseller_id)
|
|
||||||
sessionStorage.setItem("approval_id", keyBatch.approval_id) /* 审核id */
|
|
||||||
let breakchangenav = [
|
|
||||||
{
|
|
||||||
pagetitle: "复制key",
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
path: "/home/exchangecode-list",
|
|
||||||
name: "兑换码管理"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "/home/exchangecode-copyCode",
|
|
||||||
name: "复制:" + title
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
sessionStorage.setItem(
|
|
||||||
"knockGold_effectDate",
|
|
||||||
JSON.stringify(keyBatch.plan)
|
|
||||||
)
|
|
||||||
sessionStorage.setItem("pathname2", "/home/exchangecode-copyCode")
|
|
||||||
sessionStorage.setItem("breaknav", JSON.stringify(breakchangenav))
|
|
||||||
this.props.history.push("/home/exchangecode-copyCode")
|
|
||||||
}
|
|
||||||
|
|
||||||
tabFn(index) {
|
tabFn(index) {
|
||||||
this.setState({ tabIndex: index, key_word: "" })
|
this.setState({ tabIndex: index, key_word: "" })
|
||||||
this.setState({ page: 1, limit: 10 })
|
this.setState({ page: 1, limit: 10 })
|
||||||
|
|
Loading…
Reference in New Issue