Browse Source

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

intex_online20241111
lijuncheng 3 months ago
parent
commit
e0c09225cc
  1. 2
      src/common/balance.js
  2. 4
      src/mycomponents/detail/comRecommendDetailCard.vue
  3. 241
      src/mycomponents/detail/comRecommendDetailCardBatch.vue
  4. 591
      src/pages/deliver/job/deliverDetailBatch.vue
  5. 10
      src/pages/inventoryMove/coms/comInventoryDetailCard.vue
  6. 203
      src/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue
  7. 11
      src/pages/inventoryMove/job/inventoryMoveDetail.vue
  8. 26
      src/pages/issue/job/issueDetailBatch.vue
  9. 3
      src/pages/productReceipt/job/productReceiptDetail.vue
  10. 11
      src/pages/unPlanned/coms/comReceiptDetailCard.vue
  11. 15
      src/pages/unPlanned/job/issueJobDetail.vue
  12. 2
      src/pages/unPlanned/job/receiptJobDetail.vue

2
src/common/balance.js

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

4
src/mycomponents/detail/comRecommendDetailCard.vue

@ -20,7 +20,7 @@
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" style="flex:1">
</recommend>
</view>
@ -30,7 +30,7 @@
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" style="flex:1">
</recommend>
</view>

241
src/mycomponents/detail/comRecommendDetailCardBatch.vue

@ -1,241 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowStdPack="false">
</item-compare-qty>
<view class="" v-for="(item,index) in dataContent.subList" :key="index">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
style='padding:0px 0px 5px 0px;align-items: center;'>
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row;">
<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;">
<br/>
</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>
</view>
<view v-else class="uni-flex" style="flex-direction: row; 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;">
<br/>
</view>
<view class="scan_view" style="flex:1;">
<batch v-if="item.batch" :batch="item.batch"></batch>
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode">
</location>
</view>
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
</recommend> -->
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<comMessage ref="message"></comMessage>
</view>
</template>
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.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 {
getRemoveOption,
getEditRemoveOption
} from '@/common/array.js';
export default {
emits: ['openDetail', "updateData"],
components: {
itemCompareQty,
recommend,
balanceQtyEdit,
winScanLocation,
location,
toLocation,
itemCompareQty,
batch,
},
props: {
dataContent: {
type: Object,
default: null
},
settingParam: {
type: Object,
default: null
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
locationAreaTypeList: {
type: Array,
default: null
},
queryBalance: {
type: Boolean,
default: true
},
isShowStatus: {
type: Boolean,
default: true
},
isEdit: {
type: Boolean,
default: true
},
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
this.$nextTick(res => {
setTimeout(() => {
if (this.$refs.collapse1) {
this.$refs.collapse1.resize();
}
}, 500)
})
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
showItem: {},
locatonItem: {},
editItem: {},
detailOptions: [],
scanOptions: [],
options: [],
removeOptions: [],
editAndRemoveOptions: []
}
},
mounted() {
this.removeOptions = getRemoveOption();
this.editAndRemoveOptions = getEditRemoveOption()
// this.showLocation();
},
methods: {
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
},
detail(item) {
this.$emit('openDetail', item);
// this.showItem = item;
// this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.balance = {}
item.handleQty = null;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
this.$emit('updateData')
},
showLocation(item) {
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode = code;
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>
<style>
</style>

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

@ -9,7 +9,7 @@
<view class="cell_box uni-flex uni-row">
<view class="cell_info">
<view class="text_lightblue">发货类型</view>
<view style="line-height: 34rpx;">{{jobContent.deliverType}}</view>
<view>{{jobContent.deliverType}}</view>
</view>
<view class="cell_info">
@ -19,7 +19,7 @@
<view class="cell_info">
<view class="text_lightblue">目标库位</view>
<view >{{toLocationCode}}</view>
<view>{{toLocationCode}}</view>
</view>
</view>
</view>
@ -28,19 +28,20 @@
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view>
</view>
<view v-for="(toLocation, index) in detailSource">
<comDeliverDetailCardBatch ref='comIssueDetailCard'
:dataContent="toLocation"
:settingParam="jobContent"
@updateData='updateData'>
</comDeliverDetailCardBatch>
<comDeliverDetailCardBatch ref='comIssueDetailCardBatch' :dataContent="toLocation" :settingParam="jobContent"
@updateData='updateData' :allowBiggerQty='allowBiggerQty'>
</comDeliverDetailCardBatch>
<view class="split_line"></view>
</view>
</scroll-view>
</view>
<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>
<view class=" uni-flex uni-row">
@ -48,9 +49,14 @@
</view>
</view>
</view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<comScanDeliverPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData' :locationCode='fromLocationCode'>
</comScanDeliverPackBatch>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<!-- <comScanDeliverPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</comScanDeliverPackBatch> -->
<winScanPackAndLocation :balanceFromInventoryStatuses="false" :toLocationCode="jobToLocationCode" ref="scanPopup"
@getResult='getScanResult' :noShowBalanceMessage="false" @confirm='confirmFromLocation'>
</winScanPackAndLocation>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -74,13 +80,19 @@
getRemoveOption,
getCurrDateTime,
getPackingNumberAndBatch,
deepCopyData
deepCopyData,
compareAsc,
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
getTreeDataSource,
calcTreeHandleQty,
getScanCount,
getThreeDataSource,
getDataSource,
calcHandleQty,
} from '@/common/detail.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
@ -88,10 +100,10 @@
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.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 comScanDeliverPackBatch from '@/pages/deliver/coms/comScanDeliverPackBatch.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
export default {
name: 'issueDetail',
@ -99,8 +111,9 @@
jobDetailPopup,
winScanButton,
comDeliverDetailCardBatch,
comScanDeliverPackBatch,
jobTop,
comScanDeliverPackBatch
winScanPackAndLocation
},
data() {
return {
@ -113,7 +126,7 @@
status: "",
toLocationCode: "",
jobStatus: "",
fromLocationCode:''
allowBiggerQty:"TRUE",//
};
},
@ -184,13 +197,14 @@
});
getDeliverDetail(that.id).then(res => {
uni.hideLoading();
if (res.data &&res.data.subList.length > 0) {
if (res.data && res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status;
that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode
// that.detailSource = res.data;
that.detailSource = getThreeDataSource(that.jobContent)
that.toLocationCode = that.subList[0].toLocationCode
that.allowBiggerQty = res.data.allowBiggerQty;
that.resizeCollapse();
} else {
that.showMessage('未获取到详情');
@ -207,14 +221,196 @@
resizeCollapse() {
this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => {
this.$refs.comIssueDetailCardBatch.forEach(r => {
r.resizeCollapse();
})
});
},
getScanResult(result, managementTypeParams) {
this.managementType = managementTypeParams
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this.setDataBatch(result)
}else{
this.setData(result)
}
},
setDataBatch(result) {
try {
let that = this
this.balanceinfo = result.balance
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var locationCode = result.fromLocationCode;
if (!result.balance) {
this.showMessage("没有库存余额")
return;
}
// var inventoryStatus = "OK";
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 &&
r.fromLocationCode == result.fromLocationCode
})
if (itemDetail == undefined) {
var isExit;
for (let subItem of detail.subList) {
var item;
// for (let pack of subItem.packList) {
// if (pack.batch == batch) {
// item = pack;
// isExit = pack;
// break;
// }
// }
// if (item != undefined) {
// subItem.scaned = true
// subItem.handleQty = 0;
// item = undefined
// }
}
if (isExit == undefined) {
// this.showErrorMessage("" + batch + "" + result
// .fromLocationCode + "")
detail.subList.push({
scaned:true,
fromLocationCode:this.fromLocationCode,
toLocationCode:this.toLocationCode,
batch:result.label.batch,
handleQty:result.label.qty,
qty:result.balance.qty,
inventoryStatus:result.balance.inventoryStatus,
toLocation:result.balance.toLocation,
balance:result.balance,
balanceQty:result.balance.qty,
packQty:result.package.packQty,
packUnit:result.package.packUnit,
uom:result.balance.uom,
// packList:[{
// scaned : true,
// handleQty : Number(result.label.qty),
// toLocationCode : result.balance.toLocationCode,
// }]
})
detail.handleQty = 0
detail.qty = 0
detail.subList.forEach(item=>{
detail.handleQty = calc.add(detail.handleQty,item.handleQty)
detail.qty = calc.add(detail.qty,item.qty)
// item.packList.forEach(cur=>{
// cur.handleQty = calc.add(detail.handleQty,item.handleQty)
// })
})
setTimeout(r => {
that.resizeCollapse();
that.$forceUpdate()
}, 100)
} else {
if (!isExit.cancleScanedHiht && isExit.scaned) {
// this.showMessage("" + batch + "")
} else {
isExit.scaned = true
let qty = 0;
if (result.balance != null) {
qty = Number(result.balance.qty);
} else {
qty = Number(result.label.qty);
}
isExit.handleQty = Number(result.label.qty);
isExit.toLocationCode = this.toLocationCode;
}
itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty);
detail.handleQty = 0
detail.balance = result.balance,
detail.subList.forEach(item=>{
detail.handleQty = calc.add(detail.handleQty,item.handleQty)
// item.packList.forEach(cur=>{
// cur.handleQty = calc.add(detail.handleQty,item.handleQty)
// })
})
// calcHandleQtyAdd(this.detailSource, result.label);
}
this.continueScan()
this.$forceUpdate()
} else {
var scanedLength = 0;
// itemDetail.packList.forEach(res => {
// if (res.scaned) {
// scanedLength++;
// }
// })
//
itemDetail.fromInventoryStatus = result.balance.inventoryStatus;
if (itemDetail.scaned ) {
// this.showMessage("" + packingNumber + "")
// calcHandleQtyAdd(this.detailSource, result.label);
itemDetail.balance=result.balance
itemDetail.balanceQty=result.balance.qty
itemDetail.uom=result.balance.uom,
itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty);
detail.handleQty = 0
detail.subList.forEach(item=>{
detail.handleQty = calc.add(detail.handleQty,item.handleQty)
})
} else {
itemDetail.scaned = true;
this.detailSource[0].subList.sort(compareAsc('scaned')); //
itemDetail.handleQty = result.label.qty;
itemDetail.scaned = true
itemDetail.balance=result.balance
itemDetail.balanceQty=result.balance.qty
itemDetail.uom=result.balance.uom
itemDetail.packQty=result.package.packQty
itemDetail.packUnit=result.package.packUnit
itemDetail.fromlocationCode=this.fromLocationCode
itemDetail.toLocationCode=this.toLocationCode
// itemDetail.toInventoryStatus = "OK"
// itemDetail.packList.forEach(pac => {
// pac.scaned = true
// pac.handleQty = Number(result.label.qty);
// pac.toLocationCode = result.balance.toLocationCode;
// })
detail.handleQty = 0
detail.subList.forEach(item=>{
detail.handleQty = calc.add(detail.handleQty,item.handleQty)
// item.packList.forEach(cur=>{
// cur.handleQty = calc.add(detail.handleQty,item.handleQty)
// })
})
// calcTreeHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
}
}
}
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.packingNumber = ''
})
})
} catch (e) {
this.showMessage(e.message)
}
},
//
continueScan() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} else {
this.scanPopupGetFocus();
}
},
submit() {
uni.showLoading({
title: "提交中....",
@ -223,103 +419,164 @@
//
var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
itemCodes.push(item.itemCode)
})
//
var itemCodes = []
let locationCode = this.detailSource[0].subList[0].toLocationCode
this.detailSource.forEach(toLocation => {
itemCodes.push(toLocation.itemCode)
})
//使
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);
}
});
}
//
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList && this.managementList[0] ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
this.submitJob();
} else {
uni.hideLoading();
// 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(){
let str=""
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
var taskQty =0;
item.taskQty =calc.add(taskQty,item.qty)
var totalQty =0;
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
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){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
checkCount() {
let str=""
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
var taskQty =0;
item.taskQty =calc.add(taskQty,item.qty)
var totalQty =0;
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
})
//
item.totalQty =totalQty
})
//
item.totalQty =totalQty
})
//
this.detailSource.forEach(detail=>{
detail.Items.forEach(item=>{
if(this.jobContent.allowPartialComplete=="FALSE"){
if(item.taskQty!=item.totalQty){
str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n`
}
})
//
this.detailSource.forEach(detail=>{
detail.Items.forEach(item=>{
if(this.jobContent.allowPartialComplete=="FALSE"){
if(item.taskQty!=item.totalQty){
str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n`
}
}
})
})
if(str){
str = '不允许提交\n' + str
this.showErrorMessage(str)
}
return str?false:true
},
checkCountBatch() {
let str = ""
let str1 = ""
let str2 = ""
this.detailSource.forEach(detail => {
var taskQty = 0;
var totalQty = 0;
detail.subList.forEach(item => {
if(item.scaned){
item.taskQty=0
item.totalQty=0
item.taskQty =calc.add(item.taskQty,item.qty)
item.totalQty =calc.add(item.totalQty,item.handleQty)
if (this.jobContent.allowPartialComplete == "FALSE") {
if(item.handleQty!=item.taskQty){
str += `批次【${item.batch}】提交数量【${item.handleQty}】与任务物料数量【${item.taskQty}】不一致\n`
}
}
if (this.allowBiggerQty == 'FALSE') {
if ( item.taskQty < item.totalQty) {
str1 += '数量[' + item.totalQty + ']不允许大于任务数量[' + item.taskQty + ']'
}
}
if(item.handleQty>item.balance.qty){
str2 += `批次【${item.batch}】提交数量【${item.handleQty}】不可以大于库存数量【${item.balance.qty}`
}
}
})
})
if(str){
if (str) {
str = '不允许提交\n' + str
this.showErrorMessage(str)
}
return str?false:true
if (str1) {
str1 = '不允许提交\n' + str1
this.showErrorMessage(str1)
}
if (str2) {
str2 = '不允许提交\n' + str2
this.showErrorMessage(str2)
}
return str || str1 || str2 ? false : true
},
submitJob() {
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
if (params.subList.length == 0) {
uni.hideLoading()
this.$refs.comMessage.showConfirmMessageModal('请扫描箱码')
return
console.log("提交参数", params);
const isTrue = params.subList.some(item=>{
console.log(item.recordList.some(cur=>cur.scaned))
return item.recordList.some(cur=>cur.scaned) == true
})
if(!isTrue){
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的发货任务")
return
}
if(!this.checkCount()){
uni.hideLoading()
return ;
// return;
// if (params.subList.length == 0) {
// uni.hideLoading()
// this.$refs.comMessage.showConfirmMessageModal('')
// return
// }
if(this.managementType == "BY_BATCH" ||this.managementType == "BY_QUANTITY" ){
if (!this.checkCountBatch()) {
uni.hideLoading()
return;
}
}else{
if (!this.checkCount()) {
uni.hideLoading()
return;
}
}
deliverJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成发货记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
@ -335,54 +592,32 @@
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail;
subItem.recordList = [];
if (batch.Records.length > 0) {
batch.Records.forEach(r => {
let record = {};
record.handleQty = r.qty;
record.fromPackingNumber = r
.packingNumber;
record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
// record.toLocationCode = subItem
// .toLocationCode;
record.toLocationCode = this.toLocationCode;
record.supplierCode = r.supplierCode;
//使
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;
}
record.fromParentPackingNumber = r
.parentPackingNumber;
subItem.toLocationCode = this.toLocationCode
subItem.recordList.push(record);
})
subList.push(deepCopyData(subItem));
}
})
})
let obj = {...toLocationCode}
delete obj.subList
obj.recordList = []
let obj1 ={}
let arr = toLocationCode.subList.filter(item=>item.scaned)
arr.forEach(record=>{
obj1.scaned =record.scaned;
obj1.handleQty =record.handleQty;
obj1.fromLocationCode =record.fromLocationCode;
obj1.fromInventoryStatus =record.fromInventoryStatus;
obj1.copyContent =record.copyContent;
obj1.toContainerNumber = record.ContainerNumber;
obj1.toInventoryStatus =record.inventoryStatus;
obj1.toLocationCode = record.toLocationCode;
obj1.supplierCode = record.supplierCode;
obj1.toPackingNumber ='';
obj1.packingNumber = ''
obj1.fromPackingNumber = '';
obj1.toBatch = record.batch;
obj1.toPackingNumber = '';
obj1.packingNumber = '';
obj1.fromPackingNumber ='';
obj.recordList.push(obj1)
})
subList.push(obj)
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
@ -420,30 +655,12 @@
},
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;
calcHandleQty(this.detailSource);
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
this.$refs.scanPopup.packGetFocus();
}
},
@ -496,15 +713,41 @@
this.dataContent = result;
this.$forceUpdate();
},
openScanDetailPopup() {
var datacontent = {}
//
// Object.assign(datacontent, this.detailSource);
this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent);
},
// openScanDetailPopup() {
// var datacontent = {}
// //
// // Object.assign(datacontent, this.detailSource);
// this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent);
// },
closeScanPopup() {
this.updateCommitBtn();
// this.updateCommitBtn();
},
openScanPopup() {
let fromLocationCode = '';
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.find(res => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromLocationCode == '') {
if (!l.scaned) {
fromLocationCode = l.fromLocationCode;
}
}
})
}
this.fromLocationCode = fromLocationCode
this.$refs.scanPopup.openScanPopupForJob(fromLocationCode, fromlocationList, this.jobContent);
},
},
confirmFromLocation(fromLocationCodeParams){
this.fromlocationCode = fromLocationCodeParams
}
};
</script>

10
src/pages/inventoryMove/coms/comInventoryDetailCard.vue

@ -3,7 +3,11 @@
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty>
<!-- {{dataContent.handleQty}}
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty> -->
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowStdPack="false">
</item-compare-qty>
</template>
<view class='split_line'></view>
<view class="" v-for="(item,index) in dataContent.subList">
@ -27,6 +31,7 @@
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue'
@ -44,7 +49,8 @@
recommend,
balanceQtyEdit,
detailInfoPopup,
winScanLocation
winScanLocation,
itemCompareQty
},
data() {
return {

203
src/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue

@ -1,203 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<!-- <item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty> -->
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false">
</item-compare-qty>
<view class='split_line'></view>
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction" v-if="index ==0" :class="item.scaned?'scan_view':''">
<uni-swipe-action-item :right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" @click="swipeClick($event,item)">
<div style="display: flex;">
<div style="flex: 1;">
<batch v-if="item.batch" :batch="item.batch"></batch>
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode">
</location>
<to-location v-if="item.toLocationCode" title="目标库位" :locationCode="item.toLocationCode">
</to-location></div>
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text>
</div>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm"
:allowEditStatus="true"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" :locationAreaTypeList="locationAreaTypeList" title="目标库位" @getLocation='getLocation'></win-scan-location>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.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 itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import config from '@/static/config.js'
import {
getRemoveOption,
getEditRemoveOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
balanceQtyEdit,
detailInfoPopup,
winScanLocation,
location,
toLocation,
itemCompareQty,
batch,
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {
},
detailOptions: [],
scanOptions: [],
options: [],
removeOptions: [],
editAndRemoveOptions: []
}
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
allowEditQty: {
type: Boolean,
default: false
},
locationAreaTypeList: {
type: Array,
default: []
},
isEdit: {
type: Boolean,
default: true
},
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
this.$nextTick(res => {
setTimeout(() => {
if (this.$refs.collapse1) {
this.$refs.collapse1.resize();
}
}, 200)
})
}
},
immediate: true,
deep: true
}
},
mounted() {
this.removeOptions = getRemoveOption();
this.editAndRemoveOptions = getEditRemoveOption()
},
methods: {
openDetailCardPopup() {
this.$refs.winHint.openScanPopup()
},
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
},
detail(item) {
this.$emit('openDetail', item);
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.balance = {}
item.handleQty = 0;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
this.$emit('updateData')
},
showLocation(item) {
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode = code;
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>
<style>
</style>

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

@ -12,15 +12,10 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comInventoryDetailCardBatch :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData='updateData'
:locationAreaTypeList="toLocationAreaTypeList"
@openDetail="openDetail" v-if="managementType=='BY_BATCH'">
</comInventoryDetailCardBatch>
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData='updateData' :locationAreaTypeList="toLocationAreaTypeList"
:allowEditQty ="jobContent.allowModifyQty=='TRUE'?true:false"
@openDetail="openDetail" v-else>
@openDetail="openDetail">
</comInventoryDetailCard>
</view>
</view>
@ -81,7 +76,6 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comInventoryDetailCard from '@/pages/inventoryMove/coms/comInventoryDetailCard.vue'
import comInventoryDetailCardBatch from '@/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
@ -93,7 +87,6 @@
winScanButton,
winScanPack,
comInventoryDetailCard,
comInventoryDetailCardBatch,
winScanPackAndLocation,
detailInfoPopup,
jobTop
@ -292,6 +285,7 @@
calcHandleQty() {
calcHandleQty(this.detailSource)
console.log(this.detailSource)
this.continueScan()
this.$forceUpdate();
},
@ -354,6 +348,7 @@
if (itemDetail.scaned) {
// this.showMessage("" + batch + "")
itemDetail.handleQty =calc.add(itemDetail.handleQty,Number(result.label.qty));
this.calcHandleQty();
} else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);

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

@ -221,7 +221,6 @@
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getThreeDataSource(that.jobContent)
console.log(455,that.detailSource)
that.jobContent.detailToLocationCode = res.data.subList[0].toLocationCode
that.fromLocationCode = that.subList[0].fromLocationCode
//
@ -261,7 +260,6 @@
},
getScanResult(result, managementTypeParams) {
console.log(222,result)
this.managementType = managementTypeParams
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this.setDataBatch(result)
@ -283,7 +281,6 @@
this.showMessage("没有库存余额")
return;
}
console.log(9558,result)
// var inventoryStatus = "OK";
var detail = this.detailSource.find(r => r.itemCode == itemCode);
@ -335,7 +332,6 @@
// toLocationCode : result.balance.toLocationCode,
// }]
})
console.log(999,detail)
detail.handleQty = 0
detail.qty = 0
detail.subList.forEach(item=>{
@ -477,13 +473,15 @@
const isTrue = params.subList.some(item=>{
return item.recordList.some(cur=>cur.scaned) == true
})
if(!isTrue){
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的发料任务")
return
}
// return
console.log("提交参数", params);
return
issueJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
@ -592,7 +590,7 @@
let str1=""
var totalQty =0;
var taskQty =0;
console.log(this.detailSource)
console.log(877,this.detailSource)
this.detailSource.forEach(detail => {
detail.subList.forEach(item => {
if(item.scaned){
@ -608,16 +606,18 @@
})
})
if(str){
str = '任务明细未全部完成,是否提交?\n' + str
}
console.log(333,str1)
if(str1){
this.$refs.comMessage.showQuestionMessage1(str1, 'red', res => {
})
this.$refs.comMessage.showMessage(str1, res => {
if (res) {
this.afterCloseMessage()
}
});
return
}
if(str){
str = '任务明细未全部完成,是否提交?\n' + str
}
if(totalQty!=taskQty){
str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交"
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {

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

@ -230,6 +230,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
console.log(344,that.jobContent.allowModifyLocation)
that.subList = res.data.subList;
that.jobStatus = res.data.status;
that.jobToLocationCode = that.subList[0].toLocationCode;
@ -295,7 +296,7 @@
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
// itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
this.continueScan()
this.$forceUpdate()

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

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

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

@ -18,11 +18,8 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comRecommendDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-if="managementType=='BY_BATCH'">
</comRecommendDetailCardBatch>
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-else>
@remove="updateData" @updateData="updateData" @openDetail="openDetail">
</comRecommendDetailCard>
</view>
</view>
@ -84,7 +81,6 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue"
import comRecommendDetailCardBatch from "@/mycomponents/detail/comRecommendDetailCardBatch.vue"
import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
@ -94,7 +90,6 @@
winScanButton,
winScanPackAndLocation,
comRecommendDetailCard,
comRecommendDetailCardBatch,
detailInfoPopup,
jobTop
},
@ -200,8 +195,7 @@
await getManagementPrecisions(itemCodes, that.fromLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
this.managementType = this.managementList&& this.managementList[0]&& this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
}
})
} else {
@ -259,13 +253,14 @@
setDataBatch(result){
try {
var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch;
var batch = result.label.batch;
var qty = result.balance.qty;
var itemCode = result.balance.itemCode;
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
console.log(999,detail.subList)
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
@ -293,7 +288,6 @@
newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true;
detail.subList.push(newAdd)
this.calcHandleQty();
} else {
if (itemDetail.scaned) {
itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty));
@ -301,6 +295,7 @@
// .fromLocationCode + "")
}
}
this.calcHandleQty();
}
} catch (e) {
this.showMessage(e.message)

2
src/pages/unPlanned/job/receiptJobDetail.vue

@ -366,8 +366,6 @@
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
return
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;

Loading…
Cancel
Save