Browse Source

计划外出库

intex_online20241111
zhang_li 3 weeks ago
parent
commit
2671100352
  1. 2
      src/common/balance.js
  2. 103
      src/mycomponents/detail/comRecommendDetailCardBatch.vue
  3. 11
      src/pages/unPlanned/coms/comReceiptDetailCard.vue
  4. 10
      src/pages/unPlanned/job/issueJobDetail.vue

2
src/common/balance.js

@ -403,7 +403,7 @@ export function byQuantity(label, locationCode, fromInventoryStatuses, callback)
filters.push({ filters.push({
column: "batch", column: "batch",
action: "==", action: "==",
value: null value: label.batch?label.batch:null
}) })
filters.push({ filters.push({
column: "locationCode", column: "locationCode",

103
src/mycomponents/detail/comRecommendDetailCardBatch.vue

@ -1,50 +1,45 @@
<template> <template>
<view class="" style="background-color: #fff;"> <view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" >
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" <item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowStdPack="false"> :isShowStdPack="false">
</item-compare-qty> </item-compare-qty>
</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"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,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"
style='padding:0px 0px 5px 0px;align-items: center;'> style='padding:0px 0px 5px 0px;align-items: center;'>
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row;"> <view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite;">
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;background-color: antiquewhite;display: flex;align-items: center;justify-content: center;padding: 0px 10rpx;"> <view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;">
<br/>
</view> </view>
<view class="" style="flex:1;">
<batch v-if="item.batch" :batch="item.batch"></batch>
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode">
</location>
</view>
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" style="flex:1">
</recommend>
</view> </view>
<view v-else class="uni-flex" style="flex-direction: row; margin-top: 5rpx;"> <view v-else class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite; margin-top: 5rpx;">
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;background-color: antiquewhite;display: flex;align-items: center;justify-content: center;padding: 0px 10rpx;"> <view class="" style="font-size: 32rpx; color: red; font-weight: bold; text-align: center;">
<br/>
</view> </view>
<view class="scan_view" style="flex:1;">
<batch v-if="item.batch" :batch="item.batch"></batch> <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" style="flex:1">
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> </recommend>
</location>
</view>
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
</recommend> -->
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</view> </view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit> <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>
@ -57,14 +52,9 @@
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 config from '@/static/config.js'
import { import {
getRemoveOption, getDetailOption,
getEditRemoveOption getPurchaseReceiptOption
} from '@/common/array.js'; } from '@/common/array.js';
export default { export default {
@ -73,11 +63,7 @@
itemCompareQty, itemCompareQty,
recommend, recommend,
balanceQtyEdit, balanceQtyEdit,
winScanLocation, winScanLocation
location,
toLocation,
itemCompareQty,
batch,
}, },
props: { props: {
dataContent: { dataContent: {
@ -112,10 +98,6 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isEdit: {
type: Boolean,
default: true
},
}, },
watch: { watch: {
dataContent: { dataContent: {
@ -142,18 +124,18 @@
locatonItem: {}, locatonItem: {},
editItem: {}, editItem: {},
detailOptions: [], detailOptions: [],
scanOptions: [], scanOptions: []
options: [],
removeOptions: [],
editAndRemoveOptions: []
} }
}, },
mounted() { mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false)
}
this.removeOptions = getRemoveOption();
this.editAndRemoveOptions = getEditRemoveOption()
// this.showLocation(); // this.showLocation();
}, },
@ -204,35 +186,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>

11
src/pages/unPlanned/coms/comReceiptDetailCard.vue

@ -3,8 +3,11 @@
<uni-collapse ref="collapse1" > <uni-collapse ref="collapse1" >
<uni-collapse-item :open="true"> <uni-collapse-item :open="true">
<template v-slot:title> <template v-slot:title>
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :showBalanceQty="false"> <!-- <item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :showBalanceQty="false">
</item-qty> </item-qty> -->
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowStdPack="false">
</item-compare-qty>
</template> </template>
<view class='split_line'></view> <view class='split_line'></view>
<view class="" v-for="(item,index) in dataContent.subList"> <view class="" v-for="(item,index) in dataContent.subList">
@ -30,6 +33,7 @@
<script> <script>
import itemQty from '@/mycomponents/item/itemQty.vue' import itemQty from '@/mycomponents/item/itemQty.vue'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.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/job/jobDetailPopup.vue' import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
@ -47,7 +51,8 @@
recommend, recommend,
recommendQtyEdit, recommendQtyEdit,
detailInfoPopup, detailInfoPopup,
winScanLocation winScanLocation,
itemCompareQty
}, },
props: { props: {
dataContent: { dataContent: {

10
src/pages/unPlanned/job/issueJobDetail.vue

@ -19,7 +19,7 @@
<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="">
<comRecommendDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent" <comRecommendDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-if="managementType=='BY_BATCH'"> @remove="updateData" @updateData="updateData" @openDetail="openDetail" v-if="managementType=='BY_BATCH' || managementType=='BY_QUANTITY' ">
</comRecommendDetailCardBatch> </comRecommendDetailCardBatch>
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent" <comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-else> @remove="updateData" @updateData="updateData" @openDetail="openDetail" v-else>
@ -200,8 +200,7 @@
await getManagementPrecisions(itemCodes, that.fromLocationCode, res => { await getManagementPrecisions(itemCodes, that.fromLocationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision == this.managementType = this.managementList&& this.managementList[0]&& this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
'BY_BATCH') ? 'BY_BATCH' : ''
} }
}) })
} else { } else {
@ -259,13 +258,14 @@
setDataBatch(result){ setDataBatch(result){
try { try {
var packingNumber = result.balance.packingNumber; var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch; var batch = result.label.batch;
var qty = result.balance.qty; var qty = result.balance.qty;
var itemCode = result.balance.itemCode; var itemCode = result.balance.itemCode;
var locationCode = result.balance.locationCode; var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus; var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode); var detail = this.detailSource.find(r => r.itemCode == itemCode);
console.log(999,detail.subList)
if (detail == undefined) { if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else { } else {
@ -293,7 +293,6 @@
newAdd.balance.packUnit = result.package.packUnit newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true; newAdd.scaned = true;
detail.subList.push(newAdd) detail.subList.push(newAdd)
this.calcHandleQty();
} else { } else {
if (itemDetail.scaned) { if (itemDetail.scaned) {
itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty)); itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty));
@ -301,6 +300,7 @@
// .fromLocationCode + "") // .fromLocationCode + "")
} }
} }
this.calcHandleQty();
} }
} catch (e) { } catch (e) {
this.showMessage(e.message) this.showMessage(e.message)

Loading…
Cancel
Save