Browse Source

补料任务工鞥

intex
张立 2 weeks ago
parent
commit
3e777e590e
  1. 10
      src/mycomponents/balance/location.vue
  2. 2
      src/mycomponents/item/itemCompareQty.vue
  3. 2
      src/mycomponents/item/itemQty.vue
  4. 32
      src/mycomponents/job/jobComMainDetailCardTime.vue
  5. 6
      src/mycomponents/qty/recommendHandleQty.vue
  6. 5
      src/mycomponents/recommend/recommend.vue
  7. 18
      src/pages/repleinsh/coms/comRepleinshTimeJobCard.vue
  8. 94
      src/pages/repleinsh/coms/comRepleishDetailCardBatch.vue
  9. 6
      src/pages/repleinsh/job/repleinshDetail.vue
  10. 478
      src/pages/repleinsh/job/repleinshDetailBatch.vue
  11. 8
      src/pages/repleinsh/job/repleinshJob.vue

10
src/mycomponents/balance/location.vue

@ -1,6 +1,6 @@
<template>
<view class="card_view ">
<text class="card_location">{{title}}</text>
<text class="card_location" :class="activeCardLocation?activeCardLocation:''">{{title}}</text>
<text class="card_big_content" style="font-size: 40rpx;">{{locationCode}}</text>
</view>
</template>
@ -21,11 +21,17 @@
type: String,
default: '库位'
},
activeCardLocation: {
type: String,
default: ''
},
},
}
</script>
<style>
.active_card_location{
color: #0A84FF;
}
</style>

2
src/mycomponents/item/itemCompareQty.vue

@ -5,7 +5,7 @@
</view>
<!-- 显示采购标包数量和单位 -->
<view style="width: 40%;display: flex; flex-direction: column; align-items: flex-end; justify-content:flex-end;margin-right: 10rpx;word-break:break-word; " >
<recommend-qty v-if="handleQty==0" :dataContent="dataContent" :isShowStatus="false" :isShowStdPack="true" :isShowSupplierQty='isShowSupplierQty'
<recommend-qty v-if="handleQty==0" :dataContent="dataContent" :isShowStatus="false" :isShowStdPack="true" :isShowSupplierQty='isShowSupplierQty' :isShowPackUnit="isShowPackUnit"
></recommend-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="Number(handleQty)" :isShowStatus="false" :isShowPackUnit="isShowPackUnit" :isShowSupplierQty='isShowSupplierQty'>

2
src/mycomponents/item/itemQty.vue

@ -8,7 +8,7 @@
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="dataContent.handleQty"
:isShowRecommendQty="isShowRecommendQty"
:isShowStatus="false" :isShowStdPack="showStdPack" :isShowNumView='isShowNumView'>
:isShowStatus="false" :isShowStdPack="showStdPack" :isShowNumView='isShowNumView' :isShowPackUnit='false'>
</compare-qty>
</view>
</view>

32
src/mycomponents/job/jobComMainDetailCardTime.vue

@ -1,21 +1,29 @@
<template>
<view class="task_item" style="background: none;">
<view class="task_text" style="border-top: 1px solid #dedede;padding-top: 20rpx;margin-top: 20rpx;" >
<view class="uni-flex uni-row space-between uni-inline-item" style=" margin-left: 10px;">
<view class="uni-flex uni-row space-between uni-inline-item">
<view style="flex: 1;">
<itemTime :dataContent="dataContent" :isSpecial='isSpecial'></itemTime>
<itemCompareQty :dataContent="dataContent"
:isShowPackCount="isShowPackCount"
:handleQty="dataContent.handleQty" :isShowPackUnit="false"
:isShowSupplierQty='false'
:isSpecial='isSpecial'
v-if="fromWhere =='repleinshJob'"
></itemCompareQty>
<itemTime :dataContent="dataContent" :isSpecial='isSpecial' v-else style="margin-left: 10px;"></itemTime>
</view>
</view>
<div class="u-p-l-10">
<view class="card_view ">
<view class="card_view " v-if="isShowERPLocation">
<text class="card_level">ERP默认收货库位</text>
<text class="card_big_content ">{{dataContent.defaultErpLocationCode}}</text>
</view>
<location title="来源库位" :locationCode="dataContent.fromLocationCode||dataContent.locationCode" v-if="isShowFromLocation"></location>
<to-location title="目标库位" :locationCode="dataContent.toLocationCode||dataContent.locationCode">
</to-location>
<location title="生产线代码" :locationCode="dataContent.productionLineCode"></location>
<batch title="生产线区分" :batch="dataContent.productionLine"></batch>
<job-repleinsh-time-qty :dataContent="dataContent"></job-repleinsh-time-qty>
<job-repleinsh-time-qty :dataContent="dataContent" v-if="isShowTimeQty"></job-repleinsh-time-qty>
</div>
</view>
@ -102,6 +110,22 @@
type: Boolean,
default: false
},
isShowTimeQty: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: false
},
isShowERPLocation: {
type: Boolean,
default: true
},
fromWhere: {
type: String,
default: ''
},
},

6
src/mycomponents/qty/recommendHandleQty.vue

@ -18,7 +18,7 @@
<uom :uom="dataContent.supplierUom" style="font-size: 28rpx;margin-left: 12rpx;"></uom>
</view>
<view v-if="!isShowSupplierQty">
<pack-unit :dataContent="dataContent"></pack-unit>
<pack-unit :dataContent="dataContent" v-show="isShowPackUnit"></pack-unit>
<!-- <std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty> -->
</view>
</view>
@ -87,6 +87,10 @@
type: Boolean,
default: false
},
isShowPackUnit: {
type: Boolean,
default: true
},
},
watch: {

5
src/mycomponents/recommend/recommend.vue

@ -6,6 +6,7 @@
<!-- <container v-if="isShowContainer&&detail.containerNumber!=null" :container="detail.containerNumber">
</container> -->
<pack v-if="isShowPack && detail.packingNumber" :isShowPackingNumberProps="isShowPackingNumberProps" :packingCode="detail.packingNumber"></pack>
<board-number v-if="detail.boardNumber" :packingCode="detail.boardNumber"></board-number>
<batch v-if="isShowBatch && detail.batch!=null" :batch="detail.batch"></batch>
<location v-if="isShowFromLocation" :title="formLocationTitle" :locationCode="detail.fromLocationCode">
</location>
@ -39,6 +40,7 @@
import recommendQty from '@/mycomponents/qty/recommendQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue'
import config from '@/static/config.js'
import boardNumber from '@/mycomponents/balance/boardNumber.vue'
export default {
components: {
@ -48,7 +50,8 @@
toLocation,
batch,
recommendQty,
compareQty
compareQty,
boardNumber
},
data() {

18
src/pages/repleinsh/coms/comRepleinshTimeJobCard.vue

@ -1,6 +1,6 @@
<template>
<job-com-main-card-time :dataContent="dataContent">
<jobComMainDetailCardTime :dataContent="dataContent"></jobComMainDetailCardTime>
<jobComMainDetailCardTime :dataContent="dataContent" :isShowTimeQty='isShowTimeQty' :isShowFromLocation='isShowFromLocation' :isShowERPLocation='isShowERPLocation' :isSpecial='true' :repleinshJob='repleinshJob' :fromWhere='fromWhere'></jobComMainDetailCardTime>
<view class='split_line' v-show="dataContent.acceptUserName"></view>
<jobAccept :dataContent="dataContent" v-show="dataContent.acceptUserName"></jobAccept>
</job-com-main-card-time>
@ -29,6 +29,22 @@
type: Object,
default: {}
},
isShowTimeQty: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: false
},
isShowERPLocation: {
type: Boolean,
default: true
},
fromWhere: {
type: String,
default: ''
},
},
methods: {

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

@ -2,60 +2,58 @@
<view>
<!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode"
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> -->
<view v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction" :class="item.scaned? 'scan_view':''">
<uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="swipeClick($event,item,index)" style='padding:0px 0px 5px 0px;align-items: center;'>
<item-qty :dataContent="item" :handleQty="item.handleQty" :isShowBalanceQty="false"></item-qty>
<location :locationCode="item.fromLocationCode"></location>
<recommendBalanceBatch style='margin-left: 20px;' :detail="item" :isShowLocation="false"
:isShowPack="item.packingNumber"></recommendBalanceBatch>
</uni-swipe-action-item>
</uni-swipe-action>
<uni-collapse ref="collapse">
<uni-collapse-item :open="true" :show-animation="true">
<template v-slot:title>
<!-- 物品 -->
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowBalanceQty="false" :isSpecial='true'></item-qty>
</template>
<view
v-for="(item,index) in dataContent.subList">
<view >
<view class="" :class="item.scaned?'scan_view':''">
<recommendRepleinsh :isShowPackingNumberProps="true" :isShowPack="false" :detail="item" :isShowLocation="false" :isShowFromLocation="true" :isShowToLocation="item.isRecommTaskItem?true:false" :boardNumber='item.boardNumber' :settingParam='settingParam' ref="recommendRepleinshRef" :isShowStatus='false' @updateData='updateData'></recommendRepleinsh>
</view>
</view>
</view>
<qtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></qtyEdit>
</uni-collapse-item>
</uni-collapse>
</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 recommendRepleinsh from '@/mycomponents/recommend/recommendRepleinsh.vue'
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue'
import recommendBalanceBatch from '@/mycomponents/balance/recommendBalanceBatch.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 qtyEdit from '@/mycomponents/qty/qtyEdit.vue'
import location from '@/mycomponents/balance/location.vue'
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import {
getDetailOption,
getPurchaseReceiptOption,
getRemoveOption,
getEditRemoveOption
getEditRemoveOption,
getRemoveOption
} from '@/common/array.js';
export default {
emits: ['updateData'],
components: {
itemQty,
recommend,
recommendRepleinsh,
recommendBalance,
handleBalance,
recommendQtyEdit,
requiredLocation,
balanceQtyEdit,
location,
detailInfoPopup,
recommendBalanceBatch,
qtyEdit
detailInfoPopup
},
props: {
dataContent: {
@ -66,10 +64,6 @@
type: Object,
default: {}
},
isEdit: {
type: Boolean,
default: true
},
},
watch: {
@ -83,57 +77,61 @@
batchItem: {},
detailOptions: [],
scanOptions: [],
options: [],
removeOptions: [],
editAndRemoveOptions: []
removeOptions:[],
editAndRemoveOptions:[]
}
},
mounted() {
this.removeOptions = getRemoveOption();
this.detailOptions = getDetailOption();
this.scanOptions = getEditRemoveOption();
this.removeOptions = getRemoveOption()
this.editAndRemoveOptions = getEditRemoveOption()
},
methods: {
resizeCollapse() {
this.$refs.collapse.resize()
// this.$refs.collapse.childrens.forEach(i => {
// i.init();
// })
},
swipeClick(e, item, index) {
swipeClick(e, batch, record, index) {
if (e.content.text == "编辑") {
this.edit(item)
this.edit(batch, record)
} else if (e.content.text == "移除") {
this.remove(item, index)
this.remove(batch, record, index)
}
},
edit(item) {
console.log(item)
edit(batch, record) {
let that = this;
that.editItem = item;
// that.batchItem = batch;
// record.balance.balanceQty = record.balance.qty;
that.$refs.balanceQtyEdit.openEditPopup(item);
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(item) {
remove(batch, record, index) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.handleQty = 0;
item.scaned = false ;
// this.$emit('updateData', record)
batch.Records.splice(index, 1);
this.resizeCollapse();
this.$emit('updateData', record)
}
});
},
updateData(e, item, index,detail){
this.$emit('updateData',e, item, index,detail)
},
confirm(val) {
console.log(val)
this.editItem.handleQty = val;
this.editItem.qty = val;
this.$emit('updateData', this.editItem)
// let qty = 0;
// this.batchItem.Records.forEach(r => {

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

@ -14,9 +14,9 @@
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource">
<com-repleish-detail-card ref='comIssueDetailCard' :dataContent="toLocation"
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation"
@updateData='updateData'>
</com-repleish-detail-card>
</comRepleishDetailCardBatch>
</view>
</scroll-view>
</view>
@ -76,6 +76,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'
@ -85,6 +86,7 @@
jobDetailPopup,
winScanButton,
comRepleishDetailCard,
comRepleishDetailCardBatch,
comScanReplishPack,
requiredLocation,
jobTop,

478
src/pages/repleinsh/job/repleinshDetailBatch.vue

@ -1,24 +1,23 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header-view">
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
<view class="header-view uni-flex space-between u-col-center">
<view class="task_number left uni-flex">
<text> {{mDate}} </text>
<view class="time"> {{jobContent.deliNo}} </view>
</view>
<view class="header_item">
申请单号 : {{jobContent.requestNumber}}
<view class="task_number">
<text> {{mTime}} </text>
</view>
</view>
</view>
<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'></comRepleishDetailCardBatch>
</view> -->
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="detailSource" @updateData='updateData'>
<view v-for="(toLocation, index) in detailSource" :key="index">
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'
:settingParam="jobContent">
</comRepleishDetailCardBatch>
</view>
</scroll-view>
</view>
@ -35,9 +34,13 @@
</view>
</view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<comScanReplishPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</comScanReplishPackBatch>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<!-- <comScanReplishPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</comScanReplishPackBatch> -->
<winScanPackAndLocation :balanceFromInventoryStatuses="true" ref="scanPopup" @getResult='getScanResult'
:noShowBalanceMessage="false" @confirm='confirmFromLocation'>
</winScanPackAndLocation>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -49,7 +52,9 @@
getRepleinshJobDetail,
repleinshJobSubmit
} from '@/api/request2.js';
import {
getDataSourceBatch,
} from '@/common/detail.js';
import {
goHome,
navigateBack,
@ -57,7 +62,8 @@
getCurrDateTime,
getDirectoryItemArray,
getPackingNumberAndBatch,
deepCopyData
deepCopyData,
dateFormat,
} from '@/common/basic.js';
import {
@ -75,23 +81,22 @@
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
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 comScanReplishPackBatch from '@/pages/repleinsh/coms/comScanReplishPackBatch.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import jobTop from '@/mycomponents/job/jobTop.vue'
import boardNumberVue from '../../../mycomponents/balance/boardNumber.vue';
export default {
name: 'issueDetail',
components: {
jobDetailPopup,
winScanButton,
comRepleishDetailCard,
comRepleishDetailCardBatch,
comScanReplishPack,
comScanReplishPackBatch,
requiredLocation,
jobTop,
comScanReplishPackBatch
winScanPackAndLocation
},
data() {
return {
@ -105,7 +110,7 @@
toLocationAreaTypeList: [],
jobStatus: "",
scanMessage: "",
managementType: ''
detailSourceOriginal: []
};
},
@ -151,8 +156,10 @@
} else {
uni.navigateBack();
}
return true;
}
},
watch: {
@ -163,6 +170,25 @@
mounted: function() {
},
computed: {
mDate() {
if (!this.jobContent.day) {
return ''
}
let date = dateFormat(this.jobContent.day)
let dateArr = date.split(' ')[0].split('-')
return `${dateArr[1]}-${dateArr[2]}`
},
mTime() {
console.log('this.jobContent.day', this.jobContent.day)
if (!this.jobContent.day) {
return ''
}
let date = dateFormat(this.jobContent.day)
let dateArr = date.split(' ')[1].split(':')
return `${dateArr[0]}:${dateArr[1]}`
}
},
methods: {
//
@ -182,7 +208,7 @@
title: "加载中....",
mask: true
});
getRepleinshJobDetail(that.id).then(res => {
getRepleinshJobDetail(that.id).then(async res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
@ -194,9 +220,8 @@
that.toLocationCode = that.subList[0].toLocationCode
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
that.detailSource = res.data;
that.detailSource = getDataSourceBatch(that.subList)
that.detailSourceOriginal = getDataSourceBatch(that.subList)
if (that.scanMessage) {
this.$refs.comScanIssuePack.openScanPopupForJobSimulate(this.detailSource, this
.jobContent, that.scanMessage);
@ -224,25 +249,61 @@
},
resizeCollapse() {
this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
r.$refs.recommendRepleinshRef.forEach(l => {
l.resizeCollapse();
})
})
});
},
clickSubmit() {
let str = ""
var scanCount = this.getScanCount(this.subList);
if(!scanCount){
this.$refs.comMessage.showErrorMessage('扫描数量为0,请先扫描', res => {
});
return;
let str1 = ""
let str2 = ""
let str3 = ""
let isTrue = true
this.detailSource.forEach(detail => {
const isScaned = detail.subList.some(item => item.packList && item.packList.length > 0)
if (isScaned) {
if (parseFloat(detail.handleQty) < parseFloat(detail.qty)) {
str += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】小于任务数量【${detail.qty}\n`
}
if (parseFloat(detail.handleQty) > parseFloat(detail.qty)) {
str1 += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】大于任务数量【${detail.qty}\n】`
}
this.detailSource.subList.forEach(item => {
if (item.handleQty != item.qty) {
str +=
"扫描数量[" + item.handleQty + "]与任务数量不一致[" + item.qty + "],是否提交"
if (parseFloat(detail.handleQty) > parseFloat(detail.balanceQty)) {
str2 += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】大于库存数量【${detail.balanceQty}\n】`
}
}
})
if (this.jobContent.allowSmallerQty == "FALSE") {
if (str) {
str = '不允许提交\n' + str
this.showErrorMessage(str)
return
}
}
if (this.jobContent.allowBiggerQty == 'FALSE') {
if (str1) {
str1 = '不允许提交\n' + str1
this.showErrorMessage(str1)
return
}
}
if (str2) {
str2 = '不允许提交\n' + str2
this.showErrorMessage(str2)
return
}
const strr = str || str1 ? str + str1 : ''
if (strr) {
str = strr + "是否提交?"
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
//
@ -257,6 +318,144 @@
}
},
getScanResult(result, managementTypeParams) {
if (!result.package.number) {
this.showErrorMessage("包装号不能为空")
return;
}
this.managementType = managementTypeParams
let array1 = [] //
let array2 = [] //
this.detailSource.forEach(item => {
item.subList.forEach(cur => {
array1.push(cur.fromLocationCode)
array2.push(cur.batch)
})
})
//
const obj1 = array1.find(item => item == result.fromLocationCode)
const obj2 = array2.find(item => item == result.label.batch)
if (this.jobContent.allowModifyLocation == 'FALSE') {
if (!obj1) {
this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`)
return
}
}
if (this.jobContent.allowModifyBatch == 'FALSE') {
if (!obj2) {
this.showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`)
return
}
}
if (!obj1) {
this.recommendQty = 0
} else {
this.recommendQty = result.balance.qty
}
// this.managementType = managementTypeParams
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") {
this.setDataBatch(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 item = {
scaned: true,
packingNumber: packingNumber,
fromLocationCode: this.fromLocationCode,
toLocationCode: this.toLocationCode,
batch: result.label.batch,
handleQty: result.label.qty,
qty: 0,
inventoryStatus: result.balance.inventoryStatus,
toLocation: result.balance.toLocation,
balanceQty: result.balance.qty,
packQty: result.package.packQty,
packUnit: result.package.packUnit,
uom: result.balance.uom,
isRecommTaskItem: false, //
supplierCode: result.label.supplierCode,
packList: [{
boardNumber: result.package.number.substring(result.package.number.length - 5),
batch: result.label.batch,
packingNumber: result.package.number,
scaned: true,
handleQty: result.label.qty,
uom: result.balance.uom,
balanceQty: result.balance.qty,
packQty: result.package.packQty,
packUnit: result.package.packUnit,
}]
}
detail.subList.push(item)
//
detail.handleQty = 0
detail.qty = 0
} else {
// itemDetail.handleQty = calc.add(itemDetail.handleQty, result.label.qty)
itemDetail.packList = itemDetail.packList && itemDetail.packList.length > 0 ? itemDetail.packList : []
// console.log(())
let boardNumberDetail = itemDetail.packList.find(r => {
return r.packingNumber == result.package.number
})
if (boardNumberDetail) {
this.showErrorMessage('该看板编号已存在,请重新扫描')
return
} else {
itemDetail.packList.push({
boardNumber: result.package.number.substring(result.package.number.length - 5),
batch: result.label.batch,
packingNumber: result.package.number,
scaned: true,
handleQty: result.label.qty,
uom: result.balance.uom,
balanceQty: result.balance.qty,
packQty: result.package.packQty,
packUnit: result.package.packUnit,
})
}
}
detail.subList.forEach(item => {
item.handleQty = item.handleQty || 0
item.packList.forEach(cur => {
detail.handleQty = calc.add(detail.handleQty, cur.handleQty)
})
})
console.log(333, this.detailSource)
setTimeout(r => {
that.resizeCollapse();
that.$forceUpdate()
}, 3000)
}
} catch (e) {
this.showMessage(e.message)
}
},
submit() {
var scanCount = this.getScanCount(this.subList);
@ -303,25 +502,25 @@
// }
},
async submitJob() {
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var itemCodes = []
this.detailSource.subList.forEach(item => {
itemCodes.push(item.itemCode)
this.detailSource.forEach(item => {
item.Items.forEach(cur => {
itemCodes.push(cur.itemCode)
})
})
await getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交参数", params);
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) {
@ -333,56 +532,84 @@
uni.hideLoading()
this.showErrorMessage(error)
})
}
})
},
setParams() {
var commitSubList = []
var creator = this.$store.state.user.id
this.detailSource.subList.forEach(r => {
if(r.scaned){
let subItem = {
...r
}
subItem.recordList = []
this.detailSource.forEach(toLocationCode => {
toLocationCode.sublist.forEach(item => {
item.packList.forEach(boardNumber => {
// fromLocation.Batchs.forEach(batch => {
let subItem = boardNumber;
if (subItem != undefined) {
// if (batch.Records.length > 0) {
subItem.recordList = [];
// 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.fromParentPackingNumber = r
.parentPackingNumber;
record.fromPackingNumber = r
.packingNumber;
record.toPackingNumber = r
.packingNumber;
record.toPackUnit = r.packUnit;
record.toBatch = r.batch;
var info = getPackingNumberAndBatch(this.managementList, r.itemCode,r.packingNumber, r.batch);
record.toPackingNumber = info.packingNumber;
record.packingNumber = info.packingNumber;
record.fromPackingNumber = info.packingNumber;
subItem.toPackingNumber = info.packingNumber;
subItem.packingNumber = info.packingNumber;
subItem.fromPackingNumber = info.packingNumber;
record.handleQty = item.qty;
record.fromBatch = item.batch;
record.fromContainerNumber = item.containerNumber;
record.toContainerNumber = item.containerNumber;
record.toInventoryStatus = item.inventoryStatus;
record.toLocationCode = this.toLocationCode;
record.supplierCode = item.supplierCode;
record.fromParentPackingNumber = item.parentPackingNumber;
record.fromPackingNumber = item.packingNumber;
record.toPackingNumber = item.packingNumber;
record.toPackUnit = item.packUnit;
record.toBatch = item.batch;
subItem.recordList.push(record);
// })
commitSubList.push(deepCopyData(subItem));
}
// }
// })
})
})
})
console.log(88, commitSubList)
return
// this.detailSource.forEach(toLocationCode => {
// toLocationCode.Items.forEach(item => {
// item.Locations.forEach(fromLocation => {
// fromLocation.Batchs.forEach(batch => {
// let subItem = batch.detail;
// if (subItem != undefined) {
// if (batch.Records.length > 0) {
// subItem.recordList = [];
// batch.Records.forEach(r => {
// let record = {};
// record.handleQty = r.qty;
// 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.fromParentPackingNumber = r.parentPackingNumber;
// record.fromPackingNumber = r.packingNumber;
// record.toPackingNumber = r.packingNumber;
// record.toPackUnit = r.packUnit;
// record.toBatch = r.batch;
// subItem.recordList.push(record);
// })
// commitSubList.push(deepCopyData(subItem));
// }
// }
// })
// })
// })
// })
this.jobContent.subList = commitSubList
this.jobContent.creator = creator;
@ -419,14 +646,42 @@
})
},
updateData(record) {
let requestLocation = this.detailSource.subList.find(r => r.toLocationCode == record.toLocationCode);
// this.detailSource.subList.forEach(r =>{
// if(r.itemCode == record.itemCode){
// r.handleQty = record.qty
// }
// });
console.log(this.detailSource.subList)
updateData(e, item, index, detail) {
//
let itemC = this.detailSource.find(r => r.itemCode == detail.itemCode && r.fromLocationCode == detail
.fromLocationCode && r.batch == detail.batch);
//
let itemOriginal = this.detailSourceOriginal.find(r => r.itemCode == detail.itemCode && r.fromLocationCode ==
detail.fromLocationCode && r.batch == detail.batch);
if (itemOriginal) {
if (detail.packList.length == 0) {
this.detailSourceOriginal = this.detailSourceOriginal.filter(r => r.itemCode == detail.itemCode && r
.fromLocationCode == detail.fromLocationCode && r.batch == detail.batch);
this.detailSource = this.detailSource.filter(r => r.itemCode == detail.itemCode && r.fromLocationCode ==
detail.fromLocationCode && r.batch == detail.batch);
}
}
},
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.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
scanPopupGetFocus() {
@ -497,16 +752,49 @@
},
getScanCount(subList) {
var scanCount = 0;
this.detailSource.subList.forEach(toLocationCode => {
scanCount+=calc.add(scanCount,parseFloat(toLocationCode.handleQty))
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail;
if (batch.Records.length > 0) {
scanCount = calc.add(scanCount, batch.Records.length)
}
})
})
})
})
console.log(scanCount)
return scanCount;
}
}
};
</script>
<style scoped lang="scss">
.page-header .header-view {
display: flex;
flex-direction: row;
background-color: #fff;
font-size: 35rpx;
padding: 10rpx 20rpx;
border-radius: 4px;
}
.left {
display: flex;
.time {
margin-left: 10rpx;
text-align: center;
background-color: #DA8910;
min-width: 40rpx;
height: 40rpx;
line-height: 40rpx;
border-radius: 50%;
color: white;
}
}
</style>

8
src/pages/repleinsh/job/repleinshJob.vue

@ -18,8 +18,8 @@
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:item.status=='1'?detailCloseOptions:detailOptions"
@click="swipeClick($event,item)">
<com-repleinsh-job-card :dataContent="item"
@click='openJobDetail(item)'></com-repleinsh-job-card>
<com-repleinsh-time-job-card :dataContent="item"
@click='openJobDetail(item)' :isShowTimeQty='false' :isShowFromLocation='true' :isShowERPLocation='false' fromWhere='repleinshJob'></com-repleinsh-time-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
@ -71,6 +71,7 @@
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comRepleinshJobCard from '@/pages/repleinsh/coms/comRepleinshJobCard.vue'
import comRepleinshTimeJobCard from '@/pages/repleinsh/coms/comRepleinshTimeJobCard.vue'
import repleinshJobListPopup from '@/pages/repleinsh/coms/repleinshJobListPopup.vue'
import repleinshInfoPopup from '@/pages/repleinsh/coms/repleinshInfoPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -87,7 +88,8 @@
repleinshInfoPopup,
winScanPackJob,
winScanButton,
winComScanBalance
winComScanBalance,
comRepleinshTimeJobCard
},
data() {
return {

Loading…
Cancel
Save