✨ feat: 新增包结算方式
This commit is contained in:
parent
5a53adbcad
commit
89ce9e8c87
|
@ -999,4 +999,9 @@ export const receiveRetry = (data) => {
|
|||
return req("post", baseurl + "/voucher/receiveRetry", data)
|
||||
}
|
||||
|
||||
/* 包码结算方式 */
|
||||
export const getSettlementType = () => {
|
||||
return req("get", baseurl + "/plan/settlementType")
|
||||
}
|
||||
|
||||
export { req }
|
||||
|
|
|
@ -7,7 +7,13 @@ import FormItem from "@/components/form-item/main"
|
|||
import Bus from "@/assets/eventBus.js"
|
||||
import { map } from "lodash-es"
|
||||
import moment from "moment"
|
||||
import { addPlanStep, handelResponse, getReSellerOption, putPlanStep } from "@/assets/api.js"
|
||||
import {
|
||||
addPlanStep,
|
||||
handelResponse,
|
||||
getReSellerOption,
|
||||
putPlanStep,
|
||||
getSettlementType
|
||||
} from "@/assets/api.js"
|
||||
|
||||
export default class accList extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -19,8 +25,10 @@ export default class accList extends React.Component {
|
|||
type: 2,
|
||||
reseller: null,
|
||||
return_id: "1",
|
||||
date_time: ["", ""]
|
||||
date_time: ["", ""],
|
||||
settlement_type: null
|
||||
},
|
||||
settlementOptions: [],
|
||||
reseller_option: [],
|
||||
lodshow: false
|
||||
}
|
||||
|
@ -31,13 +39,15 @@ export default class accList extends React.Component {
|
|||
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]
|
||||
// sessionStorage.setItem('datetime', JSON.stringify(model.date_time))
|
||||
const date = {
|
||||
begin_time: model.date_time[0],
|
||||
end_time: model.date_time[1]
|
||||
|
@ -66,6 +76,26 @@ export default class accList extends React.Component {
|
|||
}
|
||||
)
|
||||
})
|
||||
|
||||
/* 获取结算方式 */
|
||||
getSettlementType().then((res) => {
|
||||
handelResponse(
|
||||
res,
|
||||
(req, msg) => {
|
||||
let arr = map(req, (o) => {
|
||||
let obj = {}
|
||||
obj.key = o.settlement_type
|
||||
obj.text = o.settlement_text
|
||||
obj.direct_reseller_id = o.direct_reseller_id
|
||||
return obj
|
||||
})
|
||||
this.setState({ settlementOptions: arr })
|
||||
},
|
||||
(err) => {
|
||||
Notify.error(err)
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
async submit(id) {
|
||||
|
@ -83,12 +113,14 @@ export default class accList extends React.Component {
|
|||
data.reseller_name = this.state.model.reseller.text
|
||||
data.begin_time = this.state.model.date_time[0]
|
||||
data.end_time = this.state.model.date_time[1]
|
||||
data.settlement_type = this.state.model.settlement_type.key
|
||||
|
||||
if (id) {
|
||||
let form = {
|
||||
title: data.title,
|
||||
begin_time: data.begin_time,
|
||||
end_time: data.end_time
|
||||
end_time: data.end_time,
|
||||
settlement_type: data.settlement_type
|
||||
}
|
||||
|
||||
await putPlanStep(id, form).then((res) => {
|
||||
|
@ -159,7 +191,6 @@ export default class accList extends React.Component {
|
|||
|
||||
onTypeChange(e) {
|
||||
let model = this.state.model
|
||||
|
||||
model.type = e.target.value
|
||||
this.setState({ model: model })
|
||||
}
|
||||
|
@ -267,6 +298,25 @@ export default class accList extends React.Component {
|
|||
}}
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
labelname="包码结算方式"
|
||||
prop="settlement_type"
|
||||
required=""
|
||||
id="settlement_type"
|
||||
>
|
||||
<Select
|
||||
options={this.state.settlementOptions}
|
||||
placeholder="选择一项"
|
||||
disabled={this.props.disabled}
|
||||
width={515}
|
||||
value={this.state.model.settlement_type}
|
||||
onChange={(e) => {
|
||||
let model = this.state.model
|
||||
model.settlement_type = e
|
||||
this.setState({ model })
|
||||
}}
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem labelname="开始~结束时间" prop="date_time" id="date_time">
|
||||
<DateRangePicker
|
||||
className="zent-datepicker-plan"
|
||||
|
|
Loading…
Reference in New Issue