Browse Source

增加先进先出发料功能

hella_online_20240829
niexiting 4 months ago
parent
commit
d65b7cfdc4
  1. 83
      src/api/request2.js
  2. 2
      src/pages.json
  3. 4
      src/pages/issue/coms/comIssueRequestPopup.vue
  4. 964
      src/pages/issue/record/issueRecord.vue
  5. 432
      src/pages/issue/record/issueRecordV1.vue
  6. 2
      src/pages/repleinsh/record/repleinshRecord.vue

83
src/api/request2.js

@ -2,7 +2,7 @@ import request from './httpRequest3.js'
import storage from '../common/utils/storage.js'
//公司地址
// 本地地址
const baseApi = ''
const baseApi = ''
/**
* 获取验证码
* @param {*}
@ -17,7 +17,7 @@ export function getCaptchaImage(params) {
/**
* 登录方法
*/
export function login(username, password, code, uuid,tenantName) {
export function login(username, password, code, uuid, tenantName) {
return request({
url: baseApi + '/system/auth/login',
headers: {
@ -178,7 +178,7 @@ export function getMessageUnreadCount() {
* 获取单据开关配置
*/
export function getSwitchByCode(params) {
return request({
url: baseApi + "/wms/switch/getSwitchList",
method: "post",
@ -443,9 +443,9 @@ export function getPackageListByNumber(number) {
export function getMesPackInfo(code) {
var params = {
filters: [{
column:"lowerLim",
action:"==",
value:code
column: "lowerLim",
action: "==",
value: code
}],
pageNo: 1,
pageSize: 10
@ -1363,7 +1363,7 @@ export function getProductionReceiptJobByProductionline() {
data: {},
});
}
/**
* 发料任务明细
* @param {*} 任务id
@ -1383,10 +1383,10 @@ export function getIssueJobDetail(id) {
* @param {*} 任务id
* /wms/issue-request-main
*/
export function getBalanceByBatchOffShelf(itemCode, qty) {
export function getBalanceByBatchOffShelf(itemCode, qty, businesstype) {
return request({
url: baseApi + "/wms/issue-request-main/getBalanceByBatchOffShelf?itemCode=" + itemCode + "&&qty=" +
qty,
qty + "&&businesstype=" + businesstype,
method: "get",
data: {},
});
@ -4116,7 +4116,7 @@ export function getMainMessage() {
*/
export function appCheckUpdate() {
return request({
url: baseApi+"/wms/system-install-package/returnNewFile",
url: baseApi + "/wms/system-install-package/returnNewFile",
method: "get",
data: {}
})
@ -4209,10 +4209,10 @@ export function getPackageLabel(packageCode) {
name: name,
pageNo: 1,
pageSize: 10,
sort:"",
filters:[{
sort: "",
filters: [{
action: "==",
column:"relateNumber",
column: "relateNumber",
value: packageCode
}]
}
@ -4229,7 +4229,7 @@ export function getPackageLabel(packageCode) {
*/
export function isCheckMesCode(code) {
return request({
url: baseApi + "/wms/productreceipt-detailb/getCheckWhetherItExists?remark="+code,
url: baseApi + "/wms/productreceipt-detailb/getCheckWhetherItExists?remark=" + code,
method: "get",
data: {},
});
@ -4239,11 +4239,11 @@ export function isCheckMesCode(code) {
* 获取上架任务打印明细
* @param {*}
*/
export function getJimuPutawayJobDetail(data) {
return request({
export function getJimuPutawayJobDetail(data) {
return request({
url: baseApi + "/wms/jimu-report/getPutawayJobDetailForPDA",
method: "post",
data:data
data: data
});
}
@ -4251,11 +4251,11 @@ export function getJimuPutawayJobDetail(data) {
* 查询库位后台自己查询管理模式
* @param {*}
*/
export function getBalanceByParams(data) {
return request({
export function getBalanceByParams(data) {
return request({
url: baseApi + "/wms/balance/getBalanceListByPackage",
method: "post",
data:data
data: data
});
}
@ -4264,11 +4264,11 @@ export function getBalanceByParams(data) {
* @param {*}
*/
export function getBusinessType() {
return request({
export function getBusinessType() {
return request({
url: baseApi + "/wms/businesstype/page?pageSize=1000&pageNo=1",
method: "get",
data:{}
data: {}
});
}
@ -4277,11 +4277,12 @@ export function getBusinessType() {
* @param {*}
*/
export function getPlaneInfoByproductLine(productionLine,planDate) {
return request({
url: baseApi + "/wms/production-main/getPlanProductionByProductionLineAndPlanDate?productionLine="+productionLine+"&planDate="+planDate,
export function getPlaneInfoByproductLine(productionLine, planDate) {
return request({
url: baseApi + "/wms/production-main/getPlanProductionByProductionLineAndPlanDate?productionLine=" +
productionLine + "&planDate=" + planDate,
method: "get",
data:{}
data: {}
});
}
@ -4290,33 +4291,33 @@ export function getPlaneInfoByproductLine(productionLine,planDate) {
* @param {*}
*/
export function planReceiptSubmit(params) {
return request({
export function planReceiptSubmit(params) {
return request({
url: baseApi + "/wms/productreceipt-record-main/createByPlan",
method: "post",
data:params
data: params
});
}
/**
* @param {Object} params 创建计划完工后调用上架申请 number
*/
export function createPutawayRequestByPlan(number) {
return request({
url: baseApi + "/wms/productreceipt-record-main/createPutawayRequest?number="+number,
export function createPutawayRequestByPlan(number) {
return request({
url: baseApi + "/wms/productreceipt-record-main/createPutawayRequest?number=" + number,
method: "post",
data:{}
data: {}
});
}
/**
* @param {Object} params 创建检验申请 number
*/
export function createInspectRequestByPlan(number) {
return request({
url: baseApi + "/wms/productreceipt-record-main/createInspectRequest?number="+number,
export function createInspectRequestByPlan(number) {
return request({
url: baseApi + "/wms/productreceipt-record-main/createInspectRequest?number=" + number,
method: "post",
data:{}
data: {}
});
}
@ -4324,11 +4325,11 @@ export function createInspectRequestByPlan(number) {
/**
* @param {Object} params 查询计划报工单号 number
*/
export function getPlanByNumber(params) {
return request({
export function getPlanByNumber(params) {
return request({
url: baseApi + "/wms/production-detail/senior",
method: "post",
data:params
data: params
});
}

2
src/pages.json

@ -593,7 +593,7 @@
{
"path": "pages/issue/record/issueRecord",
"style": {
"navigationBarTitleText": "直接发料记录",
"navigationBarTitleText": "先进先出发料",
"enablePullDownRefresh": false,
"titleNView": {
"autoBackButton": "true"

4
src/pages/issue/coms/comIssueRequestPopup.vue

@ -39,7 +39,7 @@
</view>
<view class='split_line'></view>
<view class="uni-flex uni-row padding title u-col-center">
<text>位置</text>
<text>目标位置</text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;">
{{positionInfo}}
@ -51,7 +51,7 @@
<view class='split_line'></view>
<view class="title padding" style="display: flex;">
<text style=" flex-shrink: 0;">物料</text>
<text style=" flex-shrink: 0;">需求物料</text>
<view class="" style="width: 100% ;">
{{itemCode}}
</view>

964
src/pages/issue/record/issueRecord.vue

File diff suppressed because it is too large

432
src/pages/issue/record/issueRecordV1.vue

@ -0,0 +1,432 @@
<template>
<view class="page-wraper">
<view class="" v-if='detailSource.length==0'>
<com-blank-view @goScan='goScan(true)'></com-blank-view>
</view>
<view v-else class="page-wraper">
<view class="page-main">
<scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource">
<view class="uni-row uni-flex">
<!-- <com-issue-request-info :workShopCode="workShopCode" :dataContent="toLocation">
</com-issue-request-info> -->
<work-station :workshopCode="workShopCode"
:productionLineCode="toLocation.productionLineCode"
:workStationCode="toLocation.workStationCode"
:rawLocationCode="toLocation.toLocationCode"></work-station>
</view>
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation"
@updateData='updateData'
@removeItemCode ="removeItemCode"
>
</com-issue-detail-card>
</view>
</scroll-view>
<button class="btn_add" @click="goScan(false)">+去添加</button>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
</view>
</view>
</view>
</view>
<com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm' :itemCodeTypeList="itemCodeTypeList"></com-issue-request-popup>
<win-scan-button v-if='detailSource.length>0' @goScan='openScanDetailPopup'></win-scan-button>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</com-scan-issue-pack>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
import {
issueRecordSubmit,
getBalanceByBatchOffShelf
} from '@/api/request2.js';
import {
goHome,
getRemoveOption,
getISODateTime,
getCurrDateTime,
getPackingNumberAndBatch
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
getBusinessType,
} from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comIssueRequestPopup from '@/pages/issue/coms/comIssueRequestPopup.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue'
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import workStation from '@/mycomponents/workStation/workStation.vue'
export default {
name: '',
components: {
comBlankView,
comIssueRequestPopup,
jobDetailPopup,
comIssueRequestCreator,
comIssueRequestInfo,
comIssueDetailCard,
winScanButton,
comScanIssuePack,
workStation
},
data() {
return {
subList: [], //subList
detailSource: [], //
detailOptions: [],
scanOptions: [],
workShopCode: "",
fromInventoryStatuses: "",
toInventoryStatuses: "",
requestList: [],
dataContent: {},
managementList: [],
itemCodeTypeList: []
}
},
mounted() {
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
onLoad(option) {
var typeCode = "Issue"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.itemCodeTypeList = res.itemCodeTypeList;
this.fromInventoryStatuses = res.fromInventoryStatuses
this.toInventoryStatuses = res.toInventoryStatuses
this.goScan(true)
} else {
this.showErrorMessage(res.message)
}
});
},
methods: {
closeScan() {
this.resizeCollapse();
},
resizeCollapse() {
this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
})
});
},
goScan(editPosition) {
this.$refs.comIssueRequestPopup.openRequestPopup(editPosition);
},
//
requestConfirm(action, item) {
if (item.itemCode == '' || item.itemCode == null) return;
let that = this;
let request = that.requestList.find(r => r.itemCode == item.itemCode);
if (request == undefined) {
that.requestList.push(item);
this.getRecommendInfo(item);
} else {
this.$refs.comMessage.showQuestionMessage('已经存在物料[' + item.itemCode + ']的需求信息,是否要修改?', res => {
if (res) {
request.qty = item.qty;
that.detailSource.forEach(detail => {
let index = detail.Items.findIndex(r => {
r.itemCode == item.itemCode
})
detail.Items.splice(index, 1);
})
this.getRecommendInfo(item);
}
});
}
},
getRecommendInfo(item) {
let that = this;
uni.showLoading({
title: '加载中...',
mask: true
})
getBalanceByBatchOffShelf(item.itemCode, item.qty).then(res => {
if (res.data == null) {
that.showMessage('未获取到推荐信息');
} else {
if (res.data.length > 0) {
that.workShopCode = item.workshopCode;
res.data.forEach(r => {
r.toLocationCode = item.rawLocationCode;
r.productionLineCode = item.productionLineCode;
r.workStationCode = item.workStationCode;
// r.itemCode = item.itemCode;
r.itemName = item.itemName
r.uom = item.uom;
that.subList.push(r);
})
that.detailSource = getDataSource(that.detailSource, that.subList)
//
that.detailSource.forEach(detail => {
detail.Items.forEach(i => {
let request = that.requestList.find(r => r
.itemCode == i
.itemCode);
i.qty = request.qty;
})
})
that.resizeCollapse();
} else {
that.showMessage('列表数据为0');
}
uni.hideLoading();
}
}).catch(error => {
uni.hideLoading()
that.showErrorMessage(error)
})
},
caclcQty() {
var totalQty = 0;
this.detailSource.subList.forEach(res => {
totalQty = calc.add(totalQty, res.qty);
})
this.detailSource.totalQty = totalQty;
},
openScanDetailPopup() {
var datacontent = {}
//
// Object.assign(datacontent, this.detailSource);
var dataContent = {
allowModifyPackingNumber: "FALSE",
outInventoryStatuses: this.fromInventoryStatuses
}
this.$refs.comScanIssuePack.openScanPopup(this.detailSource, dataContent);
},
closeScanPopup() {
this.updateCommitBtn();
},
updateData(record) {
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode);
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode);
let itemHandleQty = 0;
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
.packingNumber == null || b.packingNumber == '') && b.batch ==
record.batch);
let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty);
})
batch.handleQty = handleQty;
itemHandleQty = calc.add(itemHandleQty, handleQty)
}
})
}
this.resizeCollapse();
// item.handleQty=itemHandleQty;
// this.closeScan();
},
removeItemCode(){
var isClear =this.detailSource[0].Items.length==0
if(isClear){
this.clearData();
this.$refs.comIssueRequestPopup.initData()
}
},
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.fromPackingNumber = r
.packingNumber;
record.fromBatch = r.batch;
record.fromContainerNumber = r
.ContainerNumber;
record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
record.toLocationCode = subItem
.toLocationCode;
record.fromLocationCode = fromLocation
.fromLocationCode
record.supplierCode = r.supplierCode;
let single_price = r.singlePrice == null ?
0 : r.singlePrice;
record.singlePrice = single_price;
record.amount = single_price * r.qty;
//使
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.dataContent.subList = subList
this.dataContent.createTime = createTime;
this.dataContent.creator = creator;
return this.dataContent;
},
submit() {
uni.showLoading({
title: "提交中....",
mask: true
});
//
var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode
this.detailSource.forEach(toLocation => {
toLocation.Items.forEach(item => {
itemCodes.push(item.itemCode)
})
})
//
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));
issueRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发料记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败:【" + res.msg+"】")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
this.$refs.comIssueRequestPopup.initData()
})
},
clearData() {
this.subList= [], //subList
this.detailSource=[], //
this.detailOptions=[],
this.scanOptions= [],
this.workShopCode="",
this.requestList= [],
this.dataContent= {},
this.managementList= []
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}
});
},
showQuestionMessage(message) {
},
// this.$refs.comMessage.showQuestionMessage('?', res => {
// if (res) {
// that.clearInfo();
// }
// });
}
}
</script>
<style>
</style>

2
src/pages/repleinsh/record/repleinshRecord.vue

@ -251,7 +251,7 @@
itemCode: result.package.itemCode,
qty: result.package.qty,
}
getBalanceByBatchOffShelf(item.itemCode, item.qty).then(res => {
getBalanceByBatchOffShelf(item.itemCode, item.qty, "Repleinment").then(res => {
if (res.data == null) {
that.showErrorMessage('未获取到推荐信息');
} else {

Loading…
Cancel
Save