Browse Source

整理预生产上架功能 2024/8/2

hella_vue3
王志国 1 month ago
parent
commit
c0ee72332a
  1. 18
      src/common/array.js
  2. 1
      src/common/record.js
  3. 25
      src/mycomponents/record/recordComDetailCard.vue
  4. 14
      src/mycomponents/scan/winScanPackage.vue
  5. 72
      src/pages/productPutaway/record/productPutawayRecord.vue

18
src/common/array.js

@ -277,7 +277,23 @@ export function getEditRemoveOption() {
return option_edit_remove; return option_edit_remove;
} }
//详情编辑移除
export function getEditLocationRemoveOption() {
let option_edit_remove = [{
text: '修改\n库位',
style: {
backgroundColor: '#F1A532'
}
},
{
text: '移除',
style: {
backgroundColor: '#F56C6C'
}
}
];
return option_edit_remove;
}
// 库存状态字典项 // 库存状态字典项
export function getInventoryStatusArray() { export function getInventoryStatusArray() {
let array = [{ let array = [{

1
src/common/record.js

@ -22,6 +22,7 @@ export function createItemInfo(balance, pack) {
uom: pack.uom, uom: pack.uom,
subList: [] subList: []
} }
item.containerNumber = pack.parentNumber != null ? pack.parentNumber : pack.number;
return item; return item;
} }

25
src/mycomponents/record/recordComDetailCard.vue

@ -5,6 +5,10 @@
<template v-slot:title> <template v-slot:title>
<u-swipe-action :show="false" style="width: 90%" :options="removeOptions" bg-color="rgba(255,255,255,0)" @click="(...event) => removeItem(event, dataContent)"> <u-swipe-action :show="false" style="width: 90%" :options="removeOptions" bg-color="rgba(255,255,255,0)" @click="(...event) => removeItem(event, dataContent)">
<item-qty :dataContent="dataContent" :isShowBalance="true" :isShowBalanceQty="isShowBalanceQty"></item-qty> <item-qty :dataContent="dataContent" :isShowBalance="true" :isShowBalanceQty="isShowBalanceQty"></item-qty>
<view style="margin-left: 10px; margin-top: 5px;">
<pack title='父包装' :packingCode='dataContent.containerNumber'></pack>
<location title='目标库位' :locationCode='dataContent.toLocationCode'></location>
</view>
</u-swipe-action> </u-swipe-action>
</template> </template>
<u-swipe-action :show="detail.show" :index="index" v-for="(detail, index) in dataContent.subList" :key="index" :options="detail.scaned ? scanOptions : detailOptions" bg-color="rgba(255,255,255,0)" class="u-m-b-20" @click="(...event) => swipeClick(event, detail)"> <u-swipe-action :show="detail.show" :index="index" v-for="(detail, index) in dataContent.subList" :key="index" :options="detail.scaned ? scanOptions : detailOptions" bg-color="rgba(255,255,255,0)" class="u-m-b-20" @click="(...event) => swipeClick(event, detail)">
@ -23,9 +27,11 @@ import { ref, onMounted, nextTick, watch } from 'vue'
import itemQty from '@/mycomponents/item/itemQty.vue' import itemQty from '@/mycomponents/item/itemQty.vue'
import balance from '@/mycomponents/balance/balance.vue' import balance from '@/mycomponents/balance/balance.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import location from '@/mycomponents/balance/location.vue'
import recordDetailPopup from '@/mycomponents/detail/recordDetailPopup.vue' import recordDetailPopup from '@/mycomponents/detail/recordDetailPopup.vue'
import pack from '@/mycomponents/balance/pack.vue'
import { getDetailOption, getDetailEditRemoveOption, getClearOption } from '@/common/array.js' import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue'
import { getDetailOption, getDetailEditRemoveOption, getClearOption,getEditLocationRemoveOption } from '@/common/array.js'
const props = defineProps({ const props = defineProps({
dataContent: { dataContent: {
@ -94,16 +100,18 @@ dataContent.value.subList.forEach((item) => {
onMounted(() => { onMounted(() => {
detailOptions.value = getDetailOption() detailOptions.value = getDetailOption()
scanOptions.value = getDetailEditRemoveOption() scanOptions.value = getDetailEditRemoveOption()
removeOptions.value = getClearOption() removeOptions.value = getEditLocationRemoveOption()
}) })
const removeItem = (params, dataContent) => { const removeItem = (params, dataContent) => {
const { text } = removeOptions.value[params[1]] const { text } = removeOptions.value[params[1]]
if (text == '清空') { if (text == '移除') {
comMessageRef.value.showQuestionMessage('确定清空物料及箱码信息?', (res) => { comMessageRef.value.showQuestionMessage('确定清空物料及箱码信息?', (res) => {
if (res) { if (res) {
emit('removeItem') emit('removeItem',dataContent)
} }
}) })
}else {
editLocation(dataContent)
} }
} }
const swipeClick = (params, item) => { const swipeClick = (params, item) => {
@ -141,9 +149,12 @@ const confirm = (qty) => {
editItem.value.handleQty = qty editItem.value.handleQty = qty
emit('updateData') emit('updateData')
} }
const editLocation = (item)=> {
editItem.value = item;
emit('editLocation', item)
}
// //
const emit = defineEmits(['updateData', 'removePack']) const emit = defineEmits(['updateData', 'removePack','editLocation'])
</script> </script>
<style> <style>

14
src/mycomponents/scan/winScanPackage.vue

@ -153,7 +153,16 @@ const getBalance = (result, callback) => {
} }
getBalanceByFilter(params) getBalanceByFilter(params)
.then((res) => { .then((res) => {
if (res.data.list.length == 0) { if (res.data.list.length > 0) {
res.data.list.forEach(r => {
if (packageInfo.parentNumber !== null) {
r.parentPackingNumber = packageInfo.parentNumber
} else {
r.parentPackingNumber = packageInfo.number
}
})
callback(res.data.list)
} else {
// //
if (packageInfo.subList.length > 0) { if (packageInfo.subList.length > 0) {
let packparams = ''; let packparams = '';
@ -175,6 +184,7 @@ const getBalance = (result, callback) => {
this.packGetFocus(); this.packGetFocus();
}) })
} else { } else {
res1.data.list.forEach(r => r.parentPackingNumber = packageInfo.number)
callback(res1.data.list) callback(res1.data.list)
} }
}).catch(err => { }).catch(err => {
@ -185,8 +195,6 @@ const getBalance = (result, callback) => {
this.packGetFocus(); this.packGetFocus();
}) })
} }
} else {
callback(res.data)
} }
}) })
.catch((err) => { .catch((err) => {

72
src/pages/productPutaway/record/productPutawayRecord.vue

@ -11,9 +11,9 @@
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)" :isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack"></record-com-detail-card> @updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation">
</record-com-detail-card>
</view> </view>
<view class="split_line"></view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
@ -21,10 +21,12 @@
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%"> <view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%">
<view class=""> <view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation="getToLocationCode" <!-- <requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation="getToLocationCode"-->
:locationAreaTypeList="tolocationTypeList"></requiredLocation> <!-- :locationAreaTypeList="tolocationTypeList"></requiredLocation>-->
</view> </view>
<view class="uni-flex uni-row"> <view class="uni-flex uni-row">
<button class="btn_single_reject" style="margin-right:5px ;" hover-class="btn_commit_after"
@click="commit">取消</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view> </view>
</view> </view>
@ -32,6 +34,8 @@
<win-scan-button @goScan="openScanPopup"></win-scan-button> <win-scan-button @goScan="openScanPopup"></win-scan-button>
</view> </view>
<win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package> <win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location>
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef" />
</view> </view>
</template> </template>
@ -39,7 +43,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' import { onLoad, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { productPutawayRecordSubmit } from '@/api/request2.js' import { productPutawayRecordSubmit,getPutawayRecommendLocation } from '@/api/request2.js'
import { goHome, getPackingNumberAndBatchByList, deepCopyData, updateTitle } from '@/common/basic.js' import { goHome, getPackingNumberAndBatchByList, deepCopyData, updateTitle } from '@/common/basic.js'
import { getPrecisionStrategyList } from '@/common/balance.js' import { getPrecisionStrategyList } from '@/common/balance.js'
@ -52,7 +56,7 @@
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue' import winScanPackage from '@/mycomponents/scan/winScanPackage.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
@ -76,6 +80,8 @@
const scanPopup = ref() const scanPopup = ref()
const comMessageRef = ref() const comMessageRef = ref()
const type = ref('') const type = ref('')
const editItem = ref(null)
const toLocationAreaTypeList = ref([])
onLoad((option) => { onLoad((option) => {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.title title: option.title
@ -91,6 +97,7 @@
businessType.value = res.businessType businessType.value = res.businessType
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList fromLocationAreaTypeList.value = res.fromLocationAreaTypeList
tolocationTypeList.value = res.tolocationTypeList tolocationTypeList.value = res.tolocationTypeList
toLocationAreaTypeList.value = res.toLocationAreaTypeList;
openScanPopup() openScanPopup()
} else { } else {
showErrorMessage(res.message) showErrorMessage(res.message)
@ -109,13 +116,17 @@
const pack = result.package const pack = result.package
result.balance.forEach( result.balance.forEach(
balance => { balance => {
var item = detailSource.value.find(res => { let item = detailSource.value.find(res => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode && res.containerNumber == balance.parentPackingNumber) {
return res return res
} }
}) })
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
//
getRecommendLocation(balance, res => {
itemp.toLocationCode = res.code;
})
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.fromInventoryStatus = balance.inventoryStatus; newDetail.fromInventoryStatus = balance.inventoryStatus;
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
@ -144,6 +155,40 @@
} }
) )
} }
const getRecommendLocation = (balance, callback)=> {
uni.showLoading({
title: '扫描中...',
mask: true
})
let param = {
itemCode: balance.itemCode,
batch: balance.batch,
inventoryStatus: balance.inventoryStatus,
supplierCode: '',
businessCode: this.bussinessCode
};
console.log(JSON.stringify(param))
getPutawayRecommendLocation(param).then(res => {
callback(res.data);
uni.hideLoading();
}).catch(error => {
uni.hideLoading()
showErrorMessage(error);
})
}
//
const removeRecommendLocation = ()=> {
showMessage('移除推荐的预占用库位')
}
const showScanToLocation = (item)=> {
editItem.value = item;
setTimeout(r => {
scanLocationCode.value.openScanPopup();
})
}
const handleCalcHandleQty = () => { const handleCalcHandleQty = () => {
calcHandleQty(detailSource.value) calcHandleQty(detailSource.value)
@ -151,12 +196,14 @@
const removeItem = (index, item) => { const removeItem = (index, item) => {
detailSource.value.splice(index, 1) detailSource.value.splice(index, 1)
removeRecommendLocation()
} }
const removePack = () => { const removePack = () => {
for (let i = 0; i < detailSource.value.length; i++) { for (let i = 0; i < detailSource.value.length; i++) {
const item = detailSource.value[i] const item = detailSource.value[i]
if (item.subList.length == 0) { if (item.subList.length == 0) {
detailSource.value.splice(i, 1) detailSource.value.splice(i, 1)
removeRecommendLocation()
} }
} }
updateData() updateData()
@ -325,16 +372,9 @@
const closeScanMessage = () => { const closeScanMessage = () => {
scanPopupGetFocus() scanPopupGetFocus()
} }
const getLocation = (location, code) => {
getFromLocationCode(location, code)
}
const getFromLocationCode = (location, code) => {
fromLocationCode.value = code
openScanPopup()
}
const getToLocationCode = (location, code) => { const getToLocationCode = (location, code) => {
console.log(code) console.log(code)
toLocationCode.value = code editItem.value.toLocationCode = code
// detailSource.value.forEach((item) => { // detailSource.value.forEach((item) => {
// item.subList.forEach((detail) => { // item.subList.forEach((detail) => {
// detail.toLocationCode = toLocationCode.value // detail.toLocationCode = toLocationCode.value

Loading…
Cancel
Save