This commit is contained in:
parent
1f44a225f4
commit
0be43d1a94
|
@ -1153,7 +1153,9 @@ export default class addKnockGold extends Component {
|
||||||
data={this.state.model}
|
data={this.state.model}
|
||||||
onChangeMoney={(isVisible, data = 0) => {
|
onChangeMoney={(isVisible, data = 0) => {
|
||||||
const models = this.state.model
|
const models = this.state.model
|
||||||
models.recharge_amount = data + Number(models.recharge_amount)
|
models.recharge_amount = (
|
||||||
|
data + Number(models.recharge_amount)
|
||||||
|
).toFixed(2)
|
||||||
this.setState({ visible: isVisible, model: models })
|
this.setState({ visible: isVisible, model: models })
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -245,7 +245,7 @@ export default class exchangedit extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getTableList() {
|
getTableList(cancel) {
|
||||||
let code_batch_id = sessionStorage.getItem('code_id')
|
let code_batch_id = sessionStorage.getItem('code_id')
|
||||||
getCodesDetail(code_batch_id)
|
getCodesDetail(code_batch_id)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
@ -255,6 +255,20 @@ export default class exchangedit extends React.Component {
|
||||||
let reqCopy = _.cloneDeep(req)
|
let reqCopy = _.cloneDeep(req)
|
||||||
const resData = this.transFormData(reqCopy)
|
const resData = this.transFormData(reqCopy)
|
||||||
reqCopy.goods = resData
|
reqCopy.goods = resData
|
||||||
|
//取消
|
||||||
|
if (cancel) {
|
||||||
|
const newConcatData = []
|
||||||
|
reqCopy.goods.filter((item) => {
|
||||||
|
this.state.tempdata.filter((item1) => {
|
||||||
|
if (item.only === item1.only) {
|
||||||
|
item1.origin.recharge_amount = item.origin.recharge_amount
|
||||||
|
}
|
||||||
|
newConcatData.push(item1)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
reqCopy.goods = newConcatData
|
||||||
|
}
|
||||||
|
|
||||||
let codeInfo = {
|
let codeInfo = {
|
||||||
code_name: reqCopy.title,
|
code_name: reqCopy.title,
|
||||||
issued: reqCopy.quantity,
|
issued: reqCopy.quantity,
|
||||||
|
@ -282,7 +296,13 @@ export default class exchangedit extends React.Component {
|
||||||
this.setState({ codeInfo: codeInfo })
|
this.setState({ codeInfo: codeInfo })
|
||||||
this.setState({ isload: true })
|
this.setState({ isload: true })
|
||||||
_.map(reqCopy.goods, (res) => {
|
_.map(reqCopy.goods, (res) => {
|
||||||
res.checked = true
|
if (cancel) {
|
||||||
|
if (res.checked) {
|
||||||
|
res.checked = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res.checked = true
|
||||||
|
}
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
this.setState({ tempdata: reqCopy.goods || [] })
|
this.setState({ tempdata: reqCopy.goods || [] })
|
||||||
|
@ -299,13 +319,25 @@ export default class exchangedit extends React.Component {
|
||||||
|
|
||||||
let arr = []
|
let arr = []
|
||||||
_.map(reqCopy.goods, (res) => {
|
_.map(reqCopy.goods, (res) => {
|
||||||
let obj = {}
|
if (cancel) {
|
||||||
obj.key = res.only
|
if (res.checked) {
|
||||||
obj.text = res.product_name
|
let obj = {}
|
||||||
obj.id = res.id
|
obj.key = res.only
|
||||||
this.state.oldProduct.push(res.id)
|
obj.text = res.product_name
|
||||||
arr.push(obj)
|
obj.id = res.id
|
||||||
return obj
|
this.state.oldProduct.push(res.id)
|
||||||
|
arr.push(obj)
|
||||||
|
return obj
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let obj = {}
|
||||||
|
obj.key = res.only
|
||||||
|
obj.text = res.product_name
|
||||||
|
obj.id = res.id
|
||||||
|
this.state.oldProduct.push(res.id)
|
||||||
|
arr.push(obj)
|
||||||
|
return obj
|
||||||
|
}
|
||||||
})
|
})
|
||||||
this.setState({ rankoptions: arr })
|
this.setState({ rankoptions: arr })
|
||||||
this.setState({ rank: arr })
|
this.setState({ rank: arr })
|
||||||
|
@ -1371,7 +1403,7 @@ export default class exchangedit extends React.Component {
|
||||||
<Button
|
<Button
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
this.setState({ drawerVisible2: false })
|
this.setState({ drawerVisible2: false })
|
||||||
// this.getTableList()
|
this.getTableList('cancel')
|
||||||
}}>
|
}}>
|
||||||
取消
|
取消
|
||||||
</Button>
|
</Button>
|
||||||
|
|
Loading…
Reference in New Issue