Browse Source

包装换批次2024/9/13 20:16:09

syhx
zhang_li 2 months ago
parent
commit
e6ad23863e
  1. 16
      src/pages/productReceipt/coms/comProductDetailCardBatch.vue
  2. 34
      src/pages/productReceipt/job/scrapReceiptDetail.vue
  3. 4
      src/pages/productionReceipt/job/productionReceiptDetail.vue
  4. 178
      src/pages/repleinsh/coms/comRepleishDetailCardBatch.vue
  5. 110
      src/pages/repleinsh/job/repleinshDetail.vue
  6. 173
      src/pages/stockUp/coms/comStockUpDetailCardBatch.vue

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

@ -2,18 +2,20 @@
<view class="" style="background-color: #fff;">
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"></itemCompareQty>
<view class="" v-for="(item,index) in dataContent.subList" :key="index" >
<uni-swipe-action ref="swipeAction" v-if="index==0" :class="dataContent.scaned?'scan_view':''">
<uni-swipe-action ref="swipeAction" v-if="index==0" :class="item.scaned?'scan_view':''">
<uni-swipe-action-item
:right-options="(dataContent.scaned&&isEdit)?editAndRemoveOptions : dataContent.scaned? removeOptions:options"
@click="swipeClick($event,dataContent,'parent')">
<div style="display: flex;">
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="swipeClick($event,item,'parent')">
<!-- <div style="display: flex;">
<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>
</div> -->
<recommendBatch :detail="item" :isShowFromLocation="false"
:isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommendBatch>
</uni-swipe-action-item>
</uni-swipe-action>
<view v-if="item.fgList!=undefined && item.fgList.length>0" class="card_view " style="margin-left: 20px;"
@ -34,7 +36,7 @@
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendBatch from '@/mycomponents/recommend/recommendBatch.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import productDetailInfoPopup from '@/pages/productReceipt/coms/productDetailInfoPopup.vue'
@ -54,7 +56,7 @@
export default {
components: {
itemCompareQty,
recommend,
recommendBatch,
recommendQtyEdit,
jobDetailPopup,
productDetailInfoPopup,

34
src/pages/productReceipt/job/scrapReceiptDetail.vue

@ -12,8 +12,11 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comProductDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList' v-if="managementType=='BY_BATCH'">
</comProductDetailCardBatch>
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList'>
@remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList' v-else>
</comProductDetailCard>
</view>
<u-line />
@ -77,8 +80,8 @@
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue"
import comProductDetailCardBatch from "@/pages/productReceipt/coms/comProductDetailCardBatch.vue"
export default {
name: 'receipt_detail',
components: {
@ -87,7 +90,8 @@
locationCompare,
winScanPack,
jobTop,
comProductDetailCard
comProductDetailCard,
comProductDetailCardBatch
},
data() {
return {
@ -102,7 +106,8 @@
toLocationTypeList: [],
managementList: [],
jobStatus: "",
jobToLocationCode: ""
jobToLocationCode: "",
managementType:''
};
},
@ -175,7 +180,7 @@
title: "加载中....",
mask: true
});
getProductReceiptJobDetail(that.id).then(res => {
getProductReceiptJobDetail(that.id).then(async res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
@ -186,7 +191,20 @@
that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList)
that.detailSource =await getDataSource(that.subList)
//
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
await getManagementPrecisions(itemCodes, that.jobToLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
}
})
} else {
that.showMessage('列表数据为0');
}
@ -381,6 +399,8 @@
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;
detail.packingNumber = info.packingNumber;
detail.fromPackingNumber = info.packingNumber;
detail.toBatch = info.batch;
detail.toContainerNumber = '';
detail.toInventoryStatus = detail.inventoryStatus

4
src/pages/productionReceipt/job/productionReceiptDetail.vue

@ -18,10 +18,10 @@
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationAreaTypeList='toLocationAreaTypeList'>
</comDetailCardBatch>
<com-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
<!-- <com-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationAreaTypeList='toLocationAreaTypeList'>
</com-detail-card v-else>
</com-detail-card v-else> -->
<view class='split_line'></view>
</view>

178
src/pages/repleinsh/coms/comRepleishDetailCardBatch.vue

@ -0,0 +1,178 @@
<template>
<view>
<!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode"
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> -->
<view v-for="(item,index) in dataContent.Items">
<uni-collapse ref="collapse">
<uni-collapse-item :open="true" :show-animation="true">
<template v-slot:title>
<!-- 物品 -->
<item-qty :dataContent="item" :handleQty="item.handleQty" :isShowBalanceQty="false" ></item-qty>
</template>
<view v-for="(loacation,index) in item.Locations">
<view>
<view class="uni-flex uni-row space-between">
<!-- 推荐库位 -->
<location :locationCode="loacation.fromLocationCode">
</location>
</view>
<view v-for="(batch,index) in loacation.Batchs">
<recommend-balance style='margin-left: 20px;' :detail="batch" :isShowLocation="false"
:isShowPack="batch.packingNumber!=null && batch.packingNumber!=''">
</recommend-balance>
<view class="uni-flex uni-row" v-if='batch.Records.length>0'>
<view class="center " style=" width: 20px;background-color: #0CC2B6; color: #fff; margin-left: 40px; padding: 0px 2px;">
实际
</view>
<view class="uni-flex uni-column scan_view" style="width: 100%;">
<view v-for="(record,index) in batch.Records">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
:right-options="settingParam.allowModifyQty=='TRUE'?scanOptions:removeOptions">
<!-- <view class="card_view" v-if="record.parentPackingNumber" >
<text class="card_packing_code card_content ">外包装</text>
<text class="card_content ">{{record.parentPackingNumber}}</text>
</view> -->
<handle-balance :detail="record" :isShowLocation="false"
:isShowStatus='true'
:isShowBatch="batch.packingNumber!=null">
<!-- :isShowBatch="batch.packingNumber!=null" -->
</handle-balance>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
</view>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue'
import handleBalance from '@/mycomponents/balance/handleBalance.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import location from '@/mycomponents/balance/location.vue'
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import {
getDetailOption,
getEditRemoveOption,
getRemoveOption
} from '@/common/array.js';
export default {
emits: ['updateData'],
components: {
itemQty,
recommend,
recommendBalance,
handleBalance,
recommendQtyEdit,
requiredLocation,
balanceQtyEdit,
location,
detailInfoPopup
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
},
watch: {
},
data() {
return {
option: [],
showItem: {},
editItem: {},
batchItem: {},
detailOptions: [],
scanOptions: [],
removeOptions:[]
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getEditRemoveOption();
this.removeOptions = getRemoveOption()
},
methods: {
resizeCollapse() {
this.$nextTick(() => {
this.$refs.collapse.forEach(r => {
r.childrens.forEach(i => {
i.init();
})
r.resize();
})
});
},
swipeClick(e, batch, record, index) {
if (e.content.text == "编辑") {
this.edit(batch, record)
} else if (e.content.text == "移除") {
this.remove(batch, record, index)
}
},
edit(batch, record) {
let that = this;
that.editItem = record;
that.batchItem = batch;
record.balance.balanceQty = record.balance.qty;
that.$refs.balanceQtyEdit.openEditPopup(record.balance, record.qty);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(batch, record, index) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
batch.Records.splice(index, 1);
this.resizeCollapse();
this.$emit('updateData', record)
}
});
},
confirm(val) {
this.editItem.qty = val;
this.$emit('updateData', this.editItem)
// let qty = 0;
// this.batchItem.Records.forEach(r => {
// qty += Number(r.qty);
// })
// this.batchItem.handleQty = qty;
}
}
}
</script>
<style>
</style>

110
src/pages/repleinsh/job/repleinshDetail.vue

@ -14,8 +14,10 @@
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource">
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation"
@updateData='updateData' v-if="managementType=='BY_BATCH'"></comRepleishDetailCardBatch>
<com-repleish-detail-card ref='comIssueDetailCard' :dataContent="toLocation"
@updateData='updateData'>
@updateData='updateData' v-else>
</com-repleish-detail-card>
</view>
</scroll-view>
@ -76,6 +78,7 @@
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comRepleishDetailCard from '@/pages/repleinsh/coms/comRepleishDetailCard.vue'
import comRepleishDetailCardBatch from '@/pages/repleinsh/coms/comRepleishDetailCardBatch.vue'
import comScanReplishPack from '@/pages/repleinsh/coms/comScanReplishPack.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
@ -87,7 +90,8 @@
comRepleishDetailCard,
comScanReplishPack,
requiredLocation,
jobTop
jobTop,
comRepleishDetailCardBatch,
},
data() {
return {
@ -100,7 +104,9 @@
toLocationCode: '',
toLocationAreaTypeList: [],
jobStatus: "",
scanMessage: ""
scanMessage: "",
managementList:[],
managementType:''
};
},
@ -179,7 +185,7 @@
title: "加载中....",
mask: true
});
getRepleinshJobDetail(that.id).then(res => {
getRepleinshJobDetail(that.id).then(async res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
@ -191,12 +197,24 @@
that.toLocationCode = that.subList[0].toLocationCode
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
that.detailSource = getDataSource(that.detailSource, that.subList)
that.detailSource =await getDataSource(that.detailSource, that.subList)
if (that.scanMessage) {
this.$refs.comScanIssuePack.openScanPopupForJobSimulate(this.detailSource, this
.jobContent, that.scanMessage);
}
//
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
await getManagementPrecisions(itemCodes, that.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
}
})
let timer = setTimeout(r => {
that.resizeCollapse();
if (timer) {
@ -329,23 +347,37 @@
title: "提交中....",
mask: true
});
var params = this.setParams()
if (!params.subList || params.subList.length == 0) {
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的补料任务")
return
}
console.log("提交参数", JSON.stringify(params));
repleinshJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成补料记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
var itemCodes = []
this.detailSource.forEach(item => {
item.Items.forEach(cur=>{
itemCodes.push(cur.itemCode)
})
})
//
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
var params = this.setParams()
if (!params.subList || params.subList.length == 0) {
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的补料任务")
return
}
console.log("提交参数", JSON.stringify(params));
repleinshJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成补料记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
@ -365,31 +397,25 @@
batch.Records.forEach(r => {
let record = {};
record.handleQty = r.qty;
// record.fromPackingNumber = r
// .packingNumber;
record.fromBatch = r.batch;
record.fromContainerNumber = r
.containerNumber;
record.toContainerNumber = r
.containerNumber;
record.toInventoryStatus = r
.inventoryStatus;
record.toLocationCode = this
.toLocationCode;
record.supplierCode = r.supplierCode;
record.fromContainerNumber = r.containerNumber;
record.fromParentPackingNumber = r
.parentPackingNumber;
record.toContainerNumber = r.containerNumber;
record.toInventoryStatus = r.inventoryStatus;
record.toLocationCode = this.toLocationCode;
record.supplierCode = r.supplierCode;
record.fromParentPackingNumber = r.parentPackingNumber;
record.fromPackingNumber = r
.packingNumber;
record.toPackingNumber = r
.packingNumber;
record.fromPackingNumber = r.packingNumber;
record.toPackingNumber = r.packingNumber;
record.toPackUnit = r.packUnit;
record.toBatch = r.batch;
if(this.managementType == 'BY_BATCH'){
record.toPackingNumber = '';
record.packingNumber = '';
record.fromPackingNumber = '';
}
subItem.recordList.push(record);
})
commitSubList.push(deepCopyData(subItem));

173
src/pages/stockUp/coms/comStockUpDetailCardBatch.vue

@ -0,0 +1,173 @@
<template>
<view>
<!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode"
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> -->
<view v-for="(item,index) in dataContent.Items">
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<template v-slot:title>
<!-- 物品 -->
<item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty>
</template>
<view class='split_line'></view>
<view v-for="(loacation,index) in item.Locations" :key="index">
<view>
<view class="uni-flex uni-row space-between">
<!-- 推荐库位 -->
<location :locationCode="loacation.fromLocationCode">
</location>
</view>
<view v-for="(batch,index) in loacation.Batchs" :key="index">
<recommend-balance style='margin-left: 20px;' :detail="batch"
:isShowLocation="false" :isShowPack="batch.packingNumber!=null && batch.packingNumber!=''">
</recommend-balance>
<view class="uni-flex uni-row" v-if='batch.Records.length>0'>
<view class="center " style=" width: 20px; color: #0CC2B6; margin-left: 40px;">
实际
</view>
<view class="uni-flex uni-column" style="width: 100%;">
<view v-for="(record,index) in batch.Records" :key="index">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
:right-options="settingParam.allowModifyQty=='TRUE'?scanOptions:removeOptions">
<handle-balance :detail="record" :isShowLocation="false"
:isShowBatch="batch.packingNumber!=null">
</handle-balance>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
</view>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue'
import handleBalance from '@/mycomponents/balance/handleBalance.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import location from '@/mycomponents/balance/location.vue'
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import {
getDetailOption,
getEditRemoveOption,
getRemoveOption
} from '@/common/array.js';
export default {
emits: ['updateData'],
components: {
itemQty,
recommend,
recommendBalance,
handleBalance,
recommendQtyEdit,
requiredLocation,
balanceQtyEdit,
location,
detailInfoPopup
},
props: {
dataContent: {
type: Object,
default: null
},
settingParam: {
type: Object,
default: null
},
},
watch: {
},
data() {
return {
option: [],
showItem: {},
editItem: {},
batchItem: {},
detailOptions: [],
scanOptions: [],
removeOptions: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getEditRemoveOption();
this.removeOptions = getRemoveOption()
},
methods: {
resizeCollapse() {
this.$nextTick(r => {
this.$refs.collapse.forEach(r => {
r.childrens.forEach(i => {
i.init();
})
r.resize();
})
});
},
swipeClick(e, batch, record, index) {
if (e.content.text == "编辑") {
this.edit(batch, record)
} else if (e.content.text == "移除") {
this.remove(batch, record, index)
}
},
edit(batch, item) {
let that = this;
that.editItem = item;
that.batchItem = batch;
item.balance.balanceQty=item.balance.qty;
that.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(batch, record, index) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
batch.Records.splice(index, 1);
this.resizeCollapse();
this.$emit('updateData', record)
}
});
},
confirm(val) {
this.editItem.qty = val;
this.$emit('updateData', this.editItem)
// let qty = 0;
// this.batchItem.Records.forEach(r => {
// qty += Number(r.qty);
// })
// this.batchItem.handleQty = qty;
}
}
}
</script>
<style>
</style>
Loading…
Cancel
Save