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. 98
      src/pages/repleinsh/coms/comRepleishDetailCardBatch.vue
  9. 6
      src/pages/repleinsh/job/repleinshDetail.vue
  10. 524
      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> <template>
<view class="card_view "> <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> <text class="card_big_content" style="font-size: 40rpx;">{{locationCode}}</text>
</view> </view>
</template> </template>
@ -21,11 +21,17 @@
type: String, type: String,
default: '库位' default: '库位'
}, },
activeCardLocation: {
type: String,
default: ''
},
}, },
} }
</script> </script>
<style> <style>
.active_card_location{
color: #0A84FF;
}
</style> </style>

2
src/mycomponents/item/itemCompareQty.vue

@ -5,7 +5,7 @@
</view> </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; " > <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> ></recommend-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)" <compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="Number(handleQty)" :isShowStatus="false" :isShowPackUnit="isShowPackUnit" :isShowSupplierQty='isShowSupplierQty'> :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)" <compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="dataContent.handleQty" :handleQty="dataContent.handleQty"
:isShowRecommendQty="isShowRecommendQty" :isShowRecommendQty="isShowRecommendQty"
:isShowStatus="false" :isShowStdPack="showStdPack" :isShowNumView='isShowNumView'> :isShowStatus="false" :isShowStdPack="showStdPack" :isShowNumView='isShowNumView' :isShowPackUnit='false'>
</compare-qty> </compare-qty>
</view> </view>
</view> </view>

32
src/mycomponents/job/jobComMainDetailCardTime.vue

@ -1,21 +1,29 @@
<template> <template>
<view class="task_item" style="background: none;"> <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="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;"> <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>
</view> </view>
<div class="u-p-l-10"> <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_level">ERP默认收货库位</text>
<text class="card_big_content ">{{dataContent.defaultErpLocationCode}}</text> <text class="card_big_content ">{{dataContent.defaultErpLocationCode}}</text>
</view> </view>
<location title="来源库位" :locationCode="dataContent.fromLocationCode||dataContent.locationCode" v-if="isShowFromLocation"></location>
<to-location title="目标库位" :locationCode="dataContent.toLocationCode||dataContent.locationCode"> <to-location title="目标库位" :locationCode="dataContent.toLocationCode||dataContent.locationCode">
</to-location> </to-location>
<location title="生产线代码" :locationCode="dataContent.productionLineCode"></location> <location title="生产线代码" :locationCode="dataContent.productionLineCode"></location>
<batch title="生产线区分" :batch="dataContent.productionLine"></batch> <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> </div>
</view> </view>
@ -102,6 +110,22 @@
type: Boolean, type: Boolean,
default: false 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> <uom :uom="dataContent.supplierUom" style="font-size: 28rpx;margin-left: 12rpx;"></uom>
</view> </view>
<view v-if="!isShowSupplierQty"> <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> --> <!-- <std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty> -->
</view> </view>
</view> </view>
@ -87,6 +87,10 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
isShowPackUnit: {
type: Boolean,
default: true
},
}, },
watch: { watch: {

5
src/mycomponents/recommend/recommend.vue

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

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

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

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

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

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

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

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

@ -1,24 +1,23 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class="page-header"> <view class="page-header">
<view class="header-view"> <view class="header-view uni-flex space-between u-col-center">
<view class="header_job_top"> <view class="task_number left uni-flex">
<job-top :dataContent="jobContent"></job-top> <text> {{mDate}} </text>
<view class="time"> {{jobContent.deliNo}} </view>
</view> </view>
<view class="header_item"> <view class="task_number">
申请单号 : {{jobContent.requestNumber}} <text> {{mTime}} </text>
</view> </view>
</view> </view>
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<!-- <view v-for="(toLocation, index) in detailSource"> <view v-for="(toLocation, index) in detailSource" :key="index">
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'></comRepleishDetailCardBatch> <comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'
</view> --> :settingParam="jobContent">
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="detailSource" @updateData='updateData'> </comRepleishDetailCardBatch>
</comRepleishDetailCardBatch> </view>
</scroll-view> </scroll-view>
</view> </view>
@ -35,9 +34,13 @@
</view> </view>
</view> </view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<comScanReplishPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'> <!-- <comScanReplishPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</comScanReplishPackBatch> </comScanReplishPackBatch> -->
<winScanPackAndLocation :balanceFromInventoryStatuses="true" ref="scanPopup" @getResult='getScanResult'
:noShowBalanceMessage="false" @confirm='confirmFromLocation'>
</winScanPackAndLocation>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -49,7 +52,9 @@
getRepleinshJobDetail, getRepleinshJobDetail,
repleinshJobSubmit repleinshJobSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
getDataSourceBatch,
} from '@/common/detail.js';
import { import {
goHome, goHome,
navigateBack, navigateBack,
@ -57,7 +62,8 @@
getCurrDateTime, getCurrDateTime,
getDirectoryItemArray, getDirectoryItemArray,
getPackingNumberAndBatch, getPackingNumberAndBatch,
deepCopyData deepCopyData,
dateFormat,
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -75,23 +81,22 @@
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comRepleishDetailCard from '@/pages/repleinsh/coms/comRepleishDetailCard.vue'
import comRepleishDetailCardBatch from '@/pages/repleinsh/coms/comRepleishDetailCardBatch.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 comScanReplishPackBatch from '@/pages/repleinsh/coms/comScanReplishPackBatch.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import boardNumberVue from '../../../mycomponents/balance/boardNumber.vue';
export default { export default {
name: 'issueDetail', name: 'issueDetail',
components: { components: {
jobDetailPopup, jobDetailPopup,
winScanButton, winScanButton,
comRepleishDetailCard,
comRepleishDetailCardBatch, comRepleishDetailCardBatch,
comScanReplishPack, comScanReplishPackBatch,
requiredLocation, requiredLocation,
jobTop, jobTop,
comScanReplishPackBatch winScanPackAndLocation
}, },
data() { data() {
return { return {
@ -105,7 +110,7 @@
toLocationAreaTypeList: [], toLocationAreaTypeList: [],
jobStatus: "", jobStatus: "",
scanMessage: "", scanMessage: "",
managementType: '' detailSourceOriginal: []
}; };
}, },
@ -151,8 +156,10 @@
} else { } else {
uni.navigateBack(); uni.navigateBack();
} }
return true; return true;
} }
}, },
watch: { watch: {
@ -163,6 +170,25 @@
mounted: function() { 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: { methods: {
// //
@ -182,7 +208,7 @@
title: "加载中....", title: "加载中....",
mask: true mask: true
}); });
getRepleinshJobDetail(that.id).then(res => { getRepleinshJobDetail(that.id).then(async res => {
uni.hideLoading(); uni.hideLoading();
if (res.data == null) { if (res.data == null) {
that.showMessage('未获取到详情'); that.showMessage('未获取到详情');
@ -194,9 +220,8 @@
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes) that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
that.detailSource = getDataSourceBatch(that.subList)
that.detailSource = res.data; that.detailSourceOriginal = getDataSourceBatch(that.subList)
if (that.scanMessage) { if (that.scanMessage) {
this.$refs.comScanIssuePack.openScanPopupForJobSimulate(this.detailSource, this this.$refs.comScanIssuePack.openScanPopupForJobSimulate(this.detailSource, this
.jobContent, that.scanMessage); .jobContent, that.scanMessage);
@ -224,25 +249,61 @@
}, },
resizeCollapse() { resizeCollapse() {
this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
r.$refs.recommendRepleinshRef.forEach(l => {
l.resizeCollapse();
})
})
});
}, },
clickSubmit() { clickSubmit() {
let str = "" let str = ""
var scanCount = this.getScanCount(this.subList); let str1 = ""
if(!scanCount){ let str2 = ""
this.$refs.comMessage.showErrorMessage('扫描数量为0,请先扫描', res => { let str3 = ""
let isTrue = true
}); this.detailSource.forEach(detail => {
return; const isScaned = detail.subList.some(item => item.packList && item.packList.length > 0)
} if (isScaned) {
this.detailSource.subList.forEach(item => { if (parseFloat(detail.handleQty) < parseFloat(detail.qty)) {
if (item.handleQty != item.qty) { str += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】小于任务数量【${detail.qty}\n`
str += }
"扫描数量[" + item.handleQty + "]与任务数量不一致[" + item.qty + "],是否提交" if (parseFloat(detail.handleQty) > parseFloat(detail.qty)) {
str1 += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】大于任务数量【${detail.qty}\n】`
}
if (parseFloat(detail.handleQty) > parseFloat(detail.balanceQty)) {
str2 += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】大于库存数量【${detail.balanceQty}\n】`
}
} }
}) })
if (str) { 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 => { this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (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() { submit() {
var scanCount = this.getScanCount(this.subList); var scanCount = this.getScanCount(this.subList);
@ -303,86 +502,114 @@
// } // }
}, },
async submitJob() { submitJob() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
var itemCodes = [] var itemCodes = []
this.detailSource.subList.forEach(item => { this.detailSource.forEach(item => {
itemCodes.push(item.itemCode) item.Items.forEach(cur => {
itemCodes.push(cur.itemCode)
})
}) })
await getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) { var params = this.setParams()
this.managementList = res.list; if (!params.subList || params.subList.length == 0) {
var params = this.setParams() uni.hideLoading()
console.log("提交参数", params); this.showErrorMessage("请扫描您需要提交的补料任务")
if (!params.subList || params.subList.length == 0) { return
uni.hideLoading() }
this.showErrorMessage("请扫描您需要提交的补料任务") console.log("提交参数", JSON.stringify(params));
return repleinshJobSubmit(params).then(res => {
} uni.hideLoading()
repleinshJobSubmit(params).then(res => { if (res.data) {
uni.hideLoading() this.showCommitSuccessMessage("提交成功\n生成补料记录\n" + res.data)
if (res.data) { } else {
this.showCommitSuccessMessage("提交成功\n生成补料记录\n" + res.data) this.showErrorMessage("提交失败[" + res.msg + "]")
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} }
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
}) })
}, },
setParams() { setParams() {
var commitSubList = [] var commitSubList = []
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.subList.forEach(r => { this.detailSource.forEach(toLocationCode => {
if(r.scaned){ toLocationCode.sublist.forEach(item => {
let subItem = { item.packList.forEach(boardNumber => {
...r // fromLocation.Batchs.forEach(batch => {
} let subItem = boardNumber;
subItem.recordList = []
let record = {}; if (subItem != undefined) {
record.handleQty = r.qty; // if (batch.Records.length > 0) {
subItem.recordList = [];
// record.fromPackingNumber = r // batch.Records.forEach(r => {
// .packingNumber; let record = {};
record.fromBatch = r.batch; record.handleQty = item.qty;
record.fromContainerNumber = r record.fromBatch = item.batch;
.containerNumber; record.fromContainerNumber = item.containerNumber;
record.toContainerNumber = r record.toContainerNumber = item.containerNumber;
.containerNumber; record.toInventoryStatus = item.inventoryStatus;
record.toInventoryStatus = r record.toLocationCode = this.toLocationCode;
.inventoryStatus; record.supplierCode = item.supplierCode;
record.toLocationCode = this
.toLocationCode; record.fromParentPackingNumber = item.parentPackingNumber;
record.supplierCode = r.supplierCode;
record.fromPackingNumber = item.packingNumber;
record.fromParentPackingNumber = r record.toPackingNumber = item.packingNumber;
.parentPackingNumber; record.toPackUnit = item.packUnit;
record.toBatch = item.batch;
record.fromPackingNumber = r subItem.recordList.push(record);
.packingNumber; // })
record.toPackingNumber = r commitSubList.push(deepCopyData(subItem));
.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;
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.subList = commitSubList
this.jobContent.creator = creator; this.jobContent.creator = creator;
@ -419,14 +646,42 @@
}) })
}, },
updateData(record) { updateData(e, item, index, detail) {
let requestLocation = this.detailSource.subList.find(r => r.toLocationCode == record.toLocationCode); //
// this.detailSource.subList.forEach(r =>{ let itemC = this.detailSource.find(r => r.itemCode == detail.itemCode && r.fromLocationCode == detail
// if(r.itemCode == record.itemCode){ .fromLocationCode && r.batch == detail.batch);
// r.handleQty = record.qty //
// } let itemOriginal = this.detailSourceOriginal.find(r => r.itemCode == detail.itemCode && r.fromLocationCode ==
// }); detail.fromLocationCode && r.batch == detail.batch);
console.log(this.detailSource.subList) 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() { scanPopupGetFocus() {
@ -497,16 +752,49 @@
}, },
getScanCount(subList) { getScanCount(subList) {
var scanCount = 0; var scanCount = 0;
this.detailSource.subList.forEach(toLocationCode => { this.detailSource.forEach(toLocationCode => {
scanCount+=calc.add(scanCount,parseFloat(toLocationCode.handleQty)) 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; return scanCount;
} }
} }
}; };
</script> </script>
<style scoped lang="scss">
<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> </style>

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

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

Loading…
Cancel
Save