|
|
|
@ -27,10 +27,12 @@ |
|
|
|
<!-- 待收货展示 --> |
|
|
|
<view v-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_RECEIVE" class="button-item" @click="confirmReceive(supplierOrder)">确认收货</view> |
|
|
|
<!-- 待借款展示 --> |
|
|
|
<view v-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_CLIENT_LOAN" class="button-item" @click="goBorrowing(supplierOrder)">去借款</view> |
|
|
|
<view v-else-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_CLIENT_LOAN" class="button-item" @click="goBorrowing(supplierOrder)"> |
|
|
|
去借款 |
|
|
|
</view> |
|
|
|
<!-- 飞算支付且待还款状态 --> |
|
|
|
<view |
|
|
|
v-if="orderInfo.paymentMethod == paymentMethodEnum.FLY_PAY && supplierOrder.status == supplierOrderStatusEnum.WAIT_CLIENT_REPAY" |
|
|
|
v-else-if="orderInfo.paymentMethod == paymentMethodEnum.FLY_PAY && supplierOrder.status == supplierOrderStatusEnum.WAIT_CLIENT_REPAY" |
|
|
|
class="button-item" |
|
|
|
@click="goRepaying(supplierOrder)" |
|
|
|
> |
|
|
|
@ -64,9 +66,9 @@ |
|
|
|
</view> |
|
|
|
<view style="padding: 24rpx 10rpx"> |
|
|
|
<uni-steps |
|
|
|
:options="transformStep(order.outboundProcessList)" |
|
|
|
:options="transformStep(order.outboundProcessList, order.pieceQuantity)" |
|
|
|
active-color="#1890FF" |
|
|
|
:active="order.outboundProcessList.length > 0 ? order.outboundProcessList.length : -1" |
|
|
|
:active="order.outboundProcessList.length > 0 ? order.outboundProcessList.length - 1 : -1" |
|
|
|
></uni-steps> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -80,20 +82,29 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="imgs flex-row-start-start"> |
|
|
|
<image style="width: 120rpx; height: 120rpx; margin-right: 12rpx" src=""></image> |
|
|
|
<view v-for="item in supplierOrder.proofDelivery" :key="item.id" class="upload_img"> |
|
|
|
<image style="width: 120rpx; height: 120rpx" :src="item.imgUrl"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 收货凭证 --> |
|
|
|
<view v-if="showReceiveImgs(supplierOrder.status)" class="footer" :style="showList.includes(`${index}_receive`) ? '' : 'height:88rpx;'"> |
|
|
|
<view class="header flex-row-center-space"> |
|
|
|
<text style="font-size: 28rpx; font-weight: 600">送货凭证</text> |
|
|
|
<text style="font-size: 28rpx; font-weight: 600">收货凭证</text> |
|
|
|
<view class="flex-row-center-end" @click="changeShowIndex(`${index}_receive`)"> |
|
|
|
<text style="font-size: 28rpx; margin-right: 8rpx">{{ showList.includes(`${index}_receive`) ? '收起' : '展开' }}</text> |
|
|
|
<uni-icons :type="showList.includes(`${index}_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 v-for="item in supplierOrder.proofReceipt" :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(supplierOrder.supplierOrderId)"> |
|
|
|
<image src="/static/imgs/order/camera.png" class="icon"></image> |
|
|
|
<text style="font-size: 26rpx; color: #4c4a58">上传凭证</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -127,15 +138,16 @@ |
|
|
|
</view> |
|
|
|
<qn-footer fixed height="120rpx"> |
|
|
|
<view class="flex-row-center-end" style="padding: 0 32rpx"> |
|
|
|
<view class="button">查看合同</view> |
|
|
|
<view class="button" @click="viewContract">查看合同</view> |
|
|
|
</view> |
|
|
|
</qn-footer> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { go2, back } from '@/utils/hook.js' |
|
|
|
import { getClientOrderInfo } from '@/apis/orderApi.js' |
|
|
|
import { go2, back, uploadImage } from '@/utils/hook.js' |
|
|
|
import { getClientOrderInfo, clientUploadVoucher, clientDeleteVoucher, clientConfirmOrder } from '@/apis/orderApi.js' |
|
|
|
import { transformFileToImg } from '@/apis/commonApi.js' |
|
|
|
import { orderStatusEnum, supplierOrderStatusMap, supplierOrderStatusEnum, paymentMethodMap, paymentMethodEnum } from '@/enums/index.js' |
|
|
|
const statusImg = { |
|
|
|
[orderStatusEnum.WAIT_SUPPLIER_CONFIRM]: '待供应商确认', |
|
|
|
@ -143,6 +155,17 @@ const statusImg = { |
|
|
|
[orderStatusEnum.FINISHED]: '已完成', |
|
|
|
[orderStatusEnum.CANCELED]: '已取消' |
|
|
|
} |
|
|
|
const showVoucherStatus = [ |
|
|
|
supplierOrderStatusEnum.WAIT_RECEIVE, |
|
|
|
supplierOrderStatusEnum.WAIT_CLIENT_LOAN, |
|
|
|
supplierOrderStatusEnum.PAYING, |
|
|
|
supplierOrderStatusEnum.WAIT_CLIENT_PAY, |
|
|
|
supplierOrderStatusEnum.PAY_FAIL, |
|
|
|
supplierOrderStatusEnum.FINISHED, |
|
|
|
supplierOrderStatusEnum.WAIT_CLIENT_REPAY, |
|
|
|
supplierOrderStatusEnum.REPAYING, |
|
|
|
supplierOrderStatusEnum.CANCELED |
|
|
|
] |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
@ -160,13 +183,7 @@ export default { |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
if (option.orderId) { |
|
|
|
getClientOrderInfo({ |
|
|
|
customerOrderId: option.orderId |
|
|
|
}).then((res) => { |
|
|
|
if (res) { |
|
|
|
this.orderInfo = res |
|
|
|
} |
|
|
|
}) |
|
|
|
this.init(option.orderId) |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
title: '订单信息错误', |
|
|
|
@ -182,6 +199,15 @@ export default { |
|
|
|
methods: { |
|
|
|
go2, |
|
|
|
back, |
|
|
|
init(orderId) { |
|
|
|
getClientOrderInfo({ |
|
|
|
customerOrderId: orderId |
|
|
|
}).then((res) => { |
|
|
|
if (res) { |
|
|
|
this.orderInfo = res |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
transformAddress(address) { |
|
|
|
let res = '' |
|
|
|
if (address) { |
|
|
|
@ -190,11 +216,13 @@ export default { |
|
|
|
return res |
|
|
|
}, |
|
|
|
// 生成步骤条 |
|
|
|
transformStep(list) { |
|
|
|
transformStep(list, quantity) { |
|
|
|
// 分切 出库 完成 |
|
|
|
let step1 = [], |
|
|
|
step2 = [], |
|
|
|
step3 = [] |
|
|
|
// 出库数量 |
|
|
|
let outboundQuantity = 0 |
|
|
|
if (list && list.length > 0) { |
|
|
|
list.forEach((item) => { |
|
|
|
if (item.status == '30301') { |
|
|
|
@ -207,6 +235,7 @@ export default { |
|
|
|
title: '出库', |
|
|
|
desc: item.userName + item.quantity + '\n\r' + item.createTime |
|
|
|
}) |
|
|
|
outboundQuantity += item.quantity |
|
|
|
} else if (item.status == '30303') { |
|
|
|
step3.push({ |
|
|
|
title: '完成', |
|
|
|
@ -226,6 +255,12 @@ export default { |
|
|
|
title: '出库', |
|
|
|
desc: '未完成' |
|
|
|
}) |
|
|
|
} else if (outboundQuantity < quantity) { |
|
|
|
// 判断是否出库完成 |
|
|
|
step2.push({ |
|
|
|
title: '出库', |
|
|
|
desc: '未完成' |
|
|
|
}) |
|
|
|
} |
|
|
|
if (step3.length == 0) { |
|
|
|
step3.push({ |
|
|
|
@ -245,37 +280,38 @@ export default { |
|
|
|
}, |
|
|
|
// 根据状态是否展示送货凭证 |
|
|
|
showSendImgs(status) { |
|
|
|
let list = [ |
|
|
|
supplierOrderStatusEnum.WAIT_RECEIVE, |
|
|
|
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) |
|
|
|
return showVoucherStatus.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) |
|
|
|
return showVoucherStatus.includes(status) |
|
|
|
}, |
|
|
|
// 去借款 |
|
|
|
goBorrowing(order) {}, |
|
|
|
// 确认收货 |
|
|
|
confirmReceive(order) {}, |
|
|
|
confirmReceive(order) { |
|
|
|
uni.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '确认收货后,将不能修改,确认收货吗?', |
|
|
|
success: (res) => { |
|
|
|
if (res.confirm) { |
|
|
|
clientConfirmOrder({ |
|
|
|
supplierOrderId: order.supplierOrderId |
|
|
|
}).then((res) => { |
|
|
|
if (res) { |
|
|
|
uni.showToast({ |
|
|
|
title: '确认收货成功', |
|
|
|
icon: 'success', |
|
|
|
success: () => { |
|
|
|
this.init(this.orderInfo.orderId) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
goRepaying(order) {}, |
|
|
|
clip(content) { |
|
|
|
uni.setClipboardData({ |
|
|
|
@ -288,6 +324,62 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 删除收货凭证 |
|
|
|
deleteVoucher(id) { |
|
|
|
clientDeleteVoucher({ id }).then((res) => { |
|
|
|
if (res) { |
|
|
|
uni.showToast({ |
|
|
|
title: '删除成功', |
|
|
|
icon: 'success', |
|
|
|
success: () => { |
|
|
|
setTimeout(() => { |
|
|
|
this.init(this.orderInfo.orderId) |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 上传收货凭证 |
|
|
|
uploadVoucher(supplierOrderId) { |
|
|
|
uploadImage(['album'], 5) |
|
|
|
.then((urls) => { |
|
|
|
if (urls) { |
|
|
|
clientUploadVoucher({ |
|
|
|
supplierOrderId, |
|
|
|
proofDeliveryUrl: urls |
|
|
|
}).then((res) => { |
|
|
|
if (res) { |
|
|
|
uni.showToast({ |
|
|
|
title: '上传成功', |
|
|
|
icon: 'success', |
|
|
|
success: () => { |
|
|
|
setTimeout(() => { |
|
|
|
this.init(this.orderInfo.orderId) |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((e) => { |
|
|
|
console.log('上传失败:', e) |
|
|
|
uni.showToast({ |
|
|
|
title: '上传失败', |
|
|
|
icon: 'fail' |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 查看合同 |
|
|
|
viewContract() { |
|
|
|
let url = this.orderInfo.contractUrl |
|
|
|
if (url) { |
|
|
|
transformFileToImg({ fileUrl: url }).then((res) => { |
|
|
|
uni.previewImage({ urls: [res.imgUrl], current: res.imgUrl }) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -304,7 +396,7 @@ export default { |
|
|
|
width: 750rpx; |
|
|
|
background-color: #ffffff; |
|
|
|
.footer { |
|
|
|
padding: 24rpx 32rpx; |
|
|
|
padding: 24rpx 0; |
|
|
|
background-color: #ffffff; |
|
|
|
border-top: 1px solid #e5e5e5; |
|
|
|
} |
|
|
|
@ -382,7 +474,7 @@ export default { |
|
|
|
} |
|
|
|
.button-item { |
|
|
|
padding: 0rpx 24rpx; |
|
|
|
height: 42rpx; |
|
|
|
height: 46rpx; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
@ -391,4 +483,38 @@ export default { |
|
|
|
font-size: 26rpx; |
|
|
|
color: #ffffff; |
|
|
|
} |
|
|
|
.default-upload { |
|
|
|
width: 120rpx; |
|
|
|
height: 120rpx; |
|
|
|
border-radius: 10rpx; |
|
|
|
background-color: #dcdee0; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
.icon { |
|
|
|
width: 56rpx; |
|
|
|
height: 56rpx; |
|
|
|
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> |