1
This commit is contained in:
parent
8ae8ea78b8
commit
6141b7de1b
@ -22,7 +22,7 @@
|
||||
<text>搜索</text>
|
||||
</view>
|
||||
<view class="body-top-tab">
|
||||
<view v-for="(item, index) in tabList" :key="index" :class="{ active: active === index }"
|
||||
<view v-for="(item, index) in tabList" @click="activeTab(index)" :key="index" :class="{ active: active === index }"
|
||||
class="body-top-tab-item">
|
||||
{{ item.name }}
|
||||
<view v-if="index === active" class="activeLine"></view>
|
||||
@ -34,28 +34,23 @@
|
||||
<scroll-view :refresher-triggered="isTriggered" @scrolltolower="onReachBottomCus" class="itemContent"
|
||||
refresher-enabled
|
||||
scroll-y="true" style="height: 100%" @refresherrefresh="onRefresherrefresh">
|
||||
<view v-for="(item, index) in orderList" :key="index" class="orderItem">
|
||||
<view v-for="(item, index) in ticketWares" :key="index" class="orderItem">
|
||||
<view class="order-top">
|
||||
<view class="order-top-left">
|
||||
<text class="order-top-name">{{ '牟科宇的配件审批单' }}</text>
|
||||
<text class="order-top-date">{{ '2024-10-20 12:00' }}</text>
|
||||
<text class="order-top-name">{{ item.repairName+'的配件申请单' }}</text>
|
||||
<text class="order-top-date">{{ item.createTimeStr }}</text>
|
||||
</view>
|
||||
<text class="order-status">{{ '待审批' }}</text>
|
||||
<text class="order-status">{{ item.statusStr }}</text>
|
||||
</view>
|
||||
<view class="order-content">
|
||||
<view>
|
||||
客户信息:{{ '张三' }} {{ '157****6879' }}
|
||||
申请人:{{ item.repairName }}
|
||||
</view>
|
||||
<view>
|
||||
车牌号:{{ '川A 184AO1' }}
|
||||
</view>
|
||||
<view>
|
||||
车辆信息:{{ '一汽奥迪 2024款 A6L' }}
|
||||
服务顾问:{{ item.adviserName }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-remark">
|
||||
原因:当前库存炫驰全合成机油S7 4L/ALL数量不足
|
||||
</view>
|
||||
|
||||
<view class="order-footer">
|
||||
<template>
|
||||
<view class="order-btn no">拒绝审批</view>
|
||||
@ -67,9 +62,7 @@
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<!--<order-card v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh"-->
|
||||
<!-- @startWork="startWork"></order-card>-->
|
||||
<view v-if="orderList.length==0" style="text-align: center">
|
||||
<view v-if="ticketWares.length==0" style="text-align: center">
|
||||
<image class="" src="@/static/images/nothing.png"></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@ -86,7 +79,13 @@ import OrderCard from "@/components/orderCard.vue";
|
||||
import config from '@/config'
|
||||
import request from '@/utils/request';
|
||||
import {builderOrder, formatTimestamp, saveTicketsRecords} from "@/utils/utils";
|
||||
import {getToken, getUserInfo} from '@/utils/auth'
|
||||
import {
|
||||
getToken,
|
||||
getUserInfo,
|
||||
getStrData,
|
||||
getTenantId
|
||||
} from '@/utils/auth'
|
||||
import {getDictTextByCodeAndValue,formatDate} from "@/utils/utils";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -96,46 +95,44 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabList: [
|
||||
{
|
||||
name: '领配件'
|
||||
},
|
||||
{
|
||||
name: '退配件'
|
||||
},
|
||||
],
|
||||
//配件单查询条件
|
||||
queryParams:{
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
query: null,
|
||||
type: "01",
|
||||
},
|
||||
//配件单列表
|
||||
ticketWares:[],
|
||||
//数量
|
||||
total: 0,
|
||||
//下拉刷新状态
|
||||
isTriggered: false,
|
||||
|
||||
imgUrlPrex: config.baseImageUrl,
|
||||
userInfo: {
|
||||
avatar: undefined,
|
||||
nickname: ''
|
||||
},
|
||||
tabList: [
|
||||
{
|
||||
name: '待审批'
|
||||
},
|
||||
{
|
||||
name: '未通过'
|
||||
},
|
||||
{
|
||||
name: '已审批'
|
||||
}
|
||||
],
|
||||
|
||||
active: 0,
|
||||
menuList: [
|
||||
{
|
||||
title: '新建工单',
|
||||
desc: '直接添加客户订单',
|
||||
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'
|
||||
}
|
||||
],
|
||||
|
||||
bannerIndex: 0,
|
||||
shopList: [],
|
||||
bannerList: [],
|
||||
richTextHtml: null,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered: false,
|
||||
|
||||
|
||||
orderList: [
|
||||
{
|
||||
orderNo: '1209840149750105501',
|
||||
@ -162,9 +159,10 @@ export default {
|
||||
})
|
||||
} else {
|
||||
if (!this.$msgSocket) {
|
||||
// this.$startMsgSocket(getTenantId(), getStrData("userId"))
|
||||
this.$startMsgSocket(getTenantId(), getStrData("userId"))
|
||||
}
|
||||
}
|
||||
this.onRefresherrefresh()
|
||||
},
|
||||
onShow() {
|
||||
if (!getToken()) {
|
||||
@ -177,128 +175,71 @@ export default {
|
||||
nickname: '用户',
|
||||
roleNames: '角色'
|
||||
}
|
||||
// this.onRefresherrefresh()
|
||||
this.onRefresherrefresh()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
onReachBottomCus() {
|
||||
//判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕
|
||||
if (this.pageNo * this.pageSize >= this.total) {
|
||||
uni.$u.toast('没有更多数据了')
|
||||
return
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.pageNo++
|
||||
//此处调用自己获取数据列表的方法
|
||||
this.getOrderList()
|
||||
activeTab(index){
|
||||
this.active = index
|
||||
this.queryParams.type = 1==index?'01':'02'
|
||||
this.onRefresherrefresh()
|
||||
},
|
||||
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh() {
|
||||
this.isTriggered = true
|
||||
this.pageNo = 1
|
||||
this.queryParams.pageNo = 1
|
||||
this.total = 0
|
||||
this.orderList = []
|
||||
this.getOrderList()
|
||||
this.ticketWares = []
|
||||
this.getTicketWares()
|
||||
},
|
||||
/**
|
||||
* 开始施工
|
||||
* 配件单查询
|
||||
*/
|
||||
startWork(id) {
|
||||
let paramsObj = {ticketId: id}
|
||||
//先查当前用户在本工单下有几个维修项目
|
||||
getTicketWares(){
|
||||
request({
|
||||
url: '/admin-api/repair/titem/listProject',
|
||||
url: '/admin-api/repair/tw/page',
|
||||
method: 'get',
|
||||
params: paramsObj
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 200 && res.data.length > 0) {
|
||||
if (res.data.length == 1) {
|
||||
//只有1个,直接开始施工
|
||||
this.startWorkRequest(id, "02", res.data[0].id, "02", "kssg", "开始施工")
|
||||
} else {
|
||||
uni.showActionSheet({
|
||||
itemList: res.data.map(m => m.itemName),
|
||||
success: ({
|
||||
tapIndex
|
||||
}) => {
|
||||
this.startWorkRequest(id, "02", res.data[tapIndex].id, "02", "kssg", "开始施工")
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '操作失败,请联系管理员',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 开始施工请求后台
|
||||
*/
|
||||
async startWorkRequest(id, ticketsWorkStatus, itemId, itemStatus, recordType, remark) {
|
||||
try {
|
||||
const result = await saveTicketsRecords(id, ticketsWorkStatus, itemId, itemStatus, recordType, remark, null);
|
||||
console.error("result", result);
|
||||
this.onRefresherrefresh()
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 查本人待处理工单
|
||||
*/
|
||||
getOrderList() {
|
||||
let paramsObj = {pageNo: this.pageNo, pageSize: this.pageSize, isFinish: "0"}
|
||||
request({
|
||||
url: '/admin-api/repair/tickets/pageType',
|
||||
method: 'get',
|
||||
params: paramsObj
|
||||
}).then((res) => {
|
||||
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 = builderOrder(order)
|
||||
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页数据
|
||||
params: this.queryParams
|
||||
}).then((res)=>{
|
||||
console.log(res,187)
|
||||
if (res.code == 200){
|
||||
this.ticketWares = res.rows
|
||||
this.total = res.total
|
||||
if (this.pageNo != 1) {
|
||||
this.orderList = this.orderList.concat(thisPageRecords)
|
||||
this.ticketWares = this.ticketWares.concat(res.rows)
|
||||
} else {
|
||||
this.orderList = thisPageRecords
|
||||
this.ticketWares = res.rows
|
||||
}
|
||||
//将获取的总条数赋值
|
||||
this.total = res.data.total
|
||||
this.ticketWares.map((item) => {
|
||||
item.statusStr = getDictTextByCodeAndValue('ticket_wares_status', item.status)
|
||||
item.createTimeStr = formatDate(item.createTime)
|
||||
})
|
||||
this.isTriggered = false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
onReachBottomCus() {
|
||||
//判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕
|
||||
if (this.queryParams.pageNo * this.queryParams.pageSize >= this.total) {
|
||||
uni.$u.toast('没有更多数据了')
|
||||
return
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.queryParams.pageNo++
|
||||
//此处调用自己获取数据列表的方法
|
||||
this.getTicketWares()
|
||||
},
|
||||
|
||||
|
||||
|
||||
gotoPage(menu) {
|
||||
uni.navigateTo({
|
||||
url: menu.path
|
||||
|
@ -162,10 +162,18 @@
|
||||
this.getIdLeader()
|
||||
}
|
||||
this.getStaffInfo(res.data.userinfo.id)
|
||||
//跳转首页
|
||||
uni.navigateTo({
|
||||
url: '/pages-home/home/home'
|
||||
})
|
||||
if (res.data.userinfo.roleCodes.includes("repair_warehouse")){
|
||||
//跳转首页
|
||||
uni.navigateTo({
|
||||
url: '/pages-warehouse/home/home'
|
||||
})
|
||||
} else {
|
||||
//跳转首页
|
||||
uni.navigateTo({
|
||||
url: '/pages-home/home/home'
|
||||
})
|
||||
}
|
||||
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
|
Loading…
Reference in New Issue
Block a user