This commit is contained in:
PQZ 2024-10-18 19:55:09 +08:00
commit 6beb19936c
5 changed files with 139 additions and 178 deletions

View File

@ -118,7 +118,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; margin: 15rpx 0;
} }
.order-top { .order-top {

View File

@ -12,7 +12,7 @@
<image mode="aspectFit" src="@/static/icons/tabbar/order.png" v-show="aindex != 2"></image> <image mode="aspectFit" src="@/static/icons/tabbar/order.png" v-show="aindex != 2"></image>
<image mode="aspectFit" src="@/static/icons/tabbar/order-checked.png" v-show="aindex == 2"></image> <image mode="aspectFit" src="@/static/icons/tabbar/order-checked.png" v-show="aindex == 2"></image>
</view> </view>
<view class="">工单处理</view> <view class="">工单</view>
</view> </view>
<!-- <view class="box" :class="{active: aindex == 3}" @click="getgogo(3)">--> <!-- <view class="box" :class="{active: aindex == 3}" @click="getgogo(3)">-->
<!-- <view class="imgs">--> <!-- <view class="imgs">-->
@ -172,8 +172,6 @@
} }
}, },
getgogo(index) { getgogo(index) {
if (index == 1) { if (index == 1) {
this.aindex = index this.aindex = index
uni.reLaunch({ uni.reLaunch({

View File

@ -35,6 +35,9 @@
<scroll-view 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>
<view style="text-align: center" v-if="orderList.length==0">
<image class="" src="@/static/images/nothing.png" ></image>
</view>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
@ -68,7 +71,7 @@ export default {
imgUrlPrex:config.baseImageUrl, imgUrlPrex:config.baseImageUrl,
userInfo: { userInfo: {
avatar: undefined, avatar: undefined,
nickname: '曾廷' nickname: ''
}, },
menuList: [ menuList: [
{ {
@ -77,7 +80,12 @@ export default {
icon: require('@/static/icons/homeMenuIcon/menu1.png'), icon: require('@/static/icons/homeMenuIcon/menu1.png'),
path: '/pages-order/addOrder/addOrder' path: '/pages-order/addOrder/addOrder'
}, },
{title: '预约开单', desc: '查询预约记录', icon: require('@/static/icons/homeMenuIcon/menu1.png'), path: '/pages-order/appointOrder/appointOrder'} {
title: '预约开单',
desc: '查询预约记录',
icon: require('@/static/icons/homeMenuIcon/menu1.png'),
path: '/pages-order/appointOrder/appointOrder'
}
], ],
bannerIndex: 0, bannerIndex: 0,
shopList: [], shopList: [],
@ -89,34 +97,6 @@ export default {
// //
isTriggered:false, isTriggered:false,
orderList: [ orderList: [
{
orderNo: '1209840149750105501',
flag: 1, flagStr: '待处理', carNum: '川A 184AO1',
carModel: '一汽奥迪 2024款 A6L',
projectList: [
{ name: '清洗内饰', id: 1 },
{ name: '内饰精洗除臭', id: 2 },
{ name: '烘干底板胶及脚垫', id: 3 }
],
userName: '张三',
userPhone: '157****6879',
appointDate: '2024-10-20 12:00',
counselorName: '李相东'
},
{
orderNo: '1209840149750105501',
flag: 1, flagStr: '待处理', carNum: '川A 184AO1',
carModel: '一汽奥迪 2024款 A6L',
projectList: [
{ name: '清洗内饰', id: 1 },
{ name: '内饰精洗除臭', id: 2 },
{ name: '烘干底板胶及脚垫', id: 3 }
],
userName: '张三',
userPhone: '157****6879',
appointDate: '2024-10-20 12:00',
counselorName: '李相东'
}
], ],
defaultAvatar: require('@/static/icons/avatar.png') defaultAvatar: require('@/static/icons/avatar.png')
} }
@ -130,8 +110,6 @@ export default {
if(!this.$msgSocket){ if(!this.$msgSocket){
this.$startMsgSocket(getTenantId(),getStrData("userId")) this.$startMsgSocket(getTenantId(),getStrData("userId"))
} }
this.orderList = []
this.getOrderList()
} }
}, },
onShow() { onShow() {
@ -142,6 +120,7 @@ export default {
}else{ }else{
// //
this.userInfo = getUserInfo() this.userInfo = getUserInfo()
this.onRefresherrefresh()
} }
}, },
methods: { methods: {
@ -173,11 +152,11 @@ export default {
* 查本人待处理工单 * 查本人待处理工单
*/ */
getOrderList(){ getOrderList(){
this.orderList = [] let paramsObj = {pageNo: this.pageNo, pageSize: this.pageSize, isFinish: "0"}
request({ request({
url: '/admin-api/repair/tickets/pageType', url: '/admin-api/repair/tickets/pageType',
method: 'get', method: 'get',
params:{pageNo:this.pageNo,pageSize:this.pageSize,isFinish:"0"} params:paramsObj
}).then((res) => { }).then((res) => {
console.log(res) console.log(res)
if (res.code == 200) { if (res.code == 200) {

View File

@ -2,8 +2,9 @@
<view class="container"> <view class="container">
<view class="header"> <view class="header">
<view class="searchBox"> <view class="searchBox">
<input class="searchInput" type="text" placeholder="车牌号查询工单" placeholder-style="font-size: 28rpx"> <input class="searchInput" type="text" v-model="searchText" placeholder="工单号、车牌号、手机号、客户姓名" placeholder-style="font-size: 28rpx">
<text class="searchBtn">搜索</text> <text class="searchBtn" @click="onRefresherrefresh">搜索</text>
<text class="searchBtn" @click="clearText">清空</text>
</view> </view>
</view> </view>
<view class="body"> <view class="body">
@ -15,9 +16,13 @@
</view> </view>
</view> </view>
<view class="orderList"> <view class="orderList">
<view v-for="(item, index) in orderList" :key="index" class="orderItem"> <scroll-view scroll-y="true" style="height: 100%" class="itemContent" bindscrolltolower="onReachBottom"
<order-card :order="item"></order-card> refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
</view> <order-card v-for="(item, index) in orderList" :key="index" :order="item"></order-card>
<view style="text-align: center" v-if="orderList.length==0">
<image class="" src="@/static/images/nothing.png" ></image>
</view>
</scroll-view>
</view> </view>
</view> </view>
<tabBarVue msg="2"></tabBarVue> <tabBarVue msg="2"></tabBarVue>
@ -25,10 +30,17 @@
</template> </template>
<script> <script>
import request from '../../utils/request';
import VNavigationBar from '@/components/VNavigationBar.vue' import VNavigationBar from '@/components/VNavigationBar.vue'
import tabBarVue from '@/components/tabBar/tabBar.vue' import tabBarVue from '@/components/tabBar/tabBar.vue'
import OrderCard from "@/components/orderCard.vue"; import OrderCard from "@/components/orderCard.vue";
import request from '@/utils/request';
import {formatTimestamp,getOrderStatusText,getDictByCode} from "@/utils/utils";
import {
getToken,
getUserInfo,
getStrData,
getTenantId
} from '@/utils/auth'
export default { export default {
components: { components: {
@ -38,10 +50,14 @@ export default {
}, },
data() { data() {
return { return {
searchText:"",
payShow: false, payShow: false,
activeKey: 0, activeKey: 0,
pageNum: 1, pageNo: 1,
totalPages: 0, pageSize: 10,
total: 0,
//
isTriggered:false,
imageUrl: '', imageUrl: '',
tabList: [ tabList: [
{ {
@ -50,153 +66,124 @@ export default {
}, },
{ {
id: 1, id: 1,
title: '已完成' title: '全部'
}, },
], ],
orderList: [ orderList: [
{
orderNo: '1209840149750105501',
flag: 1, flagStr: '待处理', carNum: '川A 184AO1',
carModel: '一汽奥迪 2024款 A6L',
projectList: [
{ name: '清洗内饰', id: 1 },
{ name: '内饰精洗除臭', id: 2 },
{ name: '烘干底板胶及脚垫', id: 3 }
],
userName: '张三',
userPhone: '157****6879',
appointDate: '2024-10-20 12:00',
counselorName: '李相东'
},
{
orderNo: '1209840149750105501',
flag: 2, flagStr: '已完成', carNum: '川A 184AO1',
carModel: '一汽奥迪 2024款 A6L',
projectList: [
{ name: '清洗内饰', id: 1 },
{ name: '内饰精洗除臭', id: 2 },
{ name: '烘干底板胶及脚垫', id: 3 }
],
userName: '张三',
userPhone: '157****6879',
appointDate: '2024-10-20 12:00',
counselorName: '李相东'
}
], ],
changeActive: false
} }
}, },
onShow() { onShow() {
// this.orderList = [] if(!getToken()){
// this.getList() uni.reLaunch({
}, url: '/pages/login/login'
onReachBottom() {
if (this.pageNum >= this.totalPages) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
}) })
} else { }else{
this.pageNum++ //
this.getList() this.userInfo = getUserInfo()
this.onRefresherrefresh()
} }
}, },
methods: { methods: {
async getList() { /**
let data = { * 上滑加载数据
pageSize: 20, */
pageNo: this.pageNum onReachBottom() {
// *
if (this.pageNo * this.pageSize >= this.total) {
uni.$u.toast('没有更多数据了')
return
} }
switch (this.activeKey) { //+1,
case 0: this.pageNo++
break; //
case 1: this.getOrderList()
data.status = "06" },
break; /**
case 2: * 下拉刷新数据
data.status = '00' */
break onRefresherrefresh(){
default: this.isTriggered = true
break this.pageNo = 1
this.total = 0
this.orderList = []
this.getOrderList()
},
/**
* 清空
*/
clearText(){
this.searchText = ""
this.onRefresherrefresh()
},
getOrderList(){
let paramsObj = {pageNo: this.pageNo, pageSize: this.pageSize, isFinish: "0"}
console.log("this.searchText",this.searchText)
if(''!=this.searchText){
paramsObj['ticketNo'] = this.searchText
} }
if (this.changeActive) { if(1==this.activeKey){
this.orderList = [] //
paramsObj['selectType'] = "all"
} }
this.changeActive = false request({
await request({ url: '/admin-api/repair/tickets/pageType',
url: '/userClient/order/page',
method: 'get', method: 'get',
params: data params:paramsObj
}).then((res) => { }).then((res) => {
if (res.code === 200) { console.log(res)
this.orderList = this.orderList.concat(res.rows) if (res.code == 200) {
let total = res.total let thisPageRecords = []
this.totalPages = Math.ceil(total / this.pageSize); if(res.data && res.data.hasOwnProperty("records")){
for (let i = 0; i < res.data.records.length; i++) {
let order = res.data.records[i]
let viewOrder = {
id:order.id,
orderNo:order.ticketNo,
flag:1,
ticketsStatus:order.ticketsStatus,
ticketsWorkStatus:order.ticketsWorkStatus,
flagStr:getOrderStatusText(order.ticketsStatus,order.ticketsWorkStatus),
carNum:order.carNo,
carModel:order.carBrandName,
userName:order.userName,
userPhone:order.userMobile,
counselorName:order.adviserName,
}
if(order.booking){
viewOrder['appointDate'] = formatTimestamp(order.createTime)
}
let projectList = []
if(order.itemList){
for (let j = 0; j < order.itemList.length; j++) {
let itemObj = order.itemList[j]
if("01"==itemObj.itemType){
projectList.push({
id:itemObj.id,
name:itemObj.itemName
})
}
}
}
viewOrder['projectList'] = projectList
thisPageRecords.push(viewOrder)
}
}
// concat n
if (this.pageNo != 1) {
this.orderList = this.orderList.concat(thisPageRecords)
} else {
this.orderList = thisPageRecords
}
//
this.total = res.data.total
this.isTriggered = false
} }
}) })
}, },
changeTabFun(id) { changeTabFun(id) {
this.activeKey = id this.activeKey = id
this.changeActive = true this.onRefresherrefresh()
this.getList()
},
getStatus(status) {
switch (status) {
case '0':
return '待支付'
case '1':
return '已支付'
default:
break;
}
},
async goPay(data) {
let that = this
await request({
url: '/userClient/pay/toPay',
method: 'get',
params: {orderId: data.id}
}).then((ress) => {
wx.requestPayment({
timeStamp: ress.data.timeStamp, // 19701100:00:00
nonceStr: ress.data.nonceStr, // 32
package: ress.data.package, // prepay_id prepay_id=*
signType: ress.data.signType, // MD5RSA
paySign: ress.data.paySign, //
success: function (res) {
console.log('成功', res);
if (res.errMsg = 'requestPayment:ok') {
uni.showToast({
title: '支付成功'
})
this.getList()
}
// res.errMsg = 'requestPayment:ok'
},
})
})
},
convertToImage() {
uni.canvasToTempFilePath({
canvasId: 'myQrcode',
success: function (res) {
// H5tempFilePath base64
// this.imageUrl = res.tempFilePath.replace(/[\r\n]/g, "")
document.getElementById("dl-pay-img").setAttribute("src", res.tempFilePath.replace(/[\r\n]/g, ""))
this.$forceUpdate()
console.log(this.imageUrl, 200);
}
})
},
popupChange({show}) {
if (show) {
}
}, },
gotoDetail(row) { gotoDetail(row) {
if (row.goodsType === '2') { if (row.goodsType === '2') {
@ -209,11 +196,6 @@ export default {
}) })
} }
}, },
gotoEvaluate(row) {
uni.navigateTo({
url: '/pages-order/orderDetail/evaluate?info=' + encodeURIComponent(JSON.stringify(row))
})
}
} }
} }
</script> </script>
@ -288,7 +270,9 @@ export default {
} }
.orderList { .orderList {
padding: 30rpx 0; //padding: 30rpx 0;
padding-top: 10rpx;
height: calc(100% - 90rpx);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
row-gap: 20rpx; row-gap: 20rpx;

BIN
static/images/nothing.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB