# Conflicts:
#	pages-order/orderDetail/orderDetail.vue
This commit is contained in:
Vinjor 2024-10-19 18:08:48 +08:00
commit 1f416af512
2 changed files with 106 additions and 16 deletions

View File

@ -16,7 +16,7 @@
</view> </view>
</template> </template>
</view> </view>
<view class="noReviewPart" @click="showReviewList()"> <view v-if="wares && wares.length>0" v-for="item in wares" class="noReviewPart" @click="showReviewList(item)">
<u-icon color="#E8A321" name="error-circle-fill" size="14"></u-icon> <u-icon color="#E8A321" name="error-circle-fill" size="14"></u-icon>
<text class="messageText">当前项目有待审批的配件申请单</text> <text class="messageText">当前项目有待审批的配件申请单</text>
<u-icon color="#E8A321" name="arrow-right" size="14"></u-icon> <u-icon color="#E8A321" name="arrow-right" size="14"></u-icon>
@ -278,6 +278,8 @@ export default {
iconColor: '#fff' iconColor: '#fff'
}, },
content: [], content: [],
//
wares:[],
sizeType:['compressed'], sizeType:['compressed'],
// //
fileList: [], fileList: [],
@ -361,7 +363,10 @@ export default {
} }
}, },
onShow(){ onShow(){
//
this.getOrderDetail() this.getOrderDetail()
//
this.waresByTicket()
}, },
methods: { methods: {
/** /**
@ -626,6 +631,22 @@ export default {
this.checkRoleOperate() this.checkRoleOperate()
}) })
}, },
/**
* 查询当前工单下的审批单
*/
waresByTicket(){
request({
url: '/admin-api/repair/tw/list',
method: 'get',
params:{ticketId:this.ticketId,status:'01'}
}).then((res)=>{
if (res.code == 200){
this.wares = res.data
}
})
},
/** /**
* 查当前维修的项目 * 查当前维修的项目
*/ */
@ -664,9 +685,13 @@ export default {
url: `/pages-order/choosePeople/choosePeople?type=${type}` url: `/pages-order/choosePeople/choosePeople?type=${type}`
}) })
}, },
showReviewList(projId) { /**
* 点击配件申请单提醒查看相关配件
* @param wareId
*/
showReviewList(formData) {
uni.navigateTo({ uni.navigateTo({
url: `/pages-order/reviewList/reviewList?projId=${projId}` url: '/pages-order/reviewList/reviewList?formData='+encodeURIComponent(JSON.stringify(formData))
}) })
} }
} }

View File

@ -1,21 +1,21 @@
<template> <template>
<view class="container"> <view class="container">
<VNavigationBar background-color="#fff" title="选择人员" title-color="#333"></VNavigationBar> <VNavigationBar background-color="#fff" title="配件申请" title-color="#333"></VNavigationBar>
<view class="body"> <view class="body">
<div class="userList"> <div class="userList">
<view v-for="item in list" :key="item.id" class="userItem"> <view v-for="item in twItem" :key="item.id" class="userItem">
<view class="info"> <view class="info">
<text class="name">{{ item.name }}</text> <text class="name">{{ item.waresName }}</text>
<text class="num">x{{ item.num }}</text> <text class="num">x{{ item.waresCount}}</text>
</view> </view>
<view class="info2"> <view class="info2">
<view class="info2-item"> <view class="info2-item">
<text class="label">配件分类</text> <text class="label">规格型号</text>
<text class="value">{{ item.typeName }}</text> <text class="value">{{ item.wares.model }}</text>
</view> </view>
<view class="info2-item"> <view class="info2-item">
<text class="label">当前库存</text> <text class="label">当前库存</text>
<text class="value">{{ item.count }}</text> <text class="value">{{ item.wares.stock }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -39,7 +39,7 @@
<view class="foot"> <view class="foot">
<view class="btn1" @click="noFun"> <view class="btn1" @click="noFun">
<image mode="aspectFit" src="/pages-order/static/dh.png" style="width: 32rpx;height: 32rpx"></image> <image mode="aspectFit" src="/pages-order/static/dh.png" style="width: 32rpx;height: 32rpx"></image>
取消审批 驳回
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="btn2" @click="yesFun"> <view class="btn2" @click="yesFun">
@ -52,7 +52,7 @@
<script> <script>
import VNavigationBar from '@/components/VNavigationBar.vue' import VNavigationBar from '@/components/VNavigationBar.vue'
import request from '@/utils/request';
export default { export default {
components: { components: {
VNavigationBar, VNavigationBar,
@ -65,23 +65,88 @@ export default {
{name: '刹车油DOT4', id: 3, typeName: '喷漆', num: 3, count: 35}, {name: '刹车油DOT4', id: 3, typeName: '喷漆', num: 3, count: 35},
], ],
show: false, show: false,
argument: '' argument: '',
twId:'',
//
twItem:[],
formData:{}
} }
}, },
onLoad(data) { onLoad(data) {
console.log('data', data) this.formData = JSON.parse(decodeURIComponent(data.formData))
this.listByTwId()
}, },
methods: { methods: {
/**
* 根据twId查询对应配件
*/
listByTwId(){
console.log(this.formData)
request({
url: '/admin-api/repair/twi/list',
method: 'get',
params:{twId:this.formData.id}
}).then((res)=>{
console.log(res.data,90)
if (res.code == 200){
this.twItem = res.data
}
})
},
close() { close() {
this.show = false this.show = false
}, },
open() {}, open() {},
noFun() { noFun() {
this.show = true this.handleAudit('05')
}, },
yesFun() { yesFun() {
this.handleAudit('02')
}, },
/**
* 审批接口
* @param flag"02:审批通过""05:驳回"
*/
handleAudit(flag){
this.formData['status'] = flag
//
this.formData.wares = [...this.twItem.map(item => {
return {
itemName: item.waresName,
itemCount: item.waresCount,
itemUnit: item.wares.unit,
itemPrice: item.wares.price,
repairIds: this.formData.repairId,
repairNames: this.formData.repairName,
saleId: this.formData.adviserId,
saleName: this.formData.adviserName,
itemDiscount: item.itemDiscount,
itemMoney: item.wares.price * item.waresCount,
partId: item.waresId,
remark: item.remark
}
})]
console.log(this.twItem,132)
request({
url: '/admin-api/repair/tw/audit',
method: 'post',
data:this.formData
}).then((res)=>{
if (res.code == 200){
uni.showToast({
title: '审批成功!',
icon: 'none'
})
setTimeout(()=>{
uni.navigateBack()
},700)
}
})
},
confirm() { confirm() {
this.show = false this.show = false
uni.navigateBack() uni.navigateBack()