From 342fe92ab054f6f6f5f79e8779b94fcc8da25255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 14 Feb 2022 13:35:50 +0800 Subject: [PATCH] Update edit.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正兑换码编辑生效时间区间 --- src/pages/exchangecode/edit/edit.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index cf3c0298..e994410d 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -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 }