Update edit.js

修正兑换码编辑生效时间区间
This commit is contained in:
姜棚 2022-02-14 13:35:50 +08:00
parent 0904d9a947
commit 342fe92ab0
1 changed files with 8 additions and 6 deletions

View File

@ -60,7 +60,8 @@ export default class exchangedit extends React.Component{
isAudit:false,
approvalsStatus:false,
oldTable:[],
product_title:"新建商品"
product_title:"新建商品",
plan_time:""
}
}
@ -93,7 +94,7 @@ export default class exchangedit extends React.Component{
issued:req.quantity,
stock:req.stock,
describe:req.describe,
date_time:[req.begin_time,req.plan.end_time],
date_time:[req.begin_time,req.end_time],
range:req.update_product
}
@ -121,7 +122,7 @@ export default class exchangedit extends React.Component{
getCodesDetail(code_batch_id).then(res=>{
handelResponse(res,(req,msg)=>{
codeInfo.stock = req.stock;
this.setState({plan_time:req.plan.end_time})
this.setState({oldTable:req.code_batch_stock})
let deleteArr = []
@ -202,9 +203,10 @@ export default class exchangedit extends React.Component{
issued:req.quantity,
stock:req.stock,
describe:req.describe,
date_time:[req.begin_time,req.plan.end_time],
date_time:[req.begin_time,req.end_time],
range:req.code_batch_stock
}
this.setState({plan_time:req.plan.end_time})
//获取分销商
getReseller(req.plan.reseller_id).then((res)=>{
handelResponse(res,(req,msg)=>{
@ -653,7 +655,7 @@ export default class exchangedit extends React.Component{
onDisabledCombinedDate = (val)=>{
let str = moment(val).format("YYYY-MM-DD HH:mm:ss")
let isBetween = moment(str).isBetween(this.state.codeInfo.date_time[0],this.state.codeInfo.date_time[1],null,'(]');
let isBetween = moment(str).isBetween(this.state.codeInfo.date_time[0],this.state.plan_time,null,'(]');
return !isBetween
}
@ -692,7 +694,7 @@ export default class exchangedit extends React.Component{
if( type == "end" )
{
isdisabled = moment(str).isAfter(this.state.codeInfo.date_time[1])
isdisabled = moment(str).isAfter(this.state.plan_time)
}
return isdisabled
}