Browse Source

Merge branch 'intex' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-uniapp into intex

intex_online20241111
lijuncheng 4 weeks ago
parent
commit
a6e6dd4184
  1. 2
      src/api/request2.js
  2. 6
      src/common/label.js
  3. 100
      src/mycomponents/detail/comDetailCardBatch.vue
  4. 57
      src/mycomponents/detail/comJobDetailCardBatch.vue
  5. 1
      src/mycomponents/scan/winScanPack.vue
  6. 116
      src/pages/deliver/coms/comDeliverDetailCardBatch.vue
  7. 718
      src/pages/deliver/coms/comScanDeliverPackBatch.vue
  8. 209
      src/pages/deliver/job/deliverDetailBatch.vue
  9. 1
      src/pages/inventoryMove/coms/comMoveRecord.vue
  10. 87
      src/pages/inventoryMove/job/inventoryMoveDetail.vue
  11. 1
      src/pages/issue/job/issueDetailBatch.vue
  12. 2
      src/pages/issue/job/issueJob.vue
  13. 103
      src/pages/productReceipt/coms/comProductDetailCardBatch.vue
  14. 5
      src/pages/productReceipt/job/productReceiptDetail.vue
  15. 40
      src/pages/productRecycle/job/productRecycleJobDetail.vue
  16. 80
      src/pages/productionReturn/job/okToReturnDetail.vue
  17. 14
      src/pages/putaway/job/putawayDetail.vue

2
src/api/request2.js

@ -4302,7 +4302,7 @@ export function overPackageRecordSubmit(params) {
* *
*/ */
export async function getManagementPrecision(params) { export async function getManagementPrecision(params) {
return request({ return await request({
url: baseApi + "/wms/rule/getPrecisionStrategyByItemCodes", url: baseApi + "/wms/rule/getPrecisionStrategyByItemCodes",
method: "post", method: "post",
data: params, data: params,

6
src/common/label.js

@ -105,6 +105,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) {
} }
export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) { export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
let managementType = ""
let labelResult = analysisQRCodeLabel(labelItem, scanMsg); let labelResult = analysisQRCodeLabel(labelItem, scanMsg);
if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') { if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') {
//查询包装信息 //查询包装信息
@ -114,7 +115,7 @@ export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
await getManagementPrecisions([labelResult.label.itemCode], locationCode, res => { await getManagementPrecisions([labelResult.label.itemCode], locationCode, res => {
if (res.success) { if (res.success) {
const managementList = res.list; const managementList = res.list;
const managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING' managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING'
if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){ if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){
packingNumber = '' packingNumber = ''
} }
@ -137,11 +138,12 @@ export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
callBack(labelResult); callBack(labelResult);
}) })
} else { } else {
console.log(999,labelResult)
//线边的物料可能没有箱码 //线边的物料可能没有箱码
labelResult.package = labelResult.label; labelResult.package = labelResult.label;
labelResult.package.number = packingNumber1 ? packingNumber1 : '' labelResult.package.number = packingNumber1 ? packingNumber1 : ''
labelResult.package.packingNumber='' labelResult.package.packingNumber=''
labelResult.managementType = managementType
console.log(999,labelResult)
callBack(labelResult); callBack(labelResult);
// labelResult.success = false; // labelResult.success = false;
// labelResult.message = '在条码中未解析到箱码'; // labelResult.message = '在条码中未解析到箱码';

100
src/mycomponents/detail/comDetailCardBatch.vue

@ -1,29 +1,27 @@
<template> <template>
<view style="background-color: #fff;"> <view class="" style="background-color: #fff;">
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false"> <uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowStdPack="false">
</item-compare-qty> </item-compare-qty>
<view class="" v-for="(item,index) in dataContent.subList" :key="index" :class="item.scaned?'scan_view':''"> </template>
<uni-swipe-action ref="swipeAction" v-if='index==0'>
<uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="swipeClick($event,item,'parent')" style='padding:0px 0px 5px 0px;align-items: center;'>
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" isShowPack='false'>
</recommend> -->
<div style="display: flex;"> <view class="" v-for="(item,index) in dataContent.subList" :key="index">
<div style="flex: 1;"> <uni-swipe-action ref="swipeAction">
<batch v-if="item.batch" :batch="item.batch"></batch> <uni-swipe-action-item @click="swipeClick($event,item)"
<location title="来源库位" v-if="item.fromLocationCode" :locationCode="item.fromLocationCode"></location> :right-options="item.scaned?scanOptions:detailOptions"
</div> style='padding:0px 0px 5px 0px;align-items: center;'>
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> <recommend :detail="item" :isShowFromLocation="isShowFromLocation" :isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation">
</div> </recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</view> </view>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" </uni-collapse-item>
@confirm="confirm"></balance-qty-edit> </uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' <win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> :locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<comMessage ref="message"></comMessage> <comMessage ref="message"></comMessage>
@ -31,20 +29,13 @@
</template> </template>
<script> <script>
import config from '@/static/config.js'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue' import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import { import {
getDetailOption, getDetailOption,
getPurchaseReceiptOption, getPurchaseReceiptOption
getRemoveOption,
getEditRemoveOption
} from '@/common/array.js'; } from '@/common/array.js';
export default { export default {
@ -53,10 +44,7 @@
itemCompareQty, itemCompareQty,
recommend, recommend,
balanceQtyEdit, balanceQtyEdit,
winScanLocation, winScanLocation
location,
toLocation,
batch,
}, },
props: { props: {
dataContent: { dataContent: {
@ -79,6 +67,15 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
locationAreaTypeList: { locationAreaTypeList: {
type: Array, type: Array,
default: null default: null
@ -91,10 +88,6 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isEdit: {
type: Boolean,
default: true
},
}, },
watch: { watch: {
dataContent: { dataContent: {
@ -123,10 +116,7 @@
locatonItem: {}, locatonItem: {},
editItem: {}, editItem: {},
detailOptions: [], detailOptions: [],
scanOptions: [], scanOptions: []
options: [],
removeOptions: [],
editAndRemoveOptions: []
} }
}, },
@ -137,8 +127,7 @@
if (this.scanOptions.length == 0) { if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false) this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false)
} }
this.removeOptions = getRemoveOption();
this.editAndRemoveOptions = getEditRemoveOption()
// this.showLocation(); // this.showLocation();
}, },
@ -189,35 +178,6 @@
this.locatonItem.toLocationCode = code; this.locatonItem.toLocationCode = code;
this.$emit('updateData') this.$emit('updateData')
}, },
isDevlement() {
return config.isDevelopment;
},
copy(detail) {
console.log(detail)
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
var content = "HPQ;V1.0;I" + detail.itemCode + ";P" + detail.packingNumber + ";B" + detail
.batch + ";Q" + detail.qty
// #ifdef H5
this.$copyText(content).then(
res => {
uni.showToast({
title: '复制采购标签成功',
icon: 'none'
})
}
)
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制采购标签成功'
})
}
})
// #endif
},
} }
} }
</script> </script>

57
src/mycomponents/detail/comJobDetailCardBatch.vue

@ -1,20 +1,21 @@
<!-- 采购上架任务详情按批次显示详情的组件 -->
<template> <template>
<view class="" style="background-color: #fff;"> <view class="" style="background-color: #fff;">
<uni-swipe-action> <uni-collapse ref="collapse">
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="true"></itemCompareQty> <uni-collapse-item :open="true">
<uni-swipe-action-item <template v-slot:title>
:right-options="(dataContent.scaned&&isEdit)?editAndRemoveOptions : dataContent.scaned? removeOptions:options" <itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"
@click="swipeClick($event,dataContent,'parent')"> :isShowPackUnit="true"></itemCompareQty>
<view class="" :class="dataContent.scaned?'scan_view':''"> </template>
<batch v-if="dataContent.subList[0].batch" :batch="dataContent.subList[0].batch"></batch> <package-list :dataContent="dataContent.subList"
<location title="来源库位" v-if="dataContent.subList[0].fromLocationCode" :isEdit="settingParam.allowModifyQty=='TRUE'"
:locationCode="dataContent.subList[0].fromLocationCode"> :settingParam="settingParam"
</location> @collapseChange="collapseChange"
</view> @updateData="updateData"
:isShowStatus="isShowStatus"
</uni-swipe-action-item> :isShowPackListStatus="isShowPackListStatus"
</uni-swipe-action> ></package-list>
</uni-collapse-item>
</uni-collapse>
<recommend-qty-edit ref=" receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> <recommend-qty-edit ref=" receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</recommend-qty-edit> </recommend-qty-edit>
@ -31,13 +32,7 @@
import pack from '@/mycomponents/balance/pack.vue' import pack from '@/mycomponents/balance/pack.vue'
import detailList from '@/mycomponents/detail/detailList.vue' import detailList from '@/mycomponents/detail/detailList.vue'
import packageList from '@/mycomponents/package/packageList.vue' import packageList from '@/mycomponents/package/packageList.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import {
getRemoveOption,
getEditRemoveOption
} from '@/common/array.js';
import { import {
getDetailOption, getDetailOption,
getPurchaseReceiptOption getPurchaseReceiptOption
@ -52,10 +47,7 @@
jobDetailPopup, jobDetailPopup,
receiptDetailInfoPopup, receiptDetailInfoPopup,
detailList, detailList,
packageList, packageList
location,
toLocation,
batch,
}, },
props: { props: {
dataContent: { dataContent: {
@ -77,10 +69,6 @@
isShowPackListStatus: { isShowPackListStatus: {
type: Boolean, type: Boolean,
default: true default: true
},
isEdit: {
type: Boolean,
default: true
} }
}, },
watch: { watch: {
@ -97,10 +85,7 @@
}, },
locatonItem: {}, locatonItem: {},
detailOptions: [], detailOptions: [],
scanOptions: [], scanOptions: []
options: [],
removeOptions: [],
editAndRemoveOptions: []
} }
}, },
@ -112,8 +97,6 @@
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation) .allowModifyLocation)
} }
this.removeOptions = getRemoveOption();
this.editAndRemoveOptions = getEditRemoveOption()
}, },
@ -149,7 +132,7 @@
this.$forceUpdate(); this.$forceUpdate();
}, },
swipeClick(e, item, type) { swipeClick(e, item) {
if (e.content.text == "编辑") { if (e.content.text == "编辑") {
this.edit(item) this.edit(item)
} else if (e.content.text == "移除") { } else if (e.content.text == "移除") {

1
src/mycomponents/scan/winScanPack.vue

@ -49,7 +49,6 @@
type: String, type: String,
default: 'HPQ' default: 'HPQ'
}, },
}, },
data() { data() {
return { return {

116
src/pages/deliver/coms/comDeliverDetailCardBatch.vue

@ -1,23 +1,32 @@
<template> <template>
<view> <view>
<!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode" <!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode"
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> --> :isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> -->
<view>
<view v-for="(item,index) in dataContent.subList" style="margin-bottom: 20rpx;"> <uni-collapse ref="collapse">
<uni-swipe-action ref="swipeAction" :class="item.scaned? 'scan_view':''"> <uni-collapse-item :open="true" :class="dataContent.scaned?'scan_view':''">
<template v-slot:title>
<view class="split_line"></view>
<!-- 物品 -->
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowBalanceQty='false'></item-qty>
</template>
<uni-swipe-action ref="swipeAction" style="margin-top: 10px;"
v-for="(item,index) in dataContent.subList">
<uni-swipe-action-item <uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" :right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" @click="itemCoceClick($event,item,index)">
@click="swipeClick($event,item,index)" style='padding:20rpx 0px 5px 0px;align-items: center;'> <view class="" :class="item.scaned?'scan_view':''">
<item-qty :dataContent="item" :handleQty="item.handleQty" :isShowBalanceQty="false"></item-qty> <recommend :detail="item" :isShowLocation="false" :isShowFromLocation="true" :isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommend>
<location :locationCode="item.fromLocationCode"></location> </view>
<recommendBalanceBatch style='margin-left: 20px;' :detail="item" :isShowLocation="false"
:isShowPack="item.packingNumber"></recommendBalanceBatch>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</uni-collapse-item>
</uni-collapse>
</view> </view>
</view> </view>
<qtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true" :allowBiggerQty='allowBiggerQty'></qtyEdit> <!-- <balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit> -->
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</recommend-qty-edit>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> <detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage> <comMessage ref="message"></comMessage>
</template> </template>
@ -25,39 +34,42 @@
<script> <script>
import itemQty from '@/mycomponents/item/itemQty.vue' import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue' import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendBalanceBatch from '@/mycomponents/balance/recommendBalanceBatch.vue' import recommendBalance from '@/mycomponents/balance/recommendBalance.vue'
import handleBalance from '@/mycomponents/balance/handleBalance.vue' import handleBalance from '@/mycomponents/balance/handleBalance.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import qtyEdit from '@/mycomponents/qty/qtyEdit.vue' import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import location from '@/mycomponents/balance/location.vue' import location from '@/mycomponents/balance/location.vue'
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue' import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
import batch from '@/mycomponents/balance/batch.vue'
import qtyEdit from '@/mycomponents/qty/qtyEdit.vue'
import { import {
getDetailOption, getDetailOption,
getPurchaseReceiptOption, getEditRemoveOption,
getRemoveOption, getRemoveOption
getEditRemoveOption
} from '@/common/array.js'; } from '@/common/array.js';
export default { export default {
emits: ['updateData'], emits: ['updateData', "removeItemCode"],
components: { components: {
itemQty, itemQty,
recommend, recommend,
recommendBalanceBatch, recommendBalance,
handleBalance, handleBalance,
recommendQtyEdit, recommendQtyEdit,
requiredLocation, requiredLocation,
qtyEdit, balanceQtyEdit,
location, location,
detailInfoPopup detailInfoPopup,
comIssueRequestInfo,
batch,
}, },
props: { props: {
dataContent: { dataContent: {
type: Object, type: Array,
default: {} default: []
}, },
settingParam: { settingParam: {
type: Object, type: Object,
@ -67,10 +79,6 @@ import {
type: Boolean, type: Boolean,
default: true default: true
}, },
allowBiggerQty: {
type: Boolean,
default: false
},
}, },
watch: { watch: {
@ -83,52 +91,76 @@ import {
editItem: {}, editItem: {},
batchItem: {}, batchItem: {},
detailOptions: [], detailOptions: [],
scanOptions: [] scanOptions: [],
removeOptions: [],
editAndRemoveOptions:[]
} }
}, },
mounted() { mounted() {
this.detailOptions = getDetailOption();
this.removeOptions = getRemoveOption(); this.scanOptions = getEditRemoveOption();
this.removeOptions = getRemoveOption()
this.editAndRemoveOptions = getEditRemoveOption() this.editAndRemoveOptions = getEditRemoveOption()
console.log(888,this.dataContent)
}, },
methods: { methods: {
resizeCollapse() { resizeCollapse() {
this.$nextTick(r => { this.$nextTick(r => {
this.$refs.collapse.forEach(r => { this.$refs.collapse.resize()
r.childrens.forEach(i => { this.$refs.collapse.childrens.forEach(i => {
i.init(); i.init();
}) })
r.resize();
})
}); });
}, },
swipeClick(e, batch,
record,recordIndex,
batchIndex,
Batchs,
locatonIndex,
Locations) {
if (e.content.text == "编辑") {
this.edit(batch, record)
} else if (e.content.text == "移除") {
this.remove(batch, record, recordIndex,batchIndex,Batchs,locatonIndex,Locations)
}
},
swipeClick(e, item, index) { itemCoceClick(e, item, index) {
if (e.content.text == "编辑") { if (e.content.text == "编辑") {
this.edit(item) this.edit(item)
} else if (e.content.text == "移除") { } else if (e.content.text == "移除") {
this.remove(item, index) // this.dataContent.subList.splice(index, 1);
item.scaned = false
item.handleQty=0
this.$emit('updateData')
} }
}, },
edit(item) { edit(item) {
let that = this; this.editItem = item;
that.editItem = item; this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
that.$refs.balanceQtyEdit.openEditPopup(item);
}, },
detail(item) { detail(item) {
this.showItem = item; this.showItem = item;
this.$refs.receiptHint.openScanPopup() this.$refs.receiptHint.openScanPopup()
}, },
remove(item, index) { remove(batch, record, recordIndex,batchIndex,Batchs,locatonIndex,Locations) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?", this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => { res => {
if (res) { if (res) {
item.handleQty = 0; batch.Records.splice(recordIndex, 1);
item.scaned = false ; if(batch.Records.length==0&&Batchs[batchIndex].isNewAdd){
Batchs.splice(batchIndex,1)
}
if(batch.Records.length==0&&Locations[locatonIndex].isNewAdd){
Locations.splice(locatonIndex,1)
}
this.resizeCollapse();
this.$emit('updateData', record)
} }
}); });
}, },

718
src/pages/deliver/coms/comScanDeliverPackBatch.vue

@ -3,17 +3,18 @@
<uni-popup ref="popup" :maskClick='false'> <uni-popup ref="popup" :maskClick='false'>
<view class=""> <view class="">
<view class="popup_box"> <view class="popup_box">
<view class="pop_title uni-flex space-between"> <view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;"> <view class="" style="font-size: 35rpx;">
扫描箱码 扫描箱码
</view> </view>
<view class=""> <view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg" <image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image> @click="closeScanPopup()"></image>
</view> </view>
</view> </view>
<!-- <view class="uni-flex uni-row" style="align-items: center; <!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff; background-color: #fff;
margin-left: 20rpx; margin-left: 20rpx;
@ -32,28 +33,29 @@
@confirm="confirmSelect"></u-select> @confirm="confirmSelect"></u-select>
</view> </view>
</view> </view>
</view> </view> -->
<u-line class='line_color'></u-line> --> <!-- <u-line class='line_color'></u-line> -->
<view class="uni-flex uni-row" style="align-items: center; <!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff; background-color: #fff;
margin-left: 20rpx; margin-left: 20rpx;
margin-right: 20rpx; margin-right: 20rpx;
margin-top: 8rpx; margin-top: 8rpx;
border-radius: 8rpx;"> border-radius: 8rpx;">
<view class="uni-center" style="width: 25%; "> <view class="uni-center" style="width: 25%; font-size: 35rpx; ">
来源库位 来源库位
</view> </view>
<view class="" style="width: 75%; padding: 8rpx;"> <view class="" style="width: 75%; padding: 8rpx;">
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位" <uni-combox class="my-combox" :candidates="fromLocationList" v-model="fromLocationCode"
@confirm="fromLocationUpdate"></uni-combox> placeholder="请选择库位" @confirm="fromLocationUpdate"
</view> :inputStyle="inputStyleObject"></uni-combox>
</view> </view>
</view> -->
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true" <win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
:headerType="headerType" :isShowHistory="false"> headerType="HPQ,HMQ" :isShowHistory="false" :locationCode='locationCode'>
</win-com-scan> </win-com-scan>
<view style="width: 100%;"> <view style="width: 100%;">
@ -76,7 +78,7 @@
<uni-swipe-action-item @click="swipeClick($event,record,index)" <uni-swipe-action-item @click="swipeClick($event,record,index)"
:right-options="scanOptions"> :right-options="scanOptions">
<view style="padding: 0px 10px"> <view style="padding: 0px 10px">
<balance :dataContent="record" :isShowLocation="false" <balance :dataContent="record" :isShowFromLocation="false"
:isShowStdPack="false"></balance> :isShowStdPack="false"></balance>
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
@ -95,6 +97,10 @@
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> <balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit> <balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<!-- 模拟扫描功能 -->
<!-- <win-com-scan v-show="false" ref="comscansimulate" placeholder="箱标签" @getResult="onScan" :clearResult="true"
headerType="HPQ,HMQ" :isShowHistory="false">
</win-com-scan> -->
</view> </view>
</template> </template>
@ -108,24 +114,33 @@
getDetailOption, getDetailOption,
getDetailEditRemoveOption getDetailEditRemoveOption
} from '@/common/array.js'; } from '@/common/array.js';
import {
getWorkShopLineStation,
getBalanceByFilter,
getBalanceByParams,
} from '@/api/request2.js';
import {
uniqueArray
} from '@/common/basic.js';
import { import {
getDirectoryItemArray, getLabelInfo
} from '@/common/directory.js'; } from '@/common/label.js';
import { import {
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import {
getWorkShopLineStation
} from '@/api/request2.js';
import { import {
getBalanceByManagementPrecision getBalanceByManagementPrecision
} from '@/common/balance.js'; } from '@/common/balance.js';
import {
getDirectoryItemArray
} from '../../../common/directory.js';
export default { export default {
name: 'winScanPack', name: 'winScanPack',
emits: ["afterScan", "closeScan"],
components: { components: {
winComScan, winComScan,
balance, balance,
@ -137,12 +152,10 @@
type: String, type: String,
default: '' default: ''
}, },
headerType: { locationCode:{
type: String, type: String,
default: "HPQ,HMQ" default: ''
}, }
}, },
data() { data() {
return { return {
@ -163,9 +176,14 @@
positionInfo: "请选择位置", positionInfo: "请选择位置",
positionList: [], positionList: [],
defaultValueList: [], defaultValueList: [],
fromInventoryStatuses: "",
packageInfo: {},
label: {}, label: {},
fromInventoryStatuses: [], inputStyleObject: {
packageInfo: {} fontSize: "100rpx"
},
bussinessCode: 'Issue',
toLocationAreaTypeList: []
} }
}, },
created() { created() {
@ -177,13 +195,29 @@
this.scanOptions = getDetailEditRemoveOption(); this.scanOptions = getDetailEditRemoveOption();
}, },
methods: { methods: {
openScanPopupForJobSimulate(content, jobcontent, scanMessage) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
this.initData();
getLabelInfo(scanMessage, "HPQ,HMQ", callback => {
if (callback.success) {
this.onScan(callback);
} else {
this.showErrorMessage(callback.message, res => {})
}
})
},
openScanPopup(content, jobcontent) { openScanPopup(content, jobcontent) {
this.issueRecord = []; this.issueRecord = [];
this.dataContent = content; this.dataContent = content;
this.jobContent = jobcontent; this.jobContent = jobcontent;
this.initData(); this.initData();
this.positionInfo = this.jobContent.workShopCode + "-" + this.jobContent.subList[0].productionLineCode + // this.positionInfo = this.jobContent.workShopCode + "-" + this.jobContent.subList[0].productionLineCode +
"-" + this.jobContent.subList[0].workStationCode // "-" + this.jobContent.subList[0].workStationCode
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
setTimeout(res => { setTimeout(res => {
this.getfocus(); this.getfocus();
@ -202,57 +236,58 @@
let that = this; let that = this;
that.fromLocationList = []; that.fromLocationList = [];
if (that.dataContent != null) { if (that.dataContent != null) {
that.fromInventoryStatuses = getDirectoryItemArray(this.jobContent.outInventoryStatuses) that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation =that.dataContent.subList; that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent.subList[0].toLocationCode; that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList(); that.toLocationAreaTypeList = getDirectoryItemArray(this.jobContent.toAreaTypes)
// that.fromLocationList = that.getFromLocationList();
} }
}, },
showBalanceSelect(items, packageInfo) { showBalanceSelect(items) {
this.packageInfo = packageInfo;
this.$refs.balanceSelect.openPopup(items); this.$refs.balanceSelect.openPopup(items);
}, },
getFromLocationList() { // getFromLocationList() {
let list = []; // let list = [];
let location = this.dataContent.subList.find(r => r.toLocationCode == this.toLocationCode); // this.dataContent.forEach(location => {
if (location != undefined) { // location.Items.forEach(item => {
this.dataContent.subList.forEach(item => { // item.Locations.forEach(f => {
list.push(item.fromLocationCode) // let item = list.find(l => l == f.fromLocationCode);
}) // if (item == undefined) {
this.fromLocationCode = list[0]; // list.push(f.fromLocationCode)
return list; // }
} else { // })
this.$refs.comMessage.showErrorMessages('需求库位【' + this.toLocationCode + '】不存在', res => { // })
this.toLocationCode = ''; // });
}); // //
} // list = uniqueArray(list);
}, // this.fromLocationCode = list[0];
// return list;
// },
fromLocationUpdate(fromlocation) { fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation) let location = this.fromLocationList.find(r => r == fromlocation)
// -- if (location == undefined) {
// if (location == undefined) { this.fromLocationCode = ''
this.fromLocationCode = fromlocation this.showErrorMessage('发货库位【' + fromlocation + '】不存在')
// this.showErrorMessage('' + fromlocation + '') }
// }
}, },
onScan(result) {
queryBalance(result) {
try { try {
let that = this; let that = this;
// if (that.fromLocationCode == '') {
if (that.fromLocationCode == '') { // that.showErrorMessage('', res => {
that.showErrorMessage('请选择来源库位', res => { // that.$refs.toLocationCombox.onFocus();
that.$refs.toLocationCombox.onFocus(); // });
}); // return;
return; // }
}
let packageInfo = result.package; let packageInfo = result.package;
let itemCode = result.label.itemCode; let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber; let packingCode = result.label.packingNumber;
let lot = result.label.batch; let lot = result.label.batch;
let item = that.toLocation.find(r => r.itemCode == itemCode); let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) { if (item == undefined) {
that.showErrorMessage('未查找到物料【' + itemCode + '】的发货明细', that.showErrorMessage('未查找到物料【' + itemCode + '】的发货明细',
res => { res => {
@ -261,89 +296,268 @@
) )
return; return;
} else { } else {
//
var params = {
itemCode: result.package.itemCode,
batch: result.label.batch,
packingNumber: result.label.packingNumber,
parentPackingNumber: result.package.parentNumber,
inventoryStatus: this.jobContent.outInventoryStatuses.split(','),
areaType: this.jobContent.fromAreaTypes.split(','),
bussinessCode: this.jobContent.businessType
}
uni.showLoading({ uni.showLoading({
title: '加载中', title: '查询中',
mask: true mask: true
}) })
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, getBalanceByParams(params).then(res => {
balanceRes => { if (res.data.length == 0) {
if (balanceRes.success) { var status = getInventoryStatusDesc(params.inventoryStatus)
if (balanceRes.data.list.length == 0) { var areaType = getListLocationAreaTypeDesc(params.areaType)
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', var hint =
"按物料号 [" + params.itemCode + "] \n" +
"包装号 [" + params.packingNumber + "] \n" +
"批次 [" + params.batch + "] \n" +
"状态 [" + status + "] \n" +
"库区 [" + areaType + "] \n" +
"未查找到库存余额"
this.showErrorMessage(hint,
res => { res => {
this.packGetFocus(); that.getfocus();
}) })
} else if (balanceRes.data.list.length == 1) { } else if (res.data.length == 1) {
let balance = balanceRes.data.list[0]; result.balance = res.data[0]
this.afterGetBalance(result.label, balance, packageInfo);
if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.qty = Number(result.label.qty)
} else { } else {
this.label = result.label; result.balance.qty = Number(result.balance.qty)
this.showBalanceSelect(balanceRes.data.list, packageInfo);
} }
this.afterGetBalance(result.label, result.balance, result.package);
} else { } else {
this.showErrorMessage(balanceRes.message.message); //
this.$refs.balanceSelect.openPopup(res.data);
} }
uni.hideLoading(); uni.hideLoading()
}); }).catch(error => {
uni.hideLoading()
this.showErrorMessage(error,
res => {
that.getfocus();
})
})
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.stack) this.showErrorMessage(e.stack, res => {
that.getfocus();
})
uni.hideLoading(); uni.hideLoading();
} }
}, },
getBalance(label, packageInfo, callback) {
var filters = []
if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({
column: "itemCode",
action: "==",
value: label.itemCode
})
filters.push({
column: "batch",
action: "==",
value: label.batch
})
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.fromInventoryStatuses
})
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
})
},
onScan(result) {
if (!result.package) {
this.showErrorMessage('扫描数据错误[' + result.label.code + "]",
res => {
this.getfocus();
}
)
return;
}
if (this.toLocation) {
let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode);
if (!item) {
this.showErrorMessage('扫描物料代码不属于该任务');
return
}
this.getToLocationBalance(result)
}
},
//
getToLocationBalance(result) {
uni.showLoading({
title: '查询中',
mask: true
})
var filters = []
if (result.package.parentNumber) {
var packingNumber = result.package.parentNumber + "," + result.package.number;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: result.package.number
})
}
filters.push({
column: "itemCode",
action: "==",
value: result.package.itemCode
})
filters.push({
column: "batch",
action: "==",
value: result.package.batch
})
filters.push({
column: "areaType",
action: "in",
value: this.toLocationAreaTypeList.join(',')
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
uni.hideLoading()
if (res.data.list.length > 0) {
this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额");
} else {
this.queryBalance(result);
}
// callback(res.data)
}).catch(err => {
uni.hideLoading()
this.showErrorMessage(err.message);
})
},
selectBalanceItem(balance) { selectBalanceItem(balance) {
this.afterGetBalance(balance, balance, this.packageInfo); this.afterGetBalance(balance, balance, this.packageInfo);
}, },
afterGetBalance(label, balance, packageInfo) { afterGetBalance(label, balance, packageInfo) {
let that = this; let that = this;
try { try {
let itemCode = label.itemCode; let itemCode = label.itemCode;
let packingCode = label.packingNumber; let packingCode = label.packingNumber;
let lot = label.batch; let lot = label.batch;
let item = that.toLocation.find(r => r.itemCode == itemCode); let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
// item.scaned =true that.fromLocationCode = balance.locationCode;
let fromLocation = that.toLocation.find(l => l.fromLocationCode == that.fromLocationCode); let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
// -- //
if(!fromLocation){ if (fromLocation){
fromLocation = { //
Batchs:[{ // if(fromLocation.isNewAdd){
Recommends:[],
Records: [], // }else {
batch: label.batch, // //
detail:{
...packageInfo, // }
fromLocationCode: balance.locationCode,
toLocationCode:this.toLocationCode let batch = fromLocation.Batchs.find(r => r.batch == lot);
}, if (batch != undefined) {
handleQty: 0, if (batch.Records == undefined) {
packingNumber: null, batch.Records = [];
// packingNumber: label.packingNumber, }
qty: label.qty,
uom: label.uom let record = batch.Records.find(r => r.packingNumber == packingCode);
}], if (record == undefined) {
toLocationCode:this.toLocationCode, //
fromLocationCode: balance.locationCode, if (batch.Recommends != undefined && batch.Recommends.length > 0) {
handleQty: 0, let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
qty: label.qty, if (recommend != undefined) {
uom: label.uom that.addRecord(batch, label, balance, packageInfo)
} else {
//
if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, balance, packageInfo);
} else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => {
that.getfocus();
return;
}
)
} }
item.Locations.push(fromLocation)
} }
if (fromLocation != undefined) { } else {
let batch = fromLocation.batch; that.addRecord(batch, label, balance, packageInfo)
if (batch != undefined) { }
that.addRecord(item.batch, label, balance, packageInfo)
} else {
// that.showErrorMessage('' + packingCode + ',',
// res => {
// that.getfocus();
// }
// )
that.addRecord(batch, label, balance, packageInfo)
}
} else { } else {
if (this.jobContent.allowModifyBatch == "TRUE") { if (this.jobContent.allowModifyBatch == "TRUE") {
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot +
'】的发货明细,是否要继续发货?', res => { '】的发货明细,是否要继续发货?', res => {
if (res) { if (res) {
let batch = that.createBatchInfo(label, balance, packageInfo); let batch = that.createBatchInfo(label, balance, packageInfo);
//details
if (fromLocation.Batchs.length > 0) {
batch.detail = fromLocation.Batchs[0].detail;
}
fromLocation.Batchs.unshift(batch); fromLocation.Batchs.unshift(batch);
this.getfocus();
that.$emit("afterScan");
} }
}) })
} else { } else {
@ -353,13 +567,168 @@
}); });
} }
} }
}else { }else {
that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发货明细', //
res => { if (this.jobContent.allowModifyLocation == "TRUE") {
that.getfocus(); this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,是否要继续发货?", res => {
if (res) {
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
this.getfocus();
that.$emit("afterScan");
} }
) })
} else {
this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,不允许继续发货?")
} }
}
// if (fromLocation && !fromLocation.isNewAdd) {
// let batch = fromLocation.Batchs.find(r => r.batch == lot);
// if (batch != undefined) {
// if (batch.Records == undefined) {
// batch.Records = [];
// }
// let record = batch.Records.find(r => r.packingNumber == packingCode);
// if (record == undefined) {
// //
// if (batch.Recommends != undefined && batch.Recommends.length > 0) {
// let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
// if (recommend != undefined) {
// that.addRecord(batch, label, balance, packageInfo)
// } else {
// //
// if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
// that.addRecord(batch, label, balance, packageInfo);
// } else {
// that.showErrorMessage('' + packingCode + '',
// res => {
// that.getfocus();
// return;
// }
// )
// }
// }
// } else {
// that.addRecord(batch, label, balance, packageInfo)
// }
// } else {
// that.showErrorMessage('' + packingCode + ',',
// res => {
// that.getfocus();
// }
// )
// }
// } else {
// if (this.jobContent.allowModifyBatch == "TRUE") {
// this.showQuestionMessage('' + that.fromLocationCode + ',' + lot +
// ',?', res => {
// if (res) {
// let batch = that.createBatchInfo(label, balance, packageInfo);
// //details
// if (fromLocation.Batchs.length > 0) {
// batch.detail = fromLocation.Batchs[0].detail;
// }
// fromLocation.Batchs.unshift(batch);
// this.getfocus();
// that.$emit("afterScan");
// }
// })
// } else {
// that.showErrorMessage('' + lot + '',
// res => {
// that.getfocus();
// });
// }
// }
// } else {
// if (fromLocation&&fromLocation.isNewAdd) {
// let batch = fromLocation.Batchs.find(r => r.batch == lot);
// if (batch != undefined) {
// if (batch.Records == undefined) {
// batch.Records = [];
// }
// let record = batch.Records.find(r => r.packingNumber == packingCode);
// if (record == undefined) {
// //
// if (batch.Recommends != undefined && batch.Recommends.length > 0) {
// let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
// if (recommend != undefined) {
// that.addRecord(batch, label, balance, packageInfo)
// } else {
// //
// if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
// that.addRecord(batch, label, balance, packageInfo);
// } else {
// that.showErrorMessage('' + packingCode + '',
// res => {
// that.getfocus();
// return;
// }
// )
// }
// }
// } else {
// that.addRecord(batch, label, balance, packageInfo)
// }
// } else {
// that.showErrorMessage('' + packingCode + ',',
// res => {
// that.getfocus();
// }
// )
// }
// } else {
// if (this.jobContent.allowModifyBatch == "TRUE") {
// this.showQuestionMessage('' + that.fromLocationCode + ',' + lot +
// ',?', res => {
// if (res) {
// let batch = that.createBatchInfo(label, balance, packageInfo);
// //details
// if (fromLocation.Batchs.length > 0) {
// batch.detail = fromLocation.Batchs[0].detail;
// }
// fromLocation.Batchs.unshift(batch);
// this.getfocus();
// that.$emit("afterScan");
// }
// })
// } else {
// that.showErrorMessage('' + lot + '',
// res => {
// that.getfocus();
// });
// }
// }
// } else {
// if (this.jobContent.allowModifyLocation == "TRUE") {
// this.showQuestionMessage("[" + itemCode + "]" + that.fromLocationCode +
// ",?", res => {
// if (res) {
// let locaion = that.createLocationInfo(label, balance, packageInfo);
// item.Locations.push(locaion);
// this.getfocus();
// that.$emit("afterScan");
// }
// })
// } else {
// this.showErrorMessage("[" + itemCode + "]" + that.fromLocationCode +
// ",?")
// }
// }
// }
} catch (e) { } catch (e) {
that.showErrorMessage(e.stack, that.showErrorMessage(e.stack,
res => { res => {
@ -369,27 +738,32 @@
} }
}, },
//
createLocationInfo(label, balance, packageInfo) {
let location = {
fromLocationCode: balance.locationCode,
qty: balance.qty,
uom: balance.uom,
handleQty: 0,
isNewAdd: true,
Batchs: []
}
let batch = this.createBatchInfo(label, balance, packageInfo);
batch.detail = balance;
batch.detail.fromLocationCode = balance.locationCode;
location.Batchs.push(batch);
return location;
},
createBatchInfo(data, balance, packageInfo) { createBatchInfo(data, balance, packageInfo) {
let batch = { let batch = {
batch: data.lot||data.batch, isNewAdd: true,
batch: data.batch,
qty: 0, qty: 0,
uom: data.uom, uom: data.uom,
handleQty: Number(data.qty), handleQty: Number(balance.qty),
Records: [], Records: []
detail:{
fromLocationCode:this.fromLocationCode, //balance.locationCode
toLocationCode:this.toLocationCode,
itemCode:data.itemCode,
handleQty: Number(data.qty),
packingNumber:data.packingNumber,
qty: 0,
uom:data.uom,
itemName:packageInfo.itemName,
itemDesc1:packageInfo.itemDesc1,
itemDesc2:packageInfo.itemDesc2,
singlePrice:balance.singlePrice,
amount:balance.amount
}
} }
let record = this.creatRecord(data, balance, packageInfo); let record = this.creatRecord(data, balance, packageInfo);
batch.Records.push(record); batch.Records.push(record);
@ -409,45 +783,83 @@
// qty: Number(balance.qty), // qty: Number(balance.qty),
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty), // qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
qty: Number(balance.qty), qty: Number(balance.qty),
handleQty:0, handleQty: Number(balance.qty),
uom: balance.uom, uom: balance.uom,
inventoryStatus: balance.inventoryStatus, inventoryStatus: balance.inventoryStatus,
balance: balance, balance: balance,
toLocationCode: this.toLocationCode, toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode, supplierCode: label.supplierCode,
packUnit: packageInfo.packUnit, packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty, packQty: packageInfo.packQty
fromLocationCode:balance.locationCode,
} }
return record; return record;
}, },
calcBatchHandleQty(batch,label,balance) { calcBatchHandleQty(batch) {
this.dataContent.subList.forEach(item => { let handleQty = 0;
if(item.itemCode == label.itemCode&&item.batch == label.batch){ batch.Records.forEach(res => {
item.handleQty = item.handleQty || 0 handleQty = calc.add(handleQty, res.qty)
item.handleQty = calc.add(item.handleQty, label.qty);
}
}) })
batch.handleQty = handleQty;
}, },
addRecord(batch, label, balance, packageInfo) { addRecord(batch, label, balance, packageInfo) {
var checkData = this.dataContent.subList.find(r => { if (packageInfo.parentNumber) {
if (r.batch == balance.batch) { var checkData = batch.Records.find(r => {
if (r.packingNumber == packageInfo.parentNumber &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.showErrorMessage("箱码[" + packageInfo.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
} else {
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
this.$emit("afterScan");
}
} else {
//
var checkData = batch.Records.find(r => {
if (r.parentPackingNumber == packageInfo.number &&
r.batch == balance.batch) {
return r; return r;
} }
}) })
if (checkData) { if (checkData) {
checkData.scaned = true //
this.calcBatchHandleQty(batch,label,balance); this.$refs.comMessage.showQuestionMessage("扫描箱码[" + checkData.parentPackingNumber + "]" + "批次[" +
balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
batch.Records = [];
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus(); this.getfocus();
this.$emit("afterScan");
}
})
console.log("扫描的是父包装,是否移除子包装")
} else { } else {
let record = this.creatRecord(label, balance, packageInfo); let record = this.creatRecord(label, balance, packageInfo);
this.dataContent.subList.push(record); batch.Records.push(record);
this.calcBatchHandleQty(batch,label,balance); this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus(); this.getfocus();
this.$emit("afterScan"); this.$emit("afterScan");
} }
}
}, },
getfocus() { getfocus() {
@ -496,13 +908,17 @@
let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode); let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode);
if (item != undefined) { if (item != undefined) {
item.Locations.forEach(l => { item.Locations.forEach(l => {
let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b
.batch == record.batch); .batch == record.batch);
if (batch && batch.Records && batch.Records.length > 0) {
let rIndex = batch.Records.findIndex(r => r.packingNumber == record let rIndex = batch.Records.findIndex(r => r.packingNumber == record
.packingNumber && r .packingNumber && r.batch == record.batch);
.batch == record.batch);
batch.Records.splice(rIndex, 1); batch.Records.splice(rIndex, 1);
}
}) })
} }
this.$emit('updateData', item); this.$emit('updateData', item);
@ -511,10 +927,16 @@
}, },
packGetFocus() { packGetFocus() {
if (this.$refs.comscan) {
this.$refs.comscan.getfocus(); this.$refs.comscan.getfocus();
}
}, },
packLoseFocus() { packLoseFocus() {
if (this.$refs.comscan) {
this.$refs.comscan.losefocus(); this.$refs.comscan.losefocus();
}
}, },
showMessage(message, callback) { showMessage(message, callback) {
setTimeout(r => { setTimeout(r => {
@ -561,4 +983,8 @@
max-height: 300rpx; max-height: 300rpx;
padding: 10rpx; padding: 10rpx;
} }
.my-combox {
font-size: 50px;
}
</style> </style>

209
src/pages/deliver/job/deliverDetailBatch.vue

@ -9,7 +9,7 @@
<view class="cell_box uni-flex uni-row"> <view class="cell_box uni-flex uni-row">
<view class="cell_info"> <view class="cell_info">
<view class="text_lightblue">发货类型</view> <view class="text_lightblue">发货类型</view>
<view>{{jobContent.deliverType}}</view> <view style="line-height: 34rpx;">{{jobContent.deliverType}}</view>
</view> </view>
<view class="cell_info"> <view class="cell_info">
@ -28,16 +28,19 @@
<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> <view v-for="(toLocation, index) in detailSource">
<comDeliverDetailCardBatch ref='comIssueDetailCard' :dataContent="detailSource" :settingParam="jobContent" <comDeliverDetailCardBatch ref='comIssueDetailCard'
@updateData='updateData' :allowBiggerQty='allowBiggerQty'> :dataContent="toLocation"
:settingParam="jobContent"
@updateData='updateData'>
</comDeliverDetailCardBatch> </comDeliverDetailCardBatch>
</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" 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="">
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
@ -45,9 +48,8 @@
</view> </view>
</view> </view>
</view> </view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button> <win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<comScanDeliverPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'> <comScanDeliverPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData' :locationCode='fromLocationCode'>
</comScanDeliverPackBatch> </comScanDeliverPackBatch>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -86,6 +88,7 @@
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comDeliverDetailCard from '@/pages/deliver/coms/comDeliverDetailCard.vue'
import comDeliverDetailCardBatch from '@/pages/deliver/coms/comDeliverDetailCardBatch.vue' import comDeliverDetailCardBatch from '@/pages/deliver/coms/comDeliverDetailCardBatch.vue'
import comScanDeliverPackBatch from '@/pages/deliver/coms/comScanDeliverPackBatch.vue' import comScanDeliverPackBatch from '@/pages/deliver/coms/comScanDeliverPackBatch.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
@ -96,8 +99,8 @@
jobDetailPopup, jobDetailPopup,
winScanButton, winScanButton,
comDeliverDetailCardBatch, comDeliverDetailCardBatch,
comScanDeliverPackBatch, jobTop,
jobTop comScanDeliverPackBatch
}, },
data() { data() {
return { return {
@ -110,7 +113,7 @@
status: "", status: "",
toLocationCode: "", toLocationCode: "",
jobStatus: "", jobStatus: "",
allowBiggerQty:"TRUE",// fromLocationCode:''
}; };
}, },
@ -185,9 +188,9 @@
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status; that.jobStatus = res.data.status;
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = res.data; that.detailSource = getDataSource(that.detailSource, that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
that.allowBiggerQty = res.data.allowBiggerQty;
that.resizeCollapse(); that.resizeCollapse();
} else { } else {
that.showMessage('未获取到详情'); that.showMessage('未获取到详情');
@ -203,7 +206,11 @@
}, },
resizeCollapse() { resizeCollapse() {
this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
})
});
}, },
@ -216,37 +223,28 @@
// //
var itemCodes = [] var itemCodes = []
let locationCode = this.detailSource.subList[0].toLocationCode let locationCode = this.detailSource[0].toLocationCode
this.detailSource.subList.forEach(item => { this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
itemCodes.push(item.itemCode) itemCodes.push(item.itemCode)
}) })
})
//使
if (locationCode == null) {
this.submitJob();
} else {
// //
getManagementPrecisions(itemCodes, locationCode, res => { getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
this.managementType = this.managementList && this.managementList[0] ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
this.submitJob(); this.submitJob();
} else { } else {
uni.hideLoading(); uni.hideLoading();
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
} }
}); });
// //使 }
// if (locationCode == null) {
// this.submitJob();
// } else {
// //
// getManagementPrecisions(itemCodes, locationCode, res => {
// if (res.success) {
// this.managementList = res.list;
// this.submitJob();
// } else {
// uni.hideLoading();
// this.showErrorMessage(res.message);
// }
// });
// }
}, },
checkCount(){ checkCount(){
@ -259,6 +257,18 @@
item.Locations.forEach(lco => { item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => { lco.Batchs.forEach(batch => {
batch.Records.forEach(record => { batch.Records.forEach(record => {
// if (batch.qty != record.qty) {
// var tempHandleQty = 0
// if (record.qty) {
// tempHandleQty = record.qty
// } else {
// tempHandleQty = 0
// }
// if (batch.qty != 0) {
// str +=
// `${record.packingNumber}${tempHandleQty}${batch.qty}\n`
// }
// }
if(record){ if(record){
var hanleQty =record.qty?record.qty:0 var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty) totalQty = calc.add(totalQty,hanleQty)
@ -289,69 +299,27 @@
} }
return str?false:true return str?false:true
},
checkCountBatch() {
let str = ""
let str1 = ""
this.detailSource.subList.forEach(item => {
var taskQty = 0;
var totalQty = 0;
item.taskQty = calc.add(taskQty, item.qty)
totalQty = calc.add(totalQty, item.handleQty)
//
item.totalQty = totalQty
})
//
this.detailSource.subList.forEach(detail => {
if (this.jobContent.allowPartialComplete == "FALSE") {
if (detail.taskQty != detail.totalQty) {
str += `物料号【${detail.itemCode}】任务数量【${detail.taskQty}】与实际提交数量【${detail.totalQty}】不一致\n`
}
}
if (this.allowBiggerQty == 'FALSE') {
if ( detail.taskQty < detail.totalQty) {
str1 += '数量[' + detail.totalQty + ']不允许大于任务数量[' + detail.taskQty + ']'
}
}
})
if (str) {
str = '不允许提交\n' + str
this.showErrorMessage(str)
}
if (str1) {
str1 = '不允许提交\n' + str1
this.showErrorMessage(str1)
}
return str || str1 ? false : true
}, },
submitJob() { submitJob() {
var params = this.setParams() var params = this.setParams()
console.log("提交参数", params); console.log("提交参数", JSON.stringify(params));
if (params.subList.length == 0) { if (params.subList.length == 0) {
uni.hideLoading() uni.hideLoading()
this.$refs.comMessage.showConfirmMessageModal('请扫描箱码') this.$refs.comMessage.showConfirmMessageModal('请扫描箱码')
return return
} }
if(this.managementType == "BY_BATCH" ||this.managementType == "BY_QUANTITY" ){
if (!this.checkCountBatch()) {
uni.hideLoading()
return;
}
}else{
if(!this.checkCount()){ if(!this.checkCount()){
uni.hideLoading() uni.hideLoading()
return ; return ;
} }
}
deliverJobSubmit(params).then(res => { deliverJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成发货记录\n" + res.data) this.showCommitSuccessMessage("提交成功\n生成发货记录\n" + res.data)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
@ -366,39 +334,54 @@
var subList = [] var subList = []
var createTime = getCurrDateTime(); var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.subList.forEach(r => { this.detailSource.forEach(toLocationCode => {
if (r.scaned) { toLocationCode.Items.forEach(item => {
let subItem = { item.Locations.forEach(fromLocation => {
...r fromLocation.Batchs.forEach(batch => {
} let subItem = batch.detail;
subItem.recordList = [] subItem.recordList = [];
if (batch.Records.length > 0) {
batch.Records.forEach(r => {
let record = {}; let record = {};
record.handleQty = r.handleQty; record.handleQty = r.qty;
record.toContainerNumber = r.ContainerNumber; record.fromPackingNumber = r
record.toInventoryStatus = r.inventoryStatus; .packingNumber;
record.toLocationCode = subItem.toLocationCode; record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
// record.toLocationCode = subItem
// .toLocationCode;
record.toLocationCode = this.toLocationCode;
record.supplierCode = r.supplierCode; record.supplierCode = r.supplierCode;
var info = getPackingNumberAndBatch(this.managementList, r.itemCode, r.packingNumber, r.batch);
record.toPackingNumber = info.packingNumber; //使
record.packingNumber = info.packingNumber; if (this.toLocationCode == null) {
record.fromPackingNumber = info.packingNumber; record.toPackingNumber = r
.packingNumber;
record.toBatch = r.batch;
} else {
var info =
getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
.packingNumber;
record.toBatch = info.batch; record.toBatch = info.batch;
subItem.toPackingNumber = info.packingNumber; }
subItem.packingNumber = info.packingNumber; record.fromParentPackingNumber = r
subItem.fromPackingNumber = info.packingNumber; .parentPackingNumber;
// //使 subItem.toLocationCode = this.toLocationCode
// if (this.toLocationCode == null) {
// record.toPackingNumber = r.packingNumber;
// record.toBatch = r.batch;
// } else {
// var info = getPackingNumberAndBatch(this.managementList, r.itemCode,r.packingNumber, r.batch);
// record.toPackingNumber = info.packingNumber;
// record.toBatch = info.batch;
// }
subItem.recordList.push(record); subItem.recordList.push(record);
})
subList.push(deepCopyData(subItem)); subList.push(deepCopyData(subItem));
} }
}) })
})
})
})
this.jobContent.subList = subList this.jobContent.subList = subList
this.jobContent.createTime = createTime; this.jobContent.createTime = createTime;
@ -437,7 +420,25 @@
}, },
updateData(record) { updateData(record) {
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode);
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode);
let itemHandleQty = 0;
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
.packingNumber == null || b.packingNumber == '') && b.batch ==
record.batch);
let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
itemHandleQty = calc.add(itemHandleQty, handleQty)
}
})
}
// item.handleQty=itemHandleQty;
}, },
scanPopupGetFocus() { scanPopupGetFocus() {

1
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -11,6 +11,7 @@
<view class=""> <view class="">
<com-move-record-card :dataContent="item" :index="index" @removeData="removeData" <com-move-record-card :dataContent="item" :index="index" @removeData="removeData"
:isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack' :isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack'
:allowEditQty="true"
:allowEditStatus="allowEditStatus"> :allowEditStatus="allowEditStatus">
</com-move-record-card> </com-move-record-card>
</view> </view>

87
src/pages/inventoryMove/job/inventoryMoveDetail.vue

@ -73,6 +73,10 @@
getPackingNumberAndBatchByList, getPackingNumberAndBatchByList,
getInventoryStatusName, getInventoryStatusName,
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.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'
@ -316,6 +320,88 @@
getScanResult(result,managementPrecision) { getScanResult(result,managementPrecision) {
if(managementPrecision == 'BY_BATCH'){
this.setDataBatch(result,managementPrecision)
}else{
this.setData(result,managementPrecision)
}
},
setDataBatch(result,managementPrecision){
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = ''
if(managementPrecision == 'BY_QUANTITY'){
itemDetail = detail.subList.find(r => {
return r.itemCode == result.label.itemCode
})
}else{
itemDetail = detail.subList.find(r => {
return r.batch == batch
})
}
if (itemDetail == undefined && managementPrecision != 'BY_QUANTITY') {
this.showErrorMessage( "批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
// this.showMessage("" + batch + "")
itemDetail.handleQty =calc.add(itemDetail.handleQty,Number(result.label.qty));
} else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续转移?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty);
itemDetail.fromInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty);
itemDetail.fromInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
}
}
}
}
this.scanPopupGetFocus();
} catch (e) {
this.showErrorMessage(e.message);
}
},
setData(result,managementPrecision){
try { try {
var packingNumber = result.label.packingNumber; var packingNumber = result.label.packingNumber;
var batch = result.label.batch; var batch = result.label.batch;
@ -388,7 +474,6 @@
} }
}, },
async commit() { async commit() {
this.scanCount = getScanCount(this.subList); this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) { if (this.scanCount == 0) {

1
src/pages/issue/job/issueDetailBatch.vue

@ -501,7 +501,6 @@
var subList = [] var subList = []
var createTime = getCurrDateTime(); var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
console.log(2343,this.detailSource)
this.detailSource.forEach(toLocationCode => { this.detailSource.forEach(toLocationCode => {
let obj = {...toLocationCode} let obj = {...toLocationCode}
delete obj.subList delete obj.subList

2
src/pages/issue/job/issueJob.vue

@ -484,7 +484,7 @@
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
this.managementType = this.managementList&&this.managementList[0]&&this.managementList[0].ManagementPrecision this.managementType = this.managementList&&this.managementList[0]&&this.managementList[0].ManagementPrecision
if(this.managementType == 'BY_BATCH'){ if(this.managementType == 'BY_BATCH'||this.managementType == 'BY_QUANTITY'){
uni.navigateTo({ uni.navigateTo({
url: './issueDetailBatch?id=' + result.masterId + '&status=' + result.status + url: './issueDetailBatch?id=' + result.masterId + '&status=' + result.status +
'&scanMessage=' + '&scanMessage=' +

103
src/pages/productReceipt/coms/comProductDetailCardBatch.vue

@ -1,31 +1,28 @@
<template> <template>
<view class="" style="background-color: #fff;"> <view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"></itemCompareQty> <itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"></itemCompareQty>
</template>
<view class="" v-for="(item,index) in dataContent.subList" :key="index"> <view class="" v-for="(item,index) in dataContent.subList" :key="index">
<uni-swipe-action ref="swipeAction" v-if="index==0" :class="item.scaned?'scan_view':''"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" :right-options="item.scaned?scanOptions:detailOptions">
@click="swipeClick($event,item,'parent')"> <recommend :detail="item" :isShowFromLocation="false"
<!-- <div style="display: flex;"> :isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommend>
<div style="flex: 1;">
<batch v-if="item.batch" :batch="item.batch"></batch>
<to-location title="目标库位" :locationCode="item.toLocationCode">
</to-location>
</div>
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text>
</div> -->
<recommendBatch :detail="item" :isShowFromLocation="false"
:isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommendBatch>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<view v-if="item.fgList!=undefined && item.fgList.length>0" class="card_view " style="margin-left: 20px;" <view v-if="item.fgList!=undefined && item.fgList.length>0" class="card_view "
v-for="(fg, index) in item.fgList" :key="index"> style="margin-left: 20px;" v-for="(fg, index) in item.fgList" :key="index">
<com-fg-card :detail='fg' class="scan_view"></com-fg-card> <com-fg-card :detail='fg' class="scan_view"></com-fg-card>
</view> </view>
</view> </view>
</uni-collapse-item>
</uni-collapse>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm" :isNumTips='false'>
</recommend-qty-edit> </recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' <win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> :locationAreaTypeList="locationAreaTypeList"></win-scan-location>
@ -36,36 +33,27 @@
<script> <script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommendBatch from '@/mycomponents/recommend/recommendBatch.vue' import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue' import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import productDetailInfoPopup from '@/pages/productReceipt/coms/productDetailInfoPopup.vue' import productDetailInfoPopup from '@/pages/productReceipt/coms/productDetailInfoPopup.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue" import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import config from '@/static/config.js'
import { import {
getRemoveOption, getDetailOption,
getEditRemoveOption getPurchaseReceiptOption
} from '@/common/array.js'; } from '@/common/array.js';
export default { export default {
components: { components: {
itemCompareQty, itemCompareQty,
recommendBatch, recommend,
recommendQtyEdit, recommendQtyEdit,
jobDetailPopup, jobDetailPopup,
productDetailInfoPopup, productDetailInfoPopup,
winScanLocation, winScanLocation,
comFgCard, comFgCard
pack,
location,
toLocation,
batch
}, },
props: { props: {
dataContent: { dataContent: {
@ -80,10 +68,7 @@
type: Array, type: Array,
default: null default: null
}, },
isEdit: {
type: Boolean,
default: true
},
}, },
watch: { watch: {
@ -112,17 +97,18 @@ isEdit: {
}, },
locatonItem: {}, locatonItem: {},
detailOptions: [], detailOptions: [],
scanOptions: [], scanOptions: []
options: [],
removeOptions: [],
editAndRemoveOptions: []
} }
}, },
mounted() { mounted() {
if (this.detailOptions.length == 0) {
this.removeOptions = getRemoveOption(); this.detailOptions = getDetailOption();
this.editAndRemoveOptions = getEditRemoveOption() }
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation)
}
}, },
methods: { methods: {
@ -170,36 +156,7 @@ isEdit: {
confirm(qty) { confirm(qty) {
this.editItem.handleQty = qty; this.editItem.handleQty = qty;
this.$emit('updateData') this.$emit('updateData')
},
isDevlement() {
return config.isDevelopment;
},
copy(detail) {
console.log(detail)
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
var content = "HPQ;V1.0;I" + detail.itemCode + ";P" + detail.packingNumber + ";B" + detail
.batch + ";Q" + detail.qty
// #ifdef H5
this.$copyText(content).then(
res => {
uni.showToast({
title: '复制采购标签成功',
icon: 'none'
})
} }
)
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制采购标签成功'
})
}
})
// #endif
},
} }
} }
</script> </script>

5
src/pages/productReceipt/job/productReceiptDetail.vue

@ -290,17 +290,18 @@
this.showErrorMessage("批次[" + batch + "]不在任务列表中") this.showErrorMessage("批次[" + batch + "]不在任务列表中")
} else { } else {
if (itemDetail.scaned) { if (itemDetail.scaned) {
this.showErrorMessage("批次[" + batch + "]已经扫描") // this.showErrorMessage("[" + batch + "]")
itemDetail.handleQty = calc.add(Number(result.label.qty),itemDetail.handleQty);
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty); itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode; itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty); itemDetail.labelQty = Number(result.label.qty);
calcHandleQty(this.detailSource);
this.continueScan() this.continueScan()
this.$forceUpdate() this.$forceUpdate()
} }
calcHandleQty(this.detailSource);
} }
} }
}, },

40
src/pages/productRecycle/job/productRecycleJobDetail.vue

@ -72,6 +72,10 @@
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
import {
calc
} from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
@ -366,20 +370,22 @@
if (itemDetail) { if (itemDetail) {
// //
if (itemDetail.scaned) { if (itemDetail.scaned) {
this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result // this.showErrorMessage("\n" + batch + "\n" + result
.fromLocationCode + "】\n状态【" + balanceStatus + "】\n已经扫描") // .fromLocationCode + "\n" + balanceStatus + "\n")
return; itemDetail.handleQty = calc.add(itemDetail.handleQty,Number(result.label.qty));
itemDetail.balanceQty = Number(result.label.qty);
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty); itemDetail.handleQty = Number(result.label.qty);
itemDetail.balanceQty = Number(result.label.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus; itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.inventoryStatus = result.balance.inventoryStatus; itemDetail.inventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance; itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty); itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty) itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
} }
this.calcHandleQty();
} else { } else {
// //
itemDetail = detail.subList.find(r => { itemDetail = detail.subList.find(r => {
@ -390,12 +396,13 @@
if (itemDetail) { if (itemDetail) {
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
// //
if(balanceStatus!=itemStatus){
if (this.jobContent.allowModifyInventoryStatus == "TRUE") { if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
']不一致,是否继续回收?', res => { ']不一致,是否继续回收?', res => {
if (res) { if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty); itemDetail.handleQty = itemDetail.handleQty ? calc.add(itemDetail.handleQty,Number(result.label.qty)) : Number(result.label.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus; itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.inventoryStatus = result.balance.inventoryStatus; itemDetail.inventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance; itemDetail.balance = result.balance;
@ -414,6 +421,19 @@
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}); });
} }
//
}else{
itemDetail.scaned = true;
itemDetail.handleQty = itemDetail.handleQty ? calc.add(itemDetail.handleQty,Number(result.label.qty)) : Number(result.label.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.inventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.packQty = result.package.packQty
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
}
} else { } else {
this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result
.fromLocationCode + "】\n状态【" + balanceStatus + "】\n不在任务列表中") .fromLocationCode + "】\n状态【" + balanceStatus + "】\n不在任务列表中")
@ -492,6 +512,7 @@
checkCountBatch(){ checkCountBatch(){
// //
let str = '' let str = ''
let str1 = ''
this.detailSource.forEach((item) => { this.detailSource.forEach((item) => {
item.subList.forEach(cur => { item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) { if (cur.qty != cur.handleQty) {
@ -503,8 +524,15 @@
} }
str += `物料号【${item.itemCode}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致` str += `物料号【${item.itemCode}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
} }
if(cur.handleQty > cur.balance.qty){
str1 += `物料号【${item.itemCode}】提交数量【${cur.handleQty}】不可以大于库存数量【${cur.balance.qty}`
}
}) })
}) })
if (str1) {
this.$refs.comMessage.showMessage(str1);
return
}
if (str) { if (str) {
str = '任务明细未全部完成,是否提交?\n'+ str str = '任务明细未全部完成,是否提交?\n'+ str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => { this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {

80
src/pages/productionReturn/job/okToReturnDetail.vue

@ -66,7 +66,9 @@
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
import {
calc
} from '@/common/calc'
import { import {
getDataSource, getDataSource,
createRecordInfo, createRecordInfo,
@ -256,7 +258,7 @@
}, },
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup(this.fromLocationCode);
// let fromlocationCode = ''; // let fromlocationCode = '';
// let fromlocationList = []; // let fromlocationList = [];
// for (var i = 0; i < this.detailSource.length; i++) { // for (var i = 0; i < this.detailSource.length; i++) {
@ -282,6 +284,79 @@
getScanResult(result) { getScanResult(result) {
this.managementType = result.managementType
if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') {
this.setDataBatch(result)
} else {
this.setData(result)
}
},
setDataBatch(result){
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage("批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
// this.showErrorMessage("[" + batch + "]")
itemDetail.handleQty =calc.add(itemDetail.handleQty,Number(result.package.qty))
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.package.qty)
itemDetail.inventoryStatus = "OK"
itemDetail.packQty = result.package.packQty
itemDetail.packUnit = result.package.packUnit
//退,退000000 --nxt
// let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
// let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
// if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
// this.showQuestionMessage('[' + balanceStatus + '][' + itemStatus +
// '],?', res => {
// if (res) {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty)
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.packQty = result.package.packQty
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// } else {
// this.scanPopupGetFocus();
// }
// });
// } else {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty)
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.packQty = result.package.packQty
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// }
}
this.calcHandleQty();
}
}
this.scanPopupGetFocus();
} catch (e) {
this.showErrorMessage(e.message);
}
},
setData(result){
try { try {
var packingNumber = result.label.packingNumber; var packingNumber = result.label.packingNumber;
var batch = result.label.batch; var batch = result.label.batch;
@ -400,6 +475,7 @@
itemCode: itemCodes, itemCode: itemCodes,
locationCode: this.toLocationCode locationCode: this.toLocationCode
} }
getManagementPrecisions(itemCodes, this.toLocationCode, res => { getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;

14
src/pages/putaway/job/putawayDetail.vue

@ -87,7 +87,9 @@
calcTreeHandleQty, calcTreeHandleQty,
getScanCount getScanCount
} from '@/common/detail.js'; } from '@/common/detail.js';
import {
calc
} from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comJobDetailCard from "@/mycomponents/detail/comJobDetailCard.vue" import comJobDetailCard from "@/mycomponents/detail/comJobDetailCard.vue"
@ -275,7 +277,7 @@
updateData() { updateData() {
console.log("updateData") console.log("updateData")
// this.calcHandleQty(); // this.calcHandleQty();
// calcTreeHandleQty(this.detailSource) calcTreeHandleQty(this.detailSource)
}, },
// //
openScanPopupSimulate(message) { openScanPopupSimulate(message) {
@ -470,7 +472,8 @@
.fromLocationCode + "】不在列表中") .fromLocationCode + "】不在列表中")
} else { } else {
if (!isExit.cancleScanedHiht && isExit.scaned) { if (!isExit.cancleScanedHiht && isExit.scaned) {
this.showMessage("批次【" + batch + "】已经扫描") // this.showMessage("" + batch + "")
isExit.handleQty = calc.add(Number(result.label.qty),isExit.handleQty)
} else { } else {
isExit.scaned = true isExit.scaned = true
let qty = 0; let qty = 0;
@ -501,7 +504,8 @@
if (!itemDetail.cancleScanedHiht && itemDetail.scaned && scanedLength == itemDetail.packList if (!itemDetail.cancleScanedHiht && itemDetail.scaned && scanedLength == itemDetail.packList
.length) { .length) {
// this.showMessage("" + packingNumber + "") // this.showMessage("" + packingNumber + "")
this.showMessage("批次【" + batch + "】已经扫描") // this.showMessage("" + batch + "")
itemDetail.handleQty = calc.add(Number(result.label.qty),itemDetail.handleQty)
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
this.detailSource[0].subList.sort(compareAsc('scaned')); // this.detailSource[0].subList.sort(compareAsc('scaned')); //
@ -513,10 +517,10 @@
pac.toLocationCode = this.toLocationCode; pac.toLocationCode = this.toLocationCode;
}) })
calcTreeHandleQty(this.detailSource);
this.continueScan() this.continueScan()
this.$forceUpdate() this.$forceUpdate()
} }
calcTreeHandleQty(this.detailSource);
} }
}, },

Loading…
Cancel
Save