Commit 1672228f authored by xxx's avatar xxx

修改

parent 008a552f
......@@ -123,10 +123,7 @@ export default {
}
},
mounted() {
var that = this;
this.$nextTick(() => {
this.loadData();
})
this.loadData();
},
methods: {
loadData() {
......@@ -135,14 +132,32 @@ export default {
param.page = this.page - 1;
param.size = this.size;
param.sort = sort;
let showData = [];
this.$nextTick(()=>{
//获取故障表
HttpReq.truckDispatching.carFaultQuery(param).then((res) => {
if(res.code == 200){
this.loading = false;
this.tableData = res.data.content;
this.total = res.data.totalElements;
let faultCarNumber1 = [];
res.data.content.forEach((item,index)=>{
if(item.status == '1'){
faultCarNumber1.push(item.number);
}
})
let set1 = new Set();
faultCarNumber1.forEach((item)=>{
set1.add(item);
})
let lastArray1 = Array.from(set1);
lastArray1.forEach((item)=>{
HttpReq.truckDispatching.carInformationQuery({number:item}).then((res1) => {
if(res1.code == 200){
HttpReq.truckDispatching.carInformationUpdate({id:res1.data.content[0].id,status:1}).then((res2) => {})
}
})
})
}
})
//获取车辆信息
......@@ -261,6 +276,13 @@ export default {
//修改车辆故障
reqUpdateItem(form, item){
let lastData = {...item};
//修改车辆信息状态数据
HttpReq.truckDispatching.carInformationQuery({number:lastData.number}).then((res1) => {
if(res1.code == 200){
HttpReq.truckDispatching.carInformationUpdate({id:res1.data.content[0].id,status:0}).then((res2) => {})
}
})
//修改故障表的数据
HttpReq.truckDispatching.carFaultUpdate(lastData).then((res) => {
form.visible = false;
if(res.code == 200){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment