diff --git a/components/orderCard.vue b/components/orderCard.vue index 45ea42c..91087fe 100644 --- a/components/orderCard.vue +++ b/components/orderCard.vue @@ -25,7 +25,7 @@ {{ projectName }} - + 已派工 @@ -34,7 +34,7 @@ 客户信息:{{ order.userName }} {{ order.userPhone }} - + 预约时间:{{ order.appointDate }} @@ -42,10 +42,10 @@ - + 项目派工 - + 告知取车 @@ -98,6 +98,7 @@ export default { border-radius: 8rpx 8rpx 8rpx 8rpx; border-left: 4rpx solid #FFB323; padding: 0 30rpx; + margin-bottom: 30rpx; } .order-top { diff --git a/pages-home/home/home.vue b/pages-home/home/home.vue index 688476d..d6e1ac2 100644 --- a/pages-home/home/home.vue +++ b/pages-home/home/home.vue @@ -32,7 +32,7 @@ - @@ -49,7 +49,7 @@ import VNavigationBar from '@/components/VNavigationBar.vue' import OrderCard from "@/components/orderCard.vue"; import config from '@/config' import request from '@/utils/request'; -import {formatTimestamp} from "@/utils/utils"; +import {formatTimestamp,getOrderStatusText,getDictByCode} from "@/utils/utils"; import { getToken, getUserInfo, @@ -132,6 +132,7 @@ export default { } this.orderList = [] this.getOrderList() + getDictByCode("repair_tickets_status") } }, onShow() { @@ -189,7 +190,9 @@ export default { id:order.id, orderNo:order.ticketNo, flag:1, - flagStr:"待处理", + ticketsStatus:order.ticketsStatus, + ticketsWorkStatus:order.ticketsWorkStatus, + flagStr:getOrderStatusText(order), carNum:order.carNo, carModel:order.carBrandName, userName:order.userName, diff --git a/utils/utils.js b/utils/utils.js index 4668153..e79a992 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -1,3 +1,5 @@ +import request from '@/utils/request'; + function getWXStatusHeight() { // #ifdef MP-WEIXIN // 获取距上 @@ -22,6 +24,51 @@ function getWXStatusHeight() { // #endif } +/** + * 根据订单的状态获取订单的文字展示状态 + * @param orderInfo + */ +function getOrderStatusText(orderInfo){ + let str = ""; + if("04"==orderInfo.ticketsStatus){ + //待派工 + str = "待派工" + }else if("05"==orderInfo.ticketsStatus){ + //维修中 + str = "维修中" + }else if("01"==orderInfo.ticketsStatus){ + //待结算 + str = "待结算" + }else if("06"==orderInfo.ticketsStatus){ + //挂单/记账 + str = "挂单/记账" + }else if("02"==orderInfo.ticketsStatus){ + //已结账 + str = "已结账" + }else if("03"==orderInfo.ticketsStatus){ + //已作废 + str = "已作废" + } + return str; +} + +/** + * 查询字典可选值 + * @param dictCode + */ +function getDictByCode(dictCode){ + request({ + url: '/admin-api/system/dict-data/type', + method: 'get', + params:{type:dictCode} + }).then((res) => { + console.log(res) + if (res.code == 200) { + return res.data + } + }) +} + function formatTimestamp(timestamp) { // 将时间戳转换为Date对象 const date = new Date(timestamp); @@ -37,5 +84,8 @@ function formatTimestamp(timestamp) { } export { - getWXStatusHeight,formatTimestamp + getWXStatusHeight, + formatTimestamp, + getOrderStatusText, + getDictByCode }