|
@@ -1,24 +1,36 @@
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
- <div>
|
|
|
|
|
- <el-table :data="tableData" style="width: 100%" id="container">
|
|
|
|
|
- <el-table-column prop="orderId" label="订单号" width="200">
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- prop="repairsFault.faultName"
|
|
|
|
|
- label="故障类型"
|
|
|
|
|
- width="200"
|
|
|
|
|
|
|
+ <div id="container">
|
|
|
|
|
+ <div class="block">
|
|
|
|
|
+ <el-button round @click.capture="deriveExcel()" :disabled="state">
|
|
|
|
|
+ 导出Excel
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ round
|
|
|
|
|
+ @click="
|
|
|
|
|
+ sear_data = null;
|
|
|
|
|
+ getAllOrderList(null, 0);
|
|
|
|
|
+ "
|
|
|
|
|
+ >全部订单</el-button
|
|
|
>
|
|
>
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- prop="repairsStudent.dormNumber"
|
|
|
|
|
- label="宿舍楼栋"
|
|
|
|
|
- width="200"
|
|
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="sear_data"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ placeholder="选择日期"
|
|
|
|
|
+ :picker-options="pickerOptions"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
>
|
|
>
|
|
|
|
|
+ </el-date-picker>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-table :data="tableData" style="width: 100%" height="150">
|
|
|
|
|
+ <el-table-column prop="orderId" label="订单号"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="repairsFault.faultName" label="故障类型">
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="repairsStudent.dormNumber" label="宿舍楼栋">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column prop="orderExpectedTime" label="预期时间" width="240">
|
|
|
|
|
|
|
+ <el-table-column prop="orderExpectedTime" label="预期时间">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column fixed="right" label="操作" width="240">
|
|
|
|
|
|
|
+ <el-table-column label="操作">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<!-- 按钮1——查看详情模块 -->
|
|
<!-- 按钮1——查看详情模块 -->
|
|
|
<el-button
|
|
<el-button
|
|
@@ -31,7 +43,7 @@
|
|
|
<template v-if="detailObj != null">
|
|
<template v-if="detailObj != null">
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
title="订单信息"
|
|
title="订单信息"
|
|
|
- :visible.sync="detailVisible"
|
|
|
|
|
|
|
+ :visible.sync="detailObj.detailVisible"
|
|
|
width="30%"
|
|
width="30%"
|
|
|
append-to-body
|
|
append-to-body
|
|
|
>
|
|
>
|
|
@@ -60,12 +72,39 @@
|
|
|
><span>{{ detailObj.repairsStudent.studentOtherPhone }}</span>
|
|
><span>{{ detailObj.repairsStudent.studentOtherPhone }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form_itm">
|
|
<div class="form_itm">
|
|
|
- <span>故障图片:</span
|
|
|
|
|
- ><span>{{ detailObj.orderImages }}</span>
|
|
|
|
|
|
|
+ <span>故障图片:</span>
|
|
|
|
|
+ <template v-if="imgArr != null">
|
|
|
|
|
+ <div class="img_field" v-for="(item, i) in imgArr" :key="i">
|
|
|
|
|
+ <img
|
|
|
|
|
+ @click="item.innerVisible = true"
|
|
|
|
|
+ :src="item.img"
|
|
|
|
|
+ alt=""
|
|
|
|
|
+ style="
|
|
|
|
|
+ max-width: 35px;
|
|
|
|
|
+ max-height: 35px;
|
|
|
|
|
+ margin-right: 20px;
|
|
|
|
|
+ "
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ width="30%"
|
|
|
|
|
+ title="故障图片"
|
|
|
|
|
+ :visible.sync="item.innerVisible"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ >
|
|
|
|
|
+ <img
|
|
|
|
|
+ :src="item.img"
|
|
|
|
|
+ alt="故障图片"
|
|
|
|
|
+ style="width: 100%; max-height: 100%"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="detailVisible = false"
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="detailObj.detailVisible = false"
|
|
|
>确 定</el-button
|
|
>确 定</el-button
|
|
|
>
|
|
>
|
|
|
</span>
|
|
</span>
|
|
@@ -159,72 +198,152 @@ export default {
|
|
|
name: "DeliOrder",
|
|
name: "DeliOrder",
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ state: false, //按钮禁用状态
|
|
|
// 报修单统计表
|
|
// 报修单统计表
|
|
|
tableData: [],
|
|
tableData: [],
|
|
|
- detailVisible: false, // 详情弹出
|
|
|
|
|
|
|
+ exportUrl: "`/baoxiu/repairApi/order/sendOrderExecl`",
|
|
|
|
|
+ // 今天、昨天快捷键配置
|
|
|
|
|
+ pickerOptions: {
|
|
|
|
|
+ disabledDate(time) {
|
|
|
|
|
+ return time.getTime() > Date.now();
|
|
|
|
|
+ },
|
|
|
|
|
+ shortcuts: [
|
|
|
|
|
+ {
|
|
|
|
|
+ text: "今天",
|
|
|
|
|
+ onClick(picker) {
|
|
|
|
|
+ picker.$emit("pick", new Date());
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ text: "昨天",
|
|
|
|
|
+ onClick(picker) {
|
|
|
|
|
+ const date = new Date();
|
|
|
|
|
+ date.setTime(date.getTime() - 3600 * 1000 * 24);
|
|
|
|
|
+ picker.$emit("pick", date);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
backVisible: false, // 退回弹出
|
|
backVisible: false, // 退回弹出
|
|
|
deliveryVisible: false, // 派单弹出
|
|
deliveryVisible: false, // 派单弹出
|
|
|
curpage: 1, //页码
|
|
curpage: 1, //页码
|
|
|
- pageSize: 10, //一页条数
|
|
|
|
|
|
|
+ pageSize: 15, //一页条数
|
|
|
detailObj: null, //详情信息
|
|
detailObj: null, //详情信息
|
|
|
|
|
+ imgArr: null,
|
|
|
workers: null, //工人列表
|
|
workers: null, //工人列表
|
|
|
workId: 0, // 指定维修人员
|
|
workId: 0, // 指定维修人员
|
|
|
- orderBack: "" // 退回理由
|
|
|
|
|
|
|
+ orderBack: "", // 退回理由
|
|
|
|
|
+ sear_data: "", // 查询时间
|
|
|
|
|
+ orderList: 0,
|
|
|
|
|
+ token:
|
|
|
|
|
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDY5OTA1MDAsInVzZXJJZCI6IjEifQ.D4nAou3NRFKhqewVZODCJdsIafXgFiIrlC7CaxvCjbA"
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getDeliOrderList();
|
|
|
|
|
- this.getWorker();
|
|
|
|
|
|
|
+ this.token = sessionStorage.getItem("token");
|
|
|
|
|
+ if (this.token) {
|
|
|
|
|
+ this.getAllOrderList(null, 0);
|
|
|
|
|
+ this.getWorker();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "授权失效,请重新登录",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$router.push({ path: "/" });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ sear_data(newQuestion, oldQuestion) {
|
|
|
|
|
+ this.getAllOrderList(newQuestion, this.orderList);
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- //当改变当前页数的时候触发的事件
|
|
|
|
|
- handleCurrentChange(currentPage) {
|
|
|
|
|
- // console.log(currentPage); //点击第几页
|
|
|
|
|
- this.curpage = currentPage;
|
|
|
|
|
- this.getDeliOrderList();
|
|
|
|
|
- },
|
|
|
|
|
- //获取派送订单列表
|
|
|
|
|
- getDeliOrderList() {
|
|
|
|
|
|
|
+ //获取订单列表
|
|
|
|
|
+ getAllOrderList(sear_data, orderStatus) {
|
|
|
const loading = this.$loading({
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
lock: true,
|
|
|
text: "Loading",
|
|
text: "Loading",
|
|
|
spinner: "el-icon-loading",
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
|
});
|
|
});
|
|
|
- this.tableData.length = 0;
|
|
|
|
|
- this.$axios({
|
|
|
|
|
- method: "post",
|
|
|
|
|
- url: `/testapi/order/queryAllOrderByDate?pageNum=${this.curpage}&pageSize=${this.pageSize}&orderStatus=0`,
|
|
|
|
|
- headers: {
|
|
|
|
|
- access_token: this.token
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .then(({ data }) => {
|
|
|
|
|
- this.tableData = data.data.list;
|
|
|
|
|
- loading.close();
|
|
|
|
|
|
|
+ this.orderList = orderStatus;
|
|
|
|
|
+ if (sear_data) {
|
|
|
|
|
+ this.$axios({
|
|
|
|
|
+ method: "post",
|
|
|
|
|
+ url: `/baoxiu/repairApi/order/queryAllOrderByDate?pageNum=${this.curpage}&pageSize=${this.pageSize}&time=${sear_data}&orderStatus=${orderStatus}`,
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ token: this.token
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
- .catch(err => {
|
|
|
|
|
- loading.close();
|
|
|
|
|
- this.$message({
|
|
|
|
|
- message: err,
|
|
|
|
|
- type: "warning"
|
|
|
|
|
|
|
+ .then(({ data }) => {
|
|
|
|
|
+ // console.log(data.data);
|
|
|
|
|
+ this.tableData = [];
|
|
|
|
|
+ this.tableData = data.data.list;
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: err,
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$axios({
|
|
|
|
|
+ method: "post",
|
|
|
|
|
+ url: `/baoxiu/repairApi/order/queryAllOrderByDate?pageNum=${this.curpage}&pageSize=${this.pageSize}&orderStatus=${orderStatus}`,
|
|
|
|
|
+
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ token: this.token
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(({ data }) => {
|
|
|
|
|
+ // console.log(data.data.list);
|
|
|
|
|
+ this.tableData = [];
|
|
|
|
|
+ this.tableData = data.data.list;
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: err,
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ //当改变当前页数的时候触发的事件
|
|
|
|
|
+ handleCurrentChange(currentPage) {
|
|
|
|
|
+ // console.log(currentPage); //点击第几页
|
|
|
|
|
+ this.curpage = currentPage;
|
|
|
|
|
+ this.getAllOrderList(this.sear_data, this.orderList);
|
|
|
},
|
|
},
|
|
|
//获取详情信息
|
|
//获取详情信息
|
|
|
getOrderDetail(order_id) {
|
|
getOrderDetail(order_id) {
|
|
|
- this.detailObj = null;
|
|
|
|
|
- this.detailVisible = true;
|
|
|
|
|
- // console.log(order_id);
|
|
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: "post",
|
|
method: "post",
|
|
|
- url: `/testapi/order/queryByOrderIdNotWork?orderId=${order_id}`,
|
|
|
|
|
|
|
+ url: `/baoxiu/repairApi/order/queryByOrderIdNotWork?orderId=${order_id}`,
|
|
|
headers: {
|
|
headers: {
|
|
|
- access_token: this.token
|
|
|
|
|
|
|
+ token: this.token
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
- this.detailObj = res.data.data;
|
|
|
|
|
|
|
+ .then(({ data }) => {
|
|
|
|
|
+ if (data.status != 200) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: data.message,
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // console.log(data.data);
|
|
|
|
|
+ // this.detailObj = {};
|
|
|
|
|
+ this.detailObj = data.data;
|
|
|
|
|
+ this.$set(this.detailObj, "detailVisible", true);
|
|
|
|
|
+ this.imgArr = this.detailObj.orderImages.match(/[^\;]+/g);
|
|
|
|
|
+ this.imgArr = this.imgArr.map(ite => {
|
|
|
|
|
+ return { innerVisible: false, img: ite };
|
|
|
|
|
+ });
|
|
|
|
|
+ // console.log(this.imgArr);
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
.catch(err => {
|
|
.catch(err => {
|
|
|
this.$message({
|
|
this.$message({
|
|
@@ -232,19 +351,15 @@ export default {
|
|
|
type: "warning"
|
|
type: "warning"
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
- // if (data.status == 200) {
|
|
|
|
|
- // // console.log(data.data);
|
|
|
|
|
- // this.detailObj = data.data;
|
|
|
|
|
- // }
|
|
|
|
|
},
|
|
},
|
|
|
//获取维修人员列表
|
|
//获取维修人员列表
|
|
|
async getWorker() {
|
|
async getWorker() {
|
|
|
let { data } = await this.$axios({
|
|
let { data } = await this.$axios({
|
|
|
method: "post",
|
|
method: "post",
|
|
|
- url: `/testapi/work/queryAllWorkStatus?pageSize=100`,
|
|
|
|
|
|
|
+ url: `/baoxiu/repairApi/work/queryAllWorkStatus?pageSize=100`,
|
|
|
|
|
|
|
|
headers: {
|
|
headers: {
|
|
|
- access_token: this.token
|
|
|
|
|
|
|
+ token: this.token
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
if (data.status == 200) {
|
|
if (data.status == 200) {
|
|
@@ -263,9 +378,9 @@ export default {
|
|
|
this.deliveryVisible = false;
|
|
this.deliveryVisible = false;
|
|
|
let { data } = await this.$axios({
|
|
let { data } = await this.$axios({
|
|
|
method: "post",
|
|
method: "post",
|
|
|
- url: `/testapi/order/updateRepairsOrderBath?orderId=${order_id}&workId=${work_id}`,
|
|
|
|
|
|
|
+ url: `/baoxiu/repairApi/order/updateRepairsOrderBath?orderId=${order_id}&workId=${work_id}`,
|
|
|
headers: {
|
|
headers: {
|
|
|
- access_token: this.token
|
|
|
|
|
|
|
+ token: this.token
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
if (data.status == 200) {
|
|
if (data.status == 200) {
|
|
@@ -283,9 +398,9 @@ export default {
|
|
|
this.backVisible = false;
|
|
this.backVisible = false;
|
|
|
let { data } = await this.$axios({
|
|
let { data } = await this.$axios({
|
|
|
method: "post",
|
|
method: "post",
|
|
|
- url: `/testapi/order/updateOrderBack?orderId=${order_id}&orderBack=${this.orderBack}`,
|
|
|
|
|
|
|
+ url: `/baoxiu/repairApi/order/updateOrderBack?orderId=${order_id}&orderBack=${this.orderBack}`,
|
|
|
headers: {
|
|
headers: {
|
|
|
- access_token: this.token
|
|
|
|
|
|
|
+ token: this.token
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
if (data.status == 200) {
|
|
if (data.status == 200) {
|
|
@@ -294,7 +409,23 @@ export default {
|
|
|
message: "已退回",
|
|
message: "已退回",
|
|
|
type: "success"
|
|
type: "success"
|
|
|
});
|
|
});
|
|
|
|
|
+ this.getDeliOrderList();
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ //导出表格
|
|
|
|
|
+ deriveExcel() {
|
|
|
|
|
+ this.sear_data == null
|
|
|
|
|
+ ? (window.location.href = `/baoxiu/repairApi/order/sendOrderExecl`)
|
|
|
|
|
+ : (window.location.href = `/baoxiu/repairApi/order/sendOrderExecl?time=${this.sear_data}`);
|
|
|
|
|
+ clearInterval(timer);
|
|
|
|
|
+ this.state = true;
|
|
|
|
|
+ let timer = setInterval(() => {
|
|
|
|
|
+ this.state = false;
|
|
|
|
|
+ }, 2500);
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "导出成功",
|
|
|
|
|
+ type: "success"
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|