Browse Source

修改直接补料

wms3.0_pda
Niext 9 months ago
parent
commit
6e8c65b52b
  1. 3
      mycomponents/record/recordComDetailCard.vue
  2. 1
      mycomponents/scan/winScanItem.vue
  3. 7
      pages/issue/record/issueRecord.vue
  4. 281
      pages/repleinsh/coms/comRepleinshRequestPopup.vue
  5. 233
      pages/repleinsh/record/repleinshRecord.vue

3
mycomponents/record/recordComDetailCard.vue

@ -16,7 +16,7 @@
<uni-swipe-action-item @click="swipeClick($event,detail,index)"
:right-options="detail.scaned?scanOptions:detailOptions">
<balance :dataContent="detail" :isShowStdPack="false" :isShowStatus="true"
:isShowPack="true" :isShowLocation="isShowLocation" :isShowToLocation="true"></balance>
:isShowPack="true" :isShowLocation="isShowLocation"></balance>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
@ -85,6 +85,7 @@
watch: {
dataContent: {
handler(newName, oldName) {
debugger;
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
this.$nextTick(res => {

1
mycomponents/scan/winScanItem.vue

@ -32,6 +32,7 @@
components: {
winComScan
},
emits: ["getScanCode"],
props: {
title: {
type: String,

7
pages/issue/record/issueRecord.vue

@ -132,13 +132,12 @@
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
@ -168,8 +167,8 @@
r.toLocationCode = item.rawLocationCode;
r.productionLineCode = item.productionLineCode;
r.workStationCode = item.workStationCode;
r.itemCode = item.itemCode;
r.uom = item.uom;
// r.itemCode = item.itemCode;
// r.uom = item.uom;
that.subList.push(r);
})
that.detailSource = getDataSource(that.detailSource, that.subList)

281
pages/repleinsh/coms/comRepleinshRequestPopup.vue

@ -0,0 +1,281 @@
<template>
<view class="">
<uni-popup ref="popup" :maskClick="false">
<view class="uni-flex uni-column pop_customer">
<view class="" style="padding:10rpx">
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx">
<view class="" style="font-size: 35rpx;">
{{title}}
</view>
<image style="width: 35rpx;height: 35rpx;" src="/static/icons/icons_close.svg"
@click="closeRequestPopup()"></image>
</view>
<u-line />
<view class="uni-flex uni-column" style="background-color: white; ">
<view class="uni-flex uni-column ">
<view class="uni-flex uni-row padding title u-col-center">
<text style="width: 80px;">目标库位</text>
<view class="" style="width: 70% ;">
{{toLocationCode}}
</view>
<view class="">
<image src="/static/search.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;"
@click="locationCodeClick">
</image>
</view>
</view>
<u-line />
<view class="title padding" style="display: flex;">
<text style=" flex-shrink: 0;">物料</text>
<view class="" style="width: 100% ;">
{{itemCode}}
</view>
<view class="">
<image src="/static/search.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="itemCodeClick">
</image>
</view>
</view>
<u-line />
<view class="uni-flex uni-row padding title u-col-center">
<text>数量 </text>
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'>
</uni-number-box>
<uom :uom="uom"></uom>
</view>
</view>
<u-line />
</view>
</view>
</view>
<view class="uni-flex uni-row hide_border">
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" @click="cancel()">取消</button>
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button>
</view>
</view>
</uni-popup>
<win-scan-item ref="scanPopup" title='物料代码' @getScanCode='getScanCode'>
</win-scan-item>
<win-scan-location ref="scanLocationPopup" title='目标库位' @getLocation='getLocationCode'
:locationTypeList="toLocationTypeList">
</win-scan-location>
<comMessage ref="comMessage">
</comMessage>
</view>
</template>
<script>
import {
getBasicLocationByCode,
getBasicItemByCode,
getProductionlineItem,
getWorkShopLineStation
} from '@/api/request2.js';
import {
getLocationTypeName,
getListLocationTypeDesc,
checkDirectoryItemExist
} from '@/common/directory.js';
import uom from '@/mycomponents/qty/uom.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanItem from '@/mycomponents/scan/winScanItem.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
export default {
components: {
uom,
balanceStatus,
comMessage,
winScanItem,
winScanLocation
},
data() {
return {
itemCode: '请扫描物料信息',
toLocation: {},
toLocationCode: '请扫目标库位',
itemName: "",
qty: 0,
rawLocationCode: "",
fgLocationCode: "",
itemCodeFocus: false,
isCheckItemCode: false,
counQty: 0,
editPosition: true,
numberFocus: false,
uom: "",
positionInfo: "请选择位置",
show: false,
isModifiedPosition: true,
positionList: [],
}
},
props: {
title: {
type: String,
default: '补料需求信息'
},
toLocationTypeList: {
type: Array,
default: []
},
},
mounted() {
},
methods: {
openRequestPopup(editPosition) {
// this.editPosition = editPosition;
// if (this.isModifiedPosition) {
// this.isModifiedPosition = false
// } else {
// this.itemCode = "";
// this.uom = ""
// this.qty = 0
// this.itemCodeGetFocus();
// }
this.$refs.popup.open('bottom');
this.showScanLocation();
},
closeRequestPopup() {
this.$refs.popup.close()
},
locationCodeClick() {
this.showScanLocation();
},
showScanLocation() {
this.$nextTick(() => {
this.$refs.scanLocationPopup.openScanPopup();
})
},
itemCodeClick() {
this.$refs.scanPopup.openScanPopup();
},
showScanItem() {
this.$nextTick(() => {
this.$refs.scanPopup.openScanPopup();
})
},
itemCodeGetFocus() {
this.itemCodeFocus = true;
},
itemCodeLoseFocus() {
this.itemCodeFocus = false;
},
selectedItem(item) {
this.itemCode = item.itemCode;
this.checkItemCode();
},
confirm() {
if (this.itemCode == "" || !this.isCheckItemCode) {
this.showErrorMessage("请输入物料", "itemCode")
return
}
if (this.qty == 0) {
this.showErrorMessage("数量必须大于0")
return
}
this.callback('add');
},
checkItemCode(itemCode) {
//
getBasicItemByCode(itemCode).then(res => {
uni.hideLoading();
this.$refs.scanPopup.closeScanPopup();
if (res.data != null && res.data.list.length > 0) {
this.itemCode = res.data.list[0].code;
this.itemName = res.data.list[0].name
this.isCheckItemCode = true;
this.numberFocus = true
this.uom = res.data.list[0].uom
} else {
this.showErrorMessage('未查找到物料【' + itemCode + '】', "itemCode");
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error, "itemCode");
})
},
callback(action) {
let item = {
toLocation: this.toLocation,
itemCode: this.itemCode,
itemName: this.itemName,
uom: this.uom,
qty: this.qty
};
this.closeRequestPopup();
this.$emit("confirm", action, item);
},
change(value) {
this.qty = value;
},
cancel(e) {
this.closeRequestPopup();
},
getScanCode(code) {
if (code == "") {
this.showErrorMessage('物料号不能为空')
return;
}
this.itemCode = "";
this.checkItemCode(code)
},
getLocationCode(location, code) {
if (location != null) {
this.toLocation = location;
this.toLocationCode = code;
this.showScanItem();
}
},
showErrorMessage(message, type) {
setTimeout(r => {
this.$refs.comMessage.showErrorMessage(message, res => {
if (type == "itemCode") {
this.itemCodeGetFocus();
} else {
this.numberFocus = true;
}
})
if (type == "itemCode") {
this.itemCode = ""
this.isCheckItemCode = false;
}
})
},
}
}
</script>
<style lang="scss">
.title {
font-size: 30rpx;
}
</style>

233
pages/repleinsh/record/repleinshRecord.vue

@ -6,20 +6,20 @@
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="detail-list" v-for="(toLocation, index) in detailSource" :key="index">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</record-com-detail-card>
<view class="page-header">
<view class="text_lightblue fontsize-16">目标库位:{{toLocation.toLocationCode}}</view>
</view>
<com-issue-detail-card ref='comRepleinshDetailCard' :dataContent="toLocation"
@updateData='updateData'>
</com-issue-detail-card>
</view>
<u-line />
<!-- <u-line /> -->
</view>
</scroll-view>
</view>
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
@ -32,17 +32,21 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<com-repleinsh-request-popup ref="comRepleinshRequestPopup" :toLocationTypeList="tolocationTypeList"
@confirm='requestConfirm'>
</com-repleinsh-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>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
</view>
</template>
<script>
import {
repleinshRequestSubmit,
repleinshRecordSubmit
repleinshRecordSubmit,
getBalanceByBatchOffShelf
} from '@/api/request2.js';
import {
@ -69,6 +73,10 @@
calcHandleQty
} from '@/common/record.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
@ -77,6 +85,9 @@
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import comRepleinshRequestPopup from '@/pages/repleinsh/coms/comRepleinshRequestPopup.vue'
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
export default {
components: {
@ -87,7 +98,10 @@
winScanLocation,
comMessage,
winScanPackAndLocation,
recordComDetailCard
recordComDetailCard,
comRepleinshRequestPopup,
comIssueDetailCard,
comScanIssuePack
},
data() {
return {
@ -113,23 +127,19 @@
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {},
fromType: ""
fromType: "",
requestList: [],
};
},
onLoad(option) {
this.fromType = option.fromType
if (this.fromType == "requestType") {
updateTitle("补料申请")
} else {
updateTitle("补料记录")
}
var typeCode = "Repleinment"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
this.showRequestPopup();
} else {
this.showErrorMessage(res.message)
}
@ -148,40 +158,129 @@
mounted() {},
methods: {
getScanResult(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
closeScan() {
this.resizeCollapse();
},
resizeCollapse() {
this.$nextTick(r => {
this.$refs.comRepleinshDetailCard.forEach(r => {
r.resizeCollapse();
})
});
},
showRequestPopup() {
this.$refs.comRepleinshRequestPopup.openRequestPopup();
},
//
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 {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
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);
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail);
});
}
},
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 (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
if (res.data.length > 0) {
res.data.forEach(r => {
r.toLocationCode = item.toLocation.code;
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 += res.qty
})
this.detailSource.totalQty = totalQty;
},
openScanDetailPopup() {
var datacontent = {}
//
// Object.assign(datacontent, this.detailSource);
var dataContent = {
allowModifyPackingNumber: "FALSE",
outInventoryStatuses: this.fromInventoryStatuses
}
this.calcHandleQty();
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 += Number(res.qty)
})
batch.handleQty = handleQty;
itemHandleQty += handleQty;
}
})
}
this.resizeCollapse();
// item.handleQty=itemHandleQty;
// this.closeScan();
},
showErrorMessage(message) {
@ -191,6 +290,7 @@
}
});
},
calcHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
@ -204,9 +304,8 @@
},
updateData() {
this.calcHandleQty();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
@ -222,18 +321,16 @@
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
})
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
@ -260,8 +357,6 @@
mask: true
});
if (this.fromType == "requestType") {
var params = this.setRequestParams();
console.log("提交" + JSON.stringify(params))
@ -361,7 +456,7 @@
this.scanPopupGetFocus();
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
this.getToLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationInfo = location;
@ -369,13 +464,13 @@
this.openScanPopup();
},
getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
// if (this.fromLocationCode == code) {
// uni.showToast({
// title: "[" + this.fromLocationCode + "][" + code + "]",
// duration: 2000
// })
// return
// }
this.ToLocationCodeInfo = location;
this.toLocationCode = code;
},
@ -387,15 +482,7 @@
})
},
updateData() {
this.calcHandleQty();
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
}
}
}
</script>

Loading…
Cancel
Save