工单列表页

This commit is contained in:
Vinjor 2024-10-18 18:45:07 +08:00
parent a6669bf480
commit 3ecaab7b2b
5 changed files with 139 additions and 178 deletions

View File

@ -118,7 +118,7 @@ export default {
border-radius: 8rpx 8rpx 8rpx 8rpx;
border-left: 4rpx solid #FFB323;
padding: 0 30rpx;
margin-bottom: 30rpx;
margin: 15rpx 0;
}
.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-checked.png" v-show="aindex == 2"></image>
</view>
<view class="">工单处理</view>
<view class="">工单</view>
</view>
<!-- <view class="box" :class="{active: aindex == 3}" @click="getgogo(3)">-->
<!-- <view class="imgs">-->
@ -172,8 +172,6 @@
}
},
getgogo(index) {
if (index == 1) {
this.aindex = index
uni.reLaunch({

View File

@ -35,6 +35,9 @@
<scroll-view scroll-y="true" class="itemContent" bindscrolltolower="onReachBottom"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<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>
@ -68,7 +71,7 @@ export default {
imgUrlPrex:config.baseImageUrl,
userInfo: {
avatar: undefined,
nickname: '曾廷'
nickname: ''
},
menuList: [
{
@ -77,7 +80,12 @@ export default {
icon: require('@/static/icons/homeMenuIcon/menu1.png'),
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,
shopList: [],
@ -89,34 +97,6 @@ export default {
//
isTriggered:false,
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')
}
@ -130,8 +110,6 @@ export default {
if(!this.$msgSocket){
this.$startMsgSocket(getTenantId(),getStrData("userId"))
}
this.orderList = []
this.getOrderList()
}
},
onShow() {
@ -142,6 +120,7 @@ export default {
}else{
//
this.userInfo = getUserInfo()
this.onRefresherrefresh()
}
},
methods: {
@ -173,11 +152,11 @@ export default {
* 查本人待处理工单
*/
getOrderList(){
this.orderList = []
let paramsObj = {pageNo: this.pageNo, pageSize: this.pageSize, isFinish: "0"}
request({
url: '/admin-api/repair/tickets/pageType',
method: 'get',
params:{pageNo:this.pageNo,pageSize:this.pageSize,isFinish:"0"}
params:paramsObj
}).then((res) => {
console.log(res)
if (res.code == 200) {

View File

@ -2,8 +2,9 @@
<view class="container">
<view class="header">
<view class="searchBox">
<input class="searchInput" type="text" placeholder="车牌号查询工单" placeholder-style="font-size: 28rpx">
<text class="searchBtn">搜索</text>
<input class="searchInput" type="text" v-model="searchText" placeholder="工单号、车牌号、手机号、客户姓名" placeholder-style="font-size: 28rpx">
<text class="searchBtn" @click="onRefresherrefresh">搜索</text>
<text class="searchBtn" @click="clearText">清空</text>
</view>
</view>
<view class="body">
@ -15,9 +16,13 @@
</view>
</view>
<view class="orderList">
<view v-for="(item, index) in orderList" :key="index" class="orderItem">
<order-card :order="item"></order-card>
</view>
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" bindscrolltolower="onReachBottom"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<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>
<tabBarVue msg="2"></tabBarVue>
@ -25,10 +30,17 @@
</template>
<script>
import request from '../../utils/request';
import VNavigationBar from '@/components/VNavigationBar.vue'
import tabBarVue from '@/components/tabBar/tabBar.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 {
components: {
@ -38,10 +50,14 @@ export default {
},
data() {
return {
searchText:"",
payShow: false,
activeKey: 0,
pageNum: 1,
totalPages: 0,
pageNo: 1,
pageSize: 10,
total: 0,
//
isTriggered:false,
imageUrl: '',
tabList: [
{
@ -50,153 +66,124 @@ export default {
},
{
id: 1,
title: '已完成'
title: '全部'
},
],
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() {
// this.orderList = []
// this.getList()
},
onReachBottom() {
if (this.pageNum >= this.totalPages) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
if(!getToken()){
uni.reLaunch({
url: '/pages/login/login'
})
} else {
this.pageNum++
this.getList()
}else{
//
this.userInfo = getUserInfo()
this.onRefresherrefresh()
}
},
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) {
case 0:
break;
case 1:
data.status = "06"
break;
case 2:
data.status = '00'
break
default:
break
//+1,
this.pageNo++
//
this.getOrderList()
},
/**
* 下拉刷新数据
*/
onRefresherrefresh(){
this.isTriggered = true
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) {
this.orderList = []
if(1==this.activeKey){
//
paramsObj['selectType'] = "all"
}
this.changeActive = false
await request({
url: '/userClient/order/page',
request({
url: '/admin-api/repair/tickets/pageType',
method: 'get',
params: data
params:paramsObj
}).then((res) => {
if (res.code === 200) {
this.orderList = this.orderList.concat(res.rows)
let total = res.total
this.totalPages = Math.ceil(total / this.pageSize);
console.log(res)
if (res.code == 200) {
let thisPageRecords = []
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) {
this.activeKey = id
this.changeActive = true
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) {
}
this.onRefresherrefresh()
},
gotoDetail(row) {
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>
@ -288,7 +270,9 @@ export default {
}
.orderList {
padding: 30rpx 0;
//padding: 30rpx 0;
padding-top: 10rpx;
height: calc(100% - 90rpx);
display: flex;
flex-direction: column;
row-gap: 20rpx;

BIN
static/images/nothing.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB