|
|
|
@ -30,20 +30,22 @@ |
|
|
|
<text style="font-size: 30rpx; font-weight: 600; line-height: 1.2"> |
|
|
|
{{ `${order.brandName}${order.productName} | ${order.gramWeight}g | ${order.width}*${order.length} | ${order.pieceQuantity}张` }} |
|
|
|
</text> |
|
|
|
<view v-if="steps[index].length > 0 && steps[index][0].desc == '未完成'" class="button-item" @click="operatePaper(index, 'cut')">分切</view> |
|
|
|
<view |
|
|
|
v-else-if="steps[index].length > 0 && steps[index][steps[index].length - 2].desc == '未完成'" |
|
|
|
class="button-item" |
|
|
|
@click="operatePaper(index, 'outbound')" |
|
|
|
> |
|
|
|
出库 |
|
|
|
</view> |
|
|
|
<view |
|
|
|
v-else-if="steps[index].length > 0 && steps[index][steps[index].length - 1].desc == '未完成'" |
|
|
|
class="button-item" |
|
|
|
@click="operatePaper(index, 'send')" |
|
|
|
> |
|
|
|
发货 |
|
|
|
<view v-if="orderInfo.status == supplierOrderStatusEnum.WAIT_DELIVERY"> |
|
|
|
<view v-if="steps[index].length > 0 && steps[index][0].desc == '未完成'" class="button-item" @click="operatePaper(index, 'cut')">分切</view> |
|
|
|
<view |
|
|
|
v-else-if="steps[index].length > 0 && steps[index][steps[index].length - 2].desc == '未完成'" |
|
|
|
class="button-item" |
|
|
|
@click="operatePaper(index, 'outbound', 1000)" |
|
|
|
> |
|
|
|
出库 |
|
|
|
</view> |
|
|
|
<view |
|
|
|
v-else-if="steps[index].length > 0 && steps[index][steps[index].length - 1].desc == '未完成'" |
|
|
|
class="button-item" |
|
|
|
@click="operatePaper(index, 'send')" |
|
|
|
> |
|
|
|
发货 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="order-row flex-row-center-space"> |
|
|
|
@ -66,7 +68,7 @@ |
|
|
|
<uni-steps |
|
|
|
:options="steps[index]" |
|
|
|
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,6 +82,10 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="imgs flex-row-start-start"> |
|
|
|
<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> |
|
|
|
@ -129,17 +135,25 @@ |
|
|
|
<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> |
|
|
|
<view class="button button_contact">查看合同</view> |
|
|
|
<view class="button button_confirm" style="width: 220rpx">确认发货</view> |
|
|
|
<view class="button button_contact" @click="viewContract">查看合同</view> |
|
|
|
<view class="button button_confirm" @click="delivery" style="width: 220rpx">确认发货</view> |
|
|
|
</view> |
|
|
|
</qn-footer> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { go2, back } from '@/utils/hook.js' |
|
|
|
import { getSupplierOrderDetail, cancelSupplierOrder, confirmSupplierOrder } from '@/apis/orderApi.js' |
|
|
|
import { go2, back, uploadImage } from '@/utils/hook.js' |
|
|
|
import { |
|
|
|
getSupplierOrderDetail, |
|
|
|
cancelSupplierOrder, |
|
|
|
confirmSupplierOrder, |
|
|
|
supplierOperatePaper, |
|
|
|
supplierUploadVoucher, |
|
|
|
supplierDelivery |
|
|
|
} from '@/apis/orderApi.js' |
|
|
|
import { supplierOrderStatusMap, supplierOrderStatusEnum } from '@/enums/index.js' |
|
|
|
import { transformFileToImg } from '@/apis/commonApi.js' |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
@ -319,14 +333,108 @@ export default { |
|
|
|
if (res.confirm) { |
|
|
|
confirmSupplierOrder({ |
|
|
|
orderId: order.orderId |
|
|
|
}).then((res) => { |
|
|
|
if (res) { |
|
|
|
if (res) { |
|
|
|
// #ifdef APP-PLUS |
|
|
|
go2('page-view', { title: '供应商订单签约', url: encodeURIComponent(res.signUrl), params: this.params }) |
|
|
|
// #endif |
|
|
|
// #ifdef H5 |
|
|
|
window ? (window.location.href = res.signUrl) : '' |
|
|
|
// #endif |
|
|
|
} |
|
|
|
// uni.showToast({ |
|
|
|
// title: '确认订单成功', |
|
|
|
// icon: 'success', |
|
|
|
// success: () => { |
|
|
|
// setTimeout(() => { |
|
|
|
// this.init(order.orderId) |
|
|
|
// }, 1000) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// cut: 分切 outbound: 出库 send: 发货 |
|
|
|
operatePaper(index, type, quantity) { |
|
|
|
const map = { |
|
|
|
cut: 30301, |
|
|
|
outbound: 30302, |
|
|
|
send: 30303 |
|
|
|
} |
|
|
|
let target = this.orderInfo.orderItems[index] |
|
|
|
supplierOperatePaper({ |
|
|
|
quantity: quantity || target.pieceQuantity, |
|
|
|
supplierOderItemId: target.supplierOderItemId, |
|
|
|
status: map[type] |
|
|
|
}).then((res) => { |
|
|
|
if (res) { |
|
|
|
uni.showToast({ |
|
|
|
title: '操作成功', |
|
|
|
icon: 'success', |
|
|
|
success: () => { |
|
|
|
setTimeout(() => { |
|
|
|
this.init(this.orderInfo.orderId) |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 上传送货凭证 |
|
|
|
uploadVoucher() { |
|
|
|
uploadImage(['album'], 5) |
|
|
|
.then((urls) => { |
|
|
|
if (urls) { |
|
|
|
let promiseList = [] |
|
|
|
urls.forEach((url) => { |
|
|
|
promiseList.push( |
|
|
|
supplierUploadVoucher({ |
|
|
|
supplierOrderId: this.orderInfo.orderId, |
|
|
|
proofDeliveryUrl: url |
|
|
|
}) |
|
|
|
) |
|
|
|
}) |
|
|
|
Promise.all(promiseList).then(() => { |
|
|
|
uni.showToast({ |
|
|
|
title: '上传成功', |
|
|
|
icon: 'success', |
|
|
|
success: () => { |
|
|
|
setTimeout(() => { |
|
|
|
this.init(this.orderInfo.orderId) |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((e) => { |
|
|
|
uni.showToast({ |
|
|
|
title: '上传失败', |
|
|
|
icon: 'fail' |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 确认送货 |
|
|
|
delivery() { |
|
|
|
uni.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '确定确认送货吗?', |
|
|
|
success: (res) => { |
|
|
|
if (res.confirm) { |
|
|
|
supplierDelivery({ |
|
|
|
supplierOrderId: this.orderInfo.orderId |
|
|
|
}).then((res) => { |
|
|
|
if (res) { |
|
|
|
uni.showToast({ |
|
|
|
title: '确认订单成功', |
|
|
|
title: '确认送货成功', |
|
|
|
icon: 'success', |
|
|
|
success: () => { |
|
|
|
setTimeout(() => { |
|
|
|
this.init(order.orderId) |
|
|
|
this.init(this.orderInfo.orderId) |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -336,8 +444,15 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// cut: 分切 outbound: 出库 send: 发货 |
|
|
|
operatePaper(index, type) {}, |
|
|
|
// 查看合同 |
|
|
|
viewContract() { |
|
|
|
let url = this.orderInfo.contractUrl |
|
|
|
if (url) { |
|
|
|
transformFileToImg({ fileUrl: url }).then((res) => { |
|
|
|
uni.previewImage({ urls: [res.imgUrl], current: res.imgUrl }) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
clip(content) { |
|
|
|
uni.setClipboardData({ |
|
|
|
data: content, |
|
|
|
@ -460,4 +575,19 @@ export default { |
|
|
|
color: #007aff; |
|
|
|
margin: 0 14rpx; |
|
|
|
} |
|
|
|
.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; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |