Compare commits

...

4 Commits

  1. 8
      .env.development
  2. 145
      src/pages/issue/coms/comScanIssuePack.vue
  3. 3
      src/pages/repleinsh/coms/comRepleishDetailCard.vue
  4. 332
      src/pages/repleinsh/coms/comScanReplishPack.vue
  5. 43
      src/pages/repleinsh/job/repleinshDetail.vue
  6. 5
      src/pages/repleinsh/job/repleinshJob.vue

8
.env.development

@ -1,11 +1,11 @@
VITE_BASE_URL=http://172.22.32.9:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api
VITE_BASE_URL=http://172.21.32.14:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api
# 租户配置
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'
VITE_TENANT='[{"text":"长春1379","value":1}]'
# 是否是测试环境
VITE_isDevelopment=true
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.22.32.9:90'
VITE_JMREPORT_BASE_URL='http://172.21.32.14:90'

145
src/pages/issue/coms/comScanIssuePack.vue

@ -35,7 +35,7 @@
</view> -->
<!-- <u-line class='line_color'></u-line> -->
<view class="uni-flex uni-row" style="align-items: center;
<!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
@ -49,7 +49,7 @@
placeholder="请选择库位" @confirm="fromLocationUpdate"
:inputStyle="inputStyleObject"></uni-combox>
</view>
</view>
</view> -->
<view class="">
<view class="">
@ -231,7 +231,7 @@
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList();
// that.fromLocationList = that.getFromLocationList();
}
},
@ -239,23 +239,23 @@
this.$refs.balanceSelect.openPopup(items);
},
getFromLocationList() {
let list = [];
this.dataContent.forEach(location => {
location.Items.forEach(item => {
item.Locations.forEach(f => {
let item = list.find(l => l == f.fromLocationCode);
if (item == undefined) {
list.push(f.fromLocationCode)
}
})
})
});
//
list = uniqueArray(list);
this.fromLocationCode = list[0];
return list;
},
// getFromLocationList() {
// let list = [];
// this.dataContent.forEach(location => {
// location.Items.forEach(item => {
// item.Locations.forEach(f => {
// let item = list.find(l => l == f.fromLocationCode);
// if (item == undefined) {
// list.push(f.fromLocationCode)
// }
// })
// })
// });
// //
// list = uniqueArray(list);
// this.fromLocationCode = list[0];
// return list;
// },
fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation)
@ -268,12 +268,12 @@
onScanResult(result) {
try {
let that = this;
if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus();
});
return;
}
// if (that.fromLocationCode == '') {
// that.showErrorMessage('', res => {
// that.$refs.toLocationCombox.onFocus();
// });
// return;
// }
let packageInfo = result.package;
let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber;
@ -287,7 +287,7 @@
)
return;
} else {
var params = {
itemCode: result.package.itemCode,
batch: result.label.batch,
@ -318,9 +318,7 @@
if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.handleQty = Number(result.label.qty)
}
else
{
} else {
result.balance.handleQty = Number(result.balance.qty)
}
this.afterGetBalance(result.label, result.balance, result.package);
@ -502,62 +500,7 @@
}
}
},
onScanResult1(result) {
try {
let that = this;
if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus();
});
return;
}
that.label = result.label;
that.packageInfo = result.package;
// let packageInfo = result.package;
let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber;
let lot = result.label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) {
that.showErrorMessage('未查找到物料【' + itemCode + '】的发料明细',
res => {
that.getfocus();
}
)
return;
} else {
//
uni.showLoading({
title: '加载中',
mask: true
})
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
balanceRes => {
if (balanceRes.success) {
if (balanceRes.data.list.length == 0) {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录',
res => {
this.packGetFocus();
})
} else if (balanceRes.data.list.length == 1) {
let balance = balanceRes.data.list[0];
this.afterGetBalance(result.label, balance, that.packageInfo);
} else {
this.showBalanceSelect(balanceRes.data.list);
}
} else {
this.showErrorMessage(balanceRes.message.message);
}
uni.hideLoading();
});
}
} catch (e) {
this.showErrorMessage(e.stack)
uni.hideLoading();
}
},
selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo);
},
@ -569,6 +512,7 @@
let packingCode = label.packingNumber;
let lot = label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
if (fromLocation != undefined) {
let batch = fromLocation.Batchs.find(r => r.batch == lot);
@ -580,7 +524,7 @@
let record = batch.Records.find(r => r.packingNumber == packingCode);
if (record == undefined) {
//
if ( batch.Recommends !=undefined && batch.Recommends.length > 0) {
if (batch.Recommends != undefined && batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) {
that.addRecord(batch, label, balance, packageInfo)
@ -631,11 +575,8 @@
}
}
} else {
that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发料明细',
res => {
that.getfocus();
}
)
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
}
} catch (e) {
that.showErrorMessage(e.stack,
@ -646,6 +587,22 @@
}
},
//
createLocationInfo(label, balance, packageInfo) {
let location = {
fromLocationCode: balance.locationCode,
qty: balance.qty,
uom: balance.uom,
handleQty: 0,
Batchs: []
}
let batch = this.createBatchInfo(label, balance, packageInfo);
batch.detail = balance;
location.Batchs.push(batch);
return location;
},
createBatchInfo(data, balance, packageInfo) {
let batch = {
batch: data.batch,
@ -672,7 +629,7 @@
// qty: Number(balance.qty),
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
qty: balance.handleQty,
handleQty:balance.handleQty,
handleQty: balance.handleQty,
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,
balance: balance,
@ -681,7 +638,7 @@
packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty
}
return record;
},

3
src/pages/repleinsh/coms/comRepleishDetailCard.vue

@ -35,7 +35,8 @@
<text class="card_content ">{{record.parentPackingNumber}}</text>
</view> -->
<handle-balance :detail="record" :isShowLocation="false"
:isShowBatch="batch.packingNumber!=null" :isShowStatus='true'>
:isShowStatus='true'>
<!-- :isShowBatch="batch.packingNumber!=null" -->
</handle-balance>
</uni-swipe-action-item>
</uni-swipe-action>

332
src/pages/repleinsh/coms/comScanReplishPack.vue

@ -8,7 +8,7 @@
<text class="fr" @click="closeScanPopup()">关闭</text>
</view>
<view class="uni-flex uni-row" style="align-items: center;
<!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
@ -21,7 +21,7 @@
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位"
@confirm="fromLocationUpdate"></uni-combox>
</view>
</view>
</view> -->
<view class="">
<view class="">
@ -83,13 +83,14 @@
} from '@/common/array.js';
import {
getWorkShopLineStation,
getBalanceByFilter
getBalanceByFilter,
getBalanceByParams
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
uniqueArray
} from '@/common/basic.js';
@ -100,8 +101,8 @@
import {
getDirectoryItemArray
} from '../../../common/directory.js';
import {
getLabelInfo
} from '@/common/label.js';
@ -162,8 +163,8 @@
this.$refs.popup.open('bottom')
}, 500)
},
openScanPopupForJobSimulate(content, jobcontent,scanMessage) {
openScanPopupForJobSimulate(content, jobcontent, scanMessage) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
@ -174,7 +175,7 @@
} else {
this.showErrorMessage(callback.message)
}
})
},
@ -192,7 +193,7 @@
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList();
// that.fromLocationList = that.getFromLocationList();
}
},
@ -200,26 +201,26 @@
this.$refs.balanceSelect.openPopup(items);
},
getFromLocationList() {
let list = [];
let location = this.dataContent.find(r => r.toLocationCode == this.toLocationCode);
if (location != undefined) {
location.Items.forEach(item => {
item.Locations.forEach(f => {
list.push(f.fromLocationCode)
})
})
//
list = uniqueArray(list);
this.fromLocationCode = list[0];
return list;
} else {
this.$refs.comMessage.showErrorMessages('需求库位【' + this.toLocationCode + '】不存在', res => {
this.toLocationCode = '';
});
}
},
// getFromLocationList() {
// let list = [];
// let location = this.dataContent.find(r => r.toLocationCode == this.toLocationCode);
// if (location != undefined) {
// location.Items.forEach(item => {
// item.Locations.forEach(f => {
// list.push(f.fromLocationCode)
// })
// })
// //
// list = uniqueArray(list);
// this.fromLocationCode = list[0];
// return list;
// } else {
// this.$refs.comMessage.showErrorMessages('' + this.toLocationCode + '', res => {
// this.toLocationCode = '';
// });
// }
// },
fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation)
@ -228,15 +229,44 @@
this.showErrorMessage('发料库位【' + fromlocation + '】不存在')
}
},
onScan(result) {
if (!result.package) {
this.showErrorMessage('扫描数据错误[' + result.label.code + "]",
res => {
this.getfocus();
}
)
return;
}
if (this.toLocation && result.package.packUnit) {
let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode);
if (!item) {
this.showErrorMessage('扫描物料代码不属于该任务');
return
}
if (result.package.packUnit !== item.packUnit) {
this.$refs.comMessage.showQuestionMessage(
`扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?`, res => {
if (res) {
this.onScanResult(result)
}
});
} else {
this.onScanResult(result)
}
}
},
onScanResult(result) {
try {
let that = this;
if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus();
});
return;
}
// if (that.fromLocationCode == '') {
// that.showErrorMessage('', res => {
// that.$refs.toLocationCombox.onFocus();
// });
// return;
// }
let packageInfo = result.package;
let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber;
@ -250,115 +280,50 @@
)
return;
} else {
//
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: '加载中',
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('未查找到该包装的库存信息,请重新扫描')
getBalanceByParams(params).then(res => {
if (res.data.length == 0) {
var status = getInventoryStatusDesc(params.inventoryStatus)
var areaType = getListLocationAreaTypeDesc(params.areaType)
var hint =
"按物料号 [" + params.itemCode + "] <br>" +
"包装号 [" + params.packingNumber + "] <br>" +
"批次 [" + params.batch + "] <br>" +
"状态 [" + status + "] <br>" +
"库区 [" + areaType + "] <br>" +
"未查找到库存余额"
this.showErrorMessage(hint)
} else if (res.data.length == 1) {
result.balance = res.data[0]
if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.handleQty = Number(result.label.qty)
} 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);
}
result.balance.handleQty = Number(result.balance.qty)
}
this.afterGetBalance(result.label, result.balance, result.package);
} 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 {
// }
}
//
this.$refs.balanceSelect.openPopup(res.data);
}
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.afterGetBalance(result.label, balance, packageInfo);
// } else {
// this.showBalanceSelect(balanceRes.data.list);
// }
// } else {
// this.showErrorMessage(balanceRes.message.message);
// }
// uni.hideLoading();
// });
uni.hideLoading()
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
}
} catch (e) {
this.showErrorMessage(e.stack)
@ -366,55 +331,6 @@
}
},
getBalance(label, packageInfo, callback) {
var filters = []
if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({
column: "itemCode",
action: "==",
value: label.itemCode
})
filters.push({
column: "batch",
action: "==",
value: label.batch
})
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.fromInventoryStatuses
})
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
})
},
selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo);
},
@ -426,7 +342,10 @@
let packingCode = label.packingNumber;
let lot = label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
//
if (fromLocation != undefined) {
let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) {
@ -483,11 +402,8 @@
}
}
} else {
that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发料明细',
res => {
that.getfocus();
}
)
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
}
} catch (e) {
this.showErrorMessage(e.stack,
@ -498,20 +414,34 @@
}
},
//
createLocationInfo(label, balance, packageInfo) {
let location = {
fromLocationCode: balance.locationCode,
qty: balance.qty,
uom: balance.uom,
handleQty: 0,
Batchs: []
}
let batch = this.createBatchInfo(label, balance, packageInfo);
batch.detail = balance;
location.Batchs.push(batch);
return location;
},
createBatchInfo(label, balance, packageInfo) {
let batch = {
batch: label.batch,
qty: 0,
uom: label.uom,
Records: []
}
let record = {}
if (balance == null) {
record = this.creatRecordByBalance(label, packageInfo);
if (balance != null) {
record = this.creatRecordByBalance(balance, packageInfo);
batch.handleQty = Number(label.qty)
} else {
record = this.creatRecordByLabel(balance, packageInfo);
record = this.creatRecordByLabel(label, packageInfo);
batch.handleQty = Number(balance.qty)
}
@ -535,7 +465,7 @@
toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode,
packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty
packQty: packageInfo.packQty,
}
return record;
},
@ -659,16 +589,16 @@
},
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 => {

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

@ -196,9 +196,9 @@
.jobContent, that.scanMessage);
}
let timer = setTimeout(r => {
let timer = setTimeout(r => {
that.resizeCollapse();
if(timer){
if (timer) {
timer = null
clearTimeout(timer)
}
@ -278,7 +278,7 @@
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
return;
repleinshJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
@ -333,43 +333,6 @@
record.toPackUnit = r.packUnit;
record.toBatch = r.batch;
// if (r.parentPackingNumber != '' && r
// .parentPackingNumber != null) {
// record.fromPackingNumber = r
// .parentPackingNumber;
// record.toPackingNumber = r
// .packingNumber;
// // record.fromPackUnit = r.packUnit;
// record.toPackUnit = r.packUnit;
// } else {
// record.fromPackingNumber = r
// .packingNumber;
// record.toPackingNumber = r
// .packingNumber;
// record.toPackUnit = r.packUnit;
// }
// record.toBatch = r.batch;
// //使
// 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);
})
commitSubList.push(deepCopyData(subItem));

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

@ -548,8 +548,9 @@
this.selectItem(list[0])
}
} else {
this.showMessage("物料号[" + result.label.itemCode + "]批次[" + result.label.batch +
']未查找到任务<br>' + "扫描[" + result.scanMessage + "]")
this.showMessage("按来源库位[" + balance.locationCode + "]批次[" + result.label.batch +
"]物料号[" + result.label.itemCode + "]未查找到任务<br>" + "扫描[" + result
.scanMessage + "]")
}
}).catch(error => {
this.showMessage(error + "<br>扫描[" + result.scanMessage + "]")

Loading…
Cancel
Save