Commit 76ca00fc by 张杰

修复bug

1 parent 763ba376
......@@ -97,4 +97,71 @@ export const shutDownShortcuts = [
picker.$emit("pick", [start, end]);
},
},
]
// 里程统计详情
export const mileageDetailShortcuts = [
{
text: "全部",
onClick(picker) {
const end = "";
const start = "";
picker.$emit("pick", [start, end]);
},
},
{
text: "昨日",
onClick(picker) {
const start = moment()
.day(moment().day() - 1)
.format("YYYY-MM-DD");
const end = moment()
.day(moment().day() - 1)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
}
},
{
text: "本周",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment().weekday(1).format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上周",
onClick(picker) {
let weekOfDay = parseInt(moment().format("E"));
const end = moment()
.subtract(weekOfDay, "days")
.format("YYYY-MM-DD");
const start = moment()
.subtract(weekOfDay + 7 - 1, "days")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "本月",
onClick(picker) {
const start = moment().add("month", 0).format("YYYY-MM") + "-01";
const end = moment().format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上月",
onClick(picker) {
const end = moment()
.month(moment().month() - 1)
.endOf("month")
.format("YYYY-MM-DD");
const start = moment()
.month(moment().month() - 1)
.startOf("month")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
]
\ No newline at end of file
......@@ -24,6 +24,7 @@
v-show="hasOk"
type="primary"
:size="btn_size"
:loading="loading"
@click="handleConfirm"
>{{btnOkLabel}}</el-button>
<slot name="btn-behind"></slot>
......@@ -54,6 +55,10 @@ export default {
hasOk: {
type: Boolean,
default: true
},
loading:{
type:Boolean,
default:false
}
},
methods: {
......
......@@ -32,7 +32,7 @@
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="getList()">搜索</el-button>
<el-button icon="el-icon-search" type="primary" @click="getList(1)">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-refresh" type="default" @click="rest()">重置</el-button>
......@@ -114,12 +114,12 @@ export default {
dloading: false,
tloading: false,
FENCE_MONITOR_LIST,
fenceId:''
fenceId: "",
};
},
created() {
console.log(history.state)
this.fenceId = history.state.fenceId
console.log(history.state);
this.fenceId = history.state.fenceId;
this.getList();
},
mounted() {},
......@@ -129,7 +129,7 @@ export default {
this.searchForm = {};
this.currentPage = 1;
this.pageSize = 10;
this.fenceId = ''
this.fenceId = "";
this.getList();
},
......@@ -142,8 +142,8 @@ export default {
oParams.alarmEndTime = m[1];
}
if(this.fenceId){
oParams.fenceId = this.fenceId
if (this.fenceId) {
oParams.fenceId = this.fenceId;
}
delete oParams.orgName;
......@@ -157,6 +157,9 @@ export default {
oParams.pageSize = this.pageSize;
oParams.pageNumber = current || this.currentPage;
this.tloading = true;
if (current) {
this.currentPage = current;
}
GET_FENCEALARM_LIST(oParams).then((res) => {
this.tloading = false;
let obj = res.data || {};
......@@ -205,17 +208,16 @@ export default {
? moment(row.alarmTime).format("x") - 120000
: "";
let sTime = moment(startTime).format("yyyy-MM-DD HH:mm:ss");
let endTime = row.endTime||"";
let endTime = row.endTime || "";
let eTime = moment(endTime).format("yyyy-MM-DD HH:mm:ss");
if (!row.endTime) {
eTime = moment(startTime + 3600000).format("yyyy-MM-DD HH:mm:ss");
}
console.log(sTime +'---'+eTime);
console.log(sTime + "---" + eTime);
let path = `/oEshield#/monitor/replay?sn=${row.sn}&name=${row.ownerName}&standno=${row.vin}&startTime=${sTime}&endTime=${eTime}&fenceId=${row.fenceId}&isInitFence=1`;
//this.$root.parentCommon.setBreadCrumbs(path);
window.open(path);
},
},
};
</script>
......
......@@ -8,7 +8,7 @@
<div class="search_box">
<el-form :model="searchForm" :inline="true" size="small">
<el-form-item label="关键字:">
<el-input placeholder="设备号|车架号|姓名|工单号" class="a_input" v-model="searchForm.keywords">
<el-input placeholder="设备号|车架号|姓名|工单号" class="a_input" v-model.trim="searchForm.keywords">
</el-input>
</el-form-item>
<el-form-item label="车辆归属:">
......
......@@ -16,7 +16,7 @@
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList()">搜索</el-button>
<el-button type="primary" icon="el-icon-search" @click="searchEvent()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="default" icon="el-icon-refresh" @click="rest()">重置</el-button>
......@@ -64,11 +64,11 @@ import {
GET_JOURNEYS_EXPORTDETAIL,
} from "services/report";
import { deepClone, showToast } from "@/utils/util";
import moment from "moment";
import {mileageDetailShortcuts} from '@/common/index'
export default {
data() {
return {
searchForm: {sn:this.$route.query.sn},
searchForm: { sn: this.$route.query.sn },
snList: [],
dateTime: [],
tableData: [],
......@@ -95,71 +95,10 @@ export default {
],
pageTotal: 0,
pickerOptions: {
shortcuts: [
{
text: "全部",
onClick(picker) {
const end = "";
const start = "";
picker.$emit("pick", [start, end]);
},
},
{
text: "昨日",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
picker.$emit("pick", [start, end]);
},
},
{
text: "本周",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment().weekday(1).format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上周",
onClick(picker) {
let weekOfDay = parseInt(moment().format("E"));
const end = moment()
.subtract(weekOfDay, "days")
.format("YYYY-MM-DD");
const start = moment()
.subtract(weekOfDay + 7 - 1, "days")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "本月",
onClick(picker) {
const start = moment().add("month", 0).format("YYYY-MM") + "-01";
const end = moment().format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上月",
onClick(picker) {
const end = moment()
.month(moment().month() - 1)
.endOf("month")
.format("YYYY-MM-DD");
const start = moment()
.month(moment().month() - 1)
.startOf("month")
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
],
shortcuts: mileageDetailShortcuts,
},
dloading: false,
aloding:false
aloding: false,
};
},
components: {
......@@ -169,7 +108,7 @@ export default {
//this.getSn();
},
mounted() {
this.getList()
this.getList();
//this.getTableList();
},
methods: {
......@@ -189,7 +128,7 @@ export default {
// 获取列表
getList(options) {
let oParams = this.getParams();
oParams.pageSize = this.$refs.glsxTable.pageSize;
oParams.pageSize = this.$refs.glsxTable.pageSizeNum;
oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.aloding = true;
GET_JOURNEYS_SEARCHDETAIL(oParams).then((res) => {
......@@ -231,21 +170,27 @@ export default {
let _this = this;
let oParams = this.getParams();
_this.dloading = true;
GET_JOURNEYS_EXPORTDETAIL(oParams).then(res => {
GET_JOURNEYS_EXPORTDETAIL(oParams).then((res) => {
_this.dloading = false;
if (res.code != 200) {
return false;
}
window.open(res.data);
})
});
},
// 重置
rest() {
//this.searchForm = {};
this.dateTime = [];
this.getList();
this.$refs.glsxTable.rest();
this.getList();
},
// 搜索事件
searchEvent() {
this.$refs.glsxTable.rest("currentPage", 1);
this.getList();
},
},
};
......
......@@ -138,7 +138,7 @@
<!-- 列表数据 end -->
<!-- 新增、编辑、查看弹框 开始 -->
<basic-dialog width="800px" :title="vehicleTitle" :isVisible="vehicleVisible" :hasOk="vehicleHasOk" @confirmDialog="handleConfirm('create')" @closeDialog="handleClose('create')">
<basic-dialog width="800px" :title="vehicleTitle" :isVisible="vehicleVisible" :hasOk="vehicleHasOk" :loading="ajaxLoading" @confirmDialog="handleConfirm('create')" @closeDialog="handleClose('create')">
<slot>
<div class="dialog_content" v-loading="formLoading">
<el-form class="el_form" ref="snForm" :model="snForm" :rules="vehicleRules" :inline="false" :disabled="isReadonly" size="mini" label-width="100px">
......@@ -343,7 +343,7 @@ import { VEHICLE_API } from "@/config/config";
import store from "@/store";
import freqModal from "./freqModal";
import { Validator } from "@/utils/validator";
import { deepClone } from "@/utils/util";
import { deepClone, showToast } from "@/utils/util";
import { VEHICLE_ONLINE_STATUS } from "@/common/constants";
import {
getVehicleList,
......@@ -809,6 +809,7 @@ export default {
},
],
VEHICLE_ONLINE_STATUS,
ajaxLoading: false,
};
},
......@@ -1083,6 +1084,7 @@ export default {
// 新增车辆、编辑车辆
handleConfirm(type) {
let _this = this;
switch (type) {
case "create":
//console.log(this.vehicleForm, this.vehicleData);
......@@ -1094,28 +1096,33 @@ export default {
if (params.id) {
api = updateNewVehicle;
}
api(params).then((res) => {
const { code, message } = res;
if (code != 200) {
this.$message({
_this.ajaxLoading = true;
api(params)
.then((res) => {
_this.ajaxLoading = false;
const { code, message } = res;
if (code != 200) {
showToast({
message: message,
});
return false;
}
showToast({
message: "操作成功",
type: "danger",
type: "success",
});
return false;
}
this.$message({
message: "操作成功",
type: "success",
this.vehicleVisible = !this.vehicleVisible;
this.snForm = {};
this.dialogType = "";
this.$refs.snForm.clearValidate();
//this.$refs.serchButton.$el.click();
this.getList();
//this.$refs.vehicleForm.refreshTable();
//this.$refs.snForm.refreshTable();
})
.catch(() => {
_this.ajaxLoading = false;
});
this.vehicleVisible = !this.vehicleVisible;
this.snForm = {};
this.dialogType = "";
this.$refs.snForm.clearValidate();
//this.$refs.serchButton.$el.click();
this.getList();
//this.$refs.vehicleForm.refreshTable();
//this.$refs.snForm.refreshTable();
});
});
break;
case "import":
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!