Browse Source

直接补料扫描数量2024/7/11 19:27:31uni_modules组件没写

hella_vue3
zhang_li 3 months ago
parent
commit
88613d0eb2
  1. 33
      src/common/basic.js
  2. 3
      src/mycomponents/scan/winComScanBalance.vue
  3. 5
      src/pages/container/record/containerBindRecord.vue
  4. 282
      src/pages/container/record/containerUnBindRecord.vue
  5. 13
      src/pages/fg/receiptByPlan.vue
  6. 263
      src/pages/package/record/mergePackageRecord.vue
  7. 32
      src/pages/package/record/overPackageRecord.vue
  8. 453
      src/pages/package/record/splitPackageRecord.vue
  9. 1
      src/pages/productPutaway/job/productPutawayDetail.vue
  10. 6
      src/pages/repleinsh/record/directRepleinshRecord.vue

33
src/common/basic.js

@ -726,23 +726,22 @@ export function getPackingNumberAndBatch(managementList, itemCode, packingNumber
return itemInfo; return itemInfo;
} }
// //提示是否消息 // 提示是否消息
// export function showConfirmMsg(content, callback) { export function showConfirmMsg(content, callback) {
// uni.showModal({ uni.showModal({
// title: '提示', title: '提示',
// cancelText: '否', cancelText: '否',
// confirmText: '是', confirmText: '是',
// content: content, content: content,
// success: function(res) { success: function(res) {
// if (res.confirm) { if (res.confirm) {
// callback(true); callback(true);
// } else { } else {
// callback(false); callback(false);
// } }
// }, },
// }) })
// scanErrorAudio(); }
// }
export function compare(key) { export function compare(key) {
return function(a, b) { return function(a, b) {
var val1 = a[key]; var val1 = a[key];

3
src/mycomponents/scan/winComScanBalance.vue

@ -124,6 +124,9 @@ export default {
this.showErrorMessage(hint) this.showErrorMessage(hint)
} else if (res.data.length == 1) { } else if (res.data.length == 1) {
result.balance = res.data[0] result.balance = res.data[0]
if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.lableQty = result.label.qty
}
this.$emit('getBalance', result) this.$emit('getBalance', result)
// this.closeScanPopup() // this.closeScanPopup()
} else { } else {

5
src/pages/container/record/containerBindRecord.vue

@ -79,6 +79,11 @@ const scanLocationPopup = ref()
const scanContainer = ref() const scanContainer = ref()
const scanPopup = ref() const scanPopup = ref()
const comMessageRef = ref() const comMessageRef = ref()
onLoad((option) => {
uni.setNavigationBarTitle({
title: option.title
})
})
onNavigationBarButtonTap((e) => { onNavigationBarButtonTap((e) => {
if (e.index === 0) { if (e.index === 0) {
goHome() goHome()

282
src/pages/container/record/containerUnBindRecord.vue

@ -1,80 +1,58 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class=""> <view class="">
<com-blank-view @goScan='showContainerPopup' v-if="containerCode==''"></com-blank-view> <com-blank-view @goScan="showContainerPopup" v-if="containerCode == ''"></com-blank-view>
</view> </view>
<view class="page-wraper" v-if="containerCode != ''"> <view class="page-wraper" v-if="containerCode != ''">
<view class="" style="margin-left: 20rpx;"> <view class="" style="margin-left: 20rpx">
<targetContainer ref="targetContainer" title="托盘" :containerCode="containerCode" :isShowEdit="false" <targetContainer ref="targetContainer" title="托盘" :containerCode="containerCode" :isShowEdit="false" @getContainer="getContainer"></targetContainer>
@getContainer="getContainer"></targetContainer>
</view> </view>
<view class='split_line'></view> <view class="split_line"></view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<!-- {{item.contentNumber}} --> <!-- {{item.contentNumber}} -->
<comPalletRecord :dataContent="item" :index="index" <comPalletRecord :dataContent="item" :index="index" :isShowPatch="false" @removeItem="removeItem(index, item)" @updateData="updateData" @removePack="removePack"> </comPalletRecord>
:isShowPatch="false" @removeItem="removeItem(index,item)" @updateData="updateData"
@removePack="removePack">
</comPalletRecord>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%">
style="background-color:ghostwhite; width: 100%; "> <view class=""> </view>
<view class="">
</view>
<view class="uni-flex uni-row"> <view class="uni-flex uni-row">
<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>
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan="openScanPopup"></win-scan-button>
</view> </view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack> <win-scan-pack ref="scanPopup" @getResult="getScanResult"></win-scan-pack>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
<winScanContainer ref="scanContainer" title="托盘" @getContainer='getContainer'></winScanContainer> <winScanContainer ref="scanContainer" title="托盘" @getContainer="getContainer"></winScanContainer>
</view> </view>
</template> </template>
<script> <script>
import { import { containerUnBindRecordSubmit, getContainerDetailByNumber } from '@/api/request2.js'
containerUnBindRecordSubmit, import { goHome } from '@/common/basic.js'
getContainerDetailByNumber
} from '@/api/request2.js'; import { calc } from '@/common/calc.js'
import {
goHome import { getDirectoryItemArray } from '@/common/directory.js'
} from '@/common/basic.js';
import { createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import {
calc import { getScanCount } from '@/common/detail.js'
} from '@/common/calc.js';
import {
getDirectoryItemArray
} from '@/common/directory.js';
import {
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import {
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import targetContainer from "@/mycomponents/container/targetContainer.vue" import targetContainer from '@/mycomponents/container/targetContainer.vue'
import winScanContainer from "@/mycomponents/scan/winScanContainer.vue" import winScanContainer from '@/mycomponents/scan/winScanContainer.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import comPalletRecord from '@/pages/container/coms/comPalletRecord.vue' import comPalletRecord from '@/pages/container/coms/comPalletRecord.vue'
@ -95,16 +73,18 @@
detailSource: [], // detailSource: [], //
businessTypeInfo: {}, businessTypeInfo: {},
fromLocationInfo: {}, fromLocationInfo: {},
containerCode: "", containerCode: ''
}; }
}, },
onLoad(option) { onLoad(option) {
uni.setNavigationBarTitle({
title: option.title
})
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome()
} }
}, },
// //
@ -113,75 +93,71 @@
onPullDownRefresh() {}, onPullDownRefresh() {},
mounted() { mounted() {
this.showContainerPopup(); this.showContainerPopup()
}, },
methods: { methods: {
getScanResult(result) { getScanResult(result) {
try { try {
var packingNumber = result.label.packingNumber; const { packingNumber } = result.label
var batch = result.label.batch; const { batch } = result.label
var qty = result.label.qty; const { qty } = result.label
var itemCode = result.label.itemCode; const { itemCode } = result.label
var detail = this.detailSource.find(r => r.itemCode == itemCode); const detail = this.detailSource.find((r) => r.itemCode == itemCode)
if (detail == undefined) { if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中") this.showMessage(`物料号【${itemCode}】不在列表中`)
} else { } else {
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch); const itemDetail = detail.subList.find((r) => r.packingNumber == packingNumber && r.batch == batch)
if (itemDetail == undefined) { if (itemDetail == undefined) {
this.showMessage("箱码【" + packingNumber + "】,批次【" + batch + "】不在列表中") this.showMessage(`箱码【${packingNumber}】,批次【${batch}】不在列表中`)
} else if (itemDetail.scaned) {
this.showMessage(`箱码【${packingNumber}】,批次【${batch}】已经扫描`)
} else { } else {
if (itemDetail.scaned) { itemDetail.scaned = true
this.showMessage("箱码【" + packingNumber + "】,批次【" + batch + "】已经扫描") itemDetail.record = this.createRecordInfo(itemDetail, result.label)
} else {
itemDetail.scaned = true;
itemDetail.record = this.createRecordInfo(itemDetail, result.label);
// this.calcHandleQty(); // this.calcHandleQty();
} }
} }
}
} catch (e) { } catch (e) {
this.showErrorMessage(e.message) this.showErrorMessage(e.message)
} }
}, },
createRecordInfo(detail, label) { createRecordInfo(detail, label) {
var record = {} const record = {}
detail.scaned = true; detail.scaned = true
// let record = JSON.parse(JSON.stringify(detail)); // let record = JSON.parse(JSON.stringify(detail));
// //
Object.assign(record, detail) Object.assign(record, detail)
record.qty = Number(label.qty); record.qty = Number(label.qty)
return record; return record
}, },
calcHandleQty() { calcHandleQty() {
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource)
this.scanPopupGetFocus(); this.scanPopupGetFocus()
this.$forceUpdate(); this.$forceUpdate()
}, },
getDataSource(subList) { getDataSource(subList) {
let items = []; const items = []
subList.forEach(detail => { subList.forEach((detail) => {
var item = items.find(r => let item = items.find((r) => r.itemCode == detail.itemCode)
r.itemCode == detail.itemCode)
if (item == undefined) { if (item == undefined) {
item = this.createItemInfo(detail); item = this.createItemInfo(detail)
let newDetail = this.createDetailInfo(detail); // const newDetail = this.createDetailInfo(detail) //
item.subList.push(newDetail); item.subList.push(newDetail)
items.push(item) items.push(item)
} else { } else {
item.qty = calc.add(item.qty, detail.qty) item.qty = calc.add(item.qty, detail.qty)
let newDetail = this.createDetailInfo(detail); // const newDetail = this.createDetailInfo(detail) //
item.subList.push(newDetail); item.subList.push(newDetail)
} }
}) })
return items; return items
}, },
updateData() { updateData() {
this.calcHandleQty(); this.calcHandleQty()
}, },
removeItem(index, item) { removeItem(index, item) {
@ -189,7 +165,7 @@
}, },
createItemInfo(res) { createItemInfo(res) {
let item = { const item = {
itemCode: res.itemCode, itemCode: res.itemCode,
itemName: res.itemName, itemName: res.itemName,
packQty: res.packQty, packQty: res.packQty,
@ -199,54 +175,53 @@
uom: res.uom, uom: res.uom,
subList: [] subList: []
} }
return item; return item
}, },
createDetailInfo(data) { createDetailInfo(data) {
data.scaned = false; data.scaned = false
data.packingNumber = data.contentNumber data.packingNumber = data.contentNumber
data.qty = Number(data.qty) data.qty = Number(data.qty)
data.handleQty =0; data.handleQty = 0
let detail = data; const detail = data
return detail; return detail
}, },
removePack() { removePack() {
for (var i = 0; i < this.detailSource.length; i++) { for (let i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i]; const item = this.detailSource[i]
if (item.subList.length == 0) { if (item.subList.length == 0) {
this.detailSource.splice(i, 1) this.detailSource.splice(i, 1)
} }
} }
this.updateData(); this.updateData()
}, },
openScanPopup() { openScanPopup() {
if (this.containerCode == "") { if (this.containerCode == '') {
this.showContainerPopup(); this.showContainerPopup()
return return
} }
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup()
}, },
showContainerPopup() { showContainerPopup() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.scanContainer.openScanPopup(); this.$refs.scanContainer.openScanPopup()
}) })
}, },
closeScanPopup() { closeScanPopup() {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup()
}, },
scanPopupGetFocus() { scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus(); this.$refs.scanPopup.getfocus()
} }
}, },
scanPopupLoseFocus() { scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus(); this.$refs.scanPopup.losefocus()
} }
}, },
@ -256,128 +231,125 @@
mask: true mask: true
}) })
this.scanCount = getScanCount(this.detailSource[0].subList); this.scanCount = getScanCount(this.detailSource[0].subList)
if (this.scanCount == 0) { if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描要解绑的箱码") this.showErrorMessage('扫描数为0,请先扫描要解绑的箱码')
return; return
} }
let params = this.getParams(); const params = this.getParams()
console.log("提交" + JSON.stringify(params)) console.log(`提交${JSON.stringify(params)}`)
containerUnBindRecordSubmit(params).then(res => { containerUnBindRecordSubmit(params)
.then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成器具绑定记录<br>" + res.data) this.showCommitSuccessMessage(`提交成功<br>生成器具绑定记录<br>${res.data}`)
this.clear(); this.clear()
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage(`提交失败[${res.msg}]`)
} }
}).catch(error => { })
.catch((error) => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}, },
getParams() { getParams() {
var subList = [] const subList = []
var creator = this.$store.state.user.id const creator = this.$store.state.user.id
let params = { const params = {
number: this.containerCode, number: this.containerCode,
type: 'bind', type: 'bind',
status: 'USED', status: 'USED',
creator: creator creator
}; }
this.detailSource.forEach(item => { this.detailSource.forEach((item) => {
item.subList.forEach(detail => { item.subList.forEach((detail) => {
if (detail.scaned) { if (detail.scaned) {
detail.containerContentType = 'PACKAGE'; detail.containerContentType = 'PACKAGE'
detail.contentNumber = detail.packingNumber; detail.contentNumber = detail.packingNumber
detail.itemCode = detail.itemCode; detail.itemCode = detail.itemCode
detail.batch = detail.batch; detail.batch = detail.batch
detail.inventoryStatus = detail.inventoryStatus; detail.inventoryStatus = detail.inventoryStatus
detail.qty =detail.handleQty; detail.qty = detail.handleQty
detail.package = null; detail.package = null
subList.push(detail) subList.push(detail)
} }
}) })
}) })
params.subList = subList params.subList = subList
return params; return params
}, },
showMessage(message) { showMessage(message) {
setTimeout(r => { setTimeout((r) => {
this.scanPopupLoseFocus(); this.scanPopupLoseFocus()
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, (res) => {
if (res) { if (res) {
this.scanPopupGetFocus(); this.scanPopupGetFocus()
} }
}); })
}) })
}, },
showErrorMessage(message) { showErrorMessage(message) {
setTimeout(r => { setTimeout((r) => {
this.scanPopupLoseFocus(); this.scanPopupLoseFocus()
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) { if (res) {
this.scanPopupGetFocus(); this.scanPopupGetFocus()
} }
}); })
}) })
}, },
showScanMessage(message) { showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message); this.$refs.comMessage.showScanMessage(message)
}, },
afterCloseMessage() { afterCloseMessage() {
this.scanPopupGetFocus(); this.scanPopupGetFocus()
}, },
closeScanMessage() { closeScanMessage() {
this.scanPopupGetFocus(); this.scanPopupGetFocus()
}, },
getContainer(containerInfo) { getContainer(containerInfo) {
this.containerCode = containerInfo.number; this.containerCode = containerInfo.number
getContainerDetailByNumber(this.containerCode).then(res => { getContainerDetailByNumber(this.containerCode)
.then((res) => {
if (res.data != null && res.data.subList.length > 0) { if (res.data != null && res.data.subList.length > 0) {
this.detailSource = this.getDataSource(res.data.subList) this.detailSource = this.getDataSource(res.data.subList)
} }
}).catch(error => { })
.catch((error) => {
this.showErrorMessage(error.message) this.showErrorMessage(error.message)
}) })
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, (res) => {
this.containerCode = ''; this.containerCode = ''
}) })
}, },
updateData() { updateData() {
this.calcHandleQty(); this.calcHandleQty()
for (var i = 0; i < this.detailSource.length; i++) { for (let i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i]; const item = this.detailSource[i]
if (item.qty == 0) { if (item.qty == 0) {
this.detailSource.splice(i, 1) this.detailSource.splice(i, 1)
} }
} }
}, },
clear() clear() {}
{
}
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss"></style>
</style>

13
src/pages/fg/receiptByPlan.vue

@ -1,5 +1,14 @@
<template></template> <template>
<view class="">
<com-blank-view @goScan="openFg" v-if="detailSource.length == 0"></com-blank-view>
</view>
</template>
<script></script> <script setup lang="ts">
import { ref, onMounted, nextTick, watch, getCurrentInstance } from 'vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
const detailSource = ref([])
</script>
<style></style> <style></style>

263
src/pages/package/record/mergePackageRecord.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class=""> <view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan="showFromLocationPopup" v-if="detailSource.length == 0"></com-blank-view>
</view> </view>
<view class="page-wraper" v-if="detailSource.length > 0"> <view class="page-wraper" v-if="detailSource.length > 0">
@ -9,64 +9,46 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" <record-com-detail-card :dataContent="item" :index="index" @removeItem="removeItem(index, item)" @updateData="updateData" @removePack="removePack"> </record-com-detail-card>
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view> </view>
<view class='split_line'></view> <view class="split_line"></view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%">
style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<packageTarget title="目标箱码" :isShowEdit="true" :packingNumber="toPackingNumber" <packageTarget title="目标箱码" :isShowEdit="true" :packingNumber="toPackingNumber" @getScanResult="getToPackingNumber"></packageTarget>
@getScanResult='getToPackingNumber'></packageTarget>
</view> </view>
<view class="uni-flex uni-row"> <view class="uni-flex uni-row">
<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>
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan="openScanPopup"></win-scan-button>
</view> </view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="false"> <win-scan-pack-and-location ref="scanPopup" @getResult="getScanResult" :allowModifyLocation="false"> </win-scan-pack-and-location>
</win-scan-pack-and-location> <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation="getLocation" :locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script>
import { import { mergePackageRecordSubmit } from '@/api/request2.js'
mergePackageRecordSubmit import { goHome } from '@/common/basic.js'
} from '@/api/request2.js';
import { import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js'
goHome
} from '@/common/basic.js'; import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue'
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue' import recommendBalance from '@/mycomponents/balance/recommendBalance.vue'
import packageTarget from '@/mycomponents/package/packageTarget.vue' import packageTarget from '@/mycomponents/package/packageTarget.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
@ -88,34 +70,37 @@
id: '', id: '',
scanCount: 0, scanCount: 0,
detailSource: [], // detailSource: [], //
fromLocationCode: "", fromLocationCode: '',
isShowLocation: false, isShowLocation: false,
fromLocationAreaTypeList: [], fromLocationAreaTypeList: [],
inInventoryStatus: "", // inInventoryStatus: '', //
outInventoryStatus: "", // outInventoryStatus: '', //
businessType: {}, businessType: {},
toPackingNumber: "", toPackingNumber: '',
toBatch:"", toBatch: '',
currentItemCode: "", currentItemCode: '',
dataContent: {} dataContent: {}
}; }
}, },
onLoad(option) { onLoad(option) {
var typeCode = "MergePackage" uni.setNavigationBarTitle({
getBusinessType(typeCode, res => { title: option.title
})
const typeCode = 'MergePackage'
getBusinessType(typeCode, (res) => {
if (res.success) { if (res.success) {
this.businessType = res.businessType; this.businessType = res.businessType
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList; this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
this.showFromLocationPopup(); this.showFromLocationPopup()
} else { } else {
this.showErrorMessage(res.message) this.showErrorMessage(res.message)
} }
}); })
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome()
} }
}, },
// //
@ -127,212 +112,202 @@
methods: { methods: {
scanPopupPack() { scanPopupPack() {
this.$refs.scanPopupPack.openScanPopup(); this.$refs.scanPopupPack.openScanPopup()
}, },
getScanResult(result) { getScanResult(result) {
let balance = result.balance; const { balance } = result
let label = result.label; const { label } = result
let pack = result.package; const pack = result.package
var item = this.detailSource.find(res => { const item = this.detailSource.find((res) => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode) {
return res return res
} }
}) })
if (item == undefined) { if (item == undefined) {
if (this.currentItemCode != "" && this.currentItemCode != balance.itemCode) { if (this.currentItemCode != '' && this.currentItemCode != balance.itemCode) {
this.showErrorMessage("合包当前物料号[" + this.currentItemCode + "与扫描物料号[" + balance.itemCode + this.showErrorMessage(`合包当前物料号[${this.currentItemCode}与扫描物料号[${balance.itemCode}]不一致,请扫描相同物料号`)
"]不一致,请扫描相同物料号") return
return;
} }
var itemp = createItemInfo(balance, pack); const itemp = createItemInfo(balance, pack)
let newDetail = createDetailInfo(balance, pack); // const newDetail = createDetailInfo(balance, pack) //
itemp.subList.push(newDetail); itemp.subList.push(newDetail)
this.currentItemCode = balance.itemCode; this.currentItemCode = balance.itemCode
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
var detail = item.subList.find(r => { const detail = item.subList.find((r) => {
if (r.packingNumber == balance.packingNumber && if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) {
r.batch == balance.batch && return r
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
} }
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); const newDetail = createDetailInfo(balance, pack)
item.subList.push(newDetail); item.subList.push(newDetail)
} else { } else if (detail.scaned == true) {
if (detail.scaned == true) { this.showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`)
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
} }
} }
} this.calcHandleQty()
this.calcHandleQty();
}, },
calcHandleQty() { calcHandleQty() {
calcHandleQty(this.detailSource) calcHandleQty(this.detailSource)
this.$forceUpdate(); this.$forceUpdate()
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) { if (res) {
} }
}); })
}, },
updateData() { updateData() {
this.calcHandleQty(); this.calcHandleQty()
}, },
removeItem(index, item) { removeItem(index, item) {
this.detailSource.splice(index, 1) this.detailSource.splice(index, 1)
}, },
removePack() { removePack() {
for (var i = 0; i < this.detailSource.length; i++) { for (let i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i]; const item = this.detailSource[i]
if (item.subList.length == 0) { if (item.subList.length == 0) {
this.detailSource.splice(i, 1) this.detailSource.splice(i, 1)
} }
} }
this.updateData(); this.updateData()
}, },
openScanPopup() { openScanPopup() {
if (this.fromLocationCode == "") { if (this.fromLocationCode == '') {
this.showFromLocationPopup(); this.showFromLocationPopup()
return return
} }
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType)
}, },
showFromLocationPopup() { showFromLocationPopup() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup(); this.$refs.scanLocationCode.openScanPopup()
}) })
}, },
closeScanPopup() { closeScanPopup() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup()
} }
}, },
scanPopupGetFocus() { scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus(); this.$refs.scanPopup.getfocus()
} }
}, },
commit() { commit() {
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: '提交中....',
mask: true mask: true
}); })
var params = this.setParams(); const params = this.setParams()
console.log("提交" + JSON.stringify(params)) console.log(`提交${JSON.stringify(params)}`)
mergePackageRecordSubmit(params).then(res => { mergePackageRecordSubmit(params)
.then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成合包记录<br>" + res.data) this.showCommitSuccessMessage(`提交成功<br>生成合包记录<br>${res.data}`)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage(`提交失败[${res.msg}]`)
} }
}).catch(error => { })
.catch((error) => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
} else { } else {
this.showErrorMessage("没有要扫描的数据") this.showErrorMessage('没有要扫描的数据')
} }
}, },
setParams() { setParams() {
const subList = []
var subList = [] const creator = this.$store.state.user.id
var creator = this.$store.state.user.id this.detailSource.forEach((item) => {
this.detailSource.forEach(item => { item.subList.forEach((detail) => {
item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
detail.itemCode = detail.itemCode; detail.itemCode = detail.itemCode
detail.itemName = detail.package.itemName; detail.itemName = detail.package.itemName
detail.itemDesc1 = detail.package.itemDesc1; detail.itemDesc1 = detail.package.itemDesc1
detail.itemDesc2 = detail.package.itemDesc2; detail.itemDesc2 = detail.package.itemDesc2
detail.fromInventoryStatus = detail.inventoryStatus; detail.fromInventoryStatus = detail.inventoryStatus
detail.toInventoryStatus = detail.inventoryStatus; detail.toInventoryStatus = detail.inventoryStatus
detail.fromQty = detail.handleQty detail.fromQty = detail.handleQty
detail.fromPackingNumber = detail.packingNumber; detail.fromPackingNumber = detail.packingNumber
detail.toPackingNumber = this.toPackingNumber; detail.toPackingNumber = this.toPackingNumber
detail.fromBatch = detail.batch; detail.fromBatch = detail.batch
detail.toBatch = detail.batch; detail.toBatch = detail.batch
detail.fromLocationCode = detail.locationCode; detail.fromLocationCode = detail.locationCode
// detail.toLocationCode = detail.toLocationCode; // detail.toLocationCode = detail.toLocationCode;
subList.push(detail) subList.push(detail)
} }
}) })
}) })
this.dataContent.subList = subList; this.dataContent.subList = subList
this.dataContent.creator = creator; this.dataContent.creator = creator
return this.dataContent; return this.dataContent
}, },
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, (res) => {
if (res) {} if (res) {
}); }
})
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) { if (res) {
} }
}); })
}, },
showScanMessage(message) { showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message); this.$refs.comMessage.showScanMessage(message)
}, },
afterCloseMessage() { afterCloseMessage() {
this.scanPopupGetFocus(); this.scanPopupGetFocus()
}, },
closeScanMessage() { closeScanMessage() {
this.scanPopupGetFocus(); this.scanPopupGetFocus()
}, },
getLocation(location, code) { getLocation(location, code) {
this.getFromLocationCode(location, code) this.getFromLocationCode(location, code)
}, },
getFromLocationCode(location, code) { getFromLocationCode(location, code) {
this.fromLocationCode = code; this.fromLocationCode = code
this.openScanPopup(); this.openScanPopup()
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, (res) => {
this.detailSource = [] this.detailSource = []
this.fromLocationCode = ''; this.fromLocationCode = ''
this.toPackingNumber ="" this.toPackingNumber = ''
this.toBatch ="" this.toBatch = ''
this.currentItemCode ="" this.currentItemCode = ''
this.dataContent = {} this.dataContent = {}
}) })
}, },
updateData() { updateData() {
this.calcHandleQty(); this.calcHandleQty()
for (var i = 0; i < this.detailSource.length; i++) { for (let i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i]; const item = this.detailSource[i]
if (item.qty == 0) { if (item.qty == 0) {
this.detailSource.splice(i, 1) this.detailSource.splice(i, 1)
} }
@ -340,13 +315,11 @@
}, },
getToPackingNumber(result) { getToPackingNumber(result) {
if (this.currentItemCode != result.label.itemCode) { if (this.currentItemCode != result.label.itemCode) {
this.showErrorMessage("合包当前物料号[" + this.currentItemCode + "与目标物料号[" + result.label.itemCode + this.showErrorMessage(`合包当前物料号[${this.currentItemCode}与目标物料号[${result.label.itemCode}]不一致,请扫描相同物料号`)
"]不一致,请扫描相同物料号") return
return;
} }
this.toPackingNumber = result.label.packingNumber; this.toPackingNumber = result.label.packingNumber
this.toBatch = result.label.batch this.toBatch = result.label.batch
} }
} }
} }
@ -366,7 +339,6 @@
height: 100%; height: 100%;
} }
.page-main { .page-main {
flex: 1; flex: 1;
position: relative; position: relative;
@ -385,6 +357,5 @@
line-height: 80rpx; */ line-height: 80rpx; */
text-align: center; text-align: center;
background: #e0e0e0; background: #e0e0e0;
} }
</style> </style>

32
src/pages/package/record/overPackageRecord.vue

@ -107,7 +107,7 @@ const scanPopup = ref()
const scanLocationCode = ref() const scanLocationCode = ref()
const toPackUnit = ref() const toPackUnit = ref()
const comMessageRef = ref() const comMessageRef = ref()
onShow(() => { onLoad(() => {
getBusinessType() getBusinessType()
}) })
onLoad((option) => { onLoad((option) => {
@ -205,6 +205,9 @@ const setData = (result) => {
} }
const itemp = createItemInfo(balance, pack) const itemp = createItemInfo(balance, pack)
const newDetail = createDetailInfo(balance, pack) // const newDetail = createDetailInfo(balance, pack) //
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
itemp.subList.push(newDetail) itemp.subList.push(newDetail)
detailSource.value.push(itemp) detailSource.value.push(itemp)
itemCode.value = balance.itemCode itemCode.value = balance.itemCode
@ -219,6 +222,9 @@ const setData = (result) => {
console.log(detail) console.log(detail)
if (detail == undefined) { if (detail == undefined) {
const newDetail = createDetailInfo(balance, pack) const newDetail = createDetailInfo(balance, pack)
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail) item.subList.push(newDetail)
scanPopupGetFocus() scanPopupGetFocus()
} else if (detail.scaned == true) { } else if (detail.scaned == true) {
@ -261,18 +267,6 @@ const openScanPopup = () => {
} }
} }
const showFromLocationPopup = () => {
nextTick(() => {
const overPackageRecord = uni.getStorageSync('overPackageRecord')
if (overPackageRecord) {
scanLocationCode.value.openScanPopupSimulate(overPackageRecord)
} else {
scanLocationCode.value.openScanPopup()
}
})
}
const closeScanPopup = () => { const closeScanPopup = () => {
if (scanPopup.value) { if (scanPopup.value) {
scanPopup.value.closeScanPopup() scanPopup.value.closeScanPopup()
@ -404,22 +398,14 @@ const afterCloseMessage = () => {
const closeScanMessage = () => { const closeScanMessage = () => {
scanPopupGetFocus() scanPopupGetFocus()
} }
const getLocation = (location, code) => {
if (code) {
uni.setStorageSync('overPackageRecord', code)
}
getFromLocationCode(location, code)
}
const getFromLocationCode = (location, code) => {
fromLocationCode.value = code
openScanPopup()
}
const showCommitSuccessMessage = (hint, pointData) => { const showCommitSuccessMessage = (hint, pointData) => {
comMessageRef.value.showSuccessMessage(hint, (res) => { comMessageRef.value.showSuccessMessage(hint, (res) => {
if (res) { if (res) {
detailSource.value = [] detailSource.value = []
fromLocationCode.value = '' fromLocationCode.value = ''
dataContent.value = {} dataContent.value = {}
itemCode.value = ''
if (pointData.length > 0) { if (pointData.length > 0) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}` url: `/pages/point/index?points=${JSON.stringify(pointData)}`

453
src/pages/package/record/splitPackageRecord.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class=""> <view class="">
<com-blank-view @goScan="showFromLocationPopup" v-if="detailSource.length == 0"></com-blank-view> <com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view>
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
@ -9,50 +9,77 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<com-package-record :dataContent="item" @removeItem="removeItem(index, item)" @updateData="updateData" @removePack="updateData"> </com-package-record> <record-com-detail-card :dataContent="item" @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack='updateData' :isShowToLocation="false">
</record-com-detail-card>
</view> </view>
</view> </view>
<view class="uni-flex uni-row" style="margin-left: 30rpx;margin-top: 10rpx; ">
<text style="font-size: 35rpx; margin-right: 20rpx;">拆出数量 :</text>
<uni-number-box @change="calcQty($event,splitCount)" :value="splitCount">
</uni-number-box>
<uom :uom="detailSource[0].uom"></uom>
</view>
</scroll-view> </scroll-view>
</view> </view>
<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"
<view class=""> </view> style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<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>
</view> </view>
<win-scan-button @goScan="showScanPopupPack"></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-pack-and-location ref="scanPopup" @getResult="getScanResult" :allowModifyLocation="false"> </win-scan-pack-and-location> <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="typeCode">
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation="getLocation" :locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> </winComScanBalance>
<win-scan-pack title="拆分标签" ref="scanPopupPack" @getResult="getScanPackResult"></win-scan-pack>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script>
import { goHome } from '@/common/basic.js' import {
import { splitPackageRecordSubmit } from '@/api/request2.js' goHome,
showConfirmMsg
import { calc } from '@/common/calc.js' } from '@/common/basic.js';
import {
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js' splitPackageRecordSubmit
} from '@/api/request2.js';
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import {
calc
} from '@/common/calc.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue' import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue' import recommendBalance from '@/mycomponents/balance/recommendBalance.vue'
import comPackageRecord from '@/pages/package/coms/comPackageRecord.vue' import comPackageRecord from '@/pages/package/coms/comPackageRecord.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import uom from '@/mycomponents/qty/uom.vue'
export default { export default {
components: { components: {
@ -64,39 +91,51 @@ export default {
winScanPackAndLocation, winScanPackAndLocation,
recommendBalance, recommendBalance,
recordComDetailCard, recordComDetailCard,
comPackageRecord comPackageRecord,
winComScanBalance,
uom
}, },
data() { data() {
return { return {
id: '', id: '',
detailSource: [], // detailSource: [], //
fromLocationCode: '', fromLocationCode: "",
toLocationCode: '', toLocationCode: "",
fromLocationAreaTypeList: [], fromLocationAreaTypeList: [],
inInventoryStatus: '', // inInventoryStatus: "", //
outInventoryStatus: '', // outInventoryStatus: "", //
businessType: {}, businessType: {},
dataContent: {}, dataContent: {},
currentItemCode: '', currentItemCode: "",
toPackingNumber: '' toPackingNumber: "",
} itemCode:"",
splitCount:1,
typeCode:"SplitPackage"
};
}, },
onLoad(option) { onLoad(option) {
const typeCode = 'SplitPackage' <<<<<<< Updated upstream
getBusinessType(typeCode, (res) => { uni.setNavigationBarTitle({
title: option.title
})
var typeCode = "SplitPackage"
getBusinessType(typeCode, res => {
if (res.success) { if (res.success) {
this.businessType = res.businessType this.businessType = res.businessType;
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList this.fromLocationAreaTypeList = res.fromLocationAreaTypeList;
this.showFromLocationPopup() this.showFromLocationPopup();
} else { } else {
this.showErrorMessage(res.message) this.showErrorMessage(res.message)
} }
}) });
=======
this.getBusinessType();
>>>>>>> Stashed changes
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome() goHome();
} }
}, },
// //
@ -104,248 +143,276 @@ export default {
onPullDownRefresh() {}, onPullDownRefresh() {},
mounted() { mounted() {},
// this.showFromLocationPopup();
},
methods: { methods: {
showScanPopupPack() { getBusinessType() {
this.$refs.scanPopupPack.openScanPopup() getBusinessType(this.typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
this.openScanPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
openScanPopup() {
if (this.businessType) {
if(this.detailSource.length>0){
showConfirmMsg("拆包信息还没提交,是否要重新扫描?",res=>{
if(res){
this.clearData();
this.$refs.scanPopup.openScanPopup(this.businessType);
}
})
}else {
this.$refs.scanPopup.openScanPopup(this.businessType);
}
} else {
this.getBusinessType()
}
}, },
getScanResult(result) { getScanResult(result) {
const { balance } = result this.setData(result);
const { label } = result },
const pack = result.package
const item = this.detailSource.find((res) => { setData(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
this.fromPackUnit = pack.packUnit;
this.fromPack = pack;
if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this
.fromLocationCode + "]没有库存余额")
return;
}
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode) {
return res return res
} }
}) })
if (item == undefined) { if (item == undefined) {
const itemp = createItemInfo(balance, pack) if (this.itemCode != "" && this.itemCode != balance.itemCode) {
const newDetail = createDetailInfo(balance, pack) // this.showErrorMessage("请扫描物料为【" + this.itemCode + "】的箱码")
newDetail.scaned = false return;
newDetail.Records = [] }
var itemp = createItemInfo(balance, pack);
itemp.handleQty=0
let newDetail = createDetailInfo(balance, pack); //
newDetail.handleQty=0 newDetail.handleQty=0
itemp.subList.push(newDetail) newDetail.scaned=false
itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
this.itemCode = balance.itemCode;
this.fromLocationCode = balance.locationCode
this.closeScanPopup()
} else { } else {
this.showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`) var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
} }
this.$refs.scanPopup.closeScanPopup() })
this.showScanPopupPack() if (detail == undefined) {
}, let newDetail = createDetailInfo(balance, pack);
newDetail.handleQty=0
getScanPackResult(result) { item.subList.push(newDetail);
const { packingNumber } = result.label this.closeScanPopup()
const { batch } = result.label
const { qty } = result.label
const { itemCode } = result.label
const { uom } = result.package
const item = this.detailSource.find((r) => r.itemCode == itemCode)
if (item == undefined) {
this.showErrorMessage(`物料号【${itemCode}】不在列表中`)
} else { } else {
const temp = { if (detail.scaned == true) {
scaned: true, this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
packingNumber, }
batch,
qty: Number(qty),
LabelQty: Number(qty),
stdPackUnit: result.package.stdPackUnit,
stdPackQty: result.package.stdPackQty,
uom
} }
let sumQty = 0
item.subList[0].Records.forEach(function (item1, index) {
sumQty = calc.add(sumQty, item1.qty)
})
// if (calc.add(qty,sumQty)> item.subList[0].qty) {
// this.showErrorMessage("" + (Number(qty) + sumQty) + "(" + qty + "+" +
// sumQty +
// ")" + Number(item.subList[0].qty) + "!");
// return;
// }
item.subList[0].Records.push(temp)
this.$forceUpdate()
} }
this.calcHandleQty() this.calcHandleQty();
}, },
calcHandleQty() { calcHandleQty() {
for (const detail of this.detailSource[0].subList) { calcHandleQty(this.detailSource)
let hQty = 0 this.$forceUpdate();
if (detail.Records.length > 0) {
detail.Records.forEach((r) => {
hQty = calc.add(hQty, r.qty)
})
}
detail.handleQty = hQty
}
this.$forceUpdate()
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, (res) => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
} }
}) });
}, },
updateData() { updateData() {
this.calcHandleQty() this.calcHandleQty();
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
}, },
removeItem(index, item) { removeItem(index, item) {
this.detailSource.splice(index, 1) this.detailSource.splice(index, 1)
}, },
openScanPopup() {
if (this.fromLocationCode == '') {
this.showFromLocationPopup()
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType)
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup()
})
},
closeScanPopup() { closeScanPopup() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup() this.$refs.scanPopup.closeScanPopup();
} }
}, },
scanPopupGetFocus() { scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus() this.$refs.scanPopup.getfocus();
} }
}, },
commit() { commit() {
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
uni.showLoading({
title: '提交中....',
mask: true
})
const params = this.setParams() if(this.splitCount==0){
console.log(`提交${JSON.stringify(params)}`) this.showErrorMessage("拆出数量不能等于0")
splitPackageRecordSubmit(params) return;
.then((res) => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage(`提交成功<br>生成拆包记录<br>${res.data}`)
} else {
this.showErrorMessage(`提交失败[${res.msg}]`)
} }
}) if(this.splitCount>this.detailSource[0].qty){
.catch((error) => { this.showErrorMessage("拆出数量不能大于库存数量")
uni.hideLoading() return;
this.showErrorMessage(error) }
}) uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams();
console.log("提交" + JSON.stringify(params))
// splitPackageRecordSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// let list = []
// res.data.forEach(item => {
// list.push({
// itemCode: item.itemCode, //
// itemName: item.itemName, //
// packName: item.packName, //
// packageCode: item.toPackingNumber, //
// batch: item.toBatch, //
// parentNumber: item.parentNumber, //
// itemType: item.itemType, //
// asnNumber: item.asnNumber, //ASN
// supplierCode: item.supplierCode, //
// qty: item.qty, //
// printTimes: getCurrDateTime(), //
// productionLineCode: item.productionLineCode, //线
// barcodeString: item.barcodeString, //
// barcodeBase64: '',
// })
// })
// this.showCommitSuccessMessage("<br><br>", list)
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else { } else {
this.showErrorMessage('没有要提交的数据') this.showErrorMessage("没有要提交的数据")
} }
}, },
setParams() { setParams() {
const subList = [] var subList = []
const creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach((item) => { this.detailSource.forEach(item => {
item.subList.forEach((detail) => { item.subList.forEach(detail => {
detail.Records.forEach((record) => { var subItem = {};
if (record.scaned) {
const subItem = {}
Object.assign(subItem, detail) Object.assign(subItem, detail)
subItem.itemCode = subItem.itemCode subItem.itemCode = subItem.itemCode;
subItem.itemName = detail.package.itemName subItem.itemName = detail.package.itemName;
subItem.itemDesc1 = detail.package.itemDesc1 subItem.itemDesc1 = detail.package.itemDesc1;
subItem.itemDesc2 = detail.package.itemDesc2 subItem.itemDesc2 = detail.package.itemDesc2;
subItem.fromInventoryStatus = subItem.inventoryStatus subItem.fromInventoryStatus = subItem.inventoryStatus;
subItem.toInventoryStatus = subItem.inventoryStatus subItem.toInventoryStatus = subItem.inventoryStatus;
subItem.fromQty = subItem.qty subItem.fromQty = subItem.qty
subItem.toQty = record.qty subItem.toQty = subItem.qty
subItem.fromPackingNumber = subItem.packingNumber subItem.fromPackingNumber = subItem.packingNumber;
subItem.toPackingNumber = record.packingNumber subItem.toPackingNumber = subItem.packingNumber;
subItem.fromBatch = subItem.batch subItem.fromBatch = subItem.batch;
subItem.toBatch = record.batch subItem.toBatch = subItem.batch;
subItem.fromLocationCode = subItem.fromLocationCode subItem.fromLocationCode = subItem.fromLocationCode;
subItem.package = '' subItem.package = ""
subItem.Records = '' subItem.Records = ""
subList.push(subItem) subList.push(subItem)
}
})
}) })
}) })
this.dataContent.subList = subList this.dataContent.subList = subList;
this.dataContent.creator = creator this.dataContent.creator = creator;
return this.dataContent return this.dataContent;
}, },
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message, (res) => { this.$refs.comMessage.showMessage(message, res => {
if (res) { if (res) {}
} });
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) {
}
})
}, },
showScanMessage(message) { showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message) this.$refs.comMessage.showScanMessage(message);
}, },
afterCloseMessage() { afterCloseMessage() {
this.scanPopupGetFocus() this.scanPopupGetFocus();
}, },
closeScanMessage() { closeScanMessage() {
this.scanPopupGetFocus() this.scanPopupGetFocus();
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
}, },
getFromLocationCode(location, code) {
this.fromLocationCode = code showCommitSuccessMessage(hint, pointData) {
this.openScanPopup() this.$refs.comMessage.showSuccessMessage(hint, res => {
}, this.clearData();
getToLocationCode(location, code) { if (pointData.length > 0) {
if (this.fromLocationCode == code) { uni.navigateTo({
uni.showToast({ url: `/pages/point/index?points=${JSON.stringify(pointData)}`
title: `来源库位[${this.fromLocationCode}]不能与目标库位[${code}]一致`, });
duration: 2000
})
return
} }
this.toLocationCode = code })
}, },
showCommitSuccessMessage(hint) { clearData(){
this.$refs.comMessage.showSuccessMessage(hint, (res) => {
this.detailSource = [] this.detailSource = []
this.fromLocationCode = '' this.fromLocationCode = '';
this.currentItemCode = '' this.currentItemCode = ""
this.dataContent = {} this.dataContent = {}
}) this.itemCode=""
this.splitCount=1
},
calcQty(val) {
this.splitCount =val;
// if(val<=0){
// this.showErrorMessage("0")
// }
}, },
updateData() {
this.calcHandleQty()
}
} }
} }
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss">
</style>

1
src/pages/productPutaway/job/productPutawayDetail.vue

@ -274,6 +274,7 @@ const getScanResult = (result) => {
} else if (!itemDetail.cancleScanedHiht && itemDetail.scaned) { } else if (!itemDetail.cancleScanedHiht && itemDetail.scaned) {
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】已经扫描`) showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】已经扫描`)
} else { } else {
itemDetail.cancleScanedHiht = false
addDetail(itemDetail, result) addDetail(itemDetail, result)
return return
} }

6
src/pages/repleinsh/record/directRepleinshRecord.vue

@ -197,6 +197,9 @@ const setData = (result) => {
newDetail.packingNumber = pack.number newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit newDetail.packUnit = pack.packUnit
newDetail.packQty = pack.packQty newDetail.packQty = pack.packQty
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
itemp.subList.push(newDetail) itemp.subList.push(newDetail)
detailSource.value.push(itemp) detailSource.value.push(itemp)
itemCode.value = balance.itemCode itemCode.value = balance.itemCode
@ -213,6 +216,9 @@ const setData = (result) => {
newDetail.packingNumber = pack.number newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit newDetail.packUnit = pack.packUnit
newDetail.packQty = pack.packQty newDetail.packQty = pack.packQty
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail) item.subList.push(newDetail)
scanPopupGetFocus() scanPopupGetFocus()
} else if (detail.scaned == true) { } else if (detail.scaned == true) {

Loading…
Cancel
Save