Commit d5541fa1 authored by Facius's avatar Facius

详情页面配件数量

parent 51e5d884
...@@ -189,8 +189,10 @@ let orderApiFun = function(vm){ ...@@ -189,8 +189,10 @@ let orderApiFun = function(vm){
// 备件仓列表 // 备件仓列表
let reserveList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/items/reserve', params); let reserveList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/items/reserve', params);
// 配件物流 // 配件物流
let getLogistics = async (orderId) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token+ '/orders/'+ orderId +'/express',{}, formType); let getLogistics = async (orderId) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders/'+ orderId +'/express',{}, formType);
// 配件申请单-数量统计
let getOrderPartsSum = async (orderId) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/' + orderId +'/sum',{}, formType);
const orderApi = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
listOrderCount, listOrderCount,
...@@ -238,7 +240,8 @@ let orderApiFun = function(vm){ ...@@ -238,7 +240,8 @@ let orderApiFun = function(vm){
applyList, applyList,
returnedParts, returnedParts,
reserveList, reserveList,
getLogistics getLogistics,
getOrderPartsSum
} }
return orderApi return orderApi
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
</view> </view>
<view :class="['text-content', item.type]">{{item.label}}</view> <view :class="['text-content', item.type]">{{item.label}}</view>
</u-button> </u-button>
<view v-if="item.count && item.count > 0" class="bradge-vidw">{{item.count}}</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -116,10 +117,11 @@ ...@@ -116,10 +117,11 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 0 30rpx 44rpx 30rpx; padding: 0 30rpx 44rpx 30rpx;
.button-view { .button-view {
max-width: 600rpx; max-width: 600rpx;
display: flex; display: flex;
position: relative;
&.image {} &.image {}
&.text { &.text {
...@@ -173,6 +175,21 @@ ...@@ -173,6 +175,21 @@
} }
} }
} }
} .bradge-vidw {
height: 24rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
position: absolute;
top: -10rpx;
right: 4rpx;
border: 2rpx solid #FA5A49;
color: #FA5A49;
font-size: 16rpx;
line-height: 24rpx;
text-align: center;
min-width: 36rpx;
z-index: 1;
}
}
} }
</style> </style>
<template> <template>
<u-popup v-model="show" mode="bottom" safe-area-inset-bottom width="690rpx" :mask-close-able="flase" close-icon-color="#FFFFFF" height="80%"> <u-popup v-model="show" mode="center" safe-area-inset-bottom width="690rpx" :mask-close-able="flase" close-icon-color="#FFFFFF" height="80%">
<!-- 申请列表 --> <!-- 申请列表 -->
<view class="apply-list-view"> <view class="apply-list-view">
<view class="colse-view"> <view class="colse-view">
......
...@@ -161,8 +161,8 @@ ...@@ -161,8 +161,8 @@
}, },
handleOperate(info) { handleOperate(info) {
// 调接口 // 调接口
// 修改info的status
// 刷新页面 // 跳到全部、刷新页面
}, },
handleClickCell(info) { handleClickCell(info) {
var pages = getCurrentPages(); var pages = getCurrentPages();
......
...@@ -138,7 +138,8 @@ ...@@ -138,7 +138,8 @@
// 渐变色 // 渐变色
}, },
visible: false, visible: false,
orderId: null, // orderId: null,
orderId: 11880366, // 测试数据
order: {}, order: {},
needPhotograph: true, // 需要现场拍摄 needPhotograph: true, // 需要现场拍摄
orderRecords: [], orderRecords: [],
...@@ -178,6 +179,12 @@ ...@@ -178,6 +179,12 @@
}, },
buttons() { buttons() {
//id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 配件申请 //id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 配件申请
// label: 按钮文字,
// type: 'image' 上图片下文字;'text' 纯文字,
// image: 图片名,
// show: 是否显示,
// disabled: 是 禁用;否 正常,
// id: 区分各个按钮
return [{ return [{
label: '过程反馈', label: '过程反馈',
type: 'image', type: 'image',
...@@ -208,6 +215,7 @@ ...@@ -208,6 +215,7 @@
image: 'xiancahngpaizhao.png', image: 'xiancahngpaizhao.png',
show: this.allowFeedback, show: this.allowFeedback,
disabled: false, disabled: false,
count: 3,
id: 4 id: 4
}, },
{ {
...@@ -340,6 +348,7 @@ ...@@ -340,6 +348,7 @@
} else { } else {
this.loadOrderRecord() // 履约记录 this.loadOrderRecord() // 履约记录
this.getSignDistance() // 定位 this.getSignDistance() // 定位
this.getOrderPartsSum()
} }
}, },
onShow() { onShow() {
...@@ -454,6 +463,17 @@ ...@@ -454,6 +463,17 @@
} }
}); });
}, },
getOrderPartsSum() { // 获取订单配件数量
this.$u.api.getOrderPartsSum(this.orderId).then((res) => {
if (res.code == 200) {
if (res.data) {
this.buttons[3].count = res.data.totalPartCount
}
} else {
console.log(res.message)
}
});
},
getSignDistance(){ getSignDistance(){
let self = this let self = this
var data={} var data={}
...@@ -636,17 +656,17 @@ ...@@ -636,17 +656,17 @@
} }
}, },
async handleApplyParts() { // 点击了配件申请按钮 async handleApplyParts() { // 点击了配件申请按钮
let res = await this.$u.api.applyList({ if (this.buttons[3].count > 0) { // 已经有配件,弹出配件列表
'pageSize': 1000,
'pageNumbr': 1,
'status': -1, // -1 全部,0 新申请,15 待收件,30 待返件,31 返件中
'workOrderId': this.order.orderId
})
if(res && res.code == 200) {
this.partsList = res.data
}
if (this.partsList.length > 0) { // 已经有配件,弹出配件列表
this.showApplyList = true this.showApplyList = true
let res = await this.$u.api.applyList({
'pageSize': 1000,
'pageNumbr': 1,
'status': -1, // -1 全部,0 新申请,15 待收件,30 待返件,31 返件中
'workOrderId': this.order.orderId
})
if(res && res.code == 200) {
this.partsList = res.data
}
} else { // 没有配件,跳到配件申请 } else { // 没有配件,跳到配件申请
this.toApplyParts() this.toApplyParts()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment