|
@@ -0,0 +1,129 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <a-select
|
|
|
|
|
+ v-model="timeType"
|
|
|
|
|
+ placeholder="请选择时间类型"
|
|
|
|
|
+ @change="timeTypeChange"
|
|
|
|
|
+ allowClear
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-select-option
|
|
|
|
|
+ v-for="item in timeList"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ item.label }}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ <a-range-picker
|
|
|
|
|
+ v-show="timeType == '1'"
|
|
|
|
|
+ @change="onChangeTime(1)"
|
|
|
|
|
+ v-model="signingTime"
|
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
|
+ style="margin-left: 10px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-icon slot="suffixIcon" type="calendar" />
|
|
|
|
|
+ </a-range-picker>
|
|
|
|
|
+ <a-range-picker
|
|
|
|
|
+ v-show="timeType == '2'"
|
|
|
|
|
+ @change="onChangeTime(2)"
|
|
|
|
|
+ v-model="enterTime"
|
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
|
+ style="margin-left: 10px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-icon slot="suffixIcon" type="calendar" />
|
|
|
|
|
+ </a-range-picker>
|
|
|
|
|
+ <a-radio-group
|
|
|
|
|
+ default-value="0"
|
|
|
|
|
+ button-style="solid"
|
|
|
|
|
+ v-model="dateType"
|
|
|
|
|
+ @change="getList()"
|
|
|
|
|
+ style="margin-left: 10px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-radio-button value="1" @click="clearTime"> 当天 </a-radio-button>
|
|
|
|
|
+ <a-radio-button value="2" @click="clearTime"> 近7天 </a-radio-button>
|
|
|
|
|
+ <a-radio-button value="3" @click="clearTime"> 近30天 </a-radio-button>
|
|
|
|
|
+ </a-radio-group>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import moment from "moment";
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ props: {
|
|
|
|
|
+ form: {},
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ timeList: [
|
|
|
|
|
+ { value: "1", label: "签单时间" },
|
|
|
|
|
+ { value: "2", label: "录单时间" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ timeType: "1",
|
|
|
|
|
+ signingTime: [
|
|
|
|
|
+ moment().format("YYYY-MM-DD"),
|
|
|
|
|
+ moment().format("YYYY-MM-DD"),
|
|
|
|
|
+ ],
|
|
|
|
|
+ enterTime: [moment().format("YYYY-MM-DD"), moment().format("YYYY-MM-DD")],
|
|
|
|
|
+ dateType: undefined,
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {},
|
|
|
|
|
+ mounted() {},
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ clearTime() {
|
|
|
|
|
+ this.signingTime = [];
|
|
|
|
|
+ this.enterTime = [];
|
|
|
|
|
+ // (formState.createtimeEnd = '')
|
|
|
|
|
+ },
|
|
|
|
|
+ getList() {
|
|
|
|
|
+ //
|
|
|
|
|
+ this.$emit("getList", {
|
|
|
|
|
+ dateType: this.dateType,
|
|
|
|
|
+ signingTimeStart: "",
|
|
|
|
|
+ signingTimeEnd: "",
|
|
|
|
|
+ enterTimeStart: "",
|
|
|
|
|
+ enterTimeEnd: "",
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ onChangeTime(type) {
|
|
|
|
|
+ // 123;
|
|
|
|
|
+ this.dateType = undefined;
|
|
|
|
|
+ if (type == 1) {
|
|
|
|
|
+ this.$emit("getList", {
|
|
|
|
|
+ dateType: undefined,
|
|
|
|
|
+ signingTimeStart: this.signingTime[0],
|
|
|
|
|
+ signingTimeEnd: this.signingTime[1],
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$emit("getList", {
|
|
|
|
|
+ dateType: undefined,
|
|
|
|
|
+
|
|
|
|
|
+ enterTimeStart: this.enterTime[0],
|
|
|
|
|
+ enterTimeEnd: this.enterTime[1],
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ timeTypeChange(val) {
|
|
|
|
|
+ this.dateType = undefined;
|
|
|
|
|
+ if (val == 1) {
|
|
|
|
|
+ this.$emit("getList", {
|
|
|
|
|
+ dateType: undefined,
|
|
|
|
|
+ signingTimeStart: this.signingTime[0],
|
|
|
|
|
+ signingTimeEnd: this.signingTime[1],
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$emit("getList", {
|
|
|
|
|
+ dateType: undefined,
|
|
|
|
|
+
|
|
|
|
|
+ enterTimeStart: this.enterTime[0],
|
|
|
|
|
+ enterTimeEnd: this.enterTime[1],
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|
|
|
|
|
+<style lang='less' scoped>
|
|
|
|
|
+</style>
|