From 7834d09a29d0e23b6d3245fa0543ddf8e6fdf3fd Mon Sep 17 00:00:00 2001 From: dengxiongfei Date: Thu, 20 Jan 2022 09:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=B5=81=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/commonApi.js | 3 +- apis/orderApi.js | 24 +++++ enums/index.js | 15 ++++ pages.json | 38 ++++---- pages/order-detail/index.vue | 170 ++++++++++++++++++++++------------- 5 files changed, 165 insertions(+), 85 deletions(-) diff --git a/apis/commonApi.js b/apis/commonApi.js index 13a1fcb..f65ec0f 100644 --- a/apis/commonApi.js +++ b/apis/commonApi.js @@ -76,12 +76,13 @@ export function getVerifyUrl(data = {}) { export function getGuaranteeContract(data = {}) { return http.post({ url: '/yyt-uec/create/supplier/guarantee-contract?mallSupplierId=' + data.mallSupplierId, data }) } + /** * 转换合同成图片 * @param {object} data 图片地址链接 fileUrl */ export function transformFileToImg(data) { - http.get({ + return http.get({ url: '/document/get/enterprise-documents/file-image-base64', data: data }) diff --git a/apis/orderApi.js b/apis/orderApi.js index 1dbeb15..b2f5b54 100644 --- a/apis/orderApi.js +++ b/apis/orderApi.js @@ -83,3 +83,27 @@ export function supplierDelivery(data) { data }) } + +/** + * 供应商删除送货凭证 + * @param {object} data id + * @returns {Promise} + */ +export function supplierDeleteVoucher(data) { + return http.post({ + url: '/base-paper-trading/delete/certificate/img?id=' + data.id, + data + }) +} + +/** + * 供应商确认月结订单还款 + * @param {object} data supplierOrderId + * @returns {Promise} + */ +export function supplierConfirmRepay(data) { + return http.post({ + url: '/base-paper-trading/supplier/submit/reimbursement', + data + }) +} diff --git a/enums/index.js b/enums/index.js index a708e5c..bec7584 100644 --- a/enums/index.js +++ b/enums/index.js @@ -142,3 +142,18 @@ export const supplierOrderStatusMap = { [supplierOrderStatusEnum.REPAYING]: '还款中', [supplierOrderStatusEnum.CANCELED]: '已取消' } + +/** + * 支付方式 1:微信支付 2:月结支付 4:飞算支付 + */ +export const paymentMethodEnum = { + WECHAT_PAY: 1, + MONTHLY_PAY: 2, + FLY_PAY: 4 +} + +export const paymentMethodMap = { + [paymentMethodEnum.WECHAT_PAY]: '微信支付', + [paymentMethodEnum.MONTHLY_PAY]: '月结支付', + [paymentMethodEnum.FLY_PAY]: '飞算支付' +} diff --git a/pages.json b/pages.json index c043322..1f20514 100644 --- a/pages.json +++ b/pages.json @@ -257,28 +257,24 @@ "navigationStyle": "custom", "enablePullDownRefresh": false } + }, + { + "path": "pages/user-info/index", + "style": { + "navigationBarTitleText": "用户名", + "navigationStyle": "custom", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/about/index", + "style": { + "navigationBarTitleText": "关于", + "navigationStyle": "custom", + "enablePullDownRefresh": false + } } - ,{ - "path" : "pages/user-info/index", - "style" : - { - "navigationBarTitleText": "用户名", - "navigationStyle": "custom", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/about/index", - "style" : - { - "navigationBarTitleText": "关于", - "navigationStyle": "custom", - "enablePullDownRefresh": false - } - - } - ], + ], "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", diff --git a/pages/order-detail/index.vue b/pages/order-detail/index.vue index 154b0bc..b712c37 100644 --- a/pages/order-detail/index.vue +++ b/pages/order-detail/index.vue @@ -73,7 +73,7 @@ - + 送货凭证 @@ -82,24 +82,14 @@ + + + + 上传凭证 - - - - - - - 送货凭证 - - {{ showList.includes(`receive`) ? '收起' : '展开' }} - - - - - @@ -125,6 +115,10 @@ 下单时间 {{ orderInfo.createTime }} + + 供应商 + {{ orderInfo.supplierEnterpriseName }} + @@ -132,11 +126,23 @@ 确认订单 - - - 取消订单 + + + + 取消订单 + 查看合同 - 确认发货 + + 确认发货 + + + 确认还款 + @@ -150,9 +156,11 @@ import { confirmSupplierOrder, supplierOperatePaper, supplierUploadVoucher, - supplierDelivery + supplierDelivery, + supplierDeleteVoucher, + supplierConfirmRepay } from '@/apis/orderApi.js' -import { supplierOrderStatusMap, supplierOrderStatusEnum } from '@/enums/index.js' +import { supplierOrderStatusMap, supplierOrderStatusEnum, paymentMethodEnum } from '@/enums/index.js' import { transformFileToImg } from '@/apis/commonApi.js' export default { data() { @@ -163,7 +171,8 @@ export default { }, supplierOrderStatusMap: Object.freeze(supplierOrderStatusMap), supplierOrderStatusEnum: Object.freeze(supplierOrderStatusEnum), - showList: [], + paymentMethodEnum: Object.freeze(paymentMethodEnum), + showList: ['send', 'receive'], steps: [] } }, @@ -284,20 +293,6 @@ export default { ] return list.includes(status) }, - // 根据状态是否展示收货凭证 - showReceiveImgs(status) { - let list = [ - supplierOrderStatusEnum.WAIT_CLIENT_LOAN, - supplierOrderStatusEnum.PAYING, - supplierOrderStatusEnum.WAIT_CLIENT_PAY, - supplierOrderStatusEnum.PAY_FAIL, - supplierOrderStatusEnum.FINISHED, - supplierOrderStatusEnum.WAIT_CLIENT_REPAY, - supplierOrderStatusEnum.REPAYING, - supplierOrderStatusEnum.CANCELED - ] - return list.includes(status) - }, // 取消订单 cancel(order) { uni.showModal({ @@ -343,15 +338,6 @@ export default { window ? (window.location.href = res.signUrl) : '' // #endif } - // uni.showToast({ - // title: '确认订单成功', - // icon: 'success', - // success: () => { - // setTimeout(() => { - // this.init(order.orderId) - // }, 1000) - // } - // }) } }) } @@ -389,25 +375,21 @@ export default { uploadImage(['album'], 5) .then((urls) => { if (urls) { - let promiseList = [] - urls.forEach((url) => { - promiseList.push( - supplierUploadVoucher({ - supplierOrderId: this.orderInfo.orderId, - proofDeliveryUrl: url + supplierUploadVoucher({ + supplierOrderId: this.orderInfo.orderId, + proofDeliveryUrl: urls + }).then((res) => { + if (res) { + uni.showToast({ + title: '上传成功', + icon: 'success', + success: () => { + setTimeout(() => { + this.init(this.orderInfo.orderId) + }, 1000) + } }) - ) - }) - Promise.all(promiseList).then(() => { - uni.showToast({ - title: '上传成功', - icon: 'success', - success: () => { - setTimeout(() => { - this.init(this.orderInfo.orderId) - }, 1000) - } - }) + } }) } }) @@ -453,6 +435,49 @@ export default { }) } }, + // 删除送货凭证 + deleteVoucher(id) { + supplierDeleteVoucher({ id }).then((res) => { + if (res) { + uni.showToast({ + title: '删除成功', + icon: 'success', + success: () => { + setTimeout(() => { + this.init(this.orderInfo.orderId) + }, 1000) + } + }) + } + }) + }, + // 确认月结还款 + confirmRepay() { + uni.showModal({ + title: '提示', + content: '确定确认还款吗?', + success: (res) => { + if (res.confirm) { + supplierConfirmRepay({ + supplierOrderId: this.orderInfo.orderId + }).then((res) => { + if (res) { + uni.showToast({ + title: '确认还款成功', + icon: 'success', + success: () => { + setTimeout(() => { + this.init(this.orderInfo.orderId) + }, 1000) + } + }) + } + }) + } + } + }) + }, + // 复制 clip(content) { uni.setClipboardData({ data: content, @@ -590,4 +615,23 @@ export default { margin-bottom: 8rpx; } } +.upload_img { + width: 120rpx; + height: 120rpx; + border-radius: 10rpx; + background-color: #dcdee0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + position: relative; + margin-right: 12rpx; + overflow: hidden; + .close-icon { + position: absolute; + top: 0; + right: 0; + z-index: 5; + } +}