|
@@ -85,6 +85,7 @@
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
+import { completeDate } from '@/libs/tools.js'
|
|
|
import {
|
|
|
itemList,
|
|
|
storeList,
|
|
@@ -148,7 +149,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- // nowBeginDate: '' // 下单时间 当前操作的开始时间
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -160,28 +160,8 @@ export default {
|
|
|
},
|
|
|
// 不可选日期
|
|
|
disabledDate (date, dateStrings) {
|
|
|
- // if (this.nowBeginDate) { // 有下单时间开始时间时
|
|
|
- // const bVal = this.getThreeMonthsAfter(this.nowBeginDate, -3) // 三个月前时间戳
|
|
|
- // const eVal = this.getThreeMonthsAfter(this.nowBeginDate, 3) // 三个月后时间戳
|
|
|
- // if (Date.now() < eVal) { // 当前日期距起始日期不足三个月
|
|
|
- // return date && date.valueOf() < bVal || date && date.valueOf() > Date.now()
|
|
|
- // } else {
|
|
|
- // return date && date.valueOf() < bVal || date && date.valueOf() > eVal
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // return date && date.valueOf() > Date.now()
|
|
|
- // }
|
|
|
return date && date.valueOf() > Date.now()
|
|
|
},
|
|
|
- // 获取month个月后的时间戳
|
|
|
- // getThreeMonthsAfter (dtstr, month) {
|
|
|
- // var s = dtstr.split('-')
|
|
|
- // var yy = parseInt(s[0])
|
|
|
- // var mm = parseInt(s[1])
|
|
|
- // var dd = parseInt(s[2])
|
|
|
- // var dt = new Date(yy, mm + Number(month) - 1, dd)
|
|
|
- // return dt.valueOf()
|
|
|
- // },
|
|
|
// 购买套餐
|
|
|
goBuy () {
|
|
|
this.$router.push({ path: '/SetmealSales/BuySetmeal' })
|
|
@@ -273,7 +253,7 @@ export default {
|
|
|
},
|
|
|
// 导出
|
|
|
handleExport () {
|
|
|
- this.loading = true
|
|
|
+ // this.loading = true
|
|
|
const params = {
|
|
|
beginDate: this.searchForm.beginDate == null ? getDate.getToday().starttime : this.searchForm.beginDate,
|
|
|
endDate: this.searchForm.endDate == null ? getDate.getToday().endtime : this.searchForm.endDate,
|
|
@@ -283,12 +263,15 @@ export default {
|
|
|
customerMobile: this.searchForm.customerMobile,
|
|
|
orderStatus: this.searchForm.orderStatus
|
|
|
}
|
|
|
- console.log(params, '---导出提交数据')
|
|
|
- // exportOrder(params).then(res => {
|
|
|
- // console.log(res)
|
|
|
- // this.loading = false
|
|
|
- // this.download(res)
|
|
|
- // })
|
|
|
+ if (!completeDate(params.beginDate, params.endDate, 3)) {
|
|
|
+ this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ exportOrder(params).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.loading = false
|
|
|
+ this.download(res)
|
|
|
+ })
|
|
|
},
|
|
|
download (data) {
|
|
|
if (!data) {
|