工单列表页
This commit is contained in:
parent
a6669bf480
commit
3ecaab7b2b
@ -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 {
|
||||
|
@ -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({
|
||||
|
@ -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) {
|
||||
|
@ -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, // 时间戳,从1970年1月1日00:00:00至今的秒数,即当前的时间
|
||||
nonceStr: ress.data.nonceStr, // 随机字符串,长度为32个字符以下。
|
||||
package: ress.data.package, // 统一下单接口返回的 prepay_id 参数值,格式如“prepay_id=*”
|
||||
signType: ress.data.signType, // 签名算法类型,默认为 MD5,支持RSA等其他加密算法
|
||||
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) {
|
||||
// 在H5平台下,tempFilePath 为 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
BIN
static/images/nothing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
Loading…
Reference in New Issue
Block a user