From 41c60de1fb414603336935b3d2f5f359c254f777 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com>
Date: Fri, 23 Jul 2021 12:12:21 +0800
Subject: [PATCH] =?UTF-8?q?[=E5=AF=B9=E6=8E=A5]=20=E6=8A=A5=E4=BB=B7?=
=?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3=20[?=
=?UTF-8?q?=E4=BC=98=E5=8C=96]=20=E8=B7=AF=E7=94=B1=E9=87=8D=E5=AE=9A?=
=?UTF-8?q?=E5=90=91=E5=BF=BD=E7=95=A5=E7=9A=84=E8=B7=AF=E7=94=B1=E5=88=A4?=
=?UTF-8?q?=E6=96=AD=20[=E6=96=B0=E5=A2=9E]=20=E4=BE=9B=E8=B4=A7=E8=AE=A2?=
=?UTF-8?q?=E5=8D=95=E4=B8=8A=E4=BC=A0=E5=87=AD=E8=AF=81=E5=BC=B9=E5=87=BA?=
=?UTF-8?q?=E5=B1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/api.js | 1 +
common/mixin.js | 12 ++-
pages/supply/gonghuo/detail.vue | 174 +++++++++++++++++++++++++++++++-
pages/supply/order/detail.vue | 22 ++--
pages/supply/order/index.vue | 2 +-
5 files changed, 198 insertions(+), 13 deletions(-)
diff --git a/common/api.js b/common/api.js
index d0656a7..8375748 100644
--- a/common/api.js
+++ b/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'; // 登录
diff --git a/common/mixin.js b/common/mixin.js
index 350f00c..4f059e1 100644
--- a/common/mixin.js
+++ b/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'}); // 重定向到登录页
diff --git a/pages/supply/gonghuo/detail.vue b/pages/supply/gonghuo/detail.vue
index 9032ed1..18a1cac 100644
--- a/pages/supply/gonghuo/detail.vue
+++ b/pages/supply/gonghuo/detail.vue
@@ -26,9 +26,31 @@
-
+
+
+
+
+
@@ -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);
+ },
+ // 用户点击确定,将图片上传至oss,并将url发送给后端
+ 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);
+
+ // 此处res需要处理一下,有可能格式是这样的,res.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;
+ }
diff --git a/pages/supply/order/detail.vue b/pages/supply/order/detail.vue
index 18612c7..bbe5abd 100644
--- a/pages/supply/order/detail.vue
+++ b/pages/supply/order/detail.vue
@@ -3,20 +3,21 @@
订单编号
- 2368492461046128742764
+ {{ order.q_sn }}
订单状态
- 已报价,等待审核
+ {{ order.state }}
报价商
- 广西美味供应链有限公司
+ {{ order.contact_name }}
报价明细
+
@@ -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 || {};
+ })
+ }
}
}
diff --git a/pages/supply/order/index.vue b/pages/supply/order/index.vue
index 3aabdfe..c1f07ea 100644
--- a/pages/supply/order/index.vue
+++ b/pages/supply/order/index.vue
@@ -7,7 +7,7 @@
:current="current" @change="swiperChange">
-
+
订单状态