兑换码列表新增字段并转译 修复立减金不能提交BUG
This commit is contained in:
parent
2921d09dd1
commit
92b93fe66b
|
@ -38,7 +38,7 @@ import {
|
|||
putCodes,
|
||||
putCodesBatch
|
||||
} from '../../../assets/api.js'
|
||||
import _ from 'lodash'
|
||||
import _, { isArray } from 'lodash'
|
||||
import Productform from '../product/add'
|
||||
import KnockGold from '../../plan/knockGold/' /* 立减金 */
|
||||
|
||||
|
@ -619,7 +619,7 @@ export default class exchangedit extends React.Component {
|
|||
data = JSON.parse(sessionStorage.getItem('knockGoldData'))
|
||||
temp = _.map(data, (item) => {
|
||||
let index = this.state.tempdata.findIndex((o) => {
|
||||
return o.product_id === item.uuid
|
||||
return o.batch_number === item.batch_number
|
||||
})
|
||||
|
||||
if (index > -1) {
|
||||
|
@ -629,15 +629,14 @@ export default class exchangedit extends React.Component {
|
|||
/* 转换商品结构 */
|
||||
// temp
|
||||
return {
|
||||
product_id: item.uuid,
|
||||
product_name: item.batch_goods_name, //名字
|
||||
cost_price: '',
|
||||
batch_number: item.batch_number, //批次号
|
||||
type: 'knockGold', //类型
|
||||
upstream: item.channel === '1' ? '支付宝' : '微信', //上游
|
||||
effectDate: item.entry_time[0] + '至' + item.entry_time[1], //有效时间
|
||||
contract_price: item.contract_price, //单价
|
||||
official_price: item.denomination, //官方价
|
||||
quantity: (item.all_budget / item.denomination).toFixed(0), //总库存
|
||||
stock: '',
|
||||
usage: '',
|
||||
type: 'knockGold',
|
||||
edit: 'edit'
|
||||
}
|
||||
})
|
||||
|
@ -646,7 +645,7 @@ export default class exchangedit extends React.Component {
|
|||
let arr = []
|
||||
_.map(temp.concat(this.state.tempdata), (res) => {
|
||||
let obj = {}
|
||||
obj.key = res.product_id
|
||||
obj.key = res.batch_number
|
||||
obj.text = res.product_name
|
||||
arr.push(obj)
|
||||
return obj
|
||||
|
@ -655,7 +654,7 @@ export default class exchangedit extends React.Component {
|
|||
this.setState({ rankoptions: arr })
|
||||
}
|
||||
let newArray = temp.concat(this.state.tempdata)
|
||||
newArray = deWeightThree(newArray, 'product_id')
|
||||
newArray = deWeightThree(newArray, 'batch_number')
|
||||
this.setState({ tempdata: newArray })
|
||||
}, 500)
|
||||
}
|
||||
|
@ -872,7 +871,7 @@ export default class exchangedit extends React.Component {
|
|||
if (rowData.type === 'knockGold') {
|
||||
const temp = JSON.parse(sessionStorage.getItem('knockGoldData'))
|
||||
const editData = temp.filter(
|
||||
(item) => item.uuid === rowData.product_id
|
||||
(item) => item.batch_number === rowData.batch_number
|
||||
)
|
||||
|
||||
this.setState({
|
||||
|
@ -920,6 +919,13 @@ export default class exchangedit extends React.Component {
|
|||
width: 'auto',
|
||||
type: 'normal'
|
||||
},
|
||||
{
|
||||
title: '立减金平台批次号',
|
||||
width: '200px',
|
||||
prop: 'batch_number',
|
||||
name: 'batch_number',
|
||||
type: 'normal'
|
||||
},
|
||||
{
|
||||
title: '商品名称',
|
||||
width: 'auto',
|
||||
|
@ -927,6 +933,28 @@ export default class exchangedit extends React.Component {
|
|||
name: 'product_name',
|
||||
type: 'slot'
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
width: 'auto',
|
||||
prop: 'type',
|
||||
name: 'type',
|
||||
type: 'slot'
|
||||
},
|
||||
{
|
||||
title: '上游平台',
|
||||
width: 'auto',
|
||||
prop: 'upstream',
|
||||
name: 'upstream',
|
||||
type: 'normal'
|
||||
},
|
||||
{
|
||||
title: '有效时间段',
|
||||
width: '250px',
|
||||
prop: 'effectDate',
|
||||
name: 'effectDate',
|
||||
type: 'normal'
|
||||
},
|
||||
|
||||
{
|
||||
title: '当前成本价格',
|
||||
prop: 'cost_price',
|
||||
|
@ -935,7 +963,7 @@ export default class exchangedit extends React.Component {
|
|||
type: 'normal'
|
||||
},
|
||||
{
|
||||
title: '合同价',
|
||||
title: '合同单价',
|
||||
name: 'contract_price',
|
||||
prop: 'contract_price',
|
||||
type: 'slot',
|
||||
|
@ -1163,6 +1191,13 @@ export default class exchangedit extends React.Component {
|
|||
/>
|
||||
)
|
||||
}
|
||||
if (com == 'type') {
|
||||
return (
|
||||
<>
|
||||
{rowData.type === 'knockGold' ? '立减金' : '商品'}
|
||||
</>
|
||||
)
|
||||
}
|
||||
if (com == 'quantity') {
|
||||
return (
|
||||
<Input
|
||||
|
|
|
@ -147,7 +147,7 @@ export default class addKnockGold extends Component {
|
|||
}
|
||||
} else {
|
||||
/* 校验表单 */
|
||||
if (!this.limitFunction()) {
|
||||
if (this.limitFunction() === false) {
|
||||
return false
|
||||
}
|
||||
//缓存
|
||||
|
|
|
@ -80,21 +80,4 @@ export default {
|
|||
}
|
||||
]
|
||||
}
|
||||
// quantity: [
|
||||
// { type: 'required', message: '请输入商品库存' },
|
||||
// {
|
||||
// type: 'regExp',
|
||||
// message: '请输入小于100万的整数',
|
||||
// reg: '^(?!0)(?:[0-9]{1,6}|1000000)$'
|
||||
// }
|
||||
// ],
|
||||
// contract_price: [
|
||||
// { type: 'required', message: '请输入合同价' },
|
||||
// {
|
||||
// type: 'regExp',
|
||||
// message: '最多保留4位小数',
|
||||
// reg: '^[0-9]+(.[0-9]{1,4})?$'
|
||||
// }
|
||||
// ],
|
||||
// product_name: [{ type: 'required', message: '请输入商品名称' }]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue