|
@@ -107,7 +107,6 @@
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
-import { completeDate } from '@/libs/tools.js'
|
|
|
import moment from 'moment'
|
|
|
import SetmealDetailModal from './SetmealDetailModal.vue'
|
|
|
import { salesChannelList } from '@/api/FinancialManagement'
|
|
@@ -265,8 +264,6 @@ export default {
|
|
|
// 导出
|
|
|
handleExport () {
|
|
|
const params = {
|
|
|
- beginDate: this.searchForm.beginDate == null ? getDate.getToday().starttime : this.searchForm.beginDate,
|
|
|
- endDate: this.searchForm.endDate == null ? getDate.getToday().endtime : this.searchForm.endDate,
|
|
|
bundleName: this.searchForm.bundleName,
|
|
|
number: this.searchForm.number,
|
|
|
custMobile: this.searchForm.custMobile,
|
|
@@ -275,13 +272,20 @@ export default {
|
|
|
dataSourceNo: this.searchForm.dataSourceNo,
|
|
|
freeChoiceFlag: 0
|
|
|
}
|
|
|
+ if (this.time && this.time.length) {
|
|
|
+ params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
|
|
|
+ params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
|
|
|
+ } else {
|
|
|
+ params.beginDate = ''
|
|
|
+ params.endDate = ''
|
|
|
+ }
|
|
|
if (!params.beginDate && !params.endDate) {
|
|
|
this.$message.error('请先选择需要导出的下单时间区间再进行导出!')
|
|
|
return
|
|
|
}
|
|
|
- // 判断两个时间段是否相差m个月
|
|
|
- if (!completeDate(params.beginDate, params.endDate, 3)) {
|
|
|
- this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
|
|
|
+ // 判断两个时间段是否相差1个月 第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
|
|
|
+ if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 1) {
|
|
|
+ this.$message.error('单次最多只能导出1个月的数据,请缩小查询区间后再进行导出!')
|
|
|
return
|
|
|
}
|
|
|
this.loading = true
|