Browse Source

修改直接发料和直接补料

lijuncheng0816
niexiting 1 month ago
parent
commit
fd44a8f5ae
  1. 8
      .env.development
  2. 78
      src/mycomponents/scan/winComScanBalance.vue
  3. 2
      src/pages.json
  4. 53
      src/pages/issue/record/directIssue.vue
  5. 133
      src/pages/repleinsh/record/directRepleinshRecord.vue

8
.env.development

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

78
src/mycomponents/scan/winComScanBalance.vue

@ -34,7 +34,8 @@
import { import {
getBalanceByParams, getBalanceByParams,
getBasicItemByCode getBasicItemByCode,
getBalanceByFilter
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -91,6 +92,8 @@
fromLocation: '', fromLocation: '',
fromLocationList: [], fromLocationList: [],
fromLocationAreaTypeList: [], fromLocationAreaTypeList: [],
toLocationAreaTypeList: [],
locationOnFocus: false, locationOnFocus: false,
businessType: {}, businessType: {},
inventoryStatus: [], inventoryStatus: [],
@ -109,9 +112,9 @@
this.businessType = businessType this.businessType = businessType
this.fromInventoryStatuses = getDirectoryItemArray(businessType.outInventoryStatuses) this.fromInventoryStatuses = getDirectoryItemArray(businessType.outInventoryStatuses)
this.fromLocationAreaTypeList = getDirectoryItemArray(businessType.outAreaTypes) this.fromLocationAreaTypeList = getDirectoryItemArray(businessType.outAreaTypes)
this.toLocationAreaTypeList = getDirectoryItemArray(businessType.inAreaTypes)
this.itemTypesList = getDirectoryItemArray(businessType.itemTypes) this.itemTypesList = getDirectoryItemArray(businessType.itemTypes)
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
}, },
getScanResult(result) { getScanResult(result) {
@ -121,7 +124,68 @@
return; return;
} }
this.getItemCodeType(result.package.itemCode, callBack => { this.getItemCodeType(result.package.itemCode, callBack => {
this.queryBalance(this.resultData)
this.getToLocationBalance(this.resultData)
//this.queryBalance(this.resultData)
})
},
//
getToLocationBalance(result) {
uni.showLoading({
title: '查询中',
mask: true
})
var filters = []
if (result.package.parentNumber) {
var packingNumber = result.package.parentNumber + "," + result.package.number;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: result.package.packingNumber
})
}
filters.push({
column: "itemCode",
action: "==",
value: result.package.itemCode
})
filters.push({
column: "batch",
action: "==",
value: result.package.batch
})
filters.push({
column: "areaType",
action: "in",
value: this.toLocationAreaTypeList.join(',')
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
uni.hideLoading()
if (res.data.list.length > 0) {
this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额");
} else {
this.queryBalance(this.resultData);
}
// callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
}) })
}, },
@ -170,7 +234,7 @@
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}, },
getItemCodeType(itemCode, callBack) { getItemCodeType(itemCode, callBack) {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
@ -186,9 +250,7 @@
if (this.verifyCategory) { if (this.verifyCategory) {
if (result.category == 'LCJ' || result.category == 'BJ') { if (result.category == 'LCJ' || result.category == 'BJ') {
callBack() callBack()
} } else {
else
{
this.showErrorMessage("扫描物料的种类不是【量产件】或者【备件】") this.showErrorMessage("扫描物料的种类不是【量产件】或者【备件】")
} }
} else { } else {
@ -213,6 +275,7 @@
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
@ -222,6 +285,7 @@
} }
}); });
}, },
selectBalanceItem(item) { selectBalanceItem(item) {
this.resultData.balance = item this.resultData.balance = item
this.$emit("getBalance", this.resultData) this.$emit("getBalance", this.resultData)

2
src/pages.json

@ -686,7 +686,7 @@
{ {
"path": "pages/repleinsh/record/repleinshRecord", "path": "pages/repleinsh/record/repleinshRecord",
"style": { "style": {
"navigationBarTitleText": "补料记录", "navigationBarTitleText": "超市先进先出补料",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"titleNView": { "titleNView": {
"autoBackButton": "true" "autoBackButton": "true"

53
src/pages/issue/record/directIssue.vue

@ -135,7 +135,7 @@
}, },
onLoad(option) { onLoad(option) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.title title: option.title
}) })
this.clearData(); this.clearData();
getBusinessType(this.businessTypeCode, res => { getBusinessType(this.businessTypeCode, res => {
@ -229,7 +229,6 @@
this.resultData = result; this.resultData = result;
let packageInfo = result.package; let packageInfo = result.package;
this.getBalance(result.label, packageInfo, balances => { this.getBalance(result.label, packageInfo, balances => {
// //
let s = ''; let s = '';
if (!result.package.parentNumber) { if (!result.package.parentNumber) {
@ -260,8 +259,6 @@
let subParentPackitems = balances.list.filter(r => r.packingNumber == let subParentPackitems = balances.list.filter(r => r.packingNumber ==
packageInfo packageInfo
.parentNumber && r.locationCode == this.fromLocationCode) .parentNumber && r.locationCode == this.fromLocationCode)
// //
if (subPackitems.length == 0) { if (subPackitems.length == 0) {
// //
@ -289,32 +286,34 @@
.fromLocationCode) .fromLocationCode)
if (manyBlances.length > 0) { if (manyBlances.length > 0) {
locationCode = manyBlances[0].locationCode; locationCode = manyBlances[0].locationCode;
this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' +
locationCode +
'】已经有库存余额,请重新扫描')
} else {
this.afterGetBalance(result);
} }
} }
this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' +
locationCode +
'】已经有库存余额,请重新扫描')
} }
} }
} }
}) })
}, },
showBalanceSelect(items) { showBalanceSelect(items) {
this.$refs.balanceSelect.openPopup(items); this.$refs.balanceSelect.openPopup(items);
}, },
selectBalanceItem(balance) { selectBalanceItem(balance) {
this.resultData.balance =balance; this.resultData.balance = balance;
this.afterGetBalance(this.resultData); this.afterGetBalance(this.resultData);
}, },
afterGetBalance(result){ afterGetBalance(result) {
let balance = result.balance; let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
let packUnit = pack.packUnit; let packUnit = pack.packUnit;
let packQty =pack.packQty let packQty = pack.packQty
var item = this.detailSource.find(res => { var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode) {
return res return res
@ -324,17 +323,17 @@
this.fromWarehouseCode = balance.warehouseCode; this.fromWarehouseCode = balance.warehouseCode;
} }
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.parentNumber =pack.parentNumber; newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber =pack.number newDetail.packingNumber = pack.number
newDetail.packUnit =packUnit; newDetail.packUnit = packUnit;
newDetail.packQty=packQty; newDetail.packQty = packQty;
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == pack.number && if (r.packingNumber == pack.number &&
@ -345,13 +344,13 @@
} }
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber =pack.parentNumber; newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber =pack.number newDetail.packingNumber = pack.number
newDetail.packUnit =packUnit; newDetail.packUnit = packUnit;
newDetail.packQty=packQty; newDetail.packQty = packQty;
item.subList.push(newDetail); item.subList.push(newDetail);
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
} else { } else {
if (detail.scaned == true) { if (detail.scaned == true) {
this.showErrorMessage("箱码[" + detail.packingNumber + "]批次[" + balance.batch + "]已经在列表中") this.showErrorMessage("箱码[" + detail.packingNumber + "]批次[" + balance.batch + "]已经在列表中")
@ -710,7 +709,7 @@
this.fromWarehouseCode = ''; this.fromWarehouseCode = '';
this.toWarehouseCode = ''; this.toWarehouseCode = '';
this.detailSource = []; this.detailSource = [];
this.positionInfo= "请选择生产线"; this.positionInfo = "请选择生产线";
} }
} }
} }

133
src/pages/repleinsh/record/directRepleinshRecord.vue

@ -6,10 +6,11 @@
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header"> <view class="page-header">
<view class="header_item" style="font-size:35rpx; padding: 10rpx;" > <view class="header-view">
来源库位 : {{fromLocationCode}} <view class="header_item" style="font-size:35rpx; padding: 10rpx;">
来源库位 : {{fromLocationCode}}
</view>
</view> </view>
<u-line />
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
@ -17,11 +18,9 @@
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)" :isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowToLocation="false" :isShowToLocation="false" @updateData="updateData" @removePack="removePack">
@updateData="updateData" @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
@ -31,7 +30,8 @@
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" <requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :locationAreaTypeList="toLocationAreaTypeList"></requiredLocation> @getLocation='getToLocationCode' :locationAreaTypeList="toLocationAreaTypeList">
</requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -119,9 +119,9 @@
recommendLocationList: [], // recommendLocationList: [], //
fromWarehouseCode: '', // fromWarehouseCode: '', //
businessTypeCode: "Repleinment", businessTypeCode: "Repleinment",
toLocationCode:"", toLocationCode: "",
resultData:{}, resultData: {},
itemCode:"" itemCode: ""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -145,10 +145,10 @@
mounted() {}, mounted() {},
methods: { methods: {
getBusinessType(){ getBusinessType() {
getBusinessType(this.businessTypeCode, res => { getBusinessType(this.businessTypeCode, res => {
if (res.success) { if (res.success) {
this.businessType=res.businessType; this.businessType = res.businessType;
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses); this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
this.openScanPopup(); this.openScanPopup();
@ -159,7 +159,7 @@
}, },
getBalance(label, packageInfo, callback) { getBalance(label, packageInfo, callback) {
var filters = [] var filters = []
if (packageInfo.parentNumber) { if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber; var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({ filters.push({
@ -174,7 +174,7 @@
value: label.packingNumber value: label.packingNumber
}) })
} }
filters.push({ filters.push({
column: "itemCode", column: "itemCode",
action: "==", action: "==",
@ -185,7 +185,7 @@
action: "==", action: "==",
value: label.batch value: label.batch
}) })
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") { if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({ filters.push({
column: "inventoryStatus", column: "inventoryStatus",
@ -193,7 +193,7 @@
value: this.fromInventoryStatuses value: this.fromInventoryStatuses
}) })
} }
var params = { var params = {
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
@ -205,20 +205,23 @@
this.showErrorMessage(err.message); this.showErrorMessage(err.message);
}) })
}, },
getScanResult(result) { getScanResult(result) {
this.setData(result); this.setData(result);
}, },
setData(result) { setData(result) {
let balance = result.balance; let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
if(this.fromLocationCode&&this.fromLocationCode!=balance.locationCode){
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位["+this.fromLocationCode+"]没有库存余额")
if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this
.fromLocationCode + "]没有库存余额")
return; return;
} }
var item = this.detailSource.find(res => { var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode) {
return res return res
@ -234,17 +237,17 @@
} }
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.parentNumber =pack.parentNumber; newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber =pack.number newDetail.packingNumber = pack.number
newDetail.packUnit =pack.packUnit; newDetail.packUnit = pack.packUnit;
newDetail.packQty=pack.packQty; newDetail.packQty = pack.packQty;
if(balance.lableQty){ if (balance.lableQty) {
newDetail.handleQty =balance.lableQty newDetail.handleQty = balance.lableQty
} }
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
this.itemCode = balance.itemCode; this.itemCode = balance.itemCode;
this.fromLocationCode =balance.locationCode this.fromLocationCode = balance.locationCode
this.scanPopupGetFocus() this.scanPopupGetFocus()
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
@ -257,12 +260,12 @@
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber =pack.parentNumber; newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber =pack.number newDetail.packingNumber = pack.number
newDetail.packUnit =pack.packUnit; newDetail.packUnit = pack.packUnit;
newDetail.packQty=pack.packQty; newDetail.packQty = pack.packQty;
if(balance.lableQty){ if (balance.lableQty) {
newDetail.handleQty =balance.lableQty newDetail.handleQty = balance.lableQty
} }
item.subList.push(newDetail); item.subList.push(newDetail);
this.scanPopupGetFocus() this.scanPopupGetFocus()
@ -274,8 +277,8 @@
} }
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
@ -295,7 +298,7 @@
} }
} }
this.$forceUpdate(); this.$forceUpdate();
}, },
removeItem(index, item) { removeItem(index, item) {
@ -314,9 +317,9 @@
}, },
openScanPopup() { openScanPopup() {
if(this.businessType){ if (this.businessType) {
this.$refs.scanPopup.openScanPopup(this.businessType); this.$refs.scanPopup.openScanPopup(this.businessType);
}else { } else {
this.getBusinessType() this.getBusinessType()
} }
}, },
@ -339,18 +342,18 @@
}, },
commit() { commit() {
if(this.toLocationCode==""){ if (this.toLocationCode == "") {
this.showMessage("请输入目标库位") this.showMessage("请输入目标库位")
return; return;
} }
this.detailSource.forEach(item=>{ this.detailSource.forEach(item => {
item.subList.forEach(detail=>{ item.subList.forEach(detail => {
detail.toLocationCode=this.toLocationCode detail.toLocationCode = this.toLocationCode
detail.fromLocation =this.fromLocationCode detail.fromLocation = this.fromLocationCode
}) })
}) })
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -408,25 +411,23 @@
// detail.toLocationCode = detail.toLocationCode // detail.toLocationCode = detail.toLocationCode
submitItem.qty = detail.handleQty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
submitItem.recordList=[ submitItem.recordList = [{
{ toInventoryStatus: detail.inventoryStatus,
toInventoryStatus:detail.inventoryStatus, fromPackingNumber: info.packingNumber,
fromPackingNumber:info.packingNumber, fromParentPackingNumber: detail.parentNumber,
fromParentPackingNumber: detail.parentNumber, fromBatch: info.batch,
fromBatch:info.batch,
toPackingNumber: info.packingNumber,
toPackingNumber:info.packingNumber,
toBatch: info.batch,
toBatch:info.batch, fromLocationCode: detail.locationCode,
fromLocationCode:detail.locationCode, toLocationCode: detail.toLocationCode,
toLocationCode:detail.toLocationCode, handleQty: detail.handleQty,
handleQty:detail.handleQty, fromPackUnit: detail.packUnit,
fromPackUnit:detail.packUnit, toPackUnit: detail.packUnit,
toPackUnit:detail.packUnit, fromPackQty: detail.packQty,
fromPackQty:detail.packQty, toPackQty: detail.packQty
toPackQty:detail.packQty }]
}
]
subList.push(submitItem) subList.push(submitItem)
} }
}) })
@ -480,7 +481,7 @@
this.toWarehouseCode = ''; this.toWarehouseCode = '';
this.detailSource = []; this.detailSource = [];
this.toLocationCode = ""; this.toLocationCode = "";
this.itemCode="" this.itemCode = ""
} }
} }
} }

Loading…
Cancel
Save