|
|
|
@ -73,7 +73,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 送货凭证 --> |
|
|
|
<view v-if="showSendImgs(orderInfo.status)" class="footer"> |
|
|
|
<view v-if="showSendImgs(orderInfo.status)" class="footer" :style="showList.includes(`send`) ? '' : 'height:88rpx;'"> |
|
|
|
<view class="header flex-row-center-space"> |
|
|
|
<text style="font-size: 28rpx; font-weight: 600">送货凭证</text> |
|
|
|
<view class="flex-row-center-end" @click="changeShowIndex('send')"> |
|
|
|
@ -82,24 +82,14 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="imgs flex-row-start-start"> |
|
|
|
<view v-for="item in orderInfo.proofDelivery" :key="item.id" class="upload_img"> |
|
|
|
<uni-icons type="clear" size="16" class="close-icon" @click="deleteVoucher(item.id)"></uni-icons> |
|
|
|
<image style="width: 120rpx; height: 120rpx" :src="item.imgUrl"></image> |
|
|
|
</view> |
|
|
|
<view class="default-upload" @click="uploadVoucher()"> |
|
|
|
<image src="/static/imgs/order/camera.png" class="icon"></image> |
|
|
|
<text style="font-size: 26rpx; color: #4c4a58">上传凭证</text> |
|
|
|
</view> |
|
|
|
<image style="width: 120rpx; height: 120rpx; margin-right: 12rpx" src=""></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 收货凭证 --> |
|
|
|
<view v-if="showReceiveImgs(orderInfo.status)" class="footer"> |
|
|
|
<view class="header flex-row-center-space"> |
|
|
|
<text style="font-size: 28rpx; font-weight: 600">送货凭证</text> |
|
|
|
<view class="flex-row-center-end" @click="changeShowIndex(`receive`)"> |
|
|
|
<text style="font-size: 28rpx; margin-right: 8rpx">{{ showList.includes(`receive`) ? '收起' : '展开' }}</text> |
|
|
|
<uni-icons :type="showList.includes(`receive`) ? 'top' : 'bottom'" size="16"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="imgs flex-row-start-start"> |
|
|
|
<image style="width: 120rpx; height: 120rpx; margin-right: 12rpx" src=""></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="fee flex-row-center-space"> |
|
|
|
@ -125,6 +115,10 @@ |
|
|
|
<text class="label">下单时间</text> |
|
|
|
<text class="value">{{ orderInfo.createTime }}</text> |
|
|
|
</view> |
|
|
|
<view class="flex-row-center-space order-line"> |
|
|
|
<text class="label">供应商</text> |
|
|
|
<text class="value">{{ orderInfo.supplierEnterpriseName }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<qn-footer fixed height="120rpx" v-if="orderInfo.status === supplierOrderStatusEnum.WAIT_SUPPLIER_CONFIRM"> |
|
|
|
<view class="flex-row-center-space" style="padding: 0 32rpx"> |
|
|
|
@ -132,11 +126,23 @@ |
|
|
|
<view class="button button_confirm" @click="confirm(orderInfo)">确认订单</view> |
|
|
|
</view> |
|
|
|
</qn-footer> |
|
|
|
<qn-footer fixed height="120rpx" v-if="orderInfo.status === supplierOrderStatusEnum.WAIT_DELIVERY"> |
|
|
|
<view class="flex-row-center-space" style="padding: 0 32rpx"> |
|
|
|
<view class="button button_cancel" style="width: 220rpx" @click="cancel">取消订单</view> |
|
|
|
<qn-footer fixed height="120rpx" v-if="showSendImgs(orderInfo.status)"> |
|
|
|
<view class="flex-row-center-end" style="padding: 0 32rpx"> |
|
|
|
<view class="button button_cancel" v-show="orderInfo.status === supplierOrderStatusEnum.WAIT_DELIVERY" style="width: 220rpx" @click="cancel"> |
|
|
|
取消订单 |
|
|
|
</view> |
|
|
|
<view class="button button_contact" @click="viewContract">查看合同</view> |
|
|
|
<view class="button button_confirm" @click="delivery" style="width: 220rpx">确认发货</view> |
|
|
|
<view class="button button_confirm" v-show="orderInfo.status === supplierOrderStatusEnum.WAIT_DELIVERY" @click="delivery" style="width: 220rpx"> |
|
|
|
确认发货 |
|
|
|
</view> |
|
|
|
<view |
|
|
|
class="button button_confirm" |
|
|
|
v-show="orderInfo.paymentMethod === paymentMethodEnum.MONTHLY_PAY && orderInfo.status === supplierOrderStatusEnum.WAIT_CLIENT_REPAY" |
|
|
|
@click="confirmRepay" |
|
|
|
style="width: 220rpx" |
|
|
|
> |
|
|
|
确认还款 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</qn-footer> |
|
|
|
</view> |
|
|
|
@ -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; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |