feat: 包码编辑
This commit is contained in:
parent
74bda83b3d
commit
e2baf44891
|
@ -89,7 +89,7 @@ export default class add extends React.Component {
|
|||
|
||||
componentDidMount(e) {
|
||||
let plan_status = sessionStorage.getItem("plan_status")
|
||||
if (plan_status == 3 || plan_status == 4 || plan_status == 5) {
|
||||
if (plan_status == 3 || plan_status == 4 || plan_status == 5 || plan_status == 2) {
|
||||
this.setState({ disabled: true })
|
||||
}
|
||||
let plan_id = sessionStorage.getItem("plan_id")
|
||||
|
@ -113,6 +113,7 @@ export default class add extends React.Component {
|
|||
if (req.info) {
|
||||
sessionStorage.setItem("step1", JSON.stringify(req.info))
|
||||
this.refs.step1.edit(req.info)
|
||||
return
|
||||
}
|
||||
if (req.keys.length > 0 && this.state.disabled == false) {
|
||||
this.setState({ curstep: 2 })
|
||||
|
|
|
@ -35,29 +35,6 @@ export default class accList extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
edit(data) {
|
||||
let model = {}
|
||||
model.title = data.title
|
||||
model.type = parseInt(data.type)
|
||||
model.return_id = data.return_type
|
||||
model.settlement_type = this.state.settlementOptions.filter(
|
||||
(item) => item.key == data.settlement_type
|
||||
)[0]
|
||||
model.reseller = {
|
||||
key: data.reseller_id,
|
||||
text: data.reseller_name
|
||||
}
|
||||
|
||||
model.date_time = [data.begin_time, data.end_time]
|
||||
const date = {
|
||||
begin_time: model.date_time[0],
|
||||
end_time: model.date_time[1]
|
||||
}
|
||||
sessionStorage.setItem("knockGold_effectDate", JSON.stringify(date))
|
||||
sessionStorage.setItem("redPackets_effectDate", JSON.stringify(date))
|
||||
this.setState({ model: model, lodshow: true, isSettlement: data.settlement_type ? 1 : 2 })
|
||||
}
|
||||
//
|
||||
componentDidMount(e) {
|
||||
getReSellerOption().then((res) => {
|
||||
handelResponse(
|
||||
|
@ -98,6 +75,43 @@ export default class accList extends React.Component {
|
|||
})
|
||||
}
|
||||
|
||||
edit(data) {
|
||||
let model = {}
|
||||
model.title = data.title
|
||||
model.type = parseInt(data.type)
|
||||
model.return_id = data.return_type
|
||||
|
||||
model.reseller = {
|
||||
key: data.reseller_id,
|
||||
text: data.reseller_name
|
||||
}
|
||||
model.date_time = [data.begin_time, data.end_time]
|
||||
const date = {
|
||||
begin_time: model.date_time[0],
|
||||
end_time: model.date_time[1]
|
||||
}
|
||||
sessionStorage.setItem("knockGold_effectDate", JSON.stringify(date))
|
||||
sessionStorage.setItem("redPackets_effectDate", JSON.stringify(date))
|
||||
|
||||
// 是否是包码
|
||||
let bm_obj_str = sessionStorage.getItem("bm_obj")
|
||||
if (bm_obj_str) {
|
||||
let bm_obj = JSON.parse(bm_obj_str)
|
||||
if (bm_obj.settlement_type > 0) {
|
||||
this.setState({
|
||||
isSettlement: 1
|
||||
})
|
||||
model.settlement_type = { key: bm_obj.settlement_type, text: bm_obj.settlement_type_text }
|
||||
} else {
|
||||
this.setState({
|
||||
isSettlement: 2
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
this.setState({ model: model, lodshow: true })
|
||||
}
|
||||
|
||||
async submit(id) {
|
||||
let valide = false
|
||||
if (this.refs.form1.validator()) {
|
||||
|
|
|
@ -717,6 +717,12 @@ export default class acclist extends React.Component {
|
|||
Notify.error("不可编辑")
|
||||
return
|
||||
}
|
||||
// 如果是包码
|
||||
let bm_obj = {
|
||||
settlement_type: row.settlement_type,
|
||||
settlement_type_text: row.settlement_type_text
|
||||
}
|
||||
sessionStorage.setItem("bm_obj", JSON.stringify(bm_obj))
|
||||
sessionStorage.setItem("plan_id", row.id)
|
||||
sessionStorage.setItem("plan_status", row.status)
|
||||
sessionStorage.setItem("approval_id", row.approval_id)
|
||||
|
|
Loading…
Reference in New Issue