|
@@ -11,6 +11,7 @@
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="选择开始日期时间"
|
|
|
+ @change="startDateChangeHandler"
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="interfaceLog_head_time_end">
|
|
@@ -21,6 +22,7 @@
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="选择结束日期时间"
|
|
|
+ @change="endDateChangeHandler"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -164,6 +166,7 @@
|
|
|
value-format="yyyy-MM-dd"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
+ :picker-options="dateRangePickerOptions"
|
|
|
@keyup.esc.native="dialogFocus"
|
|
|
/>
|
|
|
</template>
|
|
@@ -463,6 +466,10 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
FlightDate: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')],
|
|
|
+ dateRangePickerOptions: {
|
|
|
+ onPick: this.dateRangePickHandler,
|
|
|
+ disabledDate: this.dateRangeDisabled
|
|
|
+ },
|
|
|
form: {
|
|
|
FlightNO: '',
|
|
|
destination: '',
|
|
@@ -646,6 +653,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
+ FlightDate: {
|
|
|
+ handler(val) {
|
|
|
+ if (val === null) {
|
|
|
+ this.FlightDate = ['', '']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ },
|
|
|
dealedTableData: {
|
|
|
handler(val) {
|
|
|
this.spanArr = []
|
|
@@ -749,6 +764,46 @@ export default {
|
|
|
dialogFocus() {
|
|
|
this.$refs['dialog'].focus()
|
|
|
},
|
|
|
+ startDateChangeHandler(val) {
|
|
|
+ this.FlightDate[0] = val ?? ''
|
|
|
+ if (!val || !this.FlightDate[1]) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const startDate = new Date(val)
|
|
|
+ const endDate = new Date(this.FlightDate[1])
|
|
|
+ if (startDate > endDate) {
|
|
|
+ this.FlightDate.splice(1, 1, '')
|
|
|
+ this.$message.info('结束时间不能早于开始时间,请重新选择')
|
|
|
+ } else if (endDate - startDate > 2 * 24 * 60 * 60 * 1000) {
|
|
|
+ this.FlightDate.splice(1, 1, '')
|
|
|
+ this.$message.info('时间跨度不能超过三天,请重新选择')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ endDateChangeHandler(val) {
|
|
|
+ this.FlightDate[1] = val ?? ''
|
|
|
+ if (!val || !this.FlightDate[0]) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const startDate = new Date(this.FlightDate[0])
|
|
|
+ const endDate = new Date(val)
|
|
|
+ if (startDate > endDate) {
|
|
|
+ this.FlightDate.splice(0, 1, '')
|
|
|
+ this.$message.info('开始时间不能晚于结束时间,请重新选择')
|
|
|
+ } else if (endDate - startDate > 2 * 24 * 60 * 60 * 1000) {
|
|
|
+ this.FlightDate.splice(0, 1, '')
|
|
|
+ this.$message.info('时间跨度不能超过三天,请重新选择')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dateRangePickHandler({ maxDate, minDate }) {
|
|
|
+ if (!maxDate) {
|
|
|
+ this.pickedDate = minDate
|
|
|
+ } else {
|
|
|
+ this.pickedDate = null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dateRangeDisabled(date) {
|
|
|
+ return this.pickedDate ? Math.abs(date - this.pickedDate) > 2 * 24 * 60 * 60 * 1000 : false
|
|
|
+ },
|
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
if (['PassengerNameUpcase', 'BagWeight'].includes(column.property)) {
|
|
|
const _row = this.spanArr[rowIndex]
|