|
@@ -166,6 +166,7 @@
|
|
start-placeholder="开始日期"
|
|
start-placeholder="开始日期"
|
|
end-placeholder="结束日期"
|
|
end-placeholder="结束日期"
|
|
value-format="yyyy-MM-dd"
|
|
value-format="yyyy-MM-dd"
|
|
|
|
+ :picker-options="instantPickerOptions"
|
|
editable
|
|
editable
|
|
></el-date-picker>
|
|
></el-date-picker>
|
|
</div>
|
|
</div>
|
|
@@ -210,6 +211,7 @@
|
|
start-placeholder="开始日期"
|
|
start-placeholder="开始日期"
|
|
end-placeholder="结束日期"
|
|
end-placeholder="结束日期"
|
|
value-format="yyyy-MM-dd"
|
|
value-format="yyyy-MM-dd"
|
|
|
|
+ :picker-options="instantPickerOptions"
|
|
editable
|
|
editable
|
|
></el-date-picker>
|
|
></el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -460,6 +462,7 @@ import QRCode from 'qrcodejs2';
|
|
import { mapGetters, mapState } from 'vuex';
|
|
import { mapGetters, mapState } from 'vuex';
|
|
import axios from 'axios';
|
|
import axios from 'axios';
|
|
import ECharts from 'echarts';
|
|
import ECharts from 'echarts';
|
|
|
|
+import moment from "moment/moment";
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
QRCode
|
|
QRCode
|
|
@@ -470,6 +473,63 @@ export default {
|
|
deptRankStartDate = this.$moment(deptRankStartDate).format('YYYY-MM-DD');
|
|
deptRankStartDate = this.$moment(deptRankStartDate).format('YYYY-MM-DD');
|
|
let deptRankEndDate = this.$moment().format('YYYY-MM-DD');
|
|
let deptRankEndDate = this.$moment().format('YYYY-MM-DD');
|
|
return {
|
|
return {
|
|
|
|
+ instantPickerOptions: {
|
|
|
|
+ shortcuts: [
|
|
|
|
+ {
|
|
|
|
+ text: '今天',
|
|
|
|
+ onClick(picker) {
|
|
|
|
+ const now = new Date(new Date().toLocaleDateString());
|
|
|
|
+ const start = now.getTime();
|
|
|
|
+
|
|
|
|
+ picker.$emit('pick', [moment(start).format('YYYY-MM-DD'),moment(start).format('YYYY-MM-DD')]);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '昨天',
|
|
|
|
+ onClick(picker) {
|
|
|
|
+ const now = new Date(new Date().toLocaleDateString());
|
|
|
|
+ const start = now.getTime() - 60 * 60 * 24 * 1000;
|
|
|
|
+ picker.$emit('pick', [moment(start).format('YYYY-MM-DD'),moment(start).format('YYYY-MM-DD')]);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '本周',
|
|
|
|
+ onClick(picker) {
|
|
|
|
+ picker.$emit('pick', [moment().startOf('isoWeek').format('YYYY-MM-DD'),moment().endOf('isoWeek').format('YYYY-MM-DD')]);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '上周',
|
|
|
|
+ onClick(picker) {
|
|
|
|
+ picker.$emit('pick', [moment().subtract(1, 'w').startOf('isoWeek').format('YYYY-MM-DD'),moment().subtract(1, 'w').endOf('isoWeek').format('YYYY-MM-DD')]);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '本月',
|
|
|
|
+ onClick(picker) {
|
|
|
|
+ picker.$emit('pick', [moment().startOf('month').format('YYYY-MM-DD'),moment().endOf('month').format('YYYY-MM-DD')]);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '上月',
|
|
|
|
+ onClick(picker) {
|
|
|
|
+ picker.$emit('pick', [moment().subtract(1,'month').startOf('month').format('YYYY-MM-DD'),moment().subtract(1,'month').endOf('month').format('YYYY-MM-DD')]);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text:'本年',
|
|
|
|
+ onClick(picker){
|
|
|
|
+ picker.$emit('pick',[moment().startOf('year').format('YYYY-MM-DD'),moment().endOf('year').format('YYYY-MM-DD')])
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text:'去年',
|
|
|
|
+ onClick(picker){
|
|
|
|
+ picker.$emit('pick',[moment().subtract(1,'year').startOf('year').format('YYYY-MM-DD'),moment().subtract(1,'year').endOf('year').format('YYYY-MM-DD')])
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
ruleTrees:[],
|
|
ruleTrees:[],
|
|
rule:[],
|
|
rule:[],
|
|
noticeRole: !this.$supremeAuthority('dept_manager')&&!this.$supremeAuthority('employee'),
|
|
noticeRole: !this.$supremeAuthority('dept_manager')&&!this.$supremeAuthority('employee'),
|