配件申请单

This commit is contained in:
Vinjor 2024-10-22 16:36:43 +08:00
parent 124492b152
commit 232d4095ba
6 changed files with 251 additions and 20 deletions

View File

@ -24,22 +24,32 @@
</view>
<!-- 维修工角色-->
<view class="body-card" v-if="userInfo.roleCodes.includes('repair_staff')">
<view class="title">审批单处理<text class="formValue">全部</text><u-icon color="#999" name="arrow-right" size="12"></u-icon></view>
<view class="title">审批单处理<text class="formValue" @click="workerTodo">全部</text><u-icon color="#999" name="arrow-right" size="12"></u-icon></view>
<view class="title-box">
<view class="title-box-item">
<view class="titleDesc">已提交</view>
<view class="titleNumber">4</view>
<view class="titleNumber">{{ workerNumObj.submitNum }}</view>
<image class="titleImg" src="@/pages-home/static/up.png" ></image>
</view>
<view class="title-box-item">
<view class="titleDesc">未通过</view>
<view class="titleNumber">1</view>
<view class="titleNumber">{{ workerNumObj.noAllowNum }}</view>
<image class="titleImg" src="@/pages-home/static/no.png" ></image>
</view>
<!-- <view class="title-box-item">-->
<!-- <view class="titleDesc">已通过</view>-->
<!-- <view class="titleNumber">{{ workerNumObj.allowNum }}</view>-->
<!-- <image class="titleImg" src="@/pages-home/static/alow.png" ></image>-->
<!-- </view>-->
<view class="title-box-item">
<view class="titleDesc">已通过</view>
<view class="titleNumber">6</view>
<image class="titleImg" src="@/pages-home/static/alow.png" ></image>
<view class="titleDesc">待确认领料</view>
<view class="titleNumber">{{ workerNumObj.waitingReceiveNum }}</view>
<image class="titleImg" src="@/pages-home/static/waitingReceiveNum.png" ></image>
</view>
<view class="title-box-item">
<view class="titleDesc">待确认退料</view>
<view class="titleNumber">{{ workerNumObj.waitingBackNum }}</view>
<image class="titleImg" src="@/pages-home/static/waitingBackNum.png" ></image>
</view>
</view>
</view>
@ -64,7 +74,7 @@
</text>
</view>
<view class="todoList">
<scroll-view scroll-y="true" class="itemContent" @scrolltolower="onReachBottomCus"
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<order-card v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @startWork="startWork"></order-card>
<view style="text-align: center" v-if="orderList.length==0">
@ -130,6 +140,14 @@ export default {
isTriggered:true,
orderList: [
],
//
workerNumObj:{
submitNum:0,
allowNum:0,
noAllowNum:0,
waitingReceiveNum:0,
waitingBackNum:0,
},
defaultAvatar: require('@/static/icons/avatar.png')
}
},
@ -153,6 +171,10 @@ export default {
//
this.userInfo = getUserInfo()
this.onRefresherrefresh()
if(this.userInfo.roleCodes.includes('repair_staff')){
//
this.getWorkerTodo()
}
}
},
methods: {
@ -226,6 +248,20 @@ export default {
console.error(error);
}
},
/**
* 维修工的角度查提交的配件申请单 待处理数量
*/
getWorkerTodo(){
request({
url: '/admin-api/repair/tw/getWorkerTodo',
method: 'get',
}).then((res) => {
console.log(res)
if (res.code == 200) {
this.workerNumObj = res.data
}
})
},
/**
* 查本人待处理工单
*/
@ -287,7 +323,12 @@ export default {
uni.navigateTo({
url: '/pages/my/myInfo'
})
}
},
workerTodo() {
uni.navigateTo({
url: '/pages-repair/applyList/applyList'
})
},
}
}
</script>
@ -484,6 +525,7 @@ export default {
.todoListBox {
margin: 40rpx 32rpx;
height: calc(100vh - 500rpx);
.title {
margin-bottom: 30rpx;
@ -507,7 +549,7 @@ export default {
display: flex;
flex-direction: column;
row-gap: 20rpx;
height: calc(100vh - 500rpx);
height: 98%;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -217,24 +217,49 @@ export default {
no:orderNo,
ticketId:this.ticketId,
type:"01",
repairId:this.userInfo.nickname,
repairName:this.userInfo.id,
repairId:this.userInfo.id,
repairName:this.userInfo.nickname,
}
if(this.selectedRepairList.length>0){
let itemList = []
this.selectedRepairList.map((item)=>{
itemList.push({
waresId:item.id,
waresName:item.name,
waresCount:item.num,
//
waresStatus:"02"
})
})
dataObj.items = itemList
}else{
uni.showToast({
title: '请选择配件!',
icon: 'none'
})
return
}
request({
url: '/admin-api/repair/tw/getAllTypeList',
method: 'get'
url: '/admin-api/repair/tw/newApplyOrder',
method: 'POST',
data:dataObj
}).then((res) => {
console.log(res)
if (res.code == 200 && res.data.length>0) {
res.data.map((item)=>{
this.tabs.push({
name:item.name,
value:item.id
if (res.code == 200) {
uni.showToast({
title: '提交成功!',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 700)
}else{
uni.showToast({
title: '提交失败!',
icon: 'none'
})
}
})
console.log('this.selectedRepairList', this.selectedRepairList)
},
/**
* 切换tab选中

View File

@ -0,0 +1,161 @@
<template>
<view class="container">
<VNavigationBar style="position: relative;z-index: 99;" backgroundColor="#fff" title-color="#000" title="申请单处理"></VNavigationBar>
<view class="body">
<view class="tabList">
<view v-for="(item, index) in tabList" :key="index" :class="{actived: item.id === activeKey}" class="tabItem"
@click.stop="changeTabFun(item.id)">
{{ item.title }}
<view v-if="activeKey === item.id" class="activeLine"></view>
</view>
</view>
<view class="orderList">
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<order-card v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @startWork="startWork"></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>
</template>
<script>
import VNavigationBar from '@/components/VNavigationBar.vue'
import tabBarVue from '@/components/tabBar/tabBar.vue'
import OrderCard from "@/components/applyCard.vue";
import request from '@/utils/request';
export default {
components: {
OrderCard,
tabBarVue,
VNavigationBar
},
data() {
return {
activeKey: 0,
pageNo: 1,
pageSize: 10,
total: 0,
//
isTriggered:false,
tabList: [
{
id: 0,
title: '已提交'
},
{
id: 1,
title: '未通过'
},
{
id: 2,
title: '已通过'
},
],
orderList: [
{
carNo: "川E795C0",
createTime: '2024-10-20 12:00',
ticketsStatus: '05',
remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你'
},
{
carNo: "川E795C1",
createTime: '2024-10-20 12:00',
ticketsStatus: '02',
remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你'
},
{
carNo: "川E795C2",
createTime: '2024-10-20 12:00',
ticketsStatus: '01',
remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你'
}
],
};
},
methods:{
changeTabFun(id) {
this.activeKey = id
this.onRefresherrefresh()
},
/**
* 下拉刷新数据
*/
onRefresherrefresh(){
this.isTriggered = true
this.pageNo = 1
this.total = 0
//this.orderList = []
this.getOrderList()
},
getOrderList(){
}
}
}
</script>
<style lang="less">
.container {
height: 100%;
background: #F3F5F7;
display: flex;
flex-direction: column;
color: #333333;
.body {
flex: 1;
height: 0;
padding: 24rpx 32rpx;
overflow: auto;
}
.tabList {
background: #FFFFFF;
border-radius: 12rpx 12rpx 12rpx 12rpx;
display: flex;
align-items: center;
padding: 0 40rpx;
.tabItem {
padding: 30rpx;
flex: 1;
z-index: 9999999;
text-align: center;
position: relative;
font-size: 28rpx;
&.actived {
color: #0174F6;
}
.activeLine {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 96rpx;
height: 6rpx;
background: #0174F6;
border-radius: 4rpx 4rpx 0rpx 0rpx;
}
}
}
.orderList {
//padding: 30rpx 0;
padding-top: 10rpx;
height: calc(100% - 90rpx);
display: flex;
flex-direction: column;
row-gap: 20rpx;
.stateImg {
}
}
}
</style>

View File

@ -76,6 +76,9 @@
}
],
};
},
onLoad(){
},
methods:{
changeTabFun(id) {