mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 07:26:44 +08:00
自定义日期校验
This commit is contained in:
@@ -276,7 +276,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Icon, RadioGroup, Radio, DatetimePicker } from 'vant'
|
import { Icon, RadioGroup, Radio, DatetimePicker, Toast } from 'vant'
|
||||||
import tableDetail2 from '@/components/ebiz/billingDetail/tableDetail2'
|
import tableDetail2 from '@/components/ebiz/billingDetail/tableDetail2'
|
||||||
import generateImg from '../generateImg/generateImg.vue'
|
import generateImg from '../generateImg/generateImg.vue'
|
||||||
import policyDetails from './policyDetails.vue'
|
import policyDetails from './policyDetails.vue'
|
||||||
@@ -297,6 +297,7 @@ export default {
|
|||||||
[RadioGroup.name]: RadioGroup,
|
[RadioGroup.name]: RadioGroup,
|
||||||
[Radio.name]: Radio,
|
[Radio.name]: Radio,
|
||||||
[DatetimePicker.name]: DatetimePicker,
|
[DatetimePicker.name]: DatetimePicker,
|
||||||
|
[Toast.name]: Toast,
|
||||||
|
|
||||||
FieldDatePicter
|
FieldDatePicter
|
||||||
},
|
},
|
||||||
@@ -474,6 +475,14 @@ export default {
|
|||||||
this.queryOutOrderListFunc()
|
this.queryOutOrderListFunc()
|
||||||
},
|
},
|
||||||
popupOnConfirm() {
|
popupOnConfirm() {
|
||||||
|
if(this.dialogForm.dateFlag == 'y') {
|
||||||
|
if(this.isStartDateInvalid()) {
|
||||||
|
Toast({message: '开始日期不能小于结束日期!',size: 'large'});
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
this.titleText = this.dialogForm.startDate.toString() + '~' + this.dialogForm.endDate.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!this.dialogForm.dateFlag) {
|
if (!this.dialogForm.dateFlag) {
|
||||||
this.startDate = this.dialogForm.startDate
|
this.startDate = this.dialogForm.startDate
|
||||||
this.endDate = this.dialogForm.endDate
|
this.endDate = this.dialogForm.endDate
|
||||||
@@ -492,9 +501,7 @@ export default {
|
|||||||
this.titleText = this.monthValue
|
this.titleText = this.monthValue
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.dateFlag == 'y') {
|
|
||||||
this.titleText = this.dialogForm.startDate.toString() + '~' + this.dialogForm.endDate.toString()
|
|
||||||
}
|
|
||||||
this.outOrderTypeChange()
|
this.outOrderTypeChange()
|
||||||
this.queryOutOrderListFunc()
|
this.queryOutOrderListFunc()
|
||||||
},
|
},
|
||||||
@@ -802,6 +809,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
isStartDateInvalid() {
|
||||||
|
return this.dialogForm.endDate && new Date(this.dialogForm.startDate) > new Date(this.dialogForm.endDate);
|
||||||
|
},
|
||||||
// 选择月份事件
|
// 选择月份事件
|
||||||
formatter(type, value) {
|
formatter(type, value) {
|
||||||
if (type === 'year') {
|
if (type === 'year') {
|
||||||
@@ -1033,4 +1043,7 @@ table {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 100px;
|
margin-top: 100px;
|
||||||
}
|
}
|
||||||
|
/deep/.van-toast--text {
|
||||||
|
width: 230px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user