修复 联动
This commit is contained in:
parent
01d9f2c263
commit
bba7af35b9
|
@ -30,10 +30,6 @@ import { getVoucherWarningAccount, handelResponse } from '@/assets/api'
|
|||
import AddNewDialog from './Dialog'
|
||||
import MobileComponent from './mobileCmponent'
|
||||
import WangEditor from './wangEditor'
|
||||
const getTimeList = [
|
||||
{ key: '0', text: '立即生效' },
|
||||
{ key: '1', text: '次日生效' }
|
||||
]
|
||||
const cardTypeList = [
|
||||
{ key: '1', text: '借记卡' },
|
||||
{ key: '2', text: '信用卡' }
|
||||
|
@ -82,9 +78,22 @@ export default class addKnockGold extends Component {
|
|||
effect_date_type: '', //生效日期类型
|
||||
effect_date: '' //生效日期
|
||||
},
|
||||
TimeDiffer: '',
|
||||
visible: false, //加框弹窗
|
||||
warningInput: '', //预警输入框
|
||||
input_early_per: '', //预警百分比输入框
|
||||
getTimeList: [
|
||||
{
|
||||
key: '0',
|
||||
text: '立即生效',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
key: '1',
|
||||
text: '次日生效',
|
||||
disabled: false
|
||||
}
|
||||
],
|
||||
//预警人数据
|
||||
userSelectList: [
|
||||
{
|
||||
|
@ -150,7 +159,7 @@ export default class addKnockGold extends Component {
|
|||
: '2'
|
||||
|
||||
model.effect_date_type =
|
||||
getTimeList[
|
||||
this.state.getTimeList[
|
||||
Number(this.props.data.time_limit.use_time.effect_date_type)
|
||||
]
|
||||
model.effect_date = this.props.data.time_limit.use_time.effect_day
|
||||
|
@ -451,16 +460,12 @@ export default class addKnockGold extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
const TimeDiffer = timeDiff(
|
||||
this.state.model.entry_time[0],
|
||||
this.state.model.entry_time[1]
|
||||
)
|
||||
if (
|
||||
TimeDiffer < Number(this.state.model.effect_date) ||
|
||||
this.state.TimeDiffer < Number(this.state.model.effect_date) ||
|
||||
1 > Number(this.state.model.effect_date)
|
||||
) {
|
||||
Notify.error(
|
||||
`有限期不允许大于生效时间段 注:当前有效期最小时间为 1 天,最大时间为 ${TimeDiffer} 天`
|
||||
`有限期不允许大于生效时间段 注:当前有效期最小时间为 1 天,最大时间为 ${this.state.TimeDiffer} 天`
|
||||
)
|
||||
return false
|
||||
}
|
||||
|
@ -568,6 +573,26 @@ export default class addKnockGold extends Component {
|
|||
this.setState({ model: model2 })
|
||||
}
|
||||
|
||||
getTimeDiff() {
|
||||
if (this.state.model.entry_time[1]) {
|
||||
const TimeDiffer = timeDiff(
|
||||
this.state.model.entry_time[0],
|
||||
this.state.model.entry_time[1]
|
||||
)
|
||||
const data = this.state.getTimeList.map((item) => {
|
||||
if (item?.key === '1') {
|
||||
if (TimeDiffer < 2) {
|
||||
item.disabled = true
|
||||
} else {
|
||||
item.disabled = false
|
||||
}
|
||||
}
|
||||
return item
|
||||
})
|
||||
this.setState({ TimeDiffer, getTimeList: data })
|
||||
}
|
||||
}
|
||||
|
||||
//tag关闭
|
||||
closeCallback(item) {
|
||||
const newData = this.state.model.early_notifier.filter(
|
||||
|
@ -894,6 +919,7 @@ export default class addKnockGold extends Component {
|
|||
onChange={(value) => {
|
||||
Bus.emit('change', 'date_time', value)
|
||||
this.onHandleChange(value, 'entry_time')
|
||||
this.getTimeDiff()
|
||||
}}
|
||||
disabledTime={this.onDisabledTime}
|
||||
disabledDate={this.onDisabledRange1}
|
||||
|
@ -956,7 +982,7 @@ export default class addKnockGold extends Component {
|
|||
<div className='zent-demo-select-basic select-basic'>
|
||||
<Select
|
||||
clearable
|
||||
options={getTimeList}
|
||||
options={this.state.getTimeList}
|
||||
placeholder='选择一项'
|
||||
onChange={(value) => {
|
||||
this.onHandleChange(value, 'effect_date_type')
|
||||
|
|
Loading…
Reference in New Issue