This commit is contained in:
PQZ 2024-10-23 23:18:53 +08:00
commit 6090a17748
9 changed files with 659 additions and 74 deletions

View File

@ -1,16 +1,16 @@
<template>
<view class="orderCard" @click="viewDetail">
<view class="title">
{{ order.licenseNumber }} {{titleText}}
{{'配件申请单'==titleText?"【"+order.repairName+"】":""}} {{ order.licenseNumber }} {{titleText}}
</view>
<view class="desc">
{{'配件申请单'==titleText?'申请':'发起'}}时间{{formatTimestamp(order.createTime)}}
</view>
<view class="message red" v-if="order.status=='05'">
<view class="remark">
原因{{ order.remark }}
</view>
</view>
<!-- <view class="message red" v-if="order.status=='05'">-->
<!-- <view class="remark">-->
<!-- 原因{{ order.remark }}-->
<!-- </view>-->
<!-- </view>-->
<view v-if="'配件申请单'==titleText">
<image v-if="order.status=='05'" class="stateImg" src="@/pages-repair/static/weitongguo.png" ></image>
<image v-else-if="order.status=='01'" class="stateImg" src="@/pages-repair/static/daishenhe.png" ></image>

View File

@ -53,6 +53,13 @@
</view>
</view>
</view>
<!-- 服务顾问角色 -->
<view class="orderCount" v-if="userInfo.roleCodes.includes('service_advisor')" @click="serviceWork">
<view class="orderCountItem">
<text class="label">待审批配件申请单</text>
<text class="value">{{serviceNum}}</text>
</view>
</view>
<!-- TODO 总检角色 -->
<view class="orderCount" v-if="userInfo.roleCodes.includes('general_inspection') || userInfo.roleCodes.includes('weixiu')">
<view class="orderCountItem">
@ -148,6 +155,8 @@ export default {
waitingReceiveNum:0,
waitingBackNum:0,
},
//
serviceNum:0,
defaultAvatar: require('@/static/icons/avatar.png')
}
},
@ -174,6 +183,9 @@ export default {
if(this.userInfo.roleCodes.includes('repair_staff')){
//
this.getWorkerTodo()
}else if(this.userInfo.roleCodes.includes('service_advisor')){
//
this.getServiceTodo()
}
}
},
@ -262,6 +274,27 @@ export default {
}
})
},
/**
* 服务顾问的角度查待处理的配件申请单数量
*/
getServiceTodo(){
let params = {
pageNo:this.pageNo,
pageSize:this.pageSize,
type:"01",
status:"01"
}
request({
url: '/admin-api/repair/tw/page',
method: 'get',
params:params
}).then((res) => {
console.log(res)
if (res.code == 200) {
this.serviceNum = res.data.total
}
})
},
/**
* 查本人待处理工单
*/
@ -329,6 +362,14 @@ export default {
url: '/pages-repair/applyList/applyList'
})
},
/**
* 服务顾问待办
*/
serviceWork(){
uni.navigateTo({
url: '/pages-home/service/applyList'
})
}
}
}
</script>

View File

@ -0,0 +1,226 @@
<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" :titleText="(0==activeKey || 1==activeKey)?'配件申请单':(2==activeKey)?'领料单':'退料单'" :key="index" :order="item" @childEvent="viewDetail" ></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';
import {getUserInfo} from '@/utils/auth';
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: '所有'
}
],
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: ''
// }
],
userInfo:null,
};
},
onLoad(){
this.userInfo = getUserInfo()
console.log(this.userInfo)
},
onShow(){
this.onRefresherrefresh()
},
methods:{
changeTabFun(id) {
this.activeKey = id
this.onRefresherrefresh()
},
/**
* 上滑加载数据
*/
onReachBottomCus() {
// *
if (this.pageNo * this.pageSize >= this.total) {
uni.$u.toast('没有更多数据了')
return
}
//+1,
this.pageNo++
//
this.getOrderList()
},
/**
* 下拉刷新数据
*/
onRefresherrefresh(){
this.isTriggered = true
this.pageNo = 1
this.total = 0
this.orderList = []
this.getOrderList()
},
/**
* 查看申请单详情
*/
viewDetail(item){
if(0==this.activeKey){
//
uni.navigateTo({
url: '/pages-home/service/todoDetail?canOperate=true&id='+item.id
})
}else if(1==this.activeKey){
//
uni.navigateTo({
url: '/pages-home/service/todoDetail?id='+item.id
})
}
},
/**
* 查数据
*/
getOrderList(){
let url="/admin-api/repair/tw/page"
let params = {
pageNo:this.pageNo,
pageSize:this.pageSize,
type:"01"
}
if(0==this.activeKey){
//
params.status="01"
}
request({
url: url,
method: 'get',
params:params
}).then((res) => {
if (res.code == 200) {
if(res.data.records.length > 0){
if (this.pageNo != 1) {
this.orderList = this.orderList.concat(res.data.records)
} else {
this.orderList = res.data.records
}
}
//
this.total = res.data.total
this.isTriggered = false
}
})
}
}
}
</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

@ -0,0 +1,279 @@
<template>
<view class="container">
<VNavigationBar background-color="#fff" :title="title" title-color="#333"></VNavigationBar>
<view class="body">
<view class="repairInfo">
<view class="header">
配件信息
</view>
<view class="repairItem" v-for="(item, index) in repairList" :key="index">
<view class="repairName">{{ item.waresName }} <text class="repairNum">×{{item.waresCount}}</text></view>
<view class="grid">
<view style="grid-area: a" class="girdItem">
<text class="label">配件分类</text>
<text class="value">{{ item.typeName }}</text>
</view>
<view style="grid-area: b" class="girdItem">
<text class="label">当前库存</text>
<text class="value">{{ item.wares.stock }}</text>
</view>
<view style="grid-area: c" class="girdItem">
<text class="label">单位</text>
<text class="value">{{ item.wares.unit }}</text>
</view>
<view style="grid-area: d" class="girdItem">
<text class="label">编码</text>
<text class="value">{{ item.wares.code || ""}}</text>
</view>
</view>
</view>
</view>
</view>
<view v-if="canOperate" class="footer">
<view class="no" @click="confirmOpe('no')">
{{ backText }}
</view>
<view class="yes" @click="confirmOpe('yes')">
{{ yesText }}
</view>
</view>
</view>
</template>
<script>
import VNavigationBar from "@/components/VNavigationBar.vue";
import request from '@/utils/request';
import {getDictTextByCodeAndValue} from "@/utils/utils";
export default {
components: {
VNavigationBar
},
data() {
return {
viewType:"",
id:"",
title:"",
canOperate:false,
backText:"",
yesText:"",
repairList: [
// {
// name: '7',
// num: 3,
// type: '',
// unit: '',
// total: 35,
// code: 'XCQHCJYS7 SPI SP 5W30 4L'
// },
// {
// name: '7',
// num: 3,
// type: '',
// unit: '',
// total: 35,
// code: 'XCQHCJYS7 SPI SP 5W30 4L'
// }
]
};
},
onLoad(data){
this.canOperate = data.canOperate
this.id = data.id
this.getDetail()
},
methods:{
getDetail(){
let url;
let params={};
this.title = "配件申请单详情"
//
url = "/admin-api/repair/twi/list"
params.twId = this.id
this.yesText="审批通过"
this.backText="驳回"
request({
url: url,
method: 'get',
params:params
}).then((res) => {
if (res.code == 200) {
res.data.map((item)=>{
getDictTextByCodeAndValue("repair_unit",item.wares.unit).then(value => {
item.wares.unit = value
}).catch(error => {
item.wares.unit = "未知"
console.error(error);
});
})
this.repairList = res.data
}
})
},
confirmOpe(type){
let url = '/admin-api/repair/tw/audit'
let dataObj={
id:this.id,
type:"01",
status:"yes"==type?"02":"05"
}
request({
url: url,
method: 'POST',
data:dataObj
}).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '审批成功!',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 700)
}
})
},
}
}
</script>
<style lang="less" scoped>
.container {
height: 100%;
background: #F3F5F7;
display: flex;
flex-direction: column;
}
.body {
flex: 1;
height: 0;
overflow: auto;
.todoInfo {
margin: 20rpx 32rpx;
background-color: #fff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
padding: 30rpx;
.todoName {
font-weight: bold;
font-size: 32rpx;
color: #333333;
margin-bottom: 16rpx;
}
.todoDate {
font-size: 24rpx;
color: #858BA0;
margin-bottom: 30rpx;
}
.line {
height: 1rpx;
background-color: #DDDDDD;
margin: 30rpx 0;
}
.grid {
display: grid;
grid-template-areas:
'a b'
'c c';
gap: 20rpx;
.gridItem {
display: flex;
flex-direction: column;
row-gap: 10rpx;
font-size: 28rpx;
.gridItemLabel {
color: #858BA0;
}
.gridItemValue {
color: #333333;
}
}
}
}
.repairInfo {
margin: 20rpx 32rpx;
background-color: #fff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
.header {
padding: 30rpx;
border-bottom: 1rpx solid #DDDDDD;
}
.repairItem {
padding: 30rpx;
border-bottom: 1rpx solid #DDDDDD;
&:last-child {
border-bottom: none;
}
}
.repairName {
display: flex;
align-items: center;
column-gap: 20rpx;
font-size: 32rpx;
color: #333333;
margin-bottom: 30rpx;
.repairNum {
font-size: 28rpx;
color: #0174F6;
}
}
.grid {
display: grid;
grid-template-areas:
'a b'
'c d';
grid-template-columns: 1fr 1fr;
gap: 30rpx;
.girdItem {
display: flex;
flex-direction: column;
row-gap: 12rpx;
font-size: 28rpx;
.label {
color: #858BA0;
}
.value {
color: #333333;
}
}
}
}
}
.footer {
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 32rpx;
.yes, .no {
width: 310rpx;
height: 76rpx;
border-radius: 38rpx 38rpx 38rpx 38rpx;
display: flex;
align-items: center;
justify-content: center;
column-gap: 10rpx;
}
.yes {
background: #0174F6;
color: #FFFFFF;
}
.no {
border: 2rpx solid #858BA0;
color: #858BA0;
}
}
</style>

View File

@ -56,7 +56,7 @@
import VNavigationBar from '@/components/VNavigationBar.vue'
import {bus} from "@/utils/eventBus";
import request from '@/utils/request';
import {getDictTextByCodeAndValue} from "@/utils/utils";
import {getDictTextByCodeAndValue,saveTicketsRecords} from "@/utils/utils";
export default {
components: {
@ -73,7 +73,8 @@ export default {
type: "",
sgIds: [], //
sgNames : [],
projectId: ''
projectId: '',
itemId:"",
}
},
onLoad(data) {
@ -87,6 +88,10 @@ export default {
//2
this.ifDetail = true
}
if (data.itemId) {
//2
this.itemId = data.itemId
}
if (data.type) {
this.type = data.type
if (data.type == 'xs') {
@ -206,7 +211,7 @@ export default {
this.sgIds = arr
this.sgNames = nameArr
},
submit() {
async submit() {
if (this.type == 'sg') {
if (this.sgIds.length == 0) {
uni.showToast({
@ -285,6 +290,8 @@ export default {
})
setTimeout(() => {
if (this.ifDetail) {
//
saveTicketsRecords(this.ticketId, '03',this.itemId,"03","sgwczj","维修完成移交下一班组维修","","01",this.checkedUserName);
uni.navigateBack({
delta: 2 // 2
})

View File

@ -122,14 +122,14 @@
<view class="projEditLine1">
<text>{{ item.itemName }}</text>
<text v-if="loginUser.roleCodes.includes('weixiu') || loginUser.roleCodes.includes('service_advisor')||loginUser.roleCodes.includes('general_inspection')" class="projAmount">{{ item.itemMoney }}</text>
<text v-if="canSeeMoney" class="projAmount">{{ item.itemMoney }}</text>
</view>
<view class="projBaseInfo" v-if="loginUser.roleCodes.includes('weixiu') || loginUser.roleCodes.includes('service_advisor')||loginUser.roleCodes.includes('general_inspection')" >
<view>售价{{ item.itemPrice || "" }}</view>
<view v-if="canSeeMoney">售价{{ item.itemPrice || "" }}</view>
<view>数量{{ item.itemCount || "" }}</view>
<!-- <view>单位{{ item.itemUnit}}</view>-->
<view>折扣{{ item.itemDiscount || "" }}</view>
<view>金额{{ item.itemMoney || "" }}</view>
<view v-if="canSeeMoney">折扣{{ item.itemDiscount || "" }}</view>
<view v-if="canSeeMoney">金额{{ item.itemMoney || "" }}</view>
</view>
<view class="projEditFoot">
<view class="block1">
@ -180,14 +180,14 @@
<view class="projEditLine1">
<text>{{ item.itemName }}</text>
<text class="projAmount">{{ item.itemMoney }}</text>
<text v-if="canSeeMoney" class="projAmount">{{ item.itemMoney }}</text>
</view>
<view class="projBaseInfo">
<view>售价{{ item.itemPrice || "" }}</view>
<view v-if="canSeeMoney">售价{{ item.itemPrice || "" }}</view>
<view>数量{{ item.itemCount || "" }}</view>
<view>单位{{ item.itemUnit || ""}}</view>
<view>折扣{{ item.itemDiscount || "" }}</view>
<view>金额{{ item.itemMoney || "" }}</view>
<view v-if="canSeeMoney">折扣{{ item.itemDiscount || "" }}</view>
<view v-if="canSeeMoney">金额{{ item.itemMoney || "" }}</view>
</view>
</view>
</template>
@ -297,64 +297,67 @@ export default {
},
//
canOpenCus:false,
//
canSeeMoney:false,
//:working-|done_half-|done-
nowChooseOperate:"",
carInfo: {},
userInfo: {},
loginUser:{},
selectedProj: [
{
projName: '清洗内饰',
amount: '280',
date: '2024-10-20 12:00',
desc: '车辆已到维修厂,工作人员正准备开始维修',
imageList: [{filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}],
isSend: true,
//
examinePart: [],
id: 'projId1',
//
salesman: [
{
name: '魏书豪',
id: '11111'
}
],
//
constructor: []
},
{
projName: '清洗内饰',
amount: '280',
date: '2024-10-20 12:00',
desc: '车辆已到维修厂,工作人员正准备开始维修',
imageList: [{filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}],
isSend: false,
//
hasNoReviewPart: false,
id: 'projId2',
salesman: [],
constructor: []
},
{
projName: '清洗内饰',
amount: '280',
date: '2024-10-20 12:00',
desc: '车辆已到维修厂,工作人员正准备开始维修',
imageList: [],
isSend: false,
//
hasNoReviewPart: true,
id: 'projId3',
salesman: [],
constructor: []
}
// {
// projName: '',
// amount: '280',
// date: '2024-10-20 12:00',
// desc: '',
// imageList: [{filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}],
// isSend: true,
// //
// examinePart: [],
// id: 'projId1',
// //
// salesman: [
// {
// name: '',
// id: '11111'
// }
// ],
// //
// constructor: []
// },
// {
// projName: '',
// amount: '280',
// date: '2024-10-20 12:00',
// desc: '',
// imageList: [{filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}],
// isSend: false,
// //
// hasNoReviewPart: false,
// id: 'projId2',
// salesman: [],
// constructor: []
// },
// {
// projName: '',
// amount: '280',
// date: '2024-10-20 12:00',
// desc: '',
// imageList: [],
// isSend: false,
// //
// hasNoReviewPart: true,
// id: 'projId3',
// salesman: [],
// constructor: []
// }
],
submitData:[]
};
},
onLoad(data) {
this.loginUser = getUserInfo()
this.canSeeMoney = !this.loginUser.roleCodes.includes('repair_staff');
console.log(this.loginUser,294)
console.log(data)
if (data.id) {
@ -414,10 +417,14 @@ export default {
let fileStr = this.fileList.map(item=>item.url.replace(config.baseImageUrl,"")).join(",")
if("working"==this.nowChooseOperate){
//
const result = await saveTicketsRecords(this.ticketInfo.id,null,null,null,"sgz","施工中拍照记录",fileStr);
}else if("done_half"==this.nowChooseOperate || "done"==this.nowChooseOperate){
const result = await saveTicketsRecords(this.ticketInfo.id,null,this.nowRepair.repairItemId,null,"sgz","施工中拍照记录",fileStr,"","");
}else if("done_half"==this.nowChooseOperate){
//
const result = await saveTicketsRecords(this.ticketInfo.id, '03',this.nowRepair.repairItemId,"03","sgwczj","阶段完成",fileStr);
const result = await saveTicketsRecords(this.ticketInfo.id, '03',this.nowRepair.repairItemId,"03","sgwczj","阶段完成",fileStr,"","");
}else if("done"==this.nowChooseOperate){
//
const result = await saveTicketsRecords(this.ticketInfo.id, '03',this.nowRepair.repairItemId,"03","sgwczj","维修完成移交总检",fileStr,"02","");
//
}
this.$refs.popup.close()
uni.showToast({
@ -425,13 +432,20 @@ export default {
icon: 'none'
})
if("done"==this.nowChooseOperate){
//
//
setTimeout(() => {
uni.navigateBack()
},500)
}
if("other"==this.nowChooseOperate){
//
setTimeout(()=>{
uni.navigateTo({
url: '/pages-order/choosePeople/choosePeople?id=' + this.ticketInfo.id +'&ifDetail=true'
url: '/pages-order/choosePeople/choosePeople?id=' + this.ticketInfo.id+'&itemId='+this.nowRepair.repairItemId +'&ifDetail=true'
})
},500)
}
console.error("result",result);
} catch (error) {
console.error(error);
@ -470,7 +484,10 @@ export default {
text: '阶段完成', active: false,code:"done_half"
})
this.content.push({
text: '全部完成', active: false,code:"done"
text: '项目完成', active: false,code:"other"
})
this.content.push({
text: '移交总检', active: false,code:"done"
})
//
this.selectNowRepair()
@ -491,8 +508,8 @@ export default {
console.log(e)
this.content[e.index].active = !e.item.active
this.nowChooseOperate = e.item.code
if("working"==e.item.code || "done_half"==e.item.code || "done"==e.item.code){
//
if("working"==e.item.code || "done_half"==e.item.code || "done"==e.item.code || "other"==e.item.code){
//
this.fileList=[]
this.$refs.popup.open("bottom")
}else if("start" == e.item.code){
@ -572,7 +589,6 @@ export default {
async startWorkRequest(id,ticketsWorkStatus,itemId,itemStatus,recordType,remark){
try {
const result = await saveTicketsRecords(id,ticketsWorkStatus,itemId,itemStatus,recordType,remark,null);
debugger
//
this.getOrderDetail()
} catch (error) {

View File

@ -88,7 +88,7 @@
console.log(this.userInfo)
},
onShow(){
this.getOrderList()
this.onRefresherrefresh()
},
methods:{
changeTabFun(id) {

View File

@ -122,6 +122,18 @@
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "service/applyList",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "service/todoDetail",
"style": {
"navigationBarTitleText": ""
}
}
]
},

View File

@ -88,8 +88,10 @@ export function getDictByCode(dictCode){
* @param recordType 操作类型 对应后端枚举RecordTypeEnum
* @param remark 备注
* @param image 图片相对路径多个英文逗号隔开
* @param finishType 完成类型 01完成并移交下一班组02完成并移交总检03完成工单
* @param nextName 下一班组名称
*/
export function saveTicketsRecords(id,ticketsWorkStatus,itemId,itemStatus,recordType,remark,image){
export function saveTicketsRecords(id,ticketsWorkStatus,itemId,itemStatus,recordType,remark,image,finishType,nextName){
return new Promise((resolve, reject) => {
let dataObj = {
id: id,
@ -97,6 +99,8 @@ export function saveTicketsRecords(id,ticketsWorkStatus,itemId,itemStatus,record
item: {id: itemId, itemStatus: itemStatus},
recordType: recordType,
remark: remark,
finishType:finishType,
nextName:nextName,
image: image
}
request({