From b47b4dc384ebeb8b66dc06a755089e7ca0e43c82 Mon Sep 17 00:00:00 2001
From: niexiting <85552560@qq.com>
Date: Tue, 6 Aug 2024 13:44:18 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E6=96=99=E4=BB=BB?=
=?UTF-8?q?=E5=8A=A1=E7=9A=84=E6=89=AB=E6=8F=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 7 +-
src/mycomponents/scan/winComScanBalance.vue | 1 +
src/pages/issue/coms/comScanIssuePack.vue | 297 +++++++++++---------
src/pages/issue/job/issueDetail.vue | 5 +-
src/pages/issue/job/issueJob.vue | 236 +++++++++-------
src/pages/repleinsh/job/repleinshJob.vue | 3 +-
6 files changed, 311 insertions(+), 238 deletions(-)
diff --git a/.env.development b/.env.development
index 0d7cdb86..36a656a8 100644
--- a/.env.development
+++ b/.env.development
@@ -1,12 +1,11 @@
VITE_BASE_URL=http://172.21.47.239:12080/admin-api
-VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api
+VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api
# 租户配置
-VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'
+VITE_TENANT='[{"text":"长春1379","value":1}]'
# 是否是测试环境
VITE_isDevelopment=false
-
# 积木报表请求路径
-VITE_JMREPORT_BASE_URL='http://172.22.32.8:90'
+VITE_JMREPORT_BASE_URL='http://172.21.32.13:90'
diff --git a/src/mycomponents/scan/winComScanBalance.vue b/src/mycomponents/scan/winComScanBalance.vue
index a207bc19..61a6e5e2 100644
--- a/src/mycomponents/scan/winComScanBalance.vue
+++ b/src/mycomponents/scan/winComScanBalance.vue
@@ -170,6 +170,7 @@
this.showErrorMessage(error)
})
},
+
getItemCodeType(itemCode, callBack) {
uni.showLoading({
title: "加载中",
diff --git a/src/pages/issue/coms/comScanIssuePack.vue b/src/pages/issue/coms/comScanIssuePack.vue
index 9ed49ddb..9296a11e 100644
--- a/src/pages/issue/coms/comScanIssuePack.vue
+++ b/src/pages/issue/coms/comScanIssuePack.vue
@@ -45,8 +45,9 @@
来源库位
-
+
@@ -95,8 +96,8 @@
-
-
+
@@ -114,12 +115,13 @@
} from '@/common/array.js';
import {
getWorkShopLineStation,
- getBalanceByFilter
+ getBalanceByFilter,
+ getBalanceByParams,
} from '@/api/request2.js';
import {
uniqueArray
} from '@/common/basic.js';
-
+
import {
getLabelInfo
} from '@/common/label.js';
@@ -131,11 +133,13 @@
import {
getBalanceByManagementPrecision
} from '@/common/balance.js';
-import { getDirectoryItemArray } from '../../../common/directory.js';
+ import {
+ getDirectoryItemArray
+ } from '../../../common/directory.js';
export default {
name: 'winScanPack',
- emits: ["afterScan","closeScan"],
+ emits: ["afterScan", "closeScan"],
components: {
winComScan,
balance,
@@ -170,9 +174,10 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
fromInventoryStatuses: "",
packageInfo: {},
label: {},
- inputStyleObject:{
+ inputStyleObject: {
fontSize: "100rpx"
- }
+ },
+ bussinessCode: 'Issue'
}
},
created() {
@@ -184,7 +189,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
this.scanOptions = getDetailEditRemoveOption();
},
methods: {
- openScanPopupForJobSimulate(content, jobcontent,scanMessage) {
+ openScanPopupForJobSimulate(content, jobcontent, scanMessage) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
@@ -195,11 +200,11 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
} else {
this.showErrorMessage(callback.message, res => {})
}
-
+
})
-
+
},
-
+
openScanPopup(content, jobcontent) {
this.issueRecord = [];
this.dataContent = content;
@@ -223,7 +228,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
let that = this;
that.fromLocationList = [];
if (that.dataContent != null) {
- that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
+ that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList();
@@ -259,8 +264,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
this.showErrorMessage('发料库位【' + fromlocation + '】不存在')
}
},
-
- onScanResult(result){
+
+ onScanResult(result) {
try {
let that = this;
if (that.fromLocationCode == '') {
@@ -282,124 +287,149 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
)
return;
} else {
- //查找库存信息
- uni.showLoading({
- title: '加载中',
- mask: true
- })
-
- this.getBalance(result.label, packageInfo, balances => {
- this.packageInfo =packageInfo;
- //扫描的是外包装
- let s = '';
- if (!result.package.parentNumber) {
- if (balances.list.length == 0) {
- this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
- } else {
- let newBalances = balances.list.filter(b => b.locationCode == that
- .fromLocationCode);
- if (newBalances.length == 0) {
- this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
- } else if (newBalances.length == 1) {
- let balance = newBalances[0];
- this.afterGetBalance(result.label, balance, packageInfo);
- } else {
- this.showBalanceSelect(newBalances);
- }
- }
- } else {
- //扫描的是小包装
- if (balances.list.length == 0) {
- this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
- } else {
- //小包装库存
- let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo
- .number)
- //外包装库存
- let subParentPackitems = balances.list.filter(r => r.packingNumber ==
- packageInfo
- .parentNumber&&r.locationCode==this.fromLocationCode)
-
-
- //小包装没有库存,
- if (subPackitems.length == 0) {
- //外包装有库存,出库后剩余库存未转换为出库包装规格
-
- if (subParentPackitems.length > 0) {
- if(subParentPackitems.length==1){
- let balance = subParentPackitems[0];
- balance.qty=packageInfo.qty;
- this.afterGetBalance(result.label, balance, packageInfo);
- }else {
- this.showBalanceSelect(subParentPackitems);
- }
-
- } else {
- this.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' +
- packageInfo.number + '】都未查找到库存余额')
- }
- } else {
- var locationCode = this.fromLocationCode
- if(balances.list==1){
- locationCode=balances.list[0].locationCode
- }else {
- var manyBlances = balances.list.filter(r=>r.locationCode!=this.fromLocationCode)
- if(manyBlances.length>0){
- locationCode = manyBlances[0].locationCode;
- }
-
- }
- this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' +
- locationCode +
- '】已经有库存余额,请重新扫描')
- }
-
-
-
- // //小包装没有库存,外包装有库存
- // if (subitems.length == 0 && subParentPackitems.length > 0) {
- // this.afterGetBalance(result.label, null, packageInfo);
- // } else if (subitems.length > 0 && subParentPackitems.length == 0) {
- // //小包装没有库存,外包装没有有库存
- // this.showErrorMessage('该包装在库位【' + balances.list[0].locationCode +
- // '】已经有库存余额,请重新扫描')
- // } else {
-
- // }
-
- }
- }
- uni.hideLoading();
- });
-
-
- // getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
- // balanceRes => {
- // if (balanceRes.success) {
- // let s = '';
- // if (balanceRes.data.list.length == 0) {
- // this.afterGetBalance(result.label, null, packageInfo);
- // } else if (balanceRes.data.list.length == 1) {
- // let balance = balanceRes.data.list[0];
+ this.queryBalance(result);
+
+ // this.getBalance(result.label, packageInfo, balances => {
+ // this.packageInfo = packageInfo;
+ // //扫描的是外包装
+ // let s = '';
+ // if (!result.package.parentNumber) {
+ // if (balances.list.length == 0) {
+ // this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
+ // } else {
+ // let newBalances = balances.list.filter(b => b.locationCode == that
+ // .fromLocationCode);
+ // if (newBalances.length == 0) {
+ // this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
+ // } else if (newBalances.length == 1) {
+ // let balance = newBalances[0];
// this.afterGetBalance(result.label, balance, packageInfo);
// } else {
- // this.showBalanceSelect(balanceRes.data.list);
+ // this.showBalanceSelect(newBalances);
// }
+ // }
+ // } else {
+ // //扫描的是小包装
+ // if (balances.list.length == 0) {
+ // this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
// } else {
- // this.showErrorMessage(balanceRes.message.message);
+ // //小包装库存
+ // let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo
+ // .number)
+ // //外包装库存
+ // let subParentPackitems = balances.list.filter(r => r.packingNumber ==
+ // packageInfo
+ // .parentNumber && r.locationCode == this.fromLocationCode)
+
+
+ // //小包装没有库存,
+ // if (subPackitems.length == 0) {
+ // //外包装有库存,出库后剩余库存未转换为出库包装规格
+
+ // if (subParentPackitems.length > 0) {
+ // if (subParentPackitems.length == 1) {
+ // let balance = subParentPackitems[0];
+ // balance.qty = packageInfo.qty;
+ // this.afterGetBalance(result.label, balance, packageInfo);
+ // } else {
+ // this.showBalanceSelect(subParentPackitems);
+ // }
+
+ // } else {
+ // this.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' +
+ // packageInfo.number + '】都未查找到库存余额')
+ // }
+ // } else {
+ // var locationCode = this.fromLocationCode
+ // if (balances.list == 1) {
+ // locationCode = balances.list[0].locationCode
+ // } else {
+ // var manyBlances = balances.list.filter(r => r.locationCode != this
+ // .fromLocationCode)
+ // if (manyBlances.length > 0) {
+ // locationCode = manyBlances[0].locationCode;
+ // }
+
+ // }
+ // this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' +
+ // locationCode +
+ // '】已经有库存余额,请重新扫描')
+
+ // // var locationCode = this.fromLocationCode
+ // // if(balances.list==1){
+ // // locationCode=balances.list[0].locationCode
+ // // }else {
+ // // var manyBlances = balances.list.filter(r=>r.locationCode!=this.fromLocationCode)
+ // // if(manyBlances.length>0){
+ // // locationCode = manyBlances[0].locationCode;
+ // // }
+
+ // // }
+ // // this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' +
+ // // locationCode +
+ // // '】已经有库存余额,请重新扫描')
+ // }
// }
- // uni.hideLoading();
- // });
+ // }
+ // uni.hideLoading();
+ // });
}
} catch (e) {
this.showErrorMessage(e.stack)
uni.hideLoading();
}
},
-
+
+
+ queryBalance(result) {
+ var params = {
+ itemCode: result.package.itemCode,
+ batch: result.label.batch,
+ packingNumber: result.label.packingNumber,
+ parentPackingNumber: result.package.parentNumber,
+ inventoryStatus: this.jobContent.outInventoryStatuses.split(','),
+ areaType: this.jobContent.fromAreaTypes.split(','),
+ bussinessCode: this.jobContent.businessType
+ }
+ uni.showLoading({
+ title: '查询中',
+ mask: true
+ })
+ getBalanceByParams(params).then(res => {
+ if (res.data.length == 0) {
+ var status = getInventoryStatusDesc(params.inventoryStatus)
+ var areaType = getListLocationAreaTypeDesc(params.areaType)
+ var hint =
+ "按物料号 [" + params.itemCode + "]
" +
+ "包装号 [" + params.packingNumber + "]
" +
+ "批次 [" + params.batch + "]
" +
+ "状态 [" + status + "]
" +
+ "库区 [" + areaType + "]
" +
+ "未查找到库存余额"
+ this.showErrorMessage(hint)
+ } else if (res.data.length == 1) {
+
+ result.balance = res.data[0]
+ if (result.label.packingNumber != result.balance.packingNumber) {
+ result.balance.lableQty = result.label.qty
+ }
+ this.afterGetBalance(result.label, result.balance, result.package);
+ } else {
+ //多条记录
+ this.$refs.balanceSelect.openPopup(res.data);
+ }
+ uni.hideLoading()
+ }).catch(error => {
+ uni.hideLoading()
+ this.showErrorMessage(error)
+ })
+ },
+
+
+
getBalance(label, packageInfo, callback) {
var filters = []
-
+
if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
@@ -414,7 +444,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
value: label.packingNumber
})
}
-
+
filters.push({
column: "itemCode",
action: "==",
@@ -425,7 +455,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
action: "==",
value: label.batch
})
-
+
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
@@ -433,7 +463,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
value: this.fromInventoryStatuses
})
}
-
+
var params = {
filters: filters,
pageNo: 1,
@@ -448,8 +478,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
onScan(result) {
- if(!result.package){
- this.showErrorMessage('扫描数据错误['+result.label.code+"]",
+ if (!result.package) {
+ this.showErrorMessage('扫描数据错误[' + result.label.code + "]",
res => {
this.getfocus();
}
@@ -527,7 +557,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
},
selectBalanceItem(balance) {
- this.afterGetBalance(this.label, balance,this.packageInfo);
+ this.afterGetBalance(this.label, balance, this.packageInfo);
},
afterGetBalance(label, balance, packageInfo) {
@@ -733,16 +763,16 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
},
packGetFocus() {
- if(this.$refs.comscan){
+ if (this.$refs.comscan) {
this.$refs.comscan.getfocus();
}
-
+
},
packLoseFocus() {
- if(this.$refs.comscan){
+ if (this.$refs.comscan) {
this.$refs.comscan.losefocus();
}
-
+
},
showMessage(message, callback) {
setTimeout(r => {
@@ -789,7 +819,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
max-height: 300rpx;
padding: 10rpx;
}
- .my-combox{
+
+ .my-combox {
font-size: 50px;
}
\ No newline at end of file
diff --git a/src/pages/issue/job/issueDetail.vue b/src/pages/issue/job/issueDetail.vue
index a7c8520b..8add5f19 100644
--- a/src/pages/issue/job/issueDetail.vue
+++ b/src/pages/issue/job/issueDetail.vue
@@ -40,6 +40,7 @@
+
@@ -80,6 +81,7 @@
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import workStation from '@/mycomponents/workStation/workStation.vue'
+ import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
export default {
name: 'issueDetail',
@@ -89,7 +91,8 @@
comIssueDetailCard,
comScanIssuePack,
jobTop,
- workStation
+ workStation,
+ balanceSelect
},
data() {
return {
diff --git a/src/pages/issue/job/issueJob.vue b/src/pages/issue/job/issueJob.vue
index be82a152..c77ce378 100644
--- a/src/pages/issue/job/issueJob.vue
+++ b/src/pages/issue/job/issueJob.vue
@@ -9,12 +9,12 @@
-
-
+
-
+
@@ -25,7 +25,9 @@
-
+
+
+
@@ -43,6 +45,10 @@
updateTitle
} from '@/common/basic.js';
+ import {
+ getBusinessType
+ } from '@/common/record.js';
+
import {
getDetailOption,
getDetailGiveupOption,
@@ -57,6 +63,7 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import jobList from '@/mycomponents/jobList/jobList.vue'
+ import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
export default {
name: 'issue',
@@ -68,7 +75,8 @@
jobInfoPopup,
winScanPackJob,
winScanButton,
- jobList
+ jobList,
+ winComScanBalance
},
data() {
return {
@@ -84,18 +92,20 @@
detailOptions: [],
detailGiveupOptions: [],
productionlineList: [],
- detailCloseOptions: [],
- title:'',
- productionLine:"",
- fromLocation:""
+ detailCloseOptions: [],
+ title: '',
+ productionLine: "",
+ fromLocation: "",
+ businessTypeCode: "Issue",
+ businessType: null,
};
},
- onLoad(option) {
+ onLoad(option) {
this.title = option.title
this.getIssueJobByProductionline()
},
onShow() {
- this.getList('refresh',this.fromLocation,this.productionLine);
+ this.getList('refresh', this.fromLocation, this.productionLine);
},
onReady() {
@@ -108,12 +118,12 @@
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
- this.getList('more', this.fromLocation, this.productionLine)
-
+ this.getList('more', this.fromLocation, this.productionLine)
+
},
onPullDownRefresh() {
- this.getList('refresh',this.fromLocation, this.productionLine)
+ this.getList('refresh', this.fromLocation, this.productionLine)
},
//后退按钮
@@ -136,6 +146,19 @@
},
methods: {
+ getBusinessTypeFunc() {
+ getBusinessType(this.businessTypeCode, res => {
+ if (res.success) {
+ this.businessType = res.businessType;
+ this.fromInventoryStatuses = res.fromInventoryStatuses.split(',');
+ this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
+ // this.openScanPopup();
+ } else {
+ this.showErrorMessage(res.message)
+ }
+ });
+ },
+
getIssueJobByProductionline() {
getIssueJobByProductionline().then(res => {
if (res.code == 0) {
@@ -215,18 +238,18 @@
uni.stopPullDownRefresh();
}
var list = res.data.list;
-
+
this.totalCount = res.data.total
- updateTitle(this.title+"(" + this.totalCount + ")");
+ updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
- this.pageNo++;
- if (type === "refresh") {
- uni.stopPullDownRefresh();
+ this.pageNo++;
+ if (type === "refresh") {
+ uni.stopPullDownRefresh();
}
}).catch(error => {
if (type === "refresh") {
@@ -239,12 +262,12 @@
})
},
fromLocationCode(fromLocation) {
- this.fromLocation =fromLocation;
+ this.fromLocation = fromLocation;
this.getList('refresh', this.fromLocation, this.productionLine)
},
productionLineCode(productionLineCode) {
- this.productionLine =productionLineCode
- this.getList('refresh', this.fromLocation,this.productionLine)
+ this.productionLine = productionLineCode
+ this.getList('refresh', this.fromLocation, this.productionLine)
},
getByAsnNumber(code) {
let that = this;
@@ -274,7 +297,8 @@
openJobDetail(item, scanMessage = '') {
uni.navigateTo({
- url: './issueDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' + scanMessage +'&title='+this.title
+ url: './issueDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' +
+ scanMessage + '&title=' + this.title
});
},
@@ -296,18 +320,18 @@
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
- res => {
- if (res) {
- this.cancleJob(dataContent.masterId);
- }
- });
- }else if (e.content.text == "关闭") {
+ res => {
+ if (res) {
+ this.cancleJob(dataContent.masterId);
+ }
+ });
+ } else if (e.content.text == "关闭") {
this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?",
- res => {
- if (res) {
- this.closeJob(dataContent.masterId);
- }
- });
+ res => {
+ if (res) {
+ this.closeJob(dataContent.masterId);
+ }
+ });
}
},
@@ -318,7 +342,7 @@
cancleJob(id) {
cancleTakeIssueJob(id).then(res => {
if (res.data) {
- this.getList("refresh",this.fromLocation,this.productionLine)
+ this.getList("refresh", this.fromLocation, this.productionLine)
uni.showToast({
title: "放弃任务成功"
})
@@ -334,15 +358,15 @@
title: "加载中....",
mask: true
});
-
+
closeTakeIssueJob(id).then(res => {
uni.hideLoading()
- if(res.data){
+ if (res.data) {
this.getList("refresh")
uni.showToast({
- title:"关闭任务成功"
+ title: "关闭任务成功"
})
- }else {
+ } else {
this.showMessage("关闭任务失败")
}
}).catch(error => {
@@ -354,13 +378,13 @@
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
- this.getList("refresh",this.fromLocation,this.productionLine);
+ this.getList("refresh", this.fromLocation, this.productionLine);
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
- this.getList("refresh",this.fromLocation,this.productionLine);
+ this.getList("refresh", this.fromLocation, this.productionLine);
},
getScanNumber(code) {
@@ -383,7 +407,7 @@
action: "==",
value: code
})
-
+
filters.push({
column: "accept_user_id",
action: "==",
@@ -418,67 +442,83 @@
});
},
openScanPopup() {
- this.$refs.scanPopup.openScanPopup();
+ if (this.businessType == null) {
+ this.getBusinessTypeFunc()
+ } else {
+ this.$refs.scanPopup.openScanPopup(this.businessType);
+ }
},
+ // openScanPopup() {
+ // this.$refs.scanPopup.openScanPopup();
+ // },
getScanResult(result) {
- if (!result.label.batch) {
- this.showMessage("批次为空")
- return;
- }
- if (!result.label.itemCode) {
- this.showMessage("物料号为空")
- return;
- }
- try {
- var filters = [{
- column: "status",
- action: "in",
- value: '1,2'
- },
- {
- column: "batch",
- action: "==",
- value: result.label.batch
- },
- {
- column: "itemCode",
- action: "==",
- value: result.label.itemCode
- }
- ]
- getIssueJobList({
- filters: filters,
- pageNo: 1,
- pageSize: 1000,
- sort: 'createTime',
- by: 'asc'
- }).then(res => {
- this.scanMessage = result.scanMessage
- let resultList = res.data.list;
- if (resultList.length > 0) {
- resultList.forEach(item => {
- item.title = item.number;
- item.selected = false
- })
- let list = []
- resultList.forEach(item => {
- if (!list.find(subItem => subItem.title == item.title)) {
- list.push(item)
+ let balance = result.balance;
+ if (balance != null) {
+ this.scanMessage = ""
+ if (!result.label.batch) {
+ this.showMessage("批次为空")
+ return;
+ }
+ if (!result.label.itemCode) {
+ this.showMessage("物料号为空")
+ return;
+ }
+ try {
+ var filters = [{
+ column: "status",
+ action: "in",
+ value: '1,2'
+ },
+ {
+ column: "batch",
+ action: "==",
+ value: result.label.batch
+ },
+ {
+ column: "itemCode",
+ action: "==",
+ value: result.label.itemCode
+ },
+ {
+ column: "fromLocationCode",
+ action: "==",
+ value: balance.locationCode
+ }
+ ]
+ getIssueJobList({
+ filters: filters,
+ pageNo: 1,
+ pageSize: 1000,
+ sort: 'createTime',
+ by: 'asc'
+ }).then(res => {
+ this.scanMessage = result.scanMessage
+ let resultList = res.data.list;
+ if (resultList.length > 0) {
+ resultList.forEach(item => {
+ item.title = item.number;
+ item.selected = false
+ })
+ let list = []
+ resultList.forEach(item => {
+ if (!list.find(subItem => subItem.title == item.title)) {
+ list.push(item)
+ }
+ })
+ if (list.length > 0) {
+ this.selectItem(list[0])
}
- })
- if (list.length > 0) {
- this.selectItem(list[0])
+ } else {
+ this.showMessage("物料号[" + result.label.itemCode + "]批次[" + result.label.batch +
+ ']' + "未查找到任务
" + "扫描[" + result.scanMessage + "]")
}
- } else {
- this.showMessage("物料号[" + result.label.itemCode + "]批次[" + result.label.batch +
- ']'+"未查找到任务
"+"扫描["+result.scanMessage+"]")
- }
- }).catch(error => {
- this.showMessage(error+"
扫描["+result.scanMessage+"]")
- })
+ }).catch(error => {
+ this.showMessage(error + "
扫描[" + result.scanMessage + "]")
+ })
- } catch (e) {
- this.showMessage(e.message)
+ } catch (e) {
+ this.showMessage(e.message)
+ }
}
},
}
diff --git a/src/pages/repleinsh/job/repleinshJob.vue b/src/pages/repleinsh/job/repleinshJob.vue
index 656a4e2d..c0bfa5b5 100644
--- a/src/pages/repleinsh/job/repleinshJob.vue
+++ b/src/pages/repleinsh/job/repleinshJob.vue
@@ -146,7 +146,7 @@
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
- this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
+ this.fromInventoryStatuses =res.fromInventoryStatuses.split(',');
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
// this.openScanPopup();
} else {
@@ -382,7 +382,6 @@
} else {
this.$refs.scanPopup.openScanPopup(this.businessType);
}
-
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();