Commit d5541fa1 authored by Facius's avatar Facius

详情页面配件数量

parent 51e5d884
......@@ -189,7 +189,9 @@ let orderApiFun = function(vm){
// 备件仓列表
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 = {
listByRecommendOrder,
......@@ -238,7 +240,8 @@ let orderApiFun = function(vm){
applyList,
returnedParts,
reserveList,
getLogistics
getLogistics,
getOrderPartsSum
}
return orderApi
}
......
......@@ -9,6 +9,7 @@
</view>
<view :class="['text-content', item.type]">{{item.label}}</view>
</u-button>
<view v-if="item.count && item.count > 0" class="bradge-vidw">{{item.count}}</view>
</view>
</view>
</template>
......@@ -120,6 +121,7 @@
.button-view {
max-width: 600rpx;
display: flex;
position: relative;
&.image {}
&.text {
......@@ -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>
<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="colse-view">
......
......@@ -161,8 +161,8 @@
},
handleOperate(info) {
// 调接口
// 修改info的status
// 刷新页面
// 跳到全部、刷新页面
},
handleClickCell(info) {
var pages = getCurrentPages();
......
......@@ -138,7 +138,8 @@
// 渐变色
},
visible: false,
orderId: null,
// orderId: null,
orderId: 11880366, // 测试数据
order: {},
needPhotograph: true, // 需要现场拍摄
orderRecords: [],
......@@ -178,6 +179,12 @@
},
buttons() {
//id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 配件申请
// label: 按钮文字,
// type: 'image' 上图片下文字;'text' 纯文字,
// image: 图片名,
// show: 是否显示,
// disabled: 是 禁用;否 正常,
// id: 区分各个按钮
return [{
label: '过程反馈',
type: 'image',
......@@ -208,6 +215,7 @@
image: 'xiancahngpaizhao.png',
show: this.allowFeedback,
disabled: false,
count: 3,
id: 4
},
{
......@@ -340,6 +348,7 @@
} else {
this.loadOrderRecord() // 履约记录
this.getSignDistance() // 定位
this.getOrderPartsSum()
}
},
onShow() {
......@@ -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(){
let self = this
var data={}
......@@ -636,6 +656,8 @@
}
},
async handleApplyParts() { // 点击了配件申请按钮
if (this.buttons[3].count > 0) { // 已经有配件,弹出配件列表
this.showApplyList = true
let res = await this.$u.api.applyList({
'pageSize': 1000,
'pageNumbr': 1,
......@@ -645,8 +667,6 @@
if(res && res.code == 200) {
this.partsList = res.data
}
if (this.partsList.length > 0) { // 已经有配件,弹出配件列表
this.showApplyList = true
} else { // 没有配件,跳到配件申请
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