123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- var _this;
- var loading;
- new Vue({
- el: '#app',
- data: function() {
- return {
- activeName: "0",
- wireImeiLi: [{
- imei: "WTC23060426427",
- name: "振浮6-钢丝绳"
- }],
- wireItem: {},
- queryParams: {
- imei: null,
- startime: "",
- endtime: "",
- orderSql: "time desc",
- page: 1,
- rows: 12,
- accessToken: getCookie("wireToken")
- },
- wireHis: [],
- allTotal: 1,
- endPicker: false,
- starPicker: false,
- activeNames: ['0']
- }
- },
- created() {
- _this = this;
- _this.wireItem = _this.wireImeiLi[0];
- _this.queryParams.imei = _this.wireItem.imei;
- },
- methods: {
- handleQuery(){
- _this.queryParams.page = 1;
- _this.getWireHis();
- },
- endConfirm(val){
- _this.queryParams.endtime = getDTime(val)[0];
- _this.endPicker = false;
- },
- startConfirm(val){
- _this.queryParams.startime = getDTime(val)[0];
- _this.starPicker = false;
- },
- handleCurrentChange(val) {
- _this.getWireHis();
- },
- getWireHis(){
- if(_this.queryParams.startime == null||_this.queryParams.startime == ""){
- _this.$toast({
- type: 'fail',
- message: '请选择开始时间'
- });
- return;
- }
- if(_this.queryParams.endtime == null||_this.queryParams.endtime == ""){
- _this.$toast({
- type: 'fail',
- message: '请选择结束间'
- });
- return;
- }
- if(_this.queryParams.imei != null){
- loading = _this.$toast({
- type: 'loading',
- loadingType: 'spinner',
- duration: 0
- });
- _this.queryParams.gt = new Date(_this.queryParams.startime + " 00:00:00").getTime()/1000;
- _this.queryParams.lt = new Date(_this.queryParams.endtime + " 23:59:59").getTime()/1000;
- getWireHistory(_this.queryParams,function(res){
- _this.wireHis = res.data;
- _this.allTotal = res.total;
- loading.close();
- });
- }
- },
- goBack(){
- top.location.href = "../mainPh.html?sn=4";
- }
- }
- })
|