lijuncheng 1 year ago
parent
commit
ed7de0d6e9
  1. 27
      common/balance.js
  2. 1
      common/basic.js
  3. 24
      common/style/new_style.css
  4. 1
      common/style/pdabasic.css
  5. 11
      mycomponents/balance/handleBalance.vue
  6. 14
      mycomponents/balance/recommendBalance.vue
  7. 2
      mycomponents/item/itemQty.vue
  8. 4
      mycomponents/qty/balanceQtyEdit.vue
  9. 23
      pages/issue/coms/comIssueDetailCard.vue
  10. 10
      pages/issue/coms/comScanIssuePack.vue
  11. 171
      pages/issue/job/issueDetail.vue
  12. 12
      pages/issue/js/issue.js
  13. 1
      pages/productDismantle/record/productDismantleRecord.vue

27
common/balance.js

@ -1,4 +1,3 @@
import { import {
getManagementPrecision, getManagementPrecision,
getBalanceByFilter getBalanceByFilter
@ -38,7 +37,7 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) {
}) })
} }
export function getBalanceByManagementPrecision(label, locationCode,fromInventoryStatuses, callback) { export function getBalanceByManagementPrecision(label, locationCode, fromInventoryStatuses, callback) {
let result = { let result = {
list: [], list: [],
success: true, success: true,
@ -53,25 +52,25 @@ export function getBalanceByManagementPrecision(label, locationCode,fromInventor
let managementPrecision = res.data[0].ManagementPrecision; let managementPrecision = res.data[0].ManagementPrecision;
switch (managementPrecision) { switch (managementPrecision) {
case 'BY_PACKAGING': case 'BY_PACKAGING':
byPacking(label, locationCode,fromInventoryStatuses, res => { byPacking(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision; res.managementPrecision = managementPrecision;
callback(res); callback(res);
}); });
break; break;
case 'BY_BATCH': case 'BY_BATCH':
byBatch(label, locationCode,fromInventoryStatuses, res => { byBatch(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision; res.managementPrecision = managementPrecision;
callback(res); callback(res);
}); });
break; break;
case 'BY_QUANTITY': case 'BY_QUANTITY':
byQuantity(label, locationCode,fromInventoryStatuses, res => { byQuantity(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision; res.managementPrecision = managementPrecision;
callback(res); callback(res);
}); });
break; break;
case 'BY_UNIQUEID': case 'BY_UNIQUEID':
byUniqueId(label,fromInventoryStatuses, res => { byUniqueId(label, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision; res.managementPrecision = managementPrecision;
callback(res); callback(res);
}); });
@ -90,7 +89,7 @@ export function getBalanceByManagementPrecision(label, locationCode,fromInventor
* @param {Object} locationCode * @param {Object} locationCode
* @param {Object} callback * @param {Object} callback
*/ */
export function byPacking(label, locationCode,fromInventoryStatuses, callback) { export function byPacking(label, locationCode, fromInventoryStatuses, callback) {
let result = { let result = {
success: true, success: true,
message: '', message: '',
@ -117,7 +116,7 @@ export function byPacking(label, locationCode,fromInventoryStatuses, callback) {
action: "==", action: "==",
value: locationCode value: locationCode
}) })
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
filters.push({ filters.push({
column: "inventoryStatus", column: "inventoryStatus",
action: "in", action: "in",
@ -157,7 +156,7 @@ export function byPacking(label, locationCode,fromInventoryStatuses, callback) {
* @param {Object} locationCode * @param {Object} locationCode
* @param {Object} callback * @param {Object} callback
*/ */
export function byBatch(label, locationCode,fromInventoryStatuses, callback) { export function byBatch(label, locationCode, fromInventoryStatuses, callback) {
var filters = [] var filters = []
filters.push({ filters.push({
column: "itemCode", column: "itemCode",
@ -175,7 +174,7 @@ export function byBatch(label, locationCode,fromInventoryStatuses, callback) {
value: locationCode value: locationCode
}) })
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
filters.push({ filters.push({
column: "inventoryStatus", column: "inventoryStatus",
action: "in", action: "in",
@ -218,7 +217,7 @@ export function byBatch(label, locationCode,fromInventoryStatuses, callback) {
* @param {Object} locationCode * @param {Object} locationCode
* @param {Object} callback * @param {Object} callback
*/ */
export function byQuantity(label, locationCode,fromInventoryStatuses, callback) { export function byQuantity(label, locationCode, fromInventoryStatuses, callback) {
let result = { let result = {
success: true, success: true,
message: '', message: '',
@ -237,7 +236,7 @@ export function byQuantity(label, locationCode,fromInventoryStatuses, callback)
value: locationCode value: locationCode
}) })
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
filters.push({ filters.push({
column: "inventoryStatus", column: "inventoryStatus",
action: "in", action: "in",
@ -274,7 +273,7 @@ export function byQuantity(label, locationCode,fromInventoryStatuses, callback)
* @param {Object} locationCode * @param {Object} locationCode
* @param {Object} callback * @param {Object} callback
*/ */
export function byUniqueId(label, locationCode,fromInventoryStatuses, callback) { export function byUniqueId(label, locationCode, fromInventoryStatuses, callback) {
let param = { let param = {
packingNumber: label.packingNumber packingNumber: label.packingNumber
}; };
@ -291,7 +290,7 @@ export function byUniqueId(label, locationCode,fromInventoryStatuses, callback)
value: label.packingNumber value: label.packingNumber
}) })
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
filters.push({ filters.push({
column: "inventoryStatus", column: "inventoryStatus",
action: "in", action: "in",

1
common/basic.js

@ -656,7 +656,6 @@ export function getPackingNumberAndBatch(managementList, itemCode, packingNumber
itemInfo.batch = batch itemInfo.batch = batch
} }
return itemInfo; return itemInfo;
} }
// //提示是否消息 // //提示是否消息

24
common/style/new_style.css

@ -233,13 +233,13 @@ uni-page-head .uni-page-head__title {
} }
.cell_box .cell_info view { .cell_box .cell_info view {
font-size: 0.825rem; font-size: 0.9375rem;
margin-bottom: 10rpx; margin-bottom: 10rpx;
color: #7B8195; color: #7B8195;
} }
.cell_box .cell_info .text_black { .cell_box .cell_info .text_black {
font-size: .875rem; font-size: 0.875rem;
color: #101010; color: #101010;
} }
@ -305,7 +305,7 @@ uni-page-head .uni-page-head__title {
} }
.cen_card .cell_box .cell_info .text_lightblue { .cen_card .cell_box .cell_info .text_lightblue {
font-size: 0.725rem; font-size: 0.925rem;
} }
.bot_card { .bot_card {
@ -2120,11 +2120,11 @@ button::after {
background: linear-gradient(to right, #7ED7BD, #DCEFEE); background: linear-gradient(to right, #7ED7BD, #DCEFEE);
} }
.card_view .card_view {
{
font-size: 32rpx; font-size: 32rpx;
padding: 5rpx; padding: 5rpx;
} }
/* /*
.pack_view { .pack_view {
font-size: 32rpx; font-size: 32rpx;
@ -2421,6 +2421,12 @@ button[disabled] {
align-items: center; align-items: center;
} }
.space_between {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.text_recommend { .text_recommend {
color: #0A84FF; color: #0A84FF;
font-size: 38rpx; font-size: 38rpx;
@ -2635,6 +2641,7 @@ button[disabled] {
padding: 10rpx 20rpx 10rpx 20rpx; padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
/** /**
* 申请状态 审批中 * 申请状态 审批中
*/ */
@ -2645,6 +2652,7 @@ button[disabled] {
padding: 10rpx 20rpx 10rpx 20rpx; padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
/** /**
* 申请状态 审批通过 * 申请状态 审批通过
*/ */
@ -2655,6 +2663,7 @@ button[disabled] {
padding: 10rpx 20rpx 10rpx 20rpx; padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
/** /**
* 申请状态 审批驳回 * 申请状态 审批驳回
*/ */
@ -2665,6 +2674,7 @@ button[disabled] {
padding: 10rpx 20rpx 10rpx 20rpx; padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
/** /**
* 申请状态 处理中 * 申请状态 处理中
*/ */
@ -2675,6 +2685,7 @@ button[disabled] {
padding: 10rpx 20rpx 10rpx 20rpx; padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
/** /**
* 申请状态 部分完成 * 申请状态 部分完成
*/ */
@ -2685,6 +2696,7 @@ button[disabled] {
padding: 10rpx 20rpx 10rpx 20rpx; padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
/** /**
* 申请状态 已完成 * 申请状态 已完成
*/ */
@ -2695,6 +2707,7 @@ button[disabled] {
padding: 10rpx 20rpx 10rpx 20rpx; padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
/** /**
* 申请状态 中止 * 申请状态 中止
*/ */
@ -2705,6 +2718,7 @@ button[disabled] {
padding: 10rpx 20rpx 10rpx 20rpx; padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
/** /**
* 申请状态 已关闭 * 申请状态 已关闭
*/ */

1
common/style/pdabasic.css

@ -720,6 +720,7 @@ page {
.page-main { .page-main {
flex: 1; flex: 1;
position: relative; position: relative;
background: #fff;
} }
.page-main-scroll { .page-main-scroll {

11
mycomponents/balance/handleBalance.vue

@ -1,17 +1,12 @@
<template> <template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;"> <view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;">
<view class="uni-flex uni-row space-between uni-inline-item"> <view class="space_between">
<view class="uni-flex uni-row uni-inline-item"> <view >
<view style=" width: 20px;display: flex;justify-content: center;align-items: center;color: #0CC2B6;">
实际
</view>
<view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location> <location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view> </view>
</view> <view >
<view>
<recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail" <recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail"
:isShowStdPack="false"></recommend-qty> :isShowStdPack="false"></recommend-qty>

14
mycomponents/balance/recommendBalance.vue

@ -1,17 +1,17 @@
<template> <template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;"> <view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;">
<view class="uni-flex uni-row space-between "> <view class="uni-flex uni-row space-between center ">
<view class="uni-flex uni-row "> <view class="uni-flex uni-row center ">
<view class="center" style=" width: 20px;color: #32C1E8;"> <view style=" width: 20px;color: #32C1E8;">
推荐 推荐
</view> </view>
<view class="center"> <view >
<!-- <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> --> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<!-- <location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location> --> <location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view> </view>
</view> </view>
<view> <view >
<recommend-qty v-if="detail.Records==null || detail.Records.length==0" :dataContent="detail" <recommend-qty v-if="detail.Records==null || detail.Records.length==0" :dataContent="detail"
:isShowStdPack="false" :isShowStatus="false"></recommend-qty> :isShowStdPack="false" :isShowStatus="false"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="Number( detail.qty)" <compare-qty v-else :dataContent="detail" :recommendQty="Number( detail.qty)"

2
mycomponents/item/itemQty.vue

@ -1,5 +1,5 @@
<template> <template>
<view class="uni-flex uni-row space-between uni-inline-item" style="background-color:#fff;"> <view class="uni-flex uni-row space-between center" style="background-color:#fff;">
<view> <view>
<item :dataContent="dataContent"></item> <item :dataContent="dataContent"></item>
</view> </view>

4
mycomponents/qty/balanceQtyEdit.vue

@ -126,13 +126,9 @@
this.inventoryStatus = this.dataContent.inventoryStatus this.inventoryStatus = this.dataContent.inventoryStatus
this.toInventoryStatus = this.dataContent.toInventoryStatus this.toInventoryStatus = this.dataContent.toInventoryStatus
this.allQty = Number(handleQty) this.allQty = Number(handleQty)
console.log("数量",this.allQty)
setTimeout(res=>{ setTimeout(res=>{
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
},500) },500)
}, },
closeEditPopup() { closeEditPopup() {
this.$refs.popup.close() this.$refs.popup.close()

23
pages/issue/coms/comIssueDetailCard.vue

@ -9,10 +9,6 @@
<template v-slot:title> <template v-slot:title>
<!-- 物品 --> <!-- 物品 -->
<item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty> <item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty>
<view class="card_ProdLine">
{{item.productionLineCode}} | {{item.workStationCode}}
</view>
</template> </template>
<u-line /> <u-line />
<view v-for="(loacation,index) in item.Locations"> <view v-for="(loacation,index) in item.Locations">
@ -23,19 +19,20 @@
</location> </location>
</view> </view>
<view v-for="(batch,index) in loacation.Batchs"> <view v-for="(batch,index) in loacation.Batchs">
<view>
<recommend-balance style='margin-left: 20px;' :detail="batch" <recommend-balance style='margin-left: 20px;' :detail="batch"
:isShowLocation="false" :isShowPack="false"> :isShowLocation="false" :isShowPack="batch.packingNumber!=null && batch.packingNumber!=''">
</recommend-balance> </recommend-balance>
<view class="uni-flex uni-row" v-if='batch.Records.length>0'>
<view class="center " style=" width: 20px; color: #0CC2B6; margin-left: 40px;">
实际
</view> </view>
<view class="uni-flex uni-column" style="width: 100%;">
<view v-if='batch.Records!=null || batch.Records!=undefined ' <view v-for="(record,index) in batch.Records">
v-for="(record,index) in batch.Records">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)" <uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
:right-options="scanOptions"> :right-options="scanOptions">
<handle-balance style='margin-left: 40px;' :detail="record" <handle-balance :detail="record" :isShowLocation="false"
:isShowLocation="false" :isShowBatch="batch.packingNumber!=null"> :isShowBatch="batch.packingNumber!=null">
</handle-balance> </handle-balance>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -43,13 +40,14 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</view>
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
</view> </view>
</view> </view>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit> <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>
@ -139,6 +137,7 @@
let that = this; let that = this;
that.editItem = item; that.editItem = item;
that.batchItem = batch; that.batchItem = batch;
item.balance.balanceQty=item.balance.qty;
that.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty); that.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty);
}, },

10
pages/issue/coms/comScanIssuePack.vue

@ -205,7 +205,6 @@
this.showErrorMessage('发料库位【' + fromlocation + '】不存在') this.showErrorMessage('发料库位【' + fromlocation + '】不存在')
} }
}, },
onScan(result) { onScan(result) {
try { try {
let that = this; let that = this;
@ -233,8 +232,7 @@
title: '加载中', title: '加载中',
mask: true mask: true
}) })
getBalanceByManagementPrecision(result.label, that.fromLocationCode, "OK", balanceRes => {
getBalanceByManagementPrecision(result.label, that.fromLocationCode, balanceRes => {
if (balanceRes.success) { if (balanceRes.success) {
if (balanceRes.data.list.length == 0) { if (balanceRes.data.list.length == 0) {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录',
@ -276,7 +274,6 @@
let record = batch.Records.find(r => r.packingNumber == packingCode); let record = batch.Records.find(r => r.packingNumber == packingCode);
if (record == undefined) { if (record == undefined) {
// //
if (batch.Recommends.length > 0) { if (batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
@ -359,7 +356,8 @@
uom: balance.uom, uom: balance.uom,
inventoryStatus: balance.inventoryStatus, inventoryStatus: balance.inventoryStatus,
balance: balance, balance: balance,
toLocationCode: this.toLocationCode toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode
} }
return record; return record;
}, },
@ -408,6 +406,8 @@
}, },
edit(item) { edit(item) {
this.editItem = item; this.editItem = item;
// item.balance.balanceQty = item.balance.qty;
item.balance.balanceQty = item.balance.qty;
this.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty); this.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty);
}, },

171
pages/issue/job/issueDetail.vue

@ -1,13 +1,33 @@
<template> <template>
<!-- <page-meta root-font-size="18px"></page-meta> -->
<view class="page-wraper"> <view class="page-wraper">
<view class="page-main"> <view class="page-main">
<view class="" style="padding: 15rpx;font-size: 35rpx; "> <!-- <view class="" style="padding: 15rpx;font-size: 35rpx; ">
车间代码 : {{jobContent.workShopCode}} 车间代码 : {{jobContent.workShopCode}}
</view> </view> -->
<u-line />
<scroll-view scroll-y="true" class=""> <scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource"> <view v-for="(toLocation, index) in detailSource">
<view class="cen_card" style="padding: 20rpx;">
<view class="cell_box uni-flex uni-row">
<view class="cell_info">
<view class="text_lightblue">车间</view>
<view>{{jobContent.workShopCode}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">生产线</view>
<view>{{toLocation.productionLineCode}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">工位</view>
<view>{{ toLocation.workStationCode }}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">原材料库</view>
<view>{{ toLocation.toLocationCode}}</view>
</view>
</view>
<u-line />
</view>
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'> <com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'>
</com-issue-detail-card> </com-issue-detail-card>
</view> </view>
@ -41,13 +61,20 @@
updateTitle, updateTitle,
getRemoveOption, getRemoveOption,
getISODateTime, getISODateTime,
getDirectoryItemArray getCurrDateTime,
getDirectoryItemArray,
getPackingNumberAndBatch,
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getDataSource getDataSource
} from '@/pages/issue/js/issue.js'; } from '@/pages/issue/js/issue.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
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 comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue' import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue'
@ -146,9 +173,6 @@
that.jobContent = res.data; that.jobContent = res.data;
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList) that.detailSource = getDataSource(that.detailSource, that.subList)
// that.fromLocationCode = that.subList[0].fromLocationCode
// that.toLocationCode = that.subList[0].toLocationCode
// that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.resizeCollapse(); that.resizeCollapse();
uni.hideLoading(); uni.hideLoading();
} else { } else {
@ -173,7 +197,7 @@
}); });
}, },
submit() { // submit() {
//3. //3.
//:XXX //:XXX
// var isOutIn = getApp().globalData.feed_configList.filter( // var isOutIn = getApp().globalData.feed_configList.filter(
@ -184,24 +208,122 @@
// }); // });
// this.dataContent.itemCodeList.forEach(res => {
// if (res.handleQty > res.recommendQty) {
// this.$refs.modal.showConfirmMessageModal(',?', confirm => {
// if (confirm) {
// //
// uni.showToast({
// title: ""
// })
// }
// })
// } else {
// uni.showToast({
// title: "" + res.handleQty + "][" + res.recommendQty + "]"
// })
// }
// })
// },
submit() {
uni.showLoading({
title: "提交中....",
mask: true
});
this.dataContent.itemCodeList.forEach(res => { //
if (res.handleQty > res.recommendQty) { var itemCodes = []
this.$refs.modal.showConfirmMessageModal('实际数量大于需求数量,是否提交?', confirm => { let locationCode = this.detailSource[0].toLocationCode
if (confirm) { this.detailSource.forEach(item => {
// itemCodes.push(item.itemCode)
uni.showToast({
title: "提交"
}) })
//使
if (this.jobContent.useOnTheWayLocation == 'TRUE') {
this.submitJob();
} else {
//
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) {
this.managementList = res.list;
this.submitJob();
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
} }
});
}
},
submitJob() {
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
issueJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发货记录" + res.data)
} else {
this.showErrorMessage("提交失败" + res.msg)
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
}) })
},
setParams() {
var subList = []
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.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
record.toLocationCode = subItem
.toLocationCode;
record.supplierCode = r.supplierCode;
//使
if (this.jobContent.useOnTheWayLocation ==
'TRUE') {
record.toPackingNumber = r
.packingNumber;
record.toBatch = r.batch;
} else { } else {
uni.showToast({ var info = getPackingNumberAndBatch(
title: "扫描的数量" + res.handleQty + "]小于推荐数量[" + res.recommendQty + "]" this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
.packingNumber;
record.toBatch = info.batch;
}
subItem.recordList.push(record);
}) })
subList.push(subItem);
} }
}) })
})
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
return this.jobContent;
}, },
cancel() { cancel() {
@ -241,15 +363,16 @@
if (item != undefined) { if (item != undefined) {
item.Locations.forEach(l => { item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
.packingNumber == '') && b.batch == .packingNumber == null || b.packingNumber == '') && b.batch ==
record.batch); record.batch);
let handleQty = 0; let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => { batch.Records.forEach(res => {
handleQty += Number(res.qty) handleQty += Number(res.qty)
}) })
batch.handleQty = handleQty; batch.handleQty = handleQty;
itemHandleQty += handleQty; itemHandleQty += handleQty;
}
}) })
} }
// item.handleQty=itemHandleQty; // item.handleQty=itemHandleQty;
@ -284,6 +407,14 @@
this.$refs.comMessage.showCommitSuccess(); this.$refs.comMessage.showCommitSuccess();
}, },
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
uni.navigateTo({
url: './issueJob'
})
})
},
showRescanMessage(message) { showRescanMessage(message) {
this.$refs.comMessage.showRescanMessage(message); this.$refs.comMessage.showRescanMessage(message);
}, },

12
pages/issue/js/issue.js

@ -3,10 +3,11 @@ export function getDataSource(list, subList) {
let detail = subList[i]; let detail = subList[i];
var location = list.find(r => var location = list.find(r =>
r.toLocationCode == detail.toLocationCode) r.toLocationCode == detail.toLocationCode)
if (location == undefined) { if (location == undefined) {
location = { location = {
toLocationCode: detail.toLocationCode, toLocationCode: detail.toLocationCode,
productionLineCode: detail.productionLineCode,
workStationCode: detail.workStationCode,
Items: [] Items: []
} }
list.push(location); list.push(location);
@ -32,15 +33,17 @@ export function createDetailInfo(location, detail) {
item.Locations.push(location); item.Locations.push(location);
} else { } else {
//在库位下查找批次 //在库位下查找批次
let batch = location.Batchs.find(r => r.batch == detail.Bacth); let batch = location.Batchs.find(r => r.batch == detail.batch);
if (batch == undefined) { if (batch == undefined) {
let batch = createBatchInfo(detail); let batch = createBatchInfo(detail);
location.Batchs.push(batch); location.Batchs.push(batch);
} else { } else {
if (detail.packingNumber != "" && detail.packingNumber != null) {
batch.Recommends.push(detail); batch.Recommends.push(detail);
} }
} }
} }
}
} }
export function createItemInfo(detail) { export function createItemInfo(detail) {
@ -76,17 +79,18 @@ export function createLocationInfo(detail) {
export function createBatchInfo(detail) { export function createBatchInfo(detail) {
let batch = { let batch = {
detail: detail,
batch: detail.batch, batch: detail.batch,
packingNumber: detail.packingNumber, packingNumber: detail.packingNumber,
qty: detail.qty, qty: detail.qty,
uom: detail.uom, uom: detail.uom,
handleQty: 0, handleQty: 0,
Recommends: [], Recommends: [],
Records: [] Records: [],
} }
//推荐到了箱码和批次 //推荐到了箱码和批次
if (detail.packingNumber != '' && detail.packingNumber != null) { if (detail.packingNumber != "" && detail.packingNumber != null) {
batch.Recommends.push(detail); batch.Recommends.push(detail);
} }
return batch; return batch;

1
pages/productDismantle/record/productDismantleRecord.vue

@ -137,7 +137,6 @@
mounted() {}, mounted() {},
methods: { methods: {
getScanResult(result) { getScanResult(result) {
debugger
let balance = result.balance; let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;

Loading…
Cancel
Save