Browse Source

[对接] 报价订单详情接口

[优化] 路由重定向忽略的路由判断
[新增] 供货订单上传凭证弹出层
master
邓平艺 5 years ago
parent
commit
41c60de1fb
  1. 1
      common/api.js
  2. 12
      common/mixin.js
  3. 174
      pages/supply/gonghuo/detail.vue
  4. 22
      pages/supply/order/detail.vue
  5. 2
      pages/supply/order/index.vue

1
common/api.js

@ -12,6 +12,7 @@ export const API_SUPPLIER_MATERIALLIST = '/api/supplier/materialList'; // 物资
export const API_SUPPLIER_QUOTATIONAPPLY = '/api/supplier/quotationApply'; // 申请报价
export const API_SUPPLIER_QUOTATIONORDERLIST = '/api/supplier/quotationOrderList'; // 申请报价-订单列表
export const API_SUPPLIER_PURCHASEORDERLIST = '/api/supplier/purchaseOrderList'; // 供货订单列表
export const API_SUPPLIER_QUOTATIONDETAIL = '/api/supplier/quotationDetail'; // 报价订单详情
/* 食堂相关接口 */
export const API_CANTEEN_LOGIN = '/api/canteen/login'; // 登录

12
common/mixin.js

@ -119,10 +119,16 @@ export default{
}
},
$redirectToLogin(text){
let path_url = '/pages/'+ this.$getPageType() +'/login/index';
if(path_url == '/'+ this.currentPage || this.currentPage == 'pages/empty/index'){
return;
let intercept_route = [
'pages/supply/login/index',
'pages/canteen/login/index',
'pages/empty/index',
'/preview-image'
];
if(intercept_route.includes(this.currentPage)){
return; // 忽略提示跳转的路由
}
let path_url = '/pages/'+ this.$getPageType() +'/login/index';
text = text || '您的状态异常, 即将跳转...';
this.$msg(text, {duration: 800}).then(() => {
this.$url(path_url, {type: 'launch'}); // 重定向到登录页

174
pages/supply/gonghuo/detail.vue

@ -26,9 +26,31 @@
<view style="height: 100rpx;"></view>
<!-- 操作按钮 -->
<view class="fixed-bottom">
<button class="btn btn1">上传凭证</button>
<button class="btn btn1" @click="is_show_voucher = true">上传凭证</button>
<button class="btn btn2">确认发货</button>
</view>
<!-- 弹出层-上传凭证 -->
<u-popup v-model="is_show_voucher" mode="center" border-radius="20">
<view class="popup-box">
<view class="content">
<view class="popup-title">上传凭证信息</view>
<view class="popup-desc">请在此处上传检验检疫凭证售卖资质等证书</view>
<view class="popup-images">
<view class="popup-image-item" v-for="(item, index) in voucher_list" :key="index" @click="lookImage(index)">
<image :src="item" mode="aspectFill"></image>
<view class="remove-image" @click.stop="removeInage(index)">
<u-icon name="close-circle"></u-icon>
</view>
</view>
<view class="popup-image-item popup-image-item-after" @click="uploadImage" v-if="voucher_list.length < 6"></view>
</view>
</view>
<view class="foot-btn">
<u-button class="popup-btn" @click="is_show_voucher = false">取消</u-button>
<u-button class="popup-btn" @click="submitImage">确定</u-button>
</view>
</view>
</u-popup>
</view>
</template>
@ -106,13 +128,17 @@
sex: '男',
height: '192cm',
info: '无敌叫是'
}]
}],
is_show_voucher: false, //
voucher_list: [], //
voucher_count: 6 //
}
},
onLoad(){
},
methods: {
// table
onButtonClick(event){
uni.showModal({
title: '温馨提示',
@ -125,6 +151,71 @@
}
}
})
},
//
uploadImage(){
let current_count = this.voucher_count - this.voucher_list.length;
if(current_count == 0) return;
uni.chooseImage({
count: current_count,
complete: result => {
this.voucher_list.push(...result.tempFilePaths);
}
})
},
//
lookImage(current){
if(this.voucher_list.length <= 0) return;
this.$u.throttle(() => {
uni.previewImage({
urls: this.voucher_list,
current: current
})
}, 500);
},
//
removeInage(current){
this.voucher_list.splice(current, 1);
},
// ossurl
submitImage(){
let that = this;
let voucher_list = that.voucher_list;
if(voucher_list.length <= 0){
return that.$msg('您未上传图片哦');
};
that.is_show_voucher = false;
uni.showLoading({
title: '正在上传中...'
})
let http_list = [];
voucher_list.map(item => {
let itemP = new Promise((resolve, reject) => {
that.$http(that.API.XXXX, {url: item})
.then(res => resolve(res))
.catch(err => reject(err));
})
http_list.push(itemP);
})
// todo
Promise.all(http_list).then(res => {
console.log("上传完毕", res);
// resres.data.images
that.$http(that.API.XXXX, {urls: res}).then(result => {
uni.hideLoading();
that.$msg('凭证已上传成功!')
}).catch(err => uni.hideLoading());
}).catch(err => {
uni.hideLoading();
uni.showModal({
title: '',
content: JSON.stringify(err),
showCancel: false,
confirmColor: '#1833F2'
})
})
}
}
}
@ -193,4 +284,83 @@
margin-left: 20rpx;
}
}
.popup-box{
width: 686rpx;
// height: 727rpx;
height: max-content;
display: flex;
justify-content: space-between;
flex-direction: column;
.content{
.popup-title{
font-size: 32rpx;
font-weight: bold;
color: #222222;
text-align: center;
margin-top: 40rpx;
}
.popup-desc{
font-size: 28rpx;
color: #555555;
text-align: center;
margin-top: 20rpx;
margin-bottom: 18rpx;
}
.popup-images{
display: flex;
flex-wrap: wrap;
padding: 22rpx;
margin-bottom: 18rpx;
.popup-image-item{
width: 198rpx;
height: 198rpx;
margin: 8rpx;
background: #F5F5F5;
border-radius: 10rpx;
position: relative;
image{
width: 100%;
height: 100%;
}
.remove-image{
position: absolute;
right: -8rpx;
top: -16rpx;
color: #e74c3c;
font-size: 40rpx;
padding: 8rpx;
}
}
.popup-image-item-after::after{
content: '+';
position: absolute;
left: 30%;
top: 14%;
font-size: 100rpx;
color: #777777;
}
}
}
.foot-btn{
height: 90rpx;
width: 100%;
border-top: 1rpx solid #E5E5E5;
display: flex;
box-sizing: border-box;
.popup-btn{
width: 50%;
height: 100%;
border: none;
border-radius: initial;
&:last-child{
border-left: 1rpx solid #E5E5E5;
color: #1833F2;
}
}
}
}
// u-button 线
/deep/.u-hairline-border::after{
border: none;
}
</style>

22
pages/supply/order/detail.vue

@ -3,20 +3,21 @@
<view class="head">
<view class="lf-row-between list">
<view>订单编号</view>
<view class="lf-color-black">2368492461046128742764</view>
<view class="lf-color-black">{{ order.q_sn }}</view>
</view>
<view class="lf-row-between list">
<view>订单状态</view>
<view class="quoted-price">已报价等待审核</view>
<view class="quoted-price">{{ order.state }}</view>
</view>
<view class="lf-row-between list">
<view>报价商</view>
<view class="lf-color-black">广西美味供应链有限公司</view>
<view class="lf-color-black">{{ order.contact_name }}</view>
</view>
</view>
<self-line></self-line>
<view class="lf-m-t-30 lf-m-l-32">
<view class="lf-font-32 lf-color-black lf-font-bold lf-m-b-20">报价明细</view>
<!-- TODO 表格对接 -->
<wyb-table :first-line-fixed="true" contentBgColor="#eef6fe" width="100%" height="350rpx"></wyb-table>
</view>
<view style="height: 100rpx;"></view>
@ -34,14 +35,21 @@
components: { wybTable },
data(){
return {
order: {}
}
},
onLoad(){
onLoad(options){
this.getDetail(options.q_sn)
},
methods: {
getDetail(q_sn){
this.$http(this.API.API_SUPPLIER_QUOTATIONDETAIL, {
q_sn: q_sn
}).then(res => {
console.log("getDetail", res);
this.order = res.data.order || {};
})
}
}
}
</script>

2
pages/supply/order/index.vue

@ -7,7 +7,7 @@
:current="current" @change="swiperChange">
<swiper-item v-for="(tabItem, tabIndex) in tab_list" :key="tabIndex">
<scroll-view class="lf-w-100 lf-h-100 lf-p-l-32 lf-p-r-32 lf-border-box" :scroll-y="true">
<view class="card" v-for="(item, index) in tabItem.list" :key="item.id" @click="$url('/pages/supply/order/detail?id='+ item.id)">
<view class="card" v-for="(item, index) in tabItem.list" :key="item.id" @click="$url('/pages/supply/order/detail?q_sn='+ item.q_sn)">
<view class="lf-row-between upper">
<view class="lf-font-28 lf-color-333">订单状态</view>
<!-- TODO 状态颜色 -->

Loading…
Cancel
Save