封装数据字典通用方法
This commit is contained in:
parent
c3e58ddec0
commit
92a46a6b30
@ -25,7 +25,7 @@
|
|||||||
{{ projectName }}
|
{{ projectName }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="order.flag == 2" class="project-right">
|
<view v-if="order.ticketsStatus == '05'" class="project-right">
|
||||||
<image class="rightIcon" mode="aspectFit" src="/static/icons/success.png"></image>
|
<image class="rightIcon" mode="aspectFit" src="/static/icons/success.png"></image>
|
||||||
<text class="rightText">已派工</text>
|
<text class="rightText">已派工</text>
|
||||||
</view>
|
</view>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
<view>
|
<view>
|
||||||
客户信息:{{ order.userName }} {{ order.userPhone }}
|
客户信息:{{ order.userName }} {{ order.userPhone }}
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view v-if="order.appointDate">
|
||||||
预约时间:{{ order.appointDate }}
|
预约时间:{{ order.appointDate }}
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
@ -42,10 +42,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<view @click="gotoDetail" v-if="order.flag == 1" class="btn pg">
|
<view @click="gotoDetail" v-if="order.ticketsStatus == '04'" class="btn pg">
|
||||||
项目派工
|
项目派工
|
||||||
</view>
|
</view>
|
||||||
<view @click="gotoDetail" v-else-if="order.flag == 2" class="btn qc">
|
<view @click="gotoDetail" v-else-if="order.ticketsStatus == '06'" class="btn qc">
|
||||||
告知取车
|
告知取车
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -98,6 +98,7 @@ export default {
|
|||||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||||
border-left: 4rpx solid #FFB323;
|
border-left: 4rpx solid #FFB323;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-top {
|
.order-top {
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="todoList">
|
<view class="todoList">
|
||||||
<scroll-view style="height: 100%;" scroll-y="true" class="itemContent" bindscrolltolower="onReachBottom"
|
<scroll-view scroll-y="true" class="itemContent" bindscrolltolower="onReachBottom"
|
||||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||||
<order-card v-for="(item, index) in orderList" :key="index" :order="item"></order-card>
|
<order-card v-for="(item, index) in orderList" :key="index" :order="item"></order-card>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@ -49,7 +49,7 @@ import VNavigationBar from '@/components/VNavigationBar.vue'
|
|||||||
import OrderCard from "@/components/orderCard.vue";
|
import OrderCard from "@/components/orderCard.vue";
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import {formatTimestamp} from "@/utils/utils";
|
import {formatTimestamp,getOrderStatusText,getDictByCode} from "@/utils/utils";
|
||||||
import {
|
import {
|
||||||
getToken,
|
getToken,
|
||||||
getUserInfo,
|
getUserInfo,
|
||||||
@ -132,6 +132,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.orderList = []
|
this.orderList = []
|
||||||
this.getOrderList()
|
this.getOrderList()
|
||||||
|
getDictByCode("repair_tickets_status")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@ -189,7 +190,9 @@ export default {
|
|||||||
id:order.id,
|
id:order.id,
|
||||||
orderNo:order.ticketNo,
|
orderNo:order.ticketNo,
|
||||||
flag:1,
|
flag:1,
|
||||||
flagStr:"待处理",
|
ticketsStatus:order.ticketsStatus,
|
||||||
|
ticketsWorkStatus:order.ticketsWorkStatus,
|
||||||
|
flagStr:getOrderStatusText(order),
|
||||||
carNum:order.carNo,
|
carNum:order.carNo,
|
||||||
carModel:order.carBrandName,
|
carModel:order.carBrandName,
|
||||||
userName:order.userName,
|
userName:order.userName,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
function getWXStatusHeight() {
|
function getWXStatusHeight() {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 获取距上
|
// 获取距上
|
||||||
@ -22,6 +24,51 @@ function getWXStatusHeight() {
|
|||||||
// #endif
|
// #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) {
|
function formatTimestamp(timestamp) {
|
||||||
// 将时间戳转换为Date对象
|
// 将时间戳转换为Date对象
|
||||||
const date = new Date(timestamp);
|
const date = new Date(timestamp);
|
||||||
@ -37,5 +84,8 @@ function formatTimestamp(timestamp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getWXStatusHeight,formatTimestamp
|
getWXStatusHeight,
|
||||||
|
formatTimestamp,
|
||||||
|
getOrderStatusText,
|
||||||
|
getDictByCode
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user