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

35
common/balance.js

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

1
common/basic.js

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

28
common/style/new_style.css

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

1
common/style/pdabasic.css

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

17
mycomponents/balance/handleBalance.vue

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

14
mycomponents/balance/recommendBalance.vue

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

2
mycomponents/item/itemQty.vue

@ -1,5 +1,5 @@
<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>
<item :dataContent="dataContent"></item>
</view>

4
mycomponents/qty/balanceQtyEdit.vue

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

41
pages/issue/coms/comIssueDetailCard.vue

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

10
pages/issue/coms/comScanIssuePack.vue

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

209
pages/issue/job/issueDetail.vue

@ -1,13 +1,33 @@
<template>
<!-- <page-meta root-font-size="18px"></page-meta> -->
<view class="page-wraper">
<view class="page-main">
<view class="" style="padding: 15rpx;font-size: 35rpx; ">
<!-- <view class="" style="padding: 15rpx;font-size: 35rpx; ">
车间代码 : {{jobContent.workShopCode}}
</view>
<u-line />
</view> -->
<scroll-view scroll-y="true" class="">
<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>
</view>
@ -41,13 +61,20 @@
updateTitle,
getRemoveOption,
getISODateTime,
getDirectoryItemArray
getCurrDateTime,
getDirectoryItemArray,
getPackingNumberAndBatch,
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue'
@ -146,9 +173,6 @@
that.jobContent = res.data;
that.subList = res.data.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();
uni.hideLoading();
} else {
@ -173,35 +197,133 @@
});
},
// submit() {
//3.
//:XXX
// var isOutIn = getApp().globalData.feed_configList.filter(
// res => {
// if (res.name == 'feed_isOutIn') {
// return res;
// }
// });
// 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() {
//3.
//:XXX
// var isOutIn = getApp().globalData.feed_configList.filter(
// res => {
// if (res.name == 'feed_isOutIn') {
// return res;
// }
// });
uni.showLoading({
title: "提交中....",
mask: true
});
this.dataContent.itemCodeList.forEach(res => {
if (res.handleQty > res.recommendQty) {
this.$refs.modal.showConfirmMessageModal('实际数量大于需求数量,是否提交?', confirm => {
if (confirm) {
//
uni.showToast({
title: "提交"
})
}
})
//
var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
//使
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 {
uni.showToast({
title: "扫描的数量" + res.handleQty + "]小于推荐数量[" + res.recommendQty + "]"
})
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 {
var info = getPackingNumberAndBatch(
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() {
@ -241,15 +363,16 @@
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
.packingNumber == '') && b.batch ==
.packingNumber == null || b.packingNumber == '') && b.batch ==
record.batch);
let handleQty = 0;
batch.Records.forEach(res => {
handleQty += Number(res.qty)
})
batch.handleQty = handleQty;
itemHandleQty += handleQty;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty += Number(res.qty)
})
batch.handleQty = handleQty;
itemHandleQty += handleQty;
}
})
}
// item.handleQty=itemHandleQty;
@ -284,6 +407,14 @@
this.$refs.comMessage.showCommitSuccess();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
uni.navigateTo({
url: './issueJob'
})
})
},
showRescanMessage(message) {
this.$refs.comMessage.showRescanMessage(message);
},

14
pages/issue/js/issue.js

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

1
pages/productDismantle/record/productDismantleRecord.vue

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

Loading…
Cancel
Save