|
|
@@ -12,7 +12,7 @@
|
|
|
:close-on-press-escape="false"
|
|
|
title="新增调度"
|
|
|
align-center
|
|
|
- width="600"
|
|
|
+ width="550"
|
|
|
:before-close="editCloseQuery"
|
|
|
>
|
|
|
<el-form
|
|
|
@@ -25,23 +25,61 @@
|
|
|
label-position="left"
|
|
|
status-icon
|
|
|
>
|
|
|
- <!-- <el-form-item label="发车日期 :" prop="startDate">
|
|
|
- <el-date-picker
|
|
|
+ <el-form-item label="发车日期 :" prop="startDate">
|
|
|
+ <!-- <el-date-picker
|
|
|
v-model="ruleFormQuery.startDate"
|
|
|
type="date"
|
|
|
placeholder="请选择发车日期"
|
|
|
- format="YYYY-DD-MM"
|
|
|
- value-format="YYYY-DD-MM"
|
|
|
- />
|
|
|
- </el-form-item> -->
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ /> -->
|
|
|
+ <el-select
|
|
|
+ v-model="ruleFormQuery.startDate"
|
|
|
+ class="m-2"
|
|
|
+ placeholder="请选择发车日期"
|
|
|
+ @change="startbusTime"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ :label="dayjs().format('YYYY-MM-DD')"
|
|
|
+ :value="dayjs().format('YYYY-MM-DD')"
|
|
|
+ />
|
|
|
+ <el-option
|
|
|
+ :label="
|
|
|
+ dayjs(dayjs().format('YYYY-MM-DD'))
|
|
|
+ .add(1, 'day')
|
|
|
+ .format('YYYY-MM-DD')
|
|
|
+ "
|
|
|
+ :value="
|
|
|
+ dayjs(dayjs().format('YYYY-MM-DD'))
|
|
|
+ .add(1, 'day')
|
|
|
+ .format('YYYY-MM-DD')
|
|
|
+ "
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="发车时间 :" prop="ci_time">
|
|
|
<el-time-picker
|
|
|
v-model="ruleFormQuery.ci_time"
|
|
|
placeholder="请选择发车时间"
|
|
|
format="HH:mm"
|
|
|
value-format="HH:mm"
|
|
|
+ :disabled-hours="disabledQueryHours"
|
|
|
+ :disabled-minutes="disabledQueryMinutes"
|
|
|
+ :disabled-seconds="disabledQuerySeconds"
|
|
|
+ @change="addQueryTime"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <!-- <el-form-item label="扫码时间 :" prop="codeTime">
|
|
|
+ <el-time-picker
|
|
|
+ v-model="ruleFormQuery.codeTime"
|
|
|
+ format="HH:mm"
|
|
|
+ value-format="HH:mm"
|
|
|
+ is-range
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="截止时间"
|
|
|
+ />
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="车牌号 :" prop="busname">
|
|
|
<el-select
|
|
|
v-model="ruleFormQuery.busname"
|
|
|
@@ -69,6 +107,7 @@
|
|
|
v-model="ruleFormQuery.route"
|
|
|
class="m-2"
|
|
|
placeholder="请选择路线"
|
|
|
+ @change="changeRouteQuery"
|
|
|
>
|
|
|
<el-option
|
|
|
:label="item.route"
|
|
|
@@ -90,6 +129,7 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
<el-form-item
|
|
|
label="是否可提前一天预约"
|
|
|
prop="yesterday"
|
|
|
@@ -144,16 +184,37 @@
|
|
|
label-position="left"
|
|
|
status-icon
|
|
|
>
|
|
|
- <el-form-item
|
|
|
- label="发车时间 :"
|
|
|
- v-if="ruleForm.state != 3"
|
|
|
- prop="ci_time"
|
|
|
- >
|
|
|
+ <el-form-item label="发车日期 :" prop="startDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="ruleForm.startDate"
|
|
|
+ type="date"
|
|
|
+ placeholder="请选择发车日期"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ :disabled="true"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发车时间 :" prop="ci_time">
|
|
|
<el-time-picker
|
|
|
v-model="ruleForm.ci_time"
|
|
|
placeholder="请选择时间"
|
|
|
+ :disabled="ruleForm.state == 2 ? true : false"
|
|
|
format="HH:mm"
|
|
|
value-format="HH:mm"
|
|
|
+ :disabled-hours="disabledHours"
|
|
|
+ :disabled-minutes="disabledMinutes"
|
|
|
+ :disabled-seconds="disabledSeconds"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="扫码时间 :" prop="codeTime">
|
|
|
+ <el-time-picker
|
|
|
+ v-model="ruleForm.codeTime"
|
|
|
+ format="HH:mm"
|
|
|
+ value-format="HH:mm"
|
|
|
+ is-range
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="截止时间"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item
|
|
|
@@ -188,12 +249,18 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="路线 :" prop="route">
|
|
|
- <el-input
|
|
|
+ <el-select
|
|
|
v-model="ruleForm.route"
|
|
|
- placeholder="请输入路线"
|
|
|
- :disabled="true"
|
|
|
- clearable
|
|
|
- />
|
|
|
+ class="m-2"
|
|
|
+ placeholder="请选择路线"
|
|
|
+ @change="changeRoute"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ :label="item.route"
|
|
|
+ :value="item.route"
|
|
|
+ v-for="item in pathNum.list"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
label="终点站 :"
|
|
|
@@ -232,21 +299,75 @@
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
|
<div class="MingXi" style="height: 652px; margin: 10px 0 20px 0">
|
|
|
- <div class="">
|
|
|
+ <div class="filter">
|
|
|
+ <div class="condition">
|
|
|
+ <el-button
|
|
|
+ style="margin: 0 0 0 30px"
|
|
|
+ color="rgba(61, 81, 232, 1)"
|
|
|
+ type="primary"
|
|
|
+ class="search"
|
|
|
+ @click="addQuery"
|
|
|
+ ><el-icon><CirclePlus /></el-icon
|
|
|
+ ><span> 新增调度</span></el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <!-- <div class="condition">
|
|
|
+ <span>车牌号 : </span>
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ class="w-50 m-2"
|
|
|
+ placeholder="请输入车牌号"
|
|
|
+ style="width: 150px"
|
|
|
+ v-model="searchInput.car_number"
|
|
|
+ />
|
|
|
+ </div> -->
|
|
|
+ <div class="condition">
|
|
|
+ <span>车牌号 : </span>
|
|
|
+ <el-select
|
|
|
+ v-model="searchInput.car_number"
|
|
|
+ class="m-2"
|
|
|
+ placeholder="请选择车牌号"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in busNum.list"
|
|
|
+ :label="item.car_number"
|
|
|
+ :value="item.car_number"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="condition">
|
|
|
+ <span>发车日期 : </span>
|
|
|
+
|
|
|
+ <el-date-picker
|
|
|
+ type="date"
|
|
|
+ placeholder="请选择日期"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ v-model="searchInput.s_date"
|
|
|
+ />
|
|
|
+ </div> -->
|
|
|
+ <el-button
|
|
|
+ style="margin-left: 20px"
|
|
|
+ color="rgba(61, 81, 232, 1)"
|
|
|
+ type="primary"
|
|
|
+ class="search"
|
|
|
+ @click="search"
|
|
|
+ ><el-icon><Search /></el-icon><span>搜索</span></el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
- style="margin: 10px 0 0 30px"
|
|
|
+ style="margin-left: 20px"
|
|
|
color="rgba(61, 81, 232, 1)"
|
|
|
type="primary"
|
|
|
class="search"
|
|
|
- @click="addQuery"
|
|
|
- ><el-icon><CirclePlus /></el-icon><span>新增调度</span></el-button
|
|
|
+ @click="resetSearch"
|
|
|
+ ><el-icon><Search /></el-icon><span>重置</span></el-button
|
|
|
>
|
|
|
</div>
|
|
|
<div class="footer">
|
|
|
<el-table
|
|
|
:row-class-name="tableRowClassName"
|
|
|
:data="tableData.list"
|
|
|
- style="width: 100%; height: 630px"
|
|
|
+ style="width: 100%; height: 580px"
|
|
|
:header-cell-style="{
|
|
|
background: 'rgba(240, 243, 247, 1)',
|
|
|
border: 0,
|
|
|
@@ -274,7 +395,7 @@
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
width="100"
|
|
|
- prop="yy_num"
|
|
|
+ prop="by_num"
|
|
|
label="乘车人数"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
@@ -290,8 +411,18 @@
|
|
|
label="容量"
|
|
|
/>
|
|
|
|
|
|
- <el-table-column align="center" prop="route" label="路线" />
|
|
|
- <el-table-column align="center" prop="route_end" label="终点" />
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="route"
|
|
|
+ width="280"
|
|
|
+ label="路线"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ width="200"
|
|
|
+ align="center"
|
|
|
+ prop="route_end"
|
|
|
+ label="终点"
|
|
|
+ />
|
|
|
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
@@ -305,43 +436,74 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="状态" width="120">
|
|
|
<template #default="scope">
|
|
|
- <div v-if="scope.row.state == 1" style="color: blue">预约中</div>
|
|
|
<div
|
|
|
- v-if="scope.row.state == 2"
|
|
|
+ v-if="scope.row.state == 1"
|
|
|
style="color: rgba(67, 207, 124, 1)"
|
|
|
>
|
|
|
+ 预约中
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="scope.row.state == 2"
|
|
|
+ style="color: rgba(212, 48, 48, 1)"
|
|
|
+ >
|
|
|
已截止
|
|
|
</div>
|
|
|
- <div v-if="scope.row.state == 3" style="color: red">候补中</div>
|
|
|
- <div v-if="scope.row.state == 4" style="color: #ccc">已分车</div>
|
|
|
+ <div
|
|
|
+ v-if="scope.row.state == 3"
|
|
|
+ style="color: rgba(61, 81, 232, 1)"
|
|
|
+ >
|
|
|
+ 候补中
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="scope.row.state == 4"
|
|
|
+ style="color: rgba(77, 77, 77, 1)"
|
|
|
+ >
|
|
|
+ 已分车
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作" width="180">
|
|
|
<template #default="scope">
|
|
|
+ <!-- <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="sendBus(scope.row)"
|
|
|
+ v-if="scope.row.ci_time == 0"
|
|
|
+ ><div class="look">候补</div></el-button
|
|
|
+ > -->
|
|
|
<el-button link type="primary" @click="sendBus(scope.row)"
|
|
|
><div class="look">调度</div></el-button
|
|
|
>
|
|
|
- <el-button link type="primary" @click="del(scope.row)"
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="del(scope.row)"
|
|
|
+ v-if="scope.row.yy_num == 0"
|
|
|
><div class="look">删除</div></el-button
|
|
|
>
|
|
|
+ <!-- <el-button link type="primary" v-else :disabled="true"
|
|
|
+ ><div class="look">删除</div></el-button
|
|
|
+ > -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <el-pagination
|
|
|
+
|
|
|
+ <!-- 分页数据 -->
|
|
|
+ <el-pagination
|
|
|
background
|
|
|
- v-model:page-size="pageSize"
|
|
|
- v-model:current-page="currentPage"
|
|
|
- layout="total, prev, pager, next, jumper"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total, prev, pager, next, jumper, slot"
|
|
|
:total="total"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- /> -->
|
|
|
+ @update:current-page="handleCurrentChange"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, reactive, watch, onBeforeMount } from "vue";
|
|
|
+import { ref, reactive, watch, onBeforeMount, onMounted } from "vue";
|
|
|
import { useRouter } from "vue-router";
|
|
|
import { Select, Pointer, Upload } from "@element-plus/icons-vue";
|
|
|
import { JSEncrypt } from "jsencrypt"; // 加密密码
|
|
|
@@ -357,7 +519,7 @@ const api = ref("");
|
|
|
// 搜索框数据
|
|
|
const searchInput = reactive({
|
|
|
state: "",
|
|
|
- yy_date: "",
|
|
|
+ s_date: "",
|
|
|
car_number: "",
|
|
|
});
|
|
|
|
|
|
@@ -385,40 +547,58 @@ const options = ref(
|
|
|
}))
|
|
|
); //候补弹窗多选车牌号逻辑
|
|
|
|
|
|
-const pageSize = ref(12);
|
|
|
+const pageSize = ref(10);
|
|
|
const currentPage = ref(1); // 当前页
|
|
|
const total = ref(10); // 当前总数
|
|
|
const selectData = reactive({ list: [] }); // 多选框选择的数据
|
|
|
|
|
|
// 表单数据
|
|
|
const formSize = ref("default");
|
|
|
-const ruleFormRef = ref();
|
|
|
-const ruleFormRefQuery = ref();
|
|
|
+const ruleFormRef = ref(); // 调度表单
|
|
|
+const ruleFormRefQuery = ref(); // 新增调度表单
|
|
|
// 派车调度数据
|
|
|
const ruleForm = reactive({
|
|
|
- busname: [], //候补弹窗车牌绑定数据
|
|
|
- volume: "",
|
|
|
- route: "黄家湖校区-墨轩湖校区",
|
|
|
- destination: "",
|
|
|
- ci_time: "",
|
|
|
- state: "",
|
|
|
+ startDate: "", // 发车日期
|
|
|
+ busname: [], // 调度 车牌号
|
|
|
+ volume: "", // 车子容量
|
|
|
+ route: "黄家湖校区-墨轩湖校区", // 线路选择
|
|
|
+ destination: "", // 终点站
|
|
|
+ ci_time: "", // 发车时间
|
|
|
+ state: "", // 状态
|
|
|
+ codeTime: [], // 扫码时间
|
|
|
id: "",
|
|
|
});
|
|
|
// 新增车辆调度数据
|
|
|
const ruleFormQuery = reactive({
|
|
|
+ startDate: "", // 发车日期
|
|
|
busname: "", //候补弹窗车牌绑定数据
|
|
|
ci_time: "", // 发车时间
|
|
|
- volume: "",
|
|
|
- route: "",
|
|
|
- destination: "",
|
|
|
- yesterday: false,
|
|
|
+ volume: "", // 车子容量
|
|
|
+ route: "", // 线路选择
|
|
|
+ destination: "", // 终点站
|
|
|
+ yesterday: true, // 是否提前预约
|
|
|
+ // codeTime: [], // 扫码时间
|
|
|
});
|
|
|
-// 表单验证
|
|
|
+// 调度表单验证
|
|
|
const rules = reactive({
|
|
|
+ startDate: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "发车日期不能为空",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
ci_time: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "时间不能为空",
|
|
|
+ message: "发车时间不能为空",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ codeTime: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "扫码时间不能为空",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
@@ -452,11 +632,19 @@ const rules = reactive({
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请选择终点站",
|
|
|
- trigger: "change",
|
|
|
+ trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
});
|
|
|
+// 新增调度表单验证
|
|
|
const rulesQuery = reactive({
|
|
|
+ startDate: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "发车日期不能为空",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
ci_time: [
|
|
|
{
|
|
|
required: true,
|
|
|
@@ -464,6 +652,13 @@ const rulesQuery = reactive({
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
+ // codeTime: [
|
|
|
+ // {
|
|
|
+ // required: true,
|
|
|
+ // message: "扫码时间不能为空",
|
|
|
+ // trigger: "blur",
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
busname: [
|
|
|
{
|
|
|
required: true,
|
|
|
@@ -494,7 +689,7 @@ const rulesQuery = reactive({
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请选择终点站",
|
|
|
- trigger: "change",
|
|
|
+ trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
});
|
|
|
@@ -535,20 +730,29 @@ watch(
|
|
|
);
|
|
|
|
|
|
// 监控新增车辆调度路线
|
|
|
-watch(
|
|
|
- () => ruleFormQuery.route,
|
|
|
- (newValue, oldValue) => {
|
|
|
- console.log(newValue);
|
|
|
- let arr = JSON.parse(sessionStorage.getItem("route_endSelect"));
|
|
|
- // ruleFormQuery.destination = "";
|
|
|
- // console.log(arr);
|
|
|
+// watch(
|
|
|
+// () => ruleFormQuery.route,
|
|
|
+// (newValue, oldValue) => {
|
|
|
+// console.log(newValue);
|
|
|
+// let arr = JSON.parse(sessionStorage.getItem("route_endSelect"));
|
|
|
+// ruleFormQuery.destination = "";
|
|
|
+// // console.log(arr);
|
|
|
|
|
|
- addendNum.list = arr.filter((item) => {
|
|
|
- return item.route == newValue;
|
|
|
- });
|
|
|
- }
|
|
|
-);
|
|
|
-// 监控调度路线
|
|
|
+// addendNum.list = arr.filter((item) => {
|
|
|
+// return item.route == newValue;
|
|
|
+// });
|
|
|
+// }
|
|
|
+// );
|
|
|
+const changeRouteQuery = (val) => {
|
|
|
+ let arr = JSON.parse(sessionStorage.getItem("route_endSelect"));
|
|
|
+ ruleFormQuery.destination = "";
|
|
|
+ // console.log(arr);
|
|
|
+
|
|
|
+ addendNum.list = arr.filter((item) => {
|
|
|
+ return item.route == val;
|
|
|
+ });
|
|
|
+};
|
|
|
+// 监控调度路线;
|
|
|
// watch(
|
|
|
// () => ruleForm.route,
|
|
|
// (newValue, oldValue) => {
|
|
|
@@ -560,13 +764,23 @@ watch(
|
|
|
// });
|
|
|
// }
|
|
|
// );
|
|
|
+const changeRoute = (val) => {
|
|
|
+ let arr = JSON.parse(sessionStorage.getItem("route_endSelect"));
|
|
|
+ // console.log(arr);
|
|
|
+ ruleForm.destination = "";
|
|
|
+ endNum.list = arr.filter((item) => {
|
|
|
+ return item.route == val;
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
// 获取数据列表
|
|
|
const getList = async () => {
|
|
|
{
|
|
|
let data = new FormData();
|
|
|
let time = dayjs().format("YYYY-MM-DD");
|
|
|
- data.set("date", time);
|
|
|
+ data.set("car_number", searchInput.car_number);
|
|
|
+ data.set("page", currentPage.value);
|
|
|
+ data.set("rows", pageSize.value);
|
|
|
let res = await axios({
|
|
|
method: "post",
|
|
|
url: api.value + "/carBook/schequeryYlist.action",
|
|
|
@@ -575,18 +789,9 @@ const getList = async () => {
|
|
|
},
|
|
|
data: data,
|
|
|
});
|
|
|
- console.log(res);
|
|
|
-
|
|
|
+ console.log(res, "调度数据");
|
|
|
if (res.status == 200) {
|
|
|
- // if (message) {
|
|
|
- // ElMessage({
|
|
|
- // type: "success",
|
|
|
- // showClose: true,
|
|
|
- // message: message,
|
|
|
- // center: true,
|
|
|
- // });
|
|
|
- // }
|
|
|
- tableData.list = res.data.data;
|
|
|
+ tableData.list = res.data.rows;
|
|
|
// currentPage.value = res.data.currentPage;
|
|
|
total.value = res.data.total;
|
|
|
} else {
|
|
|
@@ -609,13 +814,13 @@ const getList = async () => {
|
|
|
};
|
|
|
|
|
|
// 搜索按钮
|
|
|
-// const search = lodash.debounce(() => {
|
|
|
-// getList();
|
|
|
-// }, 300);
|
|
|
+const search = lodash.debounce(() => {
|
|
|
+ getList();
|
|
|
+}, 300);
|
|
|
// 重置搜索框
|
|
|
-const resetInput = lodash.debounce(() => {
|
|
|
+const resetSearch = lodash.debounce(() => {
|
|
|
searchInput.state = "";
|
|
|
- searchInput.yy_date = "";
|
|
|
+ searchInput.s_date = "";
|
|
|
searchInput.car_number = "";
|
|
|
getList();
|
|
|
}, 300);
|
|
|
@@ -629,14 +834,91 @@ const handleSelectionChange = (val) => {
|
|
|
const addQuery = () => {
|
|
|
addBusqueryVisible.value = true;
|
|
|
};
|
|
|
+const makeRange = (start, end) => {
|
|
|
+ const result = [];
|
|
|
+ for (let i = start; i <= end; i++) {
|
|
|
+ result.push(i);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+};
|
|
|
+const startbusTime = (val) => {
|
|
|
+ ruleFormQuery.ci_time = "";
|
|
|
+};
|
|
|
+// 控制新增调度发车时间 小时
|
|
|
+const disabledQueryHours = () => {
|
|
|
+ let dateTime = dayjs().format("YYYY-MM-DD");
|
|
|
+ if (ruleFormQuery.startDate == dateTime) {
|
|
|
+ console.log("当天时间");
|
|
|
+ let hour = dayjs().hour();
|
|
|
+ return makeRange(0, hour - 1);
|
|
|
+ }
|
|
|
+};
|
|
|
+// 控制新增调度发车时间 分钟
|
|
|
+const disabledQueryMinutes = (hour) => {
|
|
|
+ let hours = dayjs().hour();
|
|
|
+ let dateTime = dayjs().format("YYYY-MM-DD");
|
|
|
+ let minute = dayjs().minute();
|
|
|
+ if (ruleFormQuery.startDate == dateTime) {
|
|
|
+ if (hour == hours) {
|
|
|
+ return makeRange(0, minute);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 控制调度发车时间 小时
|
|
|
+const disabledHours = () => {
|
|
|
+ if (ruleForm.state == 2) {
|
|
|
+ } else {
|
|
|
+ let dateTime = dayjs().format("YYYY-MM-DD");
|
|
|
+ if (ruleForm.startDate == dateTime) {
|
|
|
+ console.log("当天时间");
|
|
|
+ let hour = dayjs().hour();
|
|
|
+ return makeRange(0, hour - 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+// 控制调度发车时间 分钟
|
|
|
+const disabledMinutes = (hour) => {
|
|
|
+ if (ruleForm.state == 2) {
|
|
|
+ } else {
|
|
|
+ let hours = dayjs().hour();
|
|
|
+ let dateTime = dayjs().format("YYYY-MM-DD");
|
|
|
+ let minute = dayjs().minute();
|
|
|
+ if (ruleForm.startDate == dateTime) {
|
|
|
+ if (hour == hours) {
|
|
|
+ return makeRange(0, minute);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
|
|
|
// 派车按钮
|
|
|
const sendBus = (row) => {
|
|
|
console.log(row);
|
|
|
+ let arr = JSON.parse(sessionStorage.getItem("route_endSelect"));
|
|
|
+ endNum.list = arr.filter((item) => {
|
|
|
+ return item.route == row.route;
|
|
|
+ });
|
|
|
centerDialogVisible.value = true;
|
|
|
+ ruleForm.startDate = row.s_date;
|
|
|
ruleForm.id = row.id;
|
|
|
ruleForm.state = row.state;
|
|
|
- ruleForm.ci_time = row.ci_time;
|
|
|
+ if (row.car_number == 0) {
|
|
|
+ ruleForm.busname = [];
|
|
|
+ } else {
|
|
|
+ ruleForm.busname = [row.car_number];
|
|
|
+ }
|
|
|
+ ruleForm.route = row.route;
|
|
|
+ ruleForm.destination = row.route_end;
|
|
|
+ ruleForm.codeTime = [row.sm_start, row.sm_end];
|
|
|
+ if (row.ci_time == 0) {
|
|
|
+ // dialongTitle.value = "车辆候补调度";
|
|
|
+ ruleForm.ci_time = "";
|
|
|
+ } else {
|
|
|
+ // dialongTitle.value = "车辆调度";
|
|
|
+ ruleForm.ci_time = row.ci_time;
|
|
|
+ }
|
|
|
};
|
|
|
// 派车弹窗关闭
|
|
|
const editClose = () => {
|
|
|
@@ -649,11 +931,13 @@ const submitAdd = async (formEl) => {
|
|
|
await formEl.validate(async (valid, fields) => {
|
|
|
if (valid) {
|
|
|
let data = {
|
|
|
- car_number: ruleForm.busname.join(",f"),
|
|
|
+ car_number: ruleForm.busname.join(","),
|
|
|
route: ruleForm.route,
|
|
|
contain: ruleForm.volume,
|
|
|
route_end: ruleForm.destination,
|
|
|
ci_time: ruleForm.ci_time,
|
|
|
+ sm_start: ruleForm.codeTime[0],
|
|
|
+ sm_end: ruleForm.codeTime[1],
|
|
|
id: ruleForm.id,
|
|
|
};
|
|
|
let res = await axios({
|
|
|
@@ -674,7 +958,7 @@ const submitAdd = async (formEl) => {
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
- addDialogVisible.value = false;
|
|
|
+ centerDialogVisible.value = false;
|
|
|
ruleFormRef.value.resetFields();
|
|
|
} else {
|
|
|
ElMessage({
|
|
|
@@ -713,6 +997,7 @@ const submitAddQuery = async (formEl) => {
|
|
|
route: ruleFormQuery.route,
|
|
|
route_end: ruleFormQuery.destination,
|
|
|
before_state: yesterday,
|
|
|
+ s_date: ruleFormQuery.startDate,
|
|
|
};
|
|
|
let res = await axios({
|
|
|
method: "post",
|
|
|
@@ -767,9 +1052,9 @@ const del = (row) => {
|
|
|
data: data,
|
|
|
});
|
|
|
if (res.data.code == 200) {
|
|
|
- // if (tableData.list.length == 1 && currentPage.value != 1) {
|
|
|
- // currentPage.value = currentPage.value - 1;
|
|
|
- // }
|
|
|
+ if (tableData.list.length == 1 && currentPage.value != 1) {
|
|
|
+ currentPage.value = currentPage.value - 1;
|
|
|
+ }
|
|
|
getList();
|
|
|
ElMessage({
|
|
|
type: "success",
|
|
|
@@ -859,19 +1144,25 @@ const tableRowClassName = ({ row, rowIndex }) => {
|
|
|
// 分页
|
|
|
const handleCurrentChange = (value) => {
|
|
|
currentPage.value = value;
|
|
|
+ getList();
|
|
|
};
|
|
|
|
|
|
-onBeforeMount(() => {
|
|
|
+onMounted(() => {
|
|
|
api.value = store.state.user.api;
|
|
|
pathNum.list = JSON.parse(sessionStorage.getItem("pathSelect"));
|
|
|
busNum.list = JSON.parse(sessionStorage.getItem("busSelect"));
|
|
|
- let route_endSelect = JSON.parse(sessionStorage.getItem("route_endSelect"));
|
|
|
- endNum.list = route_endSelect.filter((item) => {
|
|
|
- return item.route == ruleForm.route;
|
|
|
- });
|
|
|
- busNum.list.forEach((item) => {
|
|
|
- initials.list.push(item.car_number);
|
|
|
- });
|
|
|
+ // let route_endSelect = JSON.parse(sessionStorage.getItem("route_endSelect"));
|
|
|
+ // console.log(route_endSelect);
|
|
|
+
|
|
|
+ // endNum.list = route_endSelect.filter((item) => {
|
|
|
+ // return item.route == ruleForm.route;
|
|
|
+ // });
|
|
|
+ if (busNum.list) {
|
|
|
+ busNum.list.forEach((item) => {
|
|
|
+ initials.list.push(item.car_number);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
options.value = Array.from({ length: initials.list.length }).map(
|
|
|
(_, idx) => ({
|
|
|
value: `${initials.list[idx % 10]}`,
|
|
|
@@ -909,6 +1200,23 @@ onBeforeMount(() => {
|
|
|
color: #4392f7;
|
|
|
}
|
|
|
}
|
|
|
+ .MingXi {
|
|
|
+ .filter {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ align-items: center;
|
|
|
+ // width: 100%;
|
|
|
+ .condition {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin: 10px 30px 10px 0;
|
|
|
+ color: #000;
|
|
|
+ span {
|
|
|
+ margin: 0 10px 0 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
:deep(.sendBus) {
|
|
|
// height: 420px;
|
|
|
border-radius: 11px;
|
|
|
@@ -937,8 +1245,6 @@ onBeforeMount(() => {
|
|
|
|
|
|
.options {
|
|
|
margin-left: 200px;
|
|
|
- .el-form-item__content {
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|