|
@@ -1,40 +1,104 @@
|
|
|
<template>
|
|
|
<view class="sendOutGoods-wrap">
|
|
|
- <view class="barCode" id="barcode"></view>
|
|
|
- <view class="info-body">
|
|
|
- <view class="info partList">
|
|
|
- <!-- 补货产品 -->
|
|
|
- <partList :list="partList" title="补货产品" model="view" fromPage="sendOutGoods" ref="partList" noDataText="暂无产品"></partList>
|
|
|
+ <view class="sendOutGoods-con">
|
|
|
+ <view class="barCode" id="barcode"></view>
|
|
|
+ <view class="info-body">
|
|
|
+ <view class="info partList">
|
|
|
+ <!-- 补货产品 -->
|
|
|
+ <partList :list="partList" title="补货产品" model="view" fromPage="sendOutGoods" ref="partList" noDataText="暂无产品"></partList>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="sendOutGoods-footer">
|
|
|
+ <u-button @click="handleOutGoods" type="success" :custom-style="customStyle" hover-class="none" shape="circle">立即出库</u-button>
|
|
|
+ </view>
|
|
|
<!-- 确认弹框 -->
|
|
|
- <common-modal v-if="confirmModal" :openModal="confirmModal" title="扫码失败" content="确认对该数字货架进行补货吗?" confirmText="好的" :isCancel="false" @confirm="modalConfirm" @close="confirmModal=false" />
|
|
|
+ <common-modal v-if="confirmModal" :openModal="confirmModal" title="扫码失败" :content="contModal" confirmText="好的" :isCancel="false" @confirm="modalConfirm" @close="confirmModal=false" />
|
|
|
+ <!-- 出库确认弹框 -->
|
|
|
+ <common-modal v-if="confirmOutModal" :openModal="confirmOutModal" title="出库" content="此补货单产品已经全部扫描完成,确认出库吗?" confirmText="确认出库" @confirm="modalOutConfirm" @close="confirmOutModal=false" />
|
|
|
+ <!-- 选择配送方式弹框 -->
|
|
|
+ <choose-type-modal v-if="chooseModal" :openModal="chooseModal" @confirm="modalChooseType" @close="chooseModal=false" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import partList from '@/pages/common/partList.vue'
|
|
|
+ import chooseTypeModal from './chooseTypeModal.vue'
|
|
|
import commonModal from '@/pages/common/commonModal.vue'
|
|
|
- import { shelfReplenishDetailList, shelfReplenishQrCode } from '@/api/shelfReplenish'
|
|
|
+ import { getQueryString } from '@/libs/tools'
|
|
|
+ import { shelfReplenishDetailList, shelfReplenishDetailOutScan, shelfReplenishOutStock } from '@/api/shelfReplenish'
|
|
|
export default {
|
|
|
- components: { partList, commonModal },
|
|
|
+ components: { partList, commonModal, chooseTypeModal },
|
|
|
data() {
|
|
|
return {
|
|
|
barcode:null,
|
|
|
replenishBillSn: null,
|
|
|
+ shelfSn: null,
|
|
|
partList: [],
|
|
|
- confirmModal: false
|
|
|
+ confirmModal: false,
|
|
|
+ customStyle: {
|
|
|
+ borderRadius:'100rpx',
|
|
|
+ fontSize:'30rpx',
|
|
|
+ background: this.$config('primaryColor')
|
|
|
+ },
|
|
|
+ isAll: false,
|
|
|
+ contModal: '',
|
|
|
+ confirmOutModal: false,
|
|
|
+ chooseModal: false
|
|
|
}
|
|
|
},
|
|
|
onReady() {
|
|
|
// 初始化摄像头
|
|
|
- // this.init()
|
|
|
+ this.init()
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- this.replenishBillSn = options.replenishBillSn
|
|
|
+ this.replenishBillSn = options.sn
|
|
|
+ this.shelfSn = options.shelfSn
|
|
|
this.getPartList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 立即出库
|
|
|
+ handleOutGoods(){
|
|
|
+ if(this.isAll){
|
|
|
+ this.confirmOutModal = true
|
|
|
+ }else{
|
|
|
+ this.toashMsg("请全部扫描完成后,再进行出库操作")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 选择配送方式
|
|
|
+ modalChooseType(data){
|
|
|
+ const _this = this
|
|
|
+ const arr = []
|
|
|
+ _this.partList.map((item, index) => {
|
|
|
+ arr.push({
|
|
|
+ productSn: item.productSn,
|
|
|
+ confirmQty: item.confirmQty,
|
|
|
+ replenishBillDetailSn: item.replenishBillDetailSn
|
|
|
+ })
|
|
|
+ })
|
|
|
+ const params = {
|
|
|
+ replenishBillSn: _this.replenishBillSn,
|
|
|
+ detailList: arr,
|
|
|
+ dispatchType: data.dispatchType,
|
|
|
+ remarks: data.remarks,
|
|
|
+ shelfSn: _this.shelfSn
|
|
|
+ }
|
|
|
+ console.log(params)
|
|
|
+ shelfReplenishOutStock(params).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.toashMsg(res.message)
|
|
|
+ _this.chooseModal = false
|
|
|
+ uni.navigateTo({ url: '/pages/replenishmentManage/replenishmentList?billState=WAIT_OUT_STOCK' })
|
|
|
+ }else{
|
|
|
+ _this.toashMsg(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 确认出库
|
|
|
+ modalOutConfirm(){
|
|
|
+ this.chooseModal = true
|
|
|
+ },
|
|
|
// 查询列表
|
|
|
getPartList(){
|
|
|
const _this = this
|
|
@@ -52,23 +116,21 @@
|
|
|
// 扫码结果
|
|
|
scanResult(qrCode){
|
|
|
const _this = this
|
|
|
- shelfReplenishQrCode({
|
|
|
- qrCode: qrCode,
|
|
|
- replenishBillSn: this.replenishBillSn
|
|
|
+ shelfReplenishDetailOutScan({
|
|
|
+ productSn: getQueryString('&'+qrCode, 'productSn'),
|
|
|
+ replenishBillDetailSn: getQueryString('&'+qrCode, 'replenishBillDetailSn')
|
|
|
}).then(res => {
|
|
|
+ console.log(res)
|
|
|
if(res.status == 200){
|
|
|
_this.toashMsg("扫码成功!")
|
|
|
- uni.navigateTo({ url: "/pages/common/printTag/printTag?sn="+item.replenishBillSn })
|
|
|
+ _this.getPartList()
|
|
|
+ if(res.data && res.data.totalConfirmQty && res.data.totalScanQty && res.data.totalConfirmQty == res.data.totalScanQty){
|
|
|
+ _this.isAll = true
|
|
|
+ _this.handleOutGoods()
|
|
|
+ }
|
|
|
}else{
|
|
|
+ this.contModal = res.message
|
|
|
this.confirmModal = true
|
|
|
- // clzConfirm({
|
|
|
- // title: '扫码失败',
|
|
|
- // content: res.message,
|
|
|
- // showCancel: false,
|
|
|
- // success: (ret) => {
|
|
|
- // _this.barcode.start()
|
|
|
- // }
|
|
|
- // })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -120,21 +182,38 @@
|
|
|
height: 100vh;
|
|
|
}
|
|
|
.sendOutGoods-wrap{
|
|
|
+ position: relative;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
- .barCode{
|
|
|
- height: 28%;
|
|
|
- }
|
|
|
- .info-body{
|
|
|
- flex-flow: 1;
|
|
|
+ overflow: hidden;
|
|
|
+ padding-bottom: 136upx;
|
|
|
+ .sendOutGoods-con{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
overflow: auto;
|
|
|
- height: 72%;
|
|
|
+ .barCode{
|
|
|
+ height: 30%;
|
|
|
+ }
|
|
|
+ .info-body{
|
|
|
+ flex-flow: 1;
|
|
|
+ overflow: auto;
|
|
|
+ height: 70%;
|
|
|
+ }
|
|
|
+ .info{
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ padding: 10rpx 30upx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ }
|
|
|
}
|
|
|
- .info{
|
|
|
- background-color: #FFFFFF;
|
|
|
- padding: 10rpx 30upx;
|
|
|
- font-size: 32rpx;
|
|
|
- margin-top: 20rpx;
|
|
|
+ .sendOutGoods-footer{
|
|
|
+ padding: 26upx 32upx 30upx;
|
|
|
+ background-color: #fff;
|
|
|
+ position: fixed;
|
|
|
+ left: 0;
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ box-shadow: 3px 1px 7px #eee;
|
|
|
}
|
|
|
}
|
|
|
</style>
|