Browse Source

修改直接补料

wms3.0_pda
Niext 11 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. 229
      pages/repleinsh/record/repleinshRecord.vue

3
mycomponents/record/recordComDetailCard.vue

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

1
mycomponents/scan/winScanItem.vue

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

7
pages/issue/record/issueRecord.vue

@ -132,13 +132,12 @@
let request = that.requestList.find(r => r.itemCode == item.itemCode); let request = that.requestList.find(r => r.itemCode == item.itemCode);
if (request == undefined) { if (request == undefined) {
that.requestList.push(item); that.requestList.push(item);
this.getRecommendInfo(item); this.getRecommendInfo(item);
} else { } else {
this.$refs.comMessage.showQuestionMessage('已经存在零件[' + item.itemCode + ']的需求信息,是否要修改?', res => { this.$refs.comMessage.showQuestionMessage('已经存在零件[' + item.itemCode + ']的需求信息,是否要修改?', res => {
if (res) { if (res) {
request.qty = item.qty;
that.detailSource.forEach(detail => { that.detailSource.forEach(detail => {
let index = detail.Items.findIndex(r => { let index = detail.Items.findIndex(r => {
r.itemCode == item.itemCode r.itemCode == item.itemCode
@ -168,8 +167,8 @@
r.toLocationCode = item.rawLocationCode; r.toLocationCode = item.rawLocationCode;
r.productionLineCode = item.productionLineCode; r.productionLineCode = item.productionLineCode;
r.workStationCode = item.workStationCode; r.workStationCode = item.workStationCode;
r.itemCode = item.itemCode; // r.itemCode = item.itemCode;
r.uom = item.uom; // r.uom = item.uom;
that.subList.push(r); that.subList.push(r);
}) })
that.detailSource = getDataSource(that.detailSource, that.subList) 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>

229
pages/repleinsh/record/repleinshRecord.vue

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

Loading…
Cancel
Save