feat: 包码编辑

This commit is contained in:
zhangds 2024-02-20 17:09:47 +08:00
parent 74bda83b3d
commit e2baf44891
3 changed files with 45 additions and 24 deletions

View File

@ -89,7 +89,7 @@ export default class add extends React.Component {
componentDidMount(e) { componentDidMount(e) {
let plan_status = sessionStorage.getItem("plan_status") 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 }) this.setState({ disabled: true })
} }
let plan_id = sessionStorage.getItem("plan_id") let plan_id = sessionStorage.getItem("plan_id")
@ -113,6 +113,7 @@ export default class add extends React.Component {
if (req.info) { if (req.info) {
sessionStorage.setItem("step1", JSON.stringify(req.info)) sessionStorage.setItem("step1", JSON.stringify(req.info))
this.refs.step1.edit(req.info) this.refs.step1.edit(req.info)
return
} }
if (req.keys.length > 0 && this.state.disabled == false) { if (req.keys.length > 0 && this.state.disabled == false) {
this.setState({ curstep: 2 }) this.setState({ curstep: 2 })

View File

@ -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) { componentDidMount(e) {
getReSellerOption().then((res) => { getReSellerOption().then((res) => {
handelResponse( 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) { async submit(id) {
let valide = false let valide = false
if (this.refs.form1.validator()) { if (this.refs.form1.validator()) {

View File

@ -717,6 +717,12 @@ export default class acclist extends React.Component {
Notify.error("不可编辑") Notify.error("不可编辑")
return 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_id", row.id)
sessionStorage.setItem("plan_status", row.status) sessionStorage.setItem("plan_status", row.status)
sessionStorage.setItem("approval_id", row.approval_id) sessionStorage.setItem("approval_id", row.approval_id)