Browse Source

新增上架时包件下架和托盘下架

dev
qb 1 year ago
parent
commit
9c5657eab0
  1. 14
      api/user.js
  2. 8
      pagesHome/pages/CustomerSign/CustomerSign.vue
  3. 6
      pagesHome/pages/DownGoods/DownGoods.vue
  4. 273
      pagesHome/pages/ScanUp/ScanUp.vue
  5. BIN
      static/PartialSelection.png

14
api/user.js

@ -2809,4 +2809,16 @@ export function postTransferUnloadTray(data, loadingObj = {}) {
); );
} }
///logpm-trunkline/api/tripartiteTransfer/transferUnloadTray /**
* 查询该库位该订单内上架的包条数据
* @param {Object} data
*/
export function postorderUpshelfDetailByAllocationId(data, loadingObj = {}) {
return request({
url: `logpm-warehouse/api/warehouseUpdownType/orderUpshelfDetailByAllocationId`,
method: "post",
data
},
loadingObj
);
}

8
pagesHome/pages/CustomerSign/CustomerSign.vue

@ -138,10 +138,10 @@
* "photo_5": 签收照 * "photo_5": 签收照
*/ */
ImagesRequiredFields: [ ImagesRequiredFields: [
{ // {
key: "photo_1", // key: "photo_1",
isShowTitle: false // isShowTitle: false
}, // },
{ {
key: "photo_2", key: "photo_2",
isShowTitle: false isShowTitle: false

6
pagesHome/pages/DownGoods/DownGoods.vue

@ -346,6 +346,12 @@
details.typelist = ['订单号', '运单号'] details.typelist = ['订单号', '运单号']
utils.ttsspke(`当前下架方式为${op.pageName}, 请录入订单号或运单号`) utils.ttsspke(`当前下架方式为${op.pageName}, 请录入订单号或运单号`)
} }
// --
if (op.trayCode) {
details.scancode = op.trayCode
scandata()
}
}) })
onShow(() => { onShow(() => {

273
pagesHome/pages/ScanUp/ScanUp.vue

@ -77,10 +77,13 @@
<scroll-view class="sclcs" scroll-y="true"> <scroll-view class="sclcs" scroll-y="true">
<view class="visc"> <view class="visc">
<template v-if="details.checkstate === 1 || details.checkstate === 2"> <template v-if="details.checkstate === 1 || details.checkstate === 2">
<view class="item1" v-for="item in renderList"> <view class="item1" v-for="(item, index) in renderList">
<view class="tpbx" v-if="item.goodsType==0"> <view class="tpbx" v-if="item.goodsType==0">
<image src="/pagesHome/static/kuweiicon.png"></image> <image src="/pagesHome/static/kuweiicon.png"></image>
<view>包条码{{item.orderPackageCode}}</view> <view>包条码{{item.orderPackageCode}}</view>
<!-- 移除 -->
<image class="removeicon" @click="handleRemove(index)" src="/pagesHome/static/removeitem.png">
</image>
</view> </view>
<view class="tpbx" v-if="item.goodsType==0" @click.stop="goorderdetail(item, item.goodsType)"> <view class="tpbx" v-if="item.goodsType==0" @click.stop="goorderdetail(item, item.goodsType)">
<image src="/pagesHome/static/kuweiicon.png"></image> <image src="/pagesHome/static/kuweiicon.png"></image>
@ -139,21 +142,20 @@
</view> </view>
</view> </view>
<view class="tpbx">
<template <template
v-if="Number(details.upshelfScanType) === 1 || Number(details.upshelfScanType) === 2 ||details.checkstate === 2"> v-if="Number(details.upshelfScanType) === 1 || Number(details.upshelfScanType) === 2 ||details.checkstate === 2">
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image> <image src="/pagesHome/static/kuweiicon.png"></image>
<view style="flex: 1; display: inline-flex; justify-content: space-between;"> <view style="flex: 1; display: inline-flex; justify-content: space-between;">
<view>总数{{item.totalNum}}</view> <view>总数{{item.totalNum}}</view>
<view>上架数量{{item.shelfNum}}</view> <view>上架数量{{item.shelfNum}}</view>
</view> </view>
</template> </view>
<!-- <template v-else> <view class="downloadBtn" @click="handleDownLoadByOrder(item)">
<image src="/pagesHome/static/kuweiicon.png"></image> 下架
<view>已扫数量{{item.shelfNum}}</view>
</template> -->
</view> </view>
</template>
<image v-if="Number(details.upshelfScanType)!=3" class="qtimgzt" <image v-if="Number(details.upshelfScanType)!=3" class="qtimgzt"
:src="item.totalNum==item.shelfNum?'/pagesHome/static/qitao.png':'/pagesHome/static/weiqitao.png'"> :src="item.totalNum==item.shelfNum?'/pagesHome/static/qitao.png':'/pagesHome/static/weiqitao.png'">
@ -170,6 +172,10 @@
<image src="/pagesHome/static/scanicon.png"></image> <image src="/pagesHome/static/scanicon.png"></image>
<view>托盘数量{{reqobj.trayNum}}</view> <view>托盘数量{{reqobj.trayNum}}</view>
</view> </view>
<view class="downloadBtn" @click="handleDownLoadByTray">
托盘下架
</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -185,6 +191,47 @@
<saomiao2 :ishidestop="scanState !== 0"></saomiao2> <saomiao2 :ishidestop="scanState !== 0"></saomiao2>
<!-- #endif --> <!-- #endif -->
<tips ref="tip"></tips> <tips ref="tip"></tips>
<!-- 下架 -- 包条 -->
<PopUp ref="downLoadByOrder">
<view class="downLoadByOrder_control">
<!-- 全选 -->
<image v-show="chooseOrderPackageCodeList.length === details.orderPackageCodeList.length"
src="/pagesHome/static/downcheck.png" @click="handleCloseCheck"></image>
<!-- 部分选 -->
<image v-show="
chooseOrderPackageCodeList.length !== details.orderPackageCodeList.length
&& chooseOrderPackageCodeList.length > 0
" src="/pagesHome/static/miniqc.png" @click="handleCheckAll"></image>
<!-- 全未选 -->
<image v-show="chooseOrderPackageCodeList.length === 0" src="/pagesHome/static/downnocheck.png"
@click="handleCheckAll"></image>
</view>
<scroll-view scroll-y="true" style="height: 35vh;">
<block v-for="item in details.orderPackageCodeList" :key="item.code">
<view class="downloadRow" @click="handleCheck(item)">
<image v-if="!item.checked" src="/pagesHome/static/downnocheck.png"></image>
<image v-if="item.checked" src="/pagesHome/static/downcheck.png"></image>
<view>{{item.code}}</view>
</view>
</block>
</scroll-view>
</PopUp>
<!-- 下架 -- 库存品 || 零担 -->
<PopUp ref="downLoadByStock">
<view class="downLoadByStock_row">
<view>
下架数
</view>
<input v-model="details.enterNum" type="number" />
</view>
</PopUp>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -193,7 +240,9 @@
warehouseUpdownTypeupShelfScanAllocation, warehouseUpdownTypeupShelfScanAllocation,
warehouseUpdownTypeupShelfOrder, warehouseUpdownTypeupShelfOrder,
warehouseUpdownTypeupShelfPackage, warehouseUpdownTypeupShelfPackage,
warehouseUpdownTypeupShelfTray warehouseUpdownTypeupShelfTray,
postorderUpshelfDetailByAllocationId,
warehouseUpdownTypedownPackage
} from '@/api/user.js' } from '@/api/user.js'
import { import {
onLoad, onLoad,
@ -202,7 +251,7 @@
onUnload, onUnload,
onPullDownRefresh onPullDownRefresh
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { inject, reactive, ref, toRefs, watchEffect } from "vue"; import { computed, inject, nextTick, reactive, ref, toRefs, watchEffect } from "vue";
import useSystemSettingsStore from '@/store/useSystemSettingsStore'; import useSystemSettingsStore from '@/store/useSystemSettingsStore';
import useStorageStore from '@/store/useStorageStore'; import useStorageStore from '@/store/useStorageStore';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
@ -220,8 +269,20 @@
uplistarr: [], uplistarr: [],
renderList: [], renderList: [],
// //
orderCodeArr: [] orderCodeArr: [],
/** 包件list */
orderPackageCodeList: [],
/** 库存品 || 零担 提交数 */
enterNum: 0
}) })
/** 被选中的包件 */
const chooseOrderPackageCodeList = ref([])
//
/** 下架 -- 包条 */
const downLoadByOrder = ref()
const downLoadByStock = ref()
// downLoadByStock
watchEffect(() => { watchEffect(() => {
if (Number(details.upshelfScanType) == 1 || Number(details.upshelfScanType) == 2) { if (Number(details.upshelfScanType) == 1 || Number(details.upshelfScanType) == 2) {
@ -240,7 +301,7 @@
}) })
// //
onShow(() => { onShow(async () => {
// #ifdef APP // #ifdef APP
uni.$off('scancodedate') uni.$off('scancodedate')
uni.$on('scancodedate', function (code) { uni.$on('scancodedate', function (code) {
@ -252,6 +313,9 @@
} }
}) })
// #endif // #endif
await nextTick()
downLoadByStock.value.details.showPopUp = true
}) })
// //
@ -273,7 +337,7 @@
// //
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
clearTimeout(timer) clearTimeout(timer)
}, 500) }, 300)
}) })
/** 扫描库位 */ /** 扫描库位 */
@ -388,6 +452,7 @@
} }
} }
/** 扫描后执行的回调 */
async function scandata() { async function scandata() {
uni.showLoading({ uni.showLoading({
@ -404,6 +469,8 @@
else scanOther(code) else scanOther(code)
} }
/** 详情页面 */
function goorderdetail(item, type) { function goorderdetail(item, type) {
// type // type
if (type !== 1) return if (type !== 1) return
@ -411,6 +478,8 @@
url: '/pagesHome/pages/orderDetails/orderDetails?orderCode=' + item.orderCode url: '/pagesHome/pages/orderDetails/orderDetails?orderCode=' + item.orderCode
}) })
} }
/** 上架提交 */
function uplist() { function uplist() {
let content = '' let content = ''
if (details.allocationId === '') { if (details.allocationId === '') {
@ -492,6 +561,7 @@
} }
}) })
} }
// //
function fn2(tempArr, fnname) { function fn2(tempArr, fnname) {
let result = []; let result = [];
@ -516,11 +586,15 @@
}) })
return result; return result;
}; };
/** 切换TabBar时执行的回调函数 */
function setstate(state : number) { function setstate(state : number) {
details.checkstate = state details.checkstate = state
if (state === 1) return details.renderList = details.uplistarr if (state === 1) return details.renderList = details.uplistarr
else if (state === 2) return details.renderList = details.datalist else if (state === 2) return details.renderList = details.datalist
} }
/** 开启小程序扫描 */
function handleScan() { function handleScan() {
// //
uni.scanCode({ uni.scanCode({
@ -532,6 +606,100 @@
} }
}) })
} }
/** 按托盘下架 */
const handleDownLoadByTray = () => {
if (!details.reqobj.trayCode) return uni.showToast({
title: '托盘数据有存在异常',
icon: 'none'
})
let url = '/pagesHome/pages/DownGoods/DownGoods?type=' + 1 + '&pageName=' + '按托盘下架' + '&trayCode=' + details.reqobj.trayCode
uni.navigateTo({
url
})
}
/** 移除待上架数据 */
const handleRemove = (index : number) => {
details.uplistarr.splice(index, 1)
}
/** 下架库位中订单内包件 */
const handleDownLoadByOrder = async (item : any) => {
const res = await postorderUpshelfDetailByAllocationId({
orderCode: item.orderCode,
allocationId: details.allocationId
})
if (res.code !== 200) return
details.orderPackageCodeList = res.data && res.data.map(val => {
return {
code: val,
checked: true
}
}) || []
chooseOrderPackageCodeList.value = res.data || []
downLoadByOrder.value.setDetails({
title: '包件下架',
showPopUp: true,
async success() {
if (details.orderPackageCodeList.length === 0) return uni.showToast({
title: '没有需要下架的数据'
})
if (chooseOrderPackageCodeList.value.length === 0) return uni.showToast({
title: '最少选择一条需要下架的数据'
})
const submitData = {
upShelfPackageList: chooseOrderPackageCodeList.value.map((val) => {
return { orderPackageCode: val }
})
}
const res = await warehouseUpdownTypedownPackage(submitData)
if (res.code !== 200) return
details.scancode = details.allocationId
scandata()
downLoadByOrder.value.details.showPopUp = false
}
})
}
/** 下架 -- 订单 -- 全选 */
const handleCheckAll = () => {
const _arr = []
for (let iterator of details.orderPackageCodeList) {
iterator.checked = true
_arr.push(iterator.code)
}
chooseOrderPackageCodeList.value = _arr
}
/** 下架 -- 订单 -- 全部取消选择 */
const handleCloseCheck = () => {
chooseOrderPackageCodeList.value = []
for (let iterator of details.orderPackageCodeList) {
iterator.checked = false
}
}
/** 下架 -- 订单 -- 单个点击 */
const handleCheck = (item) => {
if (item.checked) chooseOrderPackageCodeList.value.splice(chooseOrderPackageCodeList.value.indexOf(item.code), 1)
else chooseOrderPackageCodeList.value.push(item.code)
item.checked = !item.checked
}
const { const {
uplistarr, uplistarr,
checkstate, checkstate,
@ -540,7 +708,7 @@
} = toRefs(details) } = toRefs(details)
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.butbox { .butbox {
display: flex; display: flex;
align-items: center; align-items: center;
@ -638,6 +806,12 @@
width: 32upx; width: 32upx;
height: 32upx; height: 32upx;
margin-right: 15upx; margin-right: 15upx;
&.removeicon {
width: 64upx;
height: 64upx;
}
} }
>view { >view {
@ -652,20 +826,6 @@
} }
} }
.viewnum {
height: 100upx;
display: flex;
align-items: center;
justify-content: space-around;
>view {
font-size: 28upx;
font-weight: 400;
color: #020B18;
}
}
.tabchecklist { .tabchecklist {
width: 684upx; width: 684upx;
height: 100upx; height: 100upx;
@ -873,4 +1033,63 @@
padding: 15upx 0; padding: 15upx 0;
border-radius: 10upx; border-radius: 10upx;
} }
//
.downloadBtn {
width: fit-content;
background: var(--subjectColor);
color: #fff;
margin: 10upx auto;
padding: 20upx 40upx;
font-size: 0.9rem;
border-radius: 10upx;
}
// --
.downloadRow {
display: flex;
align-items: center;
padding: 18upx 24upx;
box-sizing: border-box;
border-bottom: 4upx solid #EEEEEE;
image {
flex: none;
width: 52upx;
height: 52upx;
margin-right: 15upx;
}
>view {
font-size: 0.9rem;
font-weight: bold;
color: #020B18;
}
}
.downLoadByOrder_control {
>image {
width: 52upx;
height: 52upx;
margin-left: 20upx;
}
}
// ||
.downLoadByStock_row {
display: flex;
align-items: center;
>view {
font-weight: bold;
font-size: 0.9rem;
}
>input {
flex: 1;
background: #F4F8FB;
padding: 10upx 20upx;
border-radius: 10upx;
}
}
</style> </style>

BIN
static/PartialSelection.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Loading…
Cancel
Save