|
@@ -9,19 +9,36 @@
|
|
|
<div class="right_but">
|
|
|
<div
|
|
|
class="right_but_left"
|
|
|
- :class="{ right_but_active: isActive }"
|
|
|
+ :class="{ right_but_active: isActive == 1 }"
|
|
|
@click="inDay"
|
|
|
>
|
|
|
本日
|
|
|
</div>
|
|
|
<div
|
|
|
class="right_but_right"
|
|
|
- :class="{ right_but_active: !isActive }"
|
|
|
+ :class="{ right_but_active: isActive == 2 }"
|
|
|
@click="inMoon"
|
|
|
>
|
|
|
本月
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="realDate"
|
|
|
+ type="daterange"
|
|
|
+ size="mini"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ style="margin-right:10px;width:240px"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ icon="el-icon-search"
|
|
|
+ style="margin-right:10px;"
|
|
|
+ @click="search"
|
|
|
+ circle
|
|
|
+ ></el-button>
|
|
|
<i
|
|
|
class="el-icon-refresh-right"
|
|
|
style="cursor: pointer;font-size:20px;line-height: 15px;"
|
|
@@ -150,6 +167,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { defaultDate2, defaultDate3 } from "@/util/date";
|
|
|
import { realTimeData, shipRealTimeData } from "@/api/wel";
|
|
|
export default {
|
|
|
name: "basicContainer",
|
|
@@ -158,8 +176,9 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- isActive: true,
|
|
|
+ isActive: 1,
|
|
|
loading: false,
|
|
|
+ realDate: [],
|
|
|
data1: {},
|
|
|
data2: {},
|
|
|
tradeType: null
|
|
@@ -167,12 +186,17 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.getSysType();
|
|
|
+ this.realDate = defaultDate2();
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.init();
|
|
|
+ this.getrealTimeData();
|
|
|
+ this.getshipRealTimeData();
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
+ if (this.realDate == null) {
|
|
|
+ return this.$message.error("请选择日期");
|
|
|
+ }
|
|
|
this.getrealTimeData();
|
|
|
this.getshipRealTimeData();
|
|
|
},
|
|
@@ -193,13 +217,17 @@ export default {
|
|
|
this.tradeType = "GN";
|
|
|
} else if (sysType == 1) {
|
|
|
this.tradeType = "XX";
|
|
|
- }else if(sysType == 999){
|
|
|
+ } else if (sysType == 999) {
|
|
|
this.tradeType = "ADMIN";
|
|
|
}
|
|
|
},
|
|
|
getrealTimeData() {
|
|
|
this.loading = true;
|
|
|
- realTimeData({ tradeType: this.tradeType })
|
|
|
+ realTimeData({
|
|
|
+ tradeType: this.tradeType,
|
|
|
+ orderStartDate: this.realDate[0],
|
|
|
+ orderEndDate: this.realDate[1]
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
this.data1 = res.data.data;
|
|
|
})
|
|
@@ -209,7 +237,11 @@ export default {
|
|
|
},
|
|
|
getshipRealTimeData() {
|
|
|
this.loading = true;
|
|
|
- shipRealTimeData({ tradeType: this.tradeType})
|
|
|
+ shipRealTimeData({
|
|
|
+ tradeType: this.tradeType,
|
|
|
+ orderStartDate: this.realDate[0],
|
|
|
+ orderEndDate: this.realDate[1]
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
this.data2 = res.data.data;
|
|
|
})
|
|
@@ -218,18 +250,18 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
inDay() {
|
|
|
- this.isActive = true;
|
|
|
- this.loading = true;
|
|
|
- setTimeout(() => {
|
|
|
- this.loading = false;
|
|
|
- }, 1000);
|
|
|
+ this.isActive = 1;
|
|
|
+ this.realDate = defaultDate2();
|
|
|
+ this.init();
|
|
|
},
|
|
|
inMoon() {
|
|
|
- this.isActive = false;
|
|
|
- this.loading = true;
|
|
|
- setTimeout(() => {
|
|
|
- this.loading = false;
|
|
|
- }, 1000);
|
|
|
+ this.isActive = 2;
|
|
|
+ this.realDate = defaultDate3();
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ search() {
|
|
|
+ this.isActive = 3;
|
|
|
+ this.init();
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -264,6 +296,7 @@ export default {
|
|
|
width: 40px;
|
|
|
text-align: center;
|
|
|
color: #409eff;
|
|
|
+ border-right: 1px solid #409eff;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
&_right {
|