|
|
|
@ -70,6 +70,23 @@ |
|
|
|
|
{{ item.name }} |
|
|
|
|
</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
|
<a-form-item label="添加时间" style="margin-left: 20px"> |
|
|
|
|
<div style="display: flex" class="goodsType"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="dateSpan" |
|
|
|
|
style="width: 350px; height: 32px; margin-top: 4px" |
|
|
|
|
type="datetimerange" |
|
|
|
|
:picker-options="pickerOptions" |
|
|
|
|
:unlink-panels="true" |
|
|
|
|
range-separator="至" |
|
|
|
|
start-placeholder="开始时间" |
|
|
|
|
size="mini" |
|
|
|
|
end-placeholder="结束时间" |
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
|
> |
|
|
|
|
</el-date-picker> |
|
|
|
|
</div> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item class="search-btn"> |
|
|
|
|
<a-button type="primary" icon="search" html-type="submit">搜索</a-button> |
|
|
|
@ -242,7 +259,7 @@ import * as GoodsApi from '@/api/goods' |
|
|
|
|
import { ContentHeader, STable } from '@/components' |
|
|
|
|
import CategoryModel from '@/common/model/Category' |
|
|
|
|
import * as Api from '@/api/store' |
|
|
|
|
|
|
|
|
|
import moment from 'moment' |
|
|
|
|
// 表格表头 |
|
|
|
|
const columns = [ |
|
|
|
|
{ |
|
|
|
@ -346,7 +363,9 @@ export default { |
|
|
|
|
is_pool: '', |
|
|
|
|
data_type: '', |
|
|
|
|
categoryId: '', |
|
|
|
|
spec_type:'' |
|
|
|
|
spec_type: '', |
|
|
|
|
start_time: '', |
|
|
|
|
end_time: '', |
|
|
|
|
}, |
|
|
|
|
// 正在加载 |
|
|
|
|
isLoading: false, |
|
|
|
@ -410,6 +429,131 @@ export default { |
|
|
|
|
categoryIds: [], |
|
|
|
|
categoryPriceIds: [], |
|
|
|
|
rate: '', |
|
|
|
|
pickerOptions: { |
|
|
|
|
disabledDate(time) { |
|
|
|
|
return time.getTime() > Date.now() |
|
|
|
|
}, |
|
|
|
|
shortcuts: [ |
|
|
|
|
{ |
|
|
|
|
text: '今天', |
|
|
|
|
onClick(picker) { |
|
|
|
|
picker.$emit('pick', [new Date(), new Date()]) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: '昨天', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const date = new Date() |
|
|
|
|
date.setTime(date.getTime() - 3600 * 1000 * 24) |
|
|
|
|
picker.$emit('pick', [date, date]) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: '近7天', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const end = new Date() |
|
|
|
|
const start = new Date() |
|
|
|
|
end.setTime(start.getTime() - 3600 * 1000 * 24) |
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) |
|
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: '近30天', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const end = new Date() |
|
|
|
|
const start = new Date() |
|
|
|
|
end.setTime(start.getTime() - 3600 * 1000 * 24) |
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) |
|
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: '近90天', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const end = new Date() |
|
|
|
|
const start = new Date() |
|
|
|
|
end.setTime(start.getTime() - 3600 * 1000 * 24) |
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) |
|
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: '近180天', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const end = new Date() |
|
|
|
|
const start = new Date() |
|
|
|
|
end.setTime(start.getTime() - 3600 * 1000 * 24) |
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 180) |
|
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: '近一年', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const end = new Date() |
|
|
|
|
const start = new Date() |
|
|
|
|
end.setTime(start.getTime() - 3600 * 1000 * 24) |
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 365) |
|
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: '本周', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const end = new Date() |
|
|
|
|
const start = new Date() |
|
|
|
|
end.setTime(start.getTime() - 3600 * 1000 * 24) |
|
|
|
|
//现在星期几;0代表星期天,6代表星期六 |
|
|
|
|
var thisDay = start.getDay() |
|
|
|
|
//现在是一个月的第几天 |
|
|
|
|
var thisDate = start.getDate() |
|
|
|
|
console.log(thisDay) |
|
|
|
|
console.log(thisDate) |
|
|
|
|
if (thisDay != 0) { |
|
|
|
|
start.setDate(thisDate - thisDay + 1) |
|
|
|
|
} |
|
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: '本月', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const end = new Date() |
|
|
|
|
const start = new Date() |
|
|
|
|
end.setTime(start.getTime() - 3600 * 1000 * 24) |
|
|
|
|
start.setDate(1) |
|
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: '本季度', |
|
|
|
|
onClick(picker) { |
|
|
|
|
var oDate = new Date() |
|
|
|
|
var thisYear = oDate.getFullYear() |
|
|
|
|
var thisMonth = oDate.getMonth() + 1 |
|
|
|
|
var n = Math.ceil(thisMonth / 3) // 季度 |
|
|
|
|
var Month = n * 3 - 1 |
|
|
|
|
var start = new Date(thisYear, Month - 2, 1) |
|
|
|
|
var end = new Date() |
|
|
|
|
end.setTime(end.getTime() - 3600 * 1000 * 24) |
|
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: '本年', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const end = new Date() |
|
|
|
|
const start = new Date() |
|
|
|
|
start.setMonth(0) |
|
|
|
|
start.setDate(1) |
|
|
|
|
end.setTime(end.getTime() - 3600 * 1000 * 24) |
|
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
dateSpan: [], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
@ -431,9 +575,6 @@ export default { |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
handleTableChange(e) { |
|
|
|
|
console.log(e) |
|
|
|
|
}, |
|
|
|
|
validateAmount() { |
|
|
|
|
let row = this.rate |
|
|
|
|
console.log(row) |
|
|
|
@ -481,6 +622,11 @@ export default { |
|
|
|
|
|
|
|
|
|
// 确认搜索 |
|
|
|
|
handleSearch(e) { |
|
|
|
|
console.log(this.dateSpan) |
|
|
|
|
if (this.dateSpan.length > 0) { |
|
|
|
|
this.queryParam.start_time = this.dateSpan[0] |
|
|
|
|
this.queryParam.end_time = this.dateSpan[1] |
|
|
|
|
} |
|
|
|
|
e.preventDefault() |
|
|
|
|
this.searchForm.validateFields((error, values) => { |
|
|
|
|
if (!error) { |
|
|
|
@ -695,6 +841,24 @@ export default { |
|
|
|
|
/deep/.ant-card-body { |
|
|
|
|
padding: 22px 18px; |
|
|
|
|
} |
|
|
|
|
/deep/.el-range-editor--mini .el-range-input { |
|
|
|
|
font-size: 14px; |
|
|
|
|
} |
|
|
|
|
/deep/.el-date-editor .el-range__icon { |
|
|
|
|
line-height: 24px !important; |
|
|
|
|
} |
|
|
|
|
/deep/.el-range-editor--mini .el-range__close-icon { |
|
|
|
|
line-height: 24px !important; |
|
|
|
|
} |
|
|
|
|
/deep/.el-range-editor--mini .el-range-separator { |
|
|
|
|
line-height: 24px !important; |
|
|
|
|
} |
|
|
|
|
/deep/.el-range-editor.el-input__inner { |
|
|
|
|
padding: 3px 0 3px 10px; |
|
|
|
|
} |
|
|
|
|
/deep/.el-picker-panel__sidebar{ |
|
|
|
|
width: 85px; |
|
|
|
|
} |
|
|
|
|
// 筛选tab |
|
|
|
|
.tab-list { |
|
|
|
|
margin-right: 20px; |
|
|
|
|