|
|
@@ -20,24 +20,13 @@
|
|
|
placeholder="选择日期"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
@change="changeTime"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
+ ></el-date-picker>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="6">
|
|
|
选择订单状态:
|
|
|
- <el-select
|
|
|
- clearable
|
|
|
- v-model="searStatus"
|
|
|
- placeholder="订单筛选"
|
|
|
- @change="changeStatus"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in order_sta"
|
|
|
- :label="item"
|
|
|
- :value="index + 1"
|
|
|
- :key="index"
|
|
|
- ></el-option>
|
|
|
+ <el-select clearable v-model="searStatus" placeholder="订单筛选" @change="changeStatus">
|
|
|
+ <el-option v-for="(item, index) in order_sta" :label="item" :value="index + 1" :key="index"></el-option>
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -54,43 +43,24 @@
|
|
|
element-loading-text="拼命加载中"
|
|
|
element-loading-spinner="el-icon-loading"
|
|
|
>
|
|
|
- <el-table-column prop="orderId" label="订单号" align="center">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="repairsFault.faultName"
|
|
|
- label="故障类型"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="repairsStudent.dormNumber"
|
|
|
- label="宿舍楼栋"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="orderCompleteTime" label="时间" align="center">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="repairsWork.workName"
|
|
|
- label="维修人员"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column prop="orderId" label="订单号" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="repairsFault.faultName" label="故障类型" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="repairsStudent.dormNumber" label="宿舍楼栋" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="orderCompleteTime" label="时间" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="repairsWork.workName" label="维修人员" align="center"></el-table-column>
|
|
|
<el-table-column label="状态" align="center">
|
|
|
<template slot-scope="{ row }">
|
|
|
<span :style="order_sty[row.orderStatus]">
|
|
|
- {{ order_sta_w[row.orderStatus] }}</span
|
|
|
- >
|
|
|
+ {{ order_sta_w[row.orderStatus] }}
|
|
|
+ </span>
|
|
|
+ <span v-if="row.orderStatus === '3'">
|
|
|
+ {{ compareTime(row.orderExpectedTime, row.orderCompleteTime) ? '(按时维修)' : '(延迟维修)' }}
|
|
|
+ </span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-button
|
|
|
- @click="getOrderDetail(row.orderId)"
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- >查看详情</el-button
|
|
|
- >
|
|
|
+ <el-button @click="getOrderDetail(row.orderId)" type="primary" size="small">查看详情</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -107,41 +77,36 @@
|
|
|
:page-size="pageSize"
|
|
|
:current-page.sync="pageNum"
|
|
|
@current-change="changeCurPage"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
+ ></el-pagination>
|
|
|
</div>
|
|
|
</el-row>
|
|
|
|
|
|
<!-- 订单详情弹窗 -->
|
|
|
- <el-dialog
|
|
|
- title="订单信息"
|
|
|
- :visible.sync="detailObj.detailVisible"
|
|
|
- width="30%"
|
|
|
- append-to-body
|
|
|
- v-if="detailObj"
|
|
|
- >
|
|
|
+ <el-dialog title="订单信息" :visible.sync="detailObj.detailVisible" width="30%" append-to-body v-if="detailObj">
|
|
|
<div class="dialog_form">
|
|
|
<div class="form_itm">
|
|
|
- <span>订单号:</span><span>{{ detailObj.orderId }}</span>
|
|
|
+ <span>订单号:</span>
|
|
|
+ <span>{{ detailObj.orderId }}</span>
|
|
|
</div>
|
|
|
<div class="form_itm">
|
|
|
- <span>报修类型:</span
|
|
|
- ><span>{{ detailObj.repairsFault.faultName }}</span>
|
|
|
+ <span>报修类型:</span>
|
|
|
+ <span>{{ detailObj.repairsFault.faultName }}</span>
|
|
|
</div>
|
|
|
<div class="form_itm">
|
|
|
- <span>宿舍楼栋:</span
|
|
|
- ><span>{{ detailObj.repairsStudent.dormNumber }}</span>
|
|
|
+ <span>宿舍楼栋:</span>
|
|
|
+ <span>{{ detailObj.repairsStudent.dormNumber }}</span>
|
|
|
</div>
|
|
|
<div class="form_itm">
|
|
|
- <span>预期时间:</span><span>{{ detailObj.orderExpectedTime }}</span>
|
|
|
+ <span>预期时间:</span>
|
|
|
+ <span>{{ detailObj.orderExpectedTime }}</span>
|
|
|
</div>
|
|
|
<div class="form_itm">
|
|
|
- <span>联系电话:</span
|
|
|
- ><span>{{ detailObj.repairsStudent.studentPhone }}</span>
|
|
|
+ <span>联系电话:</span>
|
|
|
+ <span>{{ detailObj.repairsStudent.studentPhone }}</span>
|
|
|
</div>
|
|
|
<div class="form_itm">
|
|
|
- <span>备选电话:</span
|
|
|
- ><span>{{ detailObj.repairsStudent.studentOtherPhone }}</span>
|
|
|
+ <span>备选电话:</span>
|
|
|
+ <span>{{ detailObj.repairsStudent.studentOtherPhone }}</span>
|
|
|
</div>
|
|
|
<div class="form_itm">
|
|
|
<span>故障图片:</span>
|
|
|
@@ -153,24 +118,15 @@
|
|
|
alt=""
|
|
|
style="max-width: 55px; max-height: 55px; 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 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>
|
|
|
+ <span v-else>--</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -178,95 +134,105 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- order_sta: ["待接单", "已接单", "已维修"],
|
|
|
- order_sta_w: ["新订单", "待接单", "已接单", "已维修"],
|
|
|
- order_sty: ["color:green", "color:red", "color:orange", "color:green"],
|
|
|
+ order_sta: ['待接单', '已接单', '已维修'],
|
|
|
+ order_sta_w: ['新订单', '待接单', '已接单', '已维修'],
|
|
|
+ order_sty: ['color:green', 'color:red', 'color:orange', 'color:green'],
|
|
|
loading: false,
|
|
|
time: null,
|
|
|
tableData: [],
|
|
|
- totalCount: null, //总条数
|
|
|
- pageSize: 10, //每页多少条
|
|
|
- pageNum: 1, //当前页
|
|
|
- searStatus: "",
|
|
|
+ totalCount: null, // 总条数
|
|
|
+ pageSize: 10, // 每页多少条
|
|
|
+ pageNum: 1, // 当前页
|
|
|
+ searStatus: '',
|
|
|
orderStatus: 123,
|
|
|
imgArr: [],
|
|
|
- detailObj: "",
|
|
|
- };
|
|
|
+ detailObj: '',
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
- this.getAllOrderList();
|
|
|
+ this.getAllOrderList()
|
|
|
},
|
|
|
methods: {
|
|
|
async getAllOrderList() {
|
|
|
- this.loading = true;
|
|
|
+ this.loading = true
|
|
|
let params = {
|
|
|
pageNum: this.pageNum,
|
|
|
pageSize: this.pageSize,
|
|
|
time: this.time,
|
|
|
orderStatus: this.orderStatus,
|
|
|
- };
|
|
|
- let res = await this.$API.repair.reqGetOrder(params);
|
|
|
+ }
|
|
|
+ let res = await this.$API.repair.reqGetOrder(params)
|
|
|
// console.log(res);
|
|
|
if (res.status == 200) {
|
|
|
- this.tableData = res.data.list;
|
|
|
- this.totalCount = res.data.total;
|
|
|
+ this.tableData = res.data.list
|
|
|
+ this.totalCount = res.data.total
|
|
|
} else {
|
|
|
- console.log("获取列表数据失败");
|
|
|
- this.$message.error(res.errmsg);
|
|
|
+ console.log('获取列表数据失败')
|
|
|
+ this.$message.error(res.errmsg)
|
|
|
}
|
|
|
- this.loading = false;
|
|
|
+ this.loading = false
|
|
|
},
|
|
|
|
|
|
async getOrderDetail(orderId) {
|
|
|
let params = {
|
|
|
orderId: orderId,
|
|
|
- };
|
|
|
- let res = await this.$API.repair.reqGetRepairListDetail(params);
|
|
|
+ }
|
|
|
+ let res = await this.$API.repair.reqGetRepairListDetail(params)
|
|
|
// console.log(res);
|
|
|
if (res.status == 200) {
|
|
|
- this.imgArr = null;
|
|
|
- this.detailObj = res.data;
|
|
|
- this.$set(this.detailObj, "detailVisible", true);
|
|
|
+ this.imgArr = null
|
|
|
+ this.detailObj = res.data
|
|
|
+ this.$set(this.detailObj, 'detailVisible', true)
|
|
|
if (this.detailObj.orderImages) {
|
|
|
- this.imgArr = this.detailObj.orderImages.match(/[^\;]+/g);
|
|
|
+ this.imgArr = this.detailObj.orderImages.match(/[^\;]+/g)
|
|
|
this.imgArr = this.imgArr.map((item) => {
|
|
|
- return { innerVisible: false, img: item };
|
|
|
- });
|
|
|
+ return { innerVisible: false, img: item }
|
|
|
+ })
|
|
|
}
|
|
|
} else {
|
|
|
- console.log("获取详情数据失败");
|
|
|
- this.$message.error(res.errmsg);
|
|
|
+ console.log('获取详情数据失败')
|
|
|
+ this.$message.error(res.errmsg)
|
|
|
}
|
|
|
},
|
|
|
|
|
|
deriveExcel() {
|
|
|
this.time == null
|
|
|
? (window.location.href = `/baoxiu/repairApi/order/queryOrderExecl?orderType=${this.orderStatus}`)
|
|
|
- : (window.location.href = `/baoxiu/repairApi/order/queryOrderExecl?time=${this.time}&orderType=${this.orderStatus}`);
|
|
|
- this.$message.success("导出成功");
|
|
|
+ : (window.location.href = `/baoxiu/repairApi/order/queryOrderExecl?time=${this.time}&orderType=${this.orderStatus}`)
|
|
|
+ this.$message.success('导出成功')
|
|
|
},
|
|
|
|
|
|
changeTime() {
|
|
|
- this.pageNum = 1;
|
|
|
- this.getAllOrderList();
|
|
|
+ this.pageNum = 1
|
|
|
+ this.getAllOrderList()
|
|
|
},
|
|
|
|
|
|
changeStatus() {
|
|
|
- if (this.searStatus == "") {
|
|
|
- this.orderStatus = 123;
|
|
|
+ if (this.searStatus == '') {
|
|
|
+ this.orderStatus = 123
|
|
|
} else {
|
|
|
- this.orderStatus = this.searStatus;
|
|
|
+ this.orderStatus = this.searStatus
|
|
|
}
|
|
|
- this.pageNum = 1;
|
|
|
- this.getAllOrderList();
|
|
|
+ this.pageNum = 1
|
|
|
+ this.getAllOrderList()
|
|
|
},
|
|
|
|
|
|
changeCurPage(val) {
|
|
|
- this.pageNum = val;
|
|
|
- this.getAllOrderList();
|
|
|
+ this.pageNum = val
|
|
|
+ this.getAllOrderList()
|
|
|
+ },
|
|
|
+ compareTime(startTime, endTime) {
|
|
|
+ console.log('duibi对比')
|
|
|
+ var start_time = startTime.replace(/-|\s|:|\//g, '')
|
|
|
+ var end_time = endTime.replace(/-|\s|:|\//g, '')
|
|
|
+ if (start_time < end_time) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
@@ -290,4 +256,4 @@ export default {
|
|
|
margin-bottom: 15px;
|
|
|
font-size: 20px;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|