Browse Source

完善调度联络

wangqin
zhangzhang 11 months ago
parent
commit
acd9702e20
  1. 250
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DispatchLiaison/StatsDialogVisible/index.vue
  2. 34
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DispatchLiaison/index.vue

250
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DispatchLiaison/StatsDialogVisible/index.vue

@ -37,13 +37,13 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox-group v-model="form.vehicle"> <el-checkbox-group v-model="form.vehicle">
<el-checkbox <el-checkbox
v-for="item in scope.row.shiftsMap" v-for="item in scope.row.vehiclesMap"
:label="item.shiftsName" :label="item.vehiclePlate + ' -' + item.vehicleText"
></el-checkbox> ></el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<span v-for="item in scope.row.vehiclesMap"> <!-- <span v-for="item in scope.row.vehiclesMap">
{{ item.shiftsName }}</span {{ item.vehiclePlate }}</span
> > -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -88,102 +88,6 @@ export default {
data() { data() {
return { return {
form: { personnel: [], vehicle: [] }, form: { personnel: [], vehicle: [] },
num: 0,
tableData: [],
weatherNum: [],
startTime: "",
endTime: "",
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
},
searchType: 1,
controlType: 1,
facilityIds: [],
facilityTableData: [],
searchFormList: [
{
label: "查询条件:",
key: "searchType",
required: true,
isAlone: true,
type: "RadioGroup",
default: 1,
options: {
type: "circle",
options: [
{
key: 1,
label: "站点",
},
{
key: 2,
label: "原因",
},
],
},
},
{
label: "事件类型:",
key: "controlType",
required: true,
isAlone: true,
type: "RadioGroup",
visible: (data) => {
if (data.searchType == 2) {
return true;
}
},
default: 1,
options: {
type: "circle",
options: [
{
key: 1,
label: "收费站封闭",
},
{
key: 2,
label: "收费站限行",
},
],
},
},
{
label: "选择站点:",
key: "facilityId",
required: true,
type: "Select",
options: {
multiple: true,
options: [],
},
default: [],
visible: (data) => {
if (data.searchType == 1) {
return true;
}
},
},
{
label: "日期:",
key: "date",
required: true,
type: "datePicker",
default: "",
options: {
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
},
valueFormat: "yyyy-MM-dd",
type: "daterange",
},
},
],
queryParams: {},
}; };
}, },
computed: { computed: {
@ -198,149 +102,9 @@ export default {
}, },
methods: { methods: {
getFacilityList() { handleSubmit() {},
Promise.allSettled([
//
request({
url: `/business/facility/query`,
method: "get",
}),
]).then((res) => {
if (res[0].status === "fulfilled" && res[0].value.code == 200) {
// this.searchFormList[2].options.options = res[0].value.data.map(
// (item) => ({
// key: item.id,
// label: item.facilityName,
// })
// );
let dataList = [];
res[0].value.data.forEach((item) => {
if (item.facilityType == 1) {
dataList.push({
key: item.id,
label: item.facilityName,
});
}
});
this.searchFormList[2].options.options = dataList;
this.facilityIds = res[0].value.data.map((item) => item.id);
this.searchFormList[2].default = dataList.map((item) => item.key);
console.log(56, this.searchFormList[2].default);
let currentMonth = moment().format("YYYY-MM");
let currentDate = moment().format("YYYY-MM-DD");
this.queryParams = {
searchType: 1,
facilityId: this.facilityIds,
date: [currentMonth + "-01", currentDate],
};
this.searchFormList[3].default = [currentMonth + "-01", currentDate];
this.getSelectTollStation(this.queryParams);
}
});
},
// handleResetForm(data) {
// this.getSelectTollStation(data);
// },
handleSearch(data, value) {
console.log(888, data, value);
if (value == "reset") {
data = this.queryParams;
}
this.getSelectTollStation(data);
},
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
if (this.searchType == 2) {
if (!row.causeTypeName) {
if (columnIndex === 0) {
return [1, 2];
} else if (columnIndex === 1) {
return [0, 0];
}
}
if (row.controlCauseName === "恶劣天气") {
if (columnIndex === 0) {
console.log(this.weatherNum.length);
if (rowIndex === 0) {
return [this.weatherNum.length, 1];
} else if (rowIndex <= this.weatherNum.length) {
return [0, 0];
}
// if (rowIndex === 2) {
// return [7, 1];
// }
// else if (rowIndex === 3) {
// return [0, 0];
// } else if (rowIndex === 4) {
// return [0, 0];
// }
// else if (rowIndex === 5) {
// return [0, 0];
// }
// else if (rowIndex === 6) {
// return [0, 0];
// }
// else if (rowIndex === 7) {
// return [0, 0];
// }
// else if (rowIndex === 8) {
// return [0, 0];
// }
}
// this.weatherNum = 0
}
}
},
getSelectTollStation(data) {
let startTime = "";
let endTime = "";
if (data) {
startTime = data.date[0] + " 00:00:00";
endTime = data.date[1] + " 23:59:59";
} else {
startTime = new Date("2024-01-01 11:12:21");
startTime = new Date("2024-01-26 11:12:36");
}
var formData = new FormData();
this.searchType = data.searchType;
this.controlType = data.controlType;
if (data.searchType == 1) {
formData.append("facilityId", data.facilityId);
} else {
formData.append("controlType", data.controlType);
}
formData.append("searchType", data.searchType);
formData.append("startTime", startTime);
formData.append("endTime", endTime);
let weatherData = [];
let otherData = [];
selectTollStation(formData).then((res) => {
if (data.searchType == 2) {
this.weatherNum = [];
res.data.forEach((item) => {
if (item.causeTypeName) {
this.weatherNum.push(item.causeTypeName);
weatherData.push(item);
} else {
otherData.push(item);
}
});
this.tableData = weatherData.concat(otherData);
} else {
res.data.forEach((item) => {
item.total =
item.facilityClose +
item.facilityRestriction +
item.facilityInterval;
});
this.facilityTableData = res.data;
}
});
},
},
mounted() {
this.getFacilityList();
}, },
mounted() {},
}; };
</script> </script>

34
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DispatchLiaison/index.vue

@ -49,7 +49,9 @@
<div class="dispatch-item"> <div class="dispatch-item">
<span class="label">救援车辆 </span> <span class="label">救援车辆 </span>
<span class="value" v-for="item in dispatchData.vehiclesMap">{{ <span class="value" v-for="item in dispatchData.vehiclesMap">{{
dispatchData.vehiclesMap.length > 0 ? "a" : "-" dispatchData.vehiclesMap.length > 0
? item.vehiclePlate + item.vehicleText
: "-"
}}</span> }}</span>
</div> </div>
</div> </div>
@ -68,6 +70,7 @@ import Descriptions from "@screen/components/Descriptions.vue";
import { provideMixin } from "./../../mixin"; import { provideMixin } from "./../../mixin";
import { commandDispatch } from "@/api/commandDispatch"; import { commandDispatch } from "@/api/commandDispatch";
import StatsDialogVisible from "./StatsDialogVisible/index.vue"; import StatsDialogVisible from "./StatsDialogVisible/index.vue";
import request from "@/utils/request";
export default { export default {
name: "DispatchLiaison", name: "DispatchLiaison",
@ -82,6 +85,7 @@ export default {
return { return {
dispatchData: [], dispatchData: [],
dispatchList: [], dispatchList: [],
vehicleTypeList: [],
statsDialogVisible: false, statsDialogVisible: false,
}; };
}, },
@ -98,13 +102,41 @@ export default {
stakeMark: "K099+750", stakeMark: "K099+750",
}; };
commandDispatch(data).then((res) => { commandDispatch(data).then((res) => {
res.data.forEach((element) => {
if (element.vehiclesMap.length > 0) {
element.vehiclesMap.forEach((item) => {
console.log(789, item);
this.vehicleTypeList.forEach((i) => {
console.log(456, i);
if (item.vehicleType == i.dictValue) {
item.vehicleText = "(" + i.dictLabel + ")";
}
});
});
}
});
this.dispatchList = res.data; this.dispatchList = res.data;
this.dispatchData = res.data[0]; this.dispatchData = res.data[0];
}); });
}, },
getVehicleTypeList() {
if (this.vehicleTypeList.length) return;
request({
url: `/system/dict/data/type/sys_vehicle_type`,
method: "GET",
params: {},
})
.then(({ data, code }) => {
if (code != 200) return; //Message.error("");
this.vehicleTypeList = data;
})
.catch((err) => {});
},
}, },
mounted() { mounted() {
this.getCommandDispatch(); this.getCommandDispatch();
this.getVehicleTypeList();
}, },
}; };
</script> </script>

Loading…
Cancel
Save