25 changed files with 6107 additions and 697 deletions
@ -0,0 +1,122 @@ |
|||
<template> |
|||
<view class="container"> |
|||
<uni-popup ref="popup" :maskClick="true"> |
|||
<view class="" style="align-items: center;background-color: #fff; border-radius: 15rpx; margin: 50rpx;"> |
|||
<view class="uni-center popup-content" |
|||
style="font-weight: bold; font-size: 40rpx;padding-top: 20rpx; padding-bottom: 20rpx;"> |
|||
{{title}} |
|||
</view> |
|||
<view class="" style="background-color: black; height: 1rpx; "> |
|||
|
|||
</view> |
|||
<scroll-view scroll-y="" |
|||
style="background-color: #fff; align-items: center; border-radius: 10rpx; height: 600rpx; width: 100%"> |
|||
<view class="uni-flex " style="flex-direction: column; " v-for="(item,index) in dataList" :key="index"> |
|||
<view class="uni-flex " style="font-size: 38rpx; padding: 25rpx; flex-direction: row;" > |
|||
<view class="" style="font-size: 32rpx; font-weight: bold;"> |
|||
({{index+1}}). |
|||
</view> |
|||
<view class="" style="font-size: 32rpx;"> |
|||
<view class="" > |
|||
<text style="font-size: 32rpx; font-weight: bold;">物料代码 :</text> |
|||
{{item.itemCode}} |
|||
</view> |
|||
<view class=""> |
|||
<text style="font-size: 32rpx; font-weight: bold;">物料名称 : </text> |
|||
{{item.itemName}} |
|||
</view> |
|||
<view class=""> |
|||
<text style="font-size: 32rpx; font-weight: bold;">物料描述 : </text> |
|||
{{item.itemDesc1}} |
|||
</view> |
|||
<view class="" v-if="item.packingCode"> |
|||
<text style="font-size: 32rpx; font-weight: bold;"> 箱码 : </text> |
|||
{{item.packingCode}} |
|||
</view> |
|||
<view class="" v-if="item.lot"> |
|||
<text style="font-size: 32rpx; font-weight: bold;">批次 : </text> |
|||
{{item.lot}} |
|||
</view> |
|||
<view class="" > |
|||
<text style="font-size: 32rpx; font-weight: bold;">库位 : </text> |
|||
{{item.locationCode}} |
|||
</view> |
|||
<view class=""> |
|||
<text style="font-size: 32rpx; font-weight: bold;">数量 : </text> |
|||
{{item.qty}} |
|||
</view> |
|||
<view class=""> |
|||
<text style="font-size: 32rpx; font-weight: bold;">单位 : </text> |
|||
{{item.uom}} |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
<u-line></u-line> |
|||
</view> |
|||
|
|||
</scroll-view> |
|||
|
|||
</view> |
|||
|
|||
</uni-popup> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
props: { |
|||
title: { |
|||
type: String, |
|||
default: "" |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
dataList: [], |
|||
|
|||
} |
|||
}, |
|||
|
|||
|
|||
methods: { |
|||
openScanPopup(list) { |
|||
this.dataList = list; |
|||
this.$refs.popup.open('center') |
|||
}, |
|||
closeScanPopup() { |
|||
this.$refs.popup.close() |
|||
}, |
|||
select(item) { |
|||
this.closeScanPopup(); |
|||
this.$emit("select", item) |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.popup_box { |
|||
justify-content: center; |
|||
width: 100%; |
|||
margin-right: 50rpx; |
|||
padding-right: 50rpx; |
|||
height: 500rpx; |
|||
margin: 0 auto; |
|||
} |
|||
.container { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
height: 100%; /* 需要确保父容器有足够的高度 */ |
|||
} |
|||
.popup-content { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
/* 其他样式 */ |
|||
} |
|||
</style> |
@ -0,0 +1,286 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<win-blank-view @goScan='openScanPopup' v-if="itemList.length==0"></win-blank-view> |
|||
<view class="top_wrap" v-if="itemList.length>0"> |
|||
<view class="top_card"> |
|||
|
|||
<view class="device-detail"> |
|||
<view class="list-style nopad"> |
|||
<view class="ljh_box nopad"> |
|||
<view class="tit_ljh uni-flex"> |
|||
<text class="font_xl text_black text_bold">位置码 : {{dataContent.code}}</text> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
|
|||
<scroll-view scroll-y="true" @scroll="scroll" class="scroll-detail"> |
|||
|
|||
<view class="detail-list margin_top" v-for="(item, index) in itemList" :key="item.id"> |
|||
|
|||
|
|||
<view class="detail-content"> |
|||
<view class="choose_main"> |
|||
<view class="ljh_box"> |
|||
<view class="tit_ljh">{{ item.partCode }}</view> |
|||
<view class="ljh_left desc_ljh"> |
|||
<view class="font_xs text_lightblue">{{ item.partName }}</view> |
|||
<view class="font_xs text_lightblue">{{ item.partDesc }}</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="list_form"> |
|||
<view class="uni-container"> |
|||
<uni-table style="overflow-x: hidden;"> |
|||
<uni-tr> |
|||
<uni-th width="50">库位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.locationCode }}({{item.locationName}}) |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">数量</text></uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view |
|||
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> |
|||
<com-number-box :ref="'comNumberBox_'+index" v-model="item.qty" |
|||
:max="999999" :min="0" style='width: 100px;' |
|||
@change="qtyChanged($event,item,index)"> |
|||
</com-number-box> |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">单位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.basicUom }} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">标包数</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_black">{{item.stdPackQty }}</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
</uni-table> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="choose_marked" v-if="item.scaned"> |
|||
<image src="@/static/image_marked.svg"></image> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
|
|||
<div class="new_bot_box" v-show="itemList.length>0"> |
|||
<view class="new_btn_bot bot_pos uni-flex"> |
|||
<button class="new_clear_btn btn_double" @click="clear()">清空</button> |
|||
<button class="new_save_btn btn_double" @click="submit()">提交</button> |
|||
</view> |
|||
</div> |
|||
|
|||
<!-- <win-scan-button @goScan='openScanPopup' v-if="itemList.length>0"></win-scan-button> --> |
|||
<winScanByPosition ref="scanPopup" @getScanResult='getScanResult'></winScanByPosition> |
|||
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan' |
|||
@afterCloseCommitMessage='closeCommitMessage'> |
|||
</com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
assembleIssueRequest |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
showConfirmMsg, |
|||
goHome, |
|||
getRemoveOption, |
|||
getISODateTime |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winBlankView from '@/mycomponents/wincom/winBlankView.vue' |
|||
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winScanByPosition from '@/mycomponents/wincom/winScanByPosition.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
|||
|
|||
export default { |
|||
name: 'purchasePutaway', |
|||
components: { |
|||
winBlankView, |
|||
comMessage, |
|||
winScanButton, |
|||
winScanByPosition, |
|||
comNumberBox |
|||
}, |
|||
data() { |
|||
return { |
|||
itemList: [], |
|||
dataContent: {} |
|||
}; |
|||
}, |
|||
props: { |
|||
// locationTypes: { |
|||
// type: [Array, String, Number], |
|||
// value: '' |
|||
// }, |
|||
}, |
|||
|
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} else if (e.index === 1) { |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
mounted: function() { |
|||
this.options = getRemoveOption(); |
|||
this.openScanPopup(); |
|||
}, |
|||
|
|||
methods: { |
|||
openScanPopup() { |
|||
this.$refs.scanPopup.openScanPopup() |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
this.dataContent = result; |
|||
result.qty =result.stdPackQty; |
|||
this.itemList.push(result) |
|||
this.$forceUpdate() |
|||
|
|||
}, |
|||
|
|||
clear() { |
|||
this.itemList = []; |
|||
this.dataContent = {} |
|||
}, |
|||
|
|||
|
|||
submit() { |
|||
let that = this; |
|||
if (that.itemList.length === 0) { |
|||
that.showMessage('请扫描位置码'); |
|||
return; |
|||
} |
|||
|
|||
uni.showLoading({ |
|||
title: "提交中....", |
|||
mask: true |
|||
}); |
|||
var params = this.setParams(); |
|||
console.log(JSON.stringify(params)) |
|||
assembleIssueRequest(params).then(res => { |
|||
uni.hideLoading(); |
|||
this.showMessage("提交成功") |
|||
this.clear(); |
|||
}).catch(error => { |
|||
uni.hideLoading(); |
|||
this.showMessage(error.message); |
|||
}) |
|||
|
|||
}, |
|||
setParams() { |
|||
var param = { |
|||
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN, |
|||
remark: "", |
|||
extraProperties: {}, |
|||
activeDate: getISODateTime(), |
|||
autoSubmit: true, |
|||
autoAgree: false, |
|||
autoHandle: false, |
|||
autoCompleteJob: false, |
|||
directCreateNote: true, |
|||
issueRequestType: 4, |
|||
useOnTheWayLocation: false, |
|||
details: [] |
|||
} |
|||
|
|||
this.itemList.forEach(res => { |
|||
var data = { |
|||
remark: "", |
|||
qty:res.qty, |
|||
itemCode: res.partCode, |
|||
itemName: res.partName, |
|||
itemDesc1: res.itemDesc2, |
|||
uom: res.basicUom, |
|||
stdPackQty: res.stdPackQty, |
|||
toLocationCode: res.locationCode, |
|||
prodLine: null, |
|||
requestStatus: 1, |
|||
issuedQty: res.qty, |
|||
receivedQty: 0, |
|||
status: 1, |
|||
positionCode: this.dataContent.code, |
|||
recommendType: 0, |
|||
boxQty: res.qty |
|||
|
|||
} |
|||
param.details.push(data) |
|||
}) |
|||
return param; |
|||
|
|||
}, |
|||
|
|||
qtyChanged(value, item, index) { |
|||
if (value <= 0) { |
|||
this.showMessage('发料数量不能小于或等于0') |
|||
item.handledQty = item.defaultHandleQty |
|||
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|||
return; |
|||
} |
|||
// else if (value > item.defaultHandleQty) { |
|||
// item.handledQty = item.defaultHandleQty |
|||
// this.showMessage('发料数量不能大于库存数量:' + item.handledQty) |
|||
// this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|||
// } |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
showConfirmMessage(message) { |
|||
this.$refs.comMessage.showConfirmMessage(message); |
|||
}, |
|||
showCommitSuccess() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
showScanMessage(message) { |
|||
this.$refs.comMessage.showScanMessage(message); |
|||
}, |
|||
showRescanMessage(message) { |
|||
this.$refs.comMessage.showRescanMessage(message); |
|||
}, |
|||
|
|||
closeScanMessage() { |
|||
this.scanPopupGetFocus(); |
|||
}, |
|||
|
|||
closeCommitMessage() { |
|||
// this.openScanPopup(); |
|||
}, |
|||
|
|||
scanPopupGetFocus() { |
|||
this.$refs.scanPopup.getfocus(); |
|||
}, |
|||
|
|||
scanPopupLoseFocus(message) { |
|||
this.$refs.scanPopup.losefocus(); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,195 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<win-empty-view v-if="deliverList.length==0"></win-empty-view> |
|||
<view hover-class="uni-list-cell-hover" v-for="(item, index) in deliverList" :key="item.id" |
|||
@click="openDetail(item)"> |
|||
<comKittingRequestItem :dataContent="item" @handle="handle"> |
|||
</comKittingRequestItem> |
|||
<!-- <comInjectIssue :dataContent="item"></comInjectIssue> --> |
|||
</view> |
|||
<uni-load-more :status="loadingType" v-if="deliverList.length>0" /> |
|||
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'> |
|||
</win-mulit-scan> --> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
|
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getAssembleRequestList, |
|||
assembleRequestHandle, |
|||
getAssembleRequestJobByRequest, |
|||
isAssembleHasNewJob |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
goHome |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' |
|||
import comInjectIssue from '@/mycomponents/coms/task/comInjectIssue.vue'; |
|||
import comKittingRequestItem from '@/mycomponents/comRequest/comKittingRequestItem.vue'; |
|||
|
|||
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
|
|||
export default { |
|||
name: 'deliver', |
|||
components: { |
|||
winEmptyView, |
|||
winScanButton, |
|||
winMulitScan, |
|||
comInjectIssue, |
|||
comKittingRequestItem, |
|||
comMessage |
|||
}, |
|||
data() { |
|||
return { |
|||
deliverList: [], |
|||
reload: false, |
|||
status: '', |
|||
contentText: { |
|||
contentdown: '上拉加载更多', |
|||
contentrefresh: '加载中', |
|||
contentnomore: '没有更多' |
|||
}, |
|||
pageSize: this.modelConfig, |
|||
pageIndex: 1, |
|||
isTimeWindowSorting: false, |
|||
isToday: true, |
|||
titleArray: ['任务编号'], |
|||
loadingType: "nomore" |
|||
|
|||
}; |
|||
}, |
|||
props: { |
|||
datacontent: { |
|||
type: Object, |
|||
value: null |
|||
} |
|||
}, |
|||
onShow: function() { |
|||
this.getList('refresh'); |
|||
}, |
|||
onReachBottom() { |
|||
//避免多次触发 |
|||
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
|||
return; |
|||
} |
|||
this.getList("more"); |
|||
}, |
|||
onPullDownRefresh() { |
|||
this.getList('refresh'); |
|||
}, |
|||
//后退按钮 |
|||
onBackPress(options) { |
|||
if (options.from === 'navigateBack') { |
|||
return false; |
|||
} |
|||
goHome(); |
|||
return true; |
|||
}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
}else if(e.index === 1){ |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
methods: { |
|||
async handle(item){ |
|||
uni.showLoading({ |
|||
title:"提交中", |
|||
mask:true |
|||
}) |
|||
try{ |
|||
var jobList = await getAssembleRequestJobByRequest(item.number) |
|||
var handleResult = await assembleRequestHandle(item.id) |
|||
|
|||
var isHaveNewJobList=[]; |
|||
jobList.forEach(res=>{ |
|||
isHaveNewJobList.push(res.kittingRequestNumber); |
|||
}) |
|||
var isHaveNewJob = await isAssembleHasNewJob(isHaveNewJobList) |
|||
uni.hideLoading() |
|||
this.showMessage(isHaveNewJob) |
|||
}catch(error){ |
|||
uni.hideLoading() |
|||
this.showMessage(error) |
|||
} |
|||
|
|||
|
|||
}, |
|||
openScanPopup() { |
|||
this.$refs.scanPopup.openScanPopup(); |
|||
}, |
|||
//按时间窗口排序 |
|||
timeSortingChange: function(e) { |
|||
this.isTimeWindowSorting = e.detail.value |
|||
this.getList() |
|||
}, |
|||
|
|||
//只看当天到货 |
|||
isTodayChange: function(e) { |
|||
this.isToday = e.detail.value |
|||
this.getList() |
|||
}, |
|||
|
|||
//查询发货任务 |
|||
getList(type) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
this.loadingType = "loading"; |
|||
if (type === "refresh") { |
|||
this.pageIndex = 1; |
|||
this.deliverList = []; |
|||
} |
|||
getAssembleRequestList(that.pageIndex,that.pageSize,false) |
|||
.then(res => { |
|||
uni.hideLoading(); |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
var list = res.items; |
|||
this.loadingType = "loadmore"; |
|||
if (list == null || list.length == 0) { |
|||
//没数据了 |
|||
this.loadingType = "nomore"; |
|||
return; |
|||
} |
|||
// that.deliverList = [...that.deliverList, ...list]; |
|||
that.deliverList = type === "refresh" ? list : this.deliverList.concat(list); |
|||
that.pageIndex++; |
|||
}) |
|||
.catch(err => { |
|||
this.loadingType = ""; |
|||
this.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
openDetail(item) { |
|||
uni.navigateTo({ |
|||
url: './assembleIssueRequestListDetail?id=' + item.id + '&jobStatus=' + item.jobStatus |
|||
}); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,222 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<view class="top_card"> |
|||
<view class="top_wrap" v-if="details.length>0"> |
|||
<view class="top_card"> |
|||
|
|||
<view class="device-detail"> |
|||
<view class="list-style nopad"> |
|||
<view class="ljh_box nopad"> |
|||
<view class="tit_ljh uni-flex"> |
|||
<text class="font_xl text_black text_bold">位置码 : {{details[0].positionCode}}</text> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
|
|||
<scroll-view scroll-y="true" @scroll="scroll" class="scroll-detail"> |
|||
|
|||
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id"> |
|||
|
|||
|
|||
<view class="detail-content"> |
|||
<view class="choose_main"> |
|||
<view class="ljh_box"> |
|||
<view class="tit_ljh">{{ item.itemCode }}</view> |
|||
<view class="ljh_left desc_ljh"> |
|||
<view class="font_xs text_lightblue">{{ item.itemName }}</view> |
|||
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="list_form"> |
|||
<view class="uni-container"> |
|||
<uni-table style="overflow-x: hidden;"> |
|||
<uni-tr> |
|||
<uni-th width="70">库位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.toLocationCode }} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="70">叫料数量</text></uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode" |
|||
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> |
|||
{{item.issuedQty}} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="70">单位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.uom }} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="70">标包数</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_black">{{item.stdPackQty }}</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
</uni-table> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
|
|||
<div class="new_bot_box"> |
|||
<view class="new_btn_bot bot_pos uni-flex"> |
|||
<button class="new_save_btn " style="width: 100%;" @click="submit()">执行</button> |
|||
</view> |
|||
</div> |
|||
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getAssembleRequestDetail, |
|||
assembleRequestHandle, |
|||
getAssembleRequestJobByRequest, |
|||
isAssembleHasNewJob |
|||
} from '@/api/index.js'; |
|||
import { |
|||
showConfirmMsg, |
|||
goHome, |
|||
navigateBack |
|||
} from '@/common/basic.js'; |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue' |
|||
|
|||
export default { |
|||
components: { |
|||
comMessage, |
|||
comJobScanDetail, |
|||
}, |
|||
data() { |
|||
return { |
|||
id: "", |
|||
datacontent: {}, |
|||
details: [], |
|||
jobStatus: "", |
|||
} |
|||
}, |
|||
onLoad(param) { |
|||
this.id = param.id; |
|||
this.getDetail(); |
|||
}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} else if (e.index === 1) { |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
mounted() { |
|||
uni.setNavigationBarColor({ |
|||
frontColor: '#ffffff', |
|||
backgroundColor: "#5A7CF3 !important" |
|||
}) |
|||
}, |
|||
methods: { |
|||
|
|||
//加载零件信息 |
|||
getDetail() { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title:"加载中", |
|||
mask:false |
|||
}) |
|||
getAssembleRequestDetail(that.id) |
|||
.then(item => { |
|||
uni.hideLoading() |
|||
console.log('item', item); |
|||
that.datacontent = item; |
|||
that.jobStatus = item.jobStatus |
|||
that.details = item.details; |
|||
}) |
|||
.catch(err => { |
|||
uni.hideLoading() |
|||
this.showMessage('未查找到详细信息') |
|||
}); |
|||
}, |
|||
|
|||
|
|||
getScanCount() { |
|||
this.scanCount = this.datacontent.details.filter(r => r.scaned).length; |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
if (this.allCount == this.scanCount) { |
|||
this.$refs.scanPopup.closeScanPopup(); |
|||
} |
|||
}, |
|||
|
|||
|
|||
submit() { |
|||
showConfirmMsg("是否确认执行?", callback => { |
|||
if (callback) { |
|||
this.finsh(); |
|||
} |
|||
}) |
|||
|
|||
}, |
|||
|
|||
async finsh() { |
|||
uni.showLoading({ |
|||
title:"提交中", |
|||
mask:true |
|||
}) |
|||
try{ |
|||
var jobList = await getAssembleRequestJobByRequest(this.datacontent.number) |
|||
var handleResult = await assembleRequestHandle(this.datacontent.id) |
|||
|
|||
var isHaveNewJobList=[]; |
|||
jobList.forEach(res=>{ |
|||
isHaveNewJobList.push(res.assembleRequestNumber); |
|||
}) |
|||
var isHaveNewJob = await isAssembleHasNewJob(isHaveNewJobList) |
|||
uni.hideLoading() |
|||
this.showMessage(isHaveNewJob) |
|||
}catch(error){ |
|||
uni.hideLoading() |
|||
this.showMessage(error) |
|||
} |
|||
}, |
|||
|
|||
showCommitSuccessMessage() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
|
|||
closeCommitMessage() { |
|||
navigateBack(1); //点关闭直接返回列表 |
|||
uni.hideLoading(); |
|||
}, |
|||
|
|||
|
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,286 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<win-blank-view @goScan='openScanPopup' v-if="itemList.length==0"></win-blank-view> |
|||
<view class="top_wrap" v-if="itemList.length>0"> |
|||
<view class="top_card"> |
|||
|
|||
<view class="device-detail"> |
|||
<view class="list-style nopad"> |
|||
<view class="ljh_box nopad"> |
|||
<view class="tit_ljh uni-flex"> |
|||
<text class="font_xl text_black text_bold">位置码 : {{dataContent.code}}</text> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
|
|||
<scroll-view scroll-y="true" @scroll="scroll" class="scroll-detail"> |
|||
|
|||
<view class="detail-list margin_top" v-for="(item, index) in itemList" :key="item.id"> |
|||
|
|||
|
|||
<view class="detail-content"> |
|||
<view class="choose_main"> |
|||
<view class="ljh_box"> |
|||
<view class="tit_ljh">{{ item.partCode }}</view> |
|||
<view class="ljh_left desc_ljh"> |
|||
<view class="font_xs text_lightblue">{{ item.partName }}</view> |
|||
<view class="font_xs text_lightblue">{{ item.partDesc }}</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="list_form"> |
|||
<view class="uni-container"> |
|||
<uni-table style="overflow-x: hidden;"> |
|||
<uni-tr> |
|||
<uni-th width="50">库位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.locationCode }}({{item.locationName}}) |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">数量</text></uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view |
|||
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> |
|||
<com-number-box :ref="'comNumberBox_'+index" v-model="item.qty" |
|||
:max="999999" :min="0" style='width: 100px;' |
|||
@change="qtyChanged($event,item,index)"> |
|||
</com-number-box> |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">单位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.basicUom }} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">标包数</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_black">{{item.stdPackQty }}</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
</uni-table> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="choose_marked" v-if="item.scaned"> |
|||
<image src="@/static/image_marked.svg"></image> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
|
|||
<div class="new_bot_box" v-show="itemList.length>0"> |
|||
<view class="new_btn_bot bot_pos uni-flex"> |
|||
<button class="new_clear_btn btn_double" @click="clear()">清空</button> |
|||
<button class="new_save_btn btn_double" @click="submit()">提交</button> |
|||
</view> |
|||
</div> |
|||
|
|||
<!-- <win-scan-button @goScan='openScanPopup' v-if="itemList.length>0"></win-scan-button> --> |
|||
<winScanByPosition ref="scanPopup" @getScanResult='getScanResult'></winScanByPosition> |
|||
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan' |
|||
@afterCloseCommitMessage='closeCommitMessage'> |
|||
</com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
coatingIssueRequest |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
showConfirmMsg, |
|||
goHome, |
|||
getRemoveOption, |
|||
getISODateTime |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winBlankView from '@/mycomponents/wincom/winBlankView.vue' |
|||
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winScanByPosition from '@/mycomponents/wincom/winScanByPosition.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
|||
|
|||
export default { |
|||
name: 'purchasePutaway', |
|||
components: { |
|||
winBlankView, |
|||
comMessage, |
|||
winScanButton, |
|||
winScanByPosition, |
|||
comNumberBox |
|||
}, |
|||
data() { |
|||
return { |
|||
itemList: [], |
|||
dataContent: {} |
|||
}; |
|||
}, |
|||
props: { |
|||
// locationTypes: { |
|||
// type: [Array, String, Number], |
|||
// value: '' |
|||
// }, |
|||
}, |
|||
|
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} else if (e.index === 1) { |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
mounted: function() { |
|||
this.options = getRemoveOption(); |
|||
this.openScanPopup(); |
|||
}, |
|||
|
|||
methods: { |
|||
openScanPopup() { |
|||
this.$refs.scanPopup.openScanPopup() |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
this.dataContent = result; |
|||
result.qty =result.stdPackQty; |
|||
this.itemList.push(result) |
|||
this.$forceUpdate() |
|||
|
|||
}, |
|||
|
|||
clear() { |
|||
this.itemList = []; |
|||
this.dataContent = {} |
|||
}, |
|||
|
|||
|
|||
submit() { |
|||
let that = this; |
|||
if (that.itemList.length === 0) { |
|||
that.showMessage('请扫描位置码'); |
|||
return; |
|||
} |
|||
|
|||
uni.showLoading({ |
|||
title: "提交中....", |
|||
mask: true |
|||
}); |
|||
var params = this.setParams(); |
|||
console.log(JSON.stringify(params)) |
|||
coatingIssueRequest(params).then(res => { |
|||
uni.hideLoading(); |
|||
this.showMessage("提交成功") |
|||
this.clear(); |
|||
}).catch(error => { |
|||
uni.hideLoading(); |
|||
this.showMessage(error.message); |
|||
}) |
|||
|
|||
}, |
|||
setParams() { |
|||
var param = { |
|||
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN, |
|||
remark: "", |
|||
extraProperties: {}, |
|||
activeDate: getISODateTime(), |
|||
autoSubmit: true, |
|||
autoAgree: false, |
|||
autoHandle: false, |
|||
autoCompleteJob: false, |
|||
directCreateNote: true, |
|||
issueRequestType: 4, |
|||
useOnTheWayLocation: false, |
|||
details: [] |
|||
} |
|||
|
|||
this.itemList.forEach(res => { |
|||
var data = { |
|||
remark: "", |
|||
qty:res.qty, |
|||
itemCode: res.partCode, |
|||
itemName: res.partName, |
|||
itemDesc1: res.itemDesc2, |
|||
uom: res.basicUom, |
|||
stdPackQty: res.stdPackQty, |
|||
toLocationCode: res.locationCode, |
|||
prodLine: null, |
|||
requestStatus: 1, |
|||
issuedQty: res.qty, |
|||
receivedQty: 0, |
|||
status: 1, |
|||
positionCode: this.dataContent.code, |
|||
recommendType: 0, |
|||
boxQty: res.qty |
|||
|
|||
} |
|||
param.details.push(data) |
|||
}) |
|||
return param; |
|||
|
|||
}, |
|||
|
|||
qtyChanged(value, item, index) { |
|||
if (value <= 0) { |
|||
this.showMessage('发料数量不能小于或等于0') |
|||
item.handledQty = item.defaultHandleQty |
|||
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|||
return; |
|||
} |
|||
// else if (value > item.defaultHandleQty) { |
|||
// item.handledQty = item.defaultHandleQty |
|||
// this.showMessage('发料数量不能大于库存数量:' + item.handledQty) |
|||
// this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|||
// } |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
showConfirmMessage(message) { |
|||
this.$refs.comMessage.showConfirmMessage(message); |
|||
}, |
|||
showCommitSuccess() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
showScanMessage(message) { |
|||
this.$refs.comMessage.showScanMessage(message); |
|||
}, |
|||
showRescanMessage(message) { |
|||
this.$refs.comMessage.showRescanMessage(message); |
|||
}, |
|||
|
|||
closeScanMessage() { |
|||
this.scanPopupGetFocus(); |
|||
}, |
|||
|
|||
closeCommitMessage() { |
|||
// this.openScanPopup(); |
|||
}, |
|||
|
|||
scanPopupGetFocus() { |
|||
this.$refs.scanPopup.getfocus(); |
|||
}, |
|||
|
|||
scanPopupLoseFocus(message) { |
|||
this.$refs.scanPopup.losefocus(); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,194 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<win-empty-view v-if="deliverList.length==0"></win-empty-view> |
|||
<view hover-class="uni-list-cell-hover" v-for="(item, index) in deliverList" :key="item.id" |
|||
@click="openDetail(item)"> |
|||
<comKittingRequestItem :dataContent="item" @handle="handle"> |
|||
</comKittingRequestItem> |
|||
<!-- <comInjectIssue :dataContent="item"></comInjectIssue> --> |
|||
</view> |
|||
<uni-load-more :status="loadingType" v-if="deliverList.length>0" /> |
|||
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'> |
|||
</win-mulit-scan> --> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
|
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getCoatingRequestList, |
|||
coatingRequestHandle, |
|||
getCoatingRequestJobByRequest, |
|||
isCoatingHasNewJob |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
goHome |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' |
|||
import comInjectIssue from '@/mycomponents/coms/task/comInjectIssue.vue'; |
|||
import comKittingRequestItem from '@/mycomponents/comRequest/comKittingRequestItem.vue'; |
|||
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
|
|||
export default { |
|||
name: 'deliver', |
|||
components: { |
|||
winEmptyView, |
|||
winScanButton, |
|||
winMulitScan, |
|||
comInjectIssue, |
|||
comKittingRequestItem, |
|||
comMessage |
|||
}, |
|||
data() { |
|||
return { |
|||
deliverList: [], |
|||
reload: false, |
|||
status: '', |
|||
contentText: { |
|||
contentdown: '上拉加载更多', |
|||
contentrefresh: '加载中', |
|||
contentnomore: '没有更多' |
|||
}, |
|||
pageSize: this.modelConfig, |
|||
pageIndex: 1, |
|||
isTimeWindowSorting: false, |
|||
isToday: true, |
|||
titleArray: ['任务编号'], |
|||
loadingType: "nomore" |
|||
|
|||
}; |
|||
}, |
|||
props: { |
|||
datacontent: { |
|||
type: Object, |
|||
value: null |
|||
} |
|||
}, |
|||
onShow: function() { |
|||
this.getList('refresh'); |
|||
}, |
|||
onReachBottom() { |
|||
//避免多次触发 |
|||
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
|||
return; |
|||
} |
|||
this.getList("more"); |
|||
}, |
|||
onPullDownRefresh() { |
|||
this.getList('refresh'); |
|||
}, |
|||
//后退按钮 |
|||
onBackPress(options) { |
|||
if (options.from === 'navigateBack') { |
|||
return false; |
|||
} |
|||
goHome(); |
|||
return true; |
|||
}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
}else if(e.index === 1){ |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
methods: { |
|||
async handle(item){ |
|||
uni.showLoading({ |
|||
title:"提交中", |
|||
mask:true |
|||
}) |
|||
try{ |
|||
var jobList = await getCoatingRequestJobByRequest(item.number) |
|||
var handleResult = await coatingRequestHandle(item.id) |
|||
|
|||
var isHaveNewJobList=[]; |
|||
jobList.forEach(res=>{ |
|||
isHaveNewJobList.push(res.CoatingRequestNumber); |
|||
}) |
|||
var isHaveNewJob = await isCoatingHasNewJob(isHaveNewJobList) |
|||
uni.hideLoading() |
|||
this.showMessage(isHaveNewJob) |
|||
}catch(error){ |
|||
uni.hideLoading() |
|||
this.showMessage(error) |
|||
} |
|||
|
|||
|
|||
}, |
|||
openScanPopup() { |
|||
this.$refs.scanPopup.openScanPopup(); |
|||
}, |
|||
//按时间窗口排序 |
|||
timeSortingChange: function(e) { |
|||
this.isTimeWindowSorting = e.detail.value |
|||
this.getList() |
|||
}, |
|||
|
|||
//只看当天到货 |
|||
isTodayChange: function(e) { |
|||
this.isToday = e.detail.value |
|||
this.getList() |
|||
}, |
|||
|
|||
//查询发货任务 |
|||
getList(type) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
this.loadingType = "loading"; |
|||
if (type === "refresh") { |
|||
this.pageIndex = 1; |
|||
this.deliverList = []; |
|||
} |
|||
getCoatingRequestList(that.pageIndex,that.pageSize,false) |
|||
.then(res => { |
|||
uni.hideLoading(); |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
var list = res.items; |
|||
this.loadingType = "loadmore"; |
|||
if (list == null || list.length == 0) { |
|||
//没数据了 |
|||
this.loadingType = "nomore"; |
|||
return; |
|||
} |
|||
// that.deliverList = [...that.deliverList, ...list]; |
|||
that.deliverList = type === "refresh" ? list : this.deliverList.concat(list); |
|||
that.pageIndex++; |
|||
}) |
|||
.catch(err => { |
|||
this.loadingType = ""; |
|||
this.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
openDetail(item) { |
|||
uni.navigateTo({ |
|||
url: './coatingIssueRequestListDetail?id=' + item.id + '&jobStatus=' + item.jobStatus |
|||
}); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,222 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<view class="top_card"> |
|||
<view class="top_wrap" v-if="details.length>0"> |
|||
<view class="top_card"> |
|||
|
|||
<view class="device-detail"> |
|||
<view class="list-style nopad"> |
|||
<view class="ljh_box nopad"> |
|||
<view class="tit_ljh uni-flex"> |
|||
<text class="font_xl text_black text_bold">位置码 : {{details[0].positionCode}}</text> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
|
|||
<scroll-view scroll-y="true" @scroll="scroll" class="scroll-detail"> |
|||
|
|||
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id"> |
|||
|
|||
|
|||
<view class="detail-content"> |
|||
<view class="choose_main"> |
|||
<view class="ljh_box"> |
|||
<view class="tit_ljh">{{ item.itemCode }}</view> |
|||
<view class="ljh_left desc_ljh"> |
|||
<view class="font_xs text_lightblue">{{ item.itemName }}</view> |
|||
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="list_form"> |
|||
<view class="uni-container"> |
|||
<uni-table style="overflow-x: hidden;"> |
|||
<uni-tr> |
|||
<uni-th width="70">库位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.toLocationCode }} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="70">叫料数量</text></uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode" |
|||
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> |
|||
{{item.issuedQty}} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="70">单位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.uom }} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="70">标包数</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_black">{{item.stdPackQty }}</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
</uni-table> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
|
|||
<div class="new_bot_box"> |
|||
<view class="new_btn_bot bot_pos uni-flex"> |
|||
<button class="new_save_btn " style="width: 100%;" @click="submit()">执行</button> |
|||
</view> |
|||
</div> |
|||
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getCoatingRequestDetail, |
|||
coatingRequestHandle, |
|||
getCoatingRequestJobByRequest, |
|||
isCoatingHasNewJob |
|||
} from '@/api/index.js'; |
|||
import { |
|||
showConfirmMsg, |
|||
goHome, |
|||
navigateBack |
|||
} from '@/common/basic.js'; |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue' |
|||
|
|||
export default { |
|||
components: { |
|||
comMessage, |
|||
comJobScanDetail, |
|||
}, |
|||
data() { |
|||
return { |
|||
id: "", |
|||
datacontent: {}, |
|||
details: [], |
|||
jobStatus: "", |
|||
} |
|||
}, |
|||
onLoad(param) { |
|||
this.id = param.id; |
|||
this.getDetail(); |
|||
}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} else if (e.index === 1) { |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
mounted() { |
|||
uni.setNavigationBarColor({ |
|||
frontColor: '#ffffff', |
|||
backgroundColor: "#5A7CF3 !important" |
|||
}) |
|||
}, |
|||
methods: { |
|||
|
|||
//加载零件信息 |
|||
getDetail() { |
|||
uni.showLoading({ |
|||
title:"加载中", |
|||
mask:false |
|||
}) |
|||
let that = this; |
|||
getCoatingRequestDetail(that.id) |
|||
.then(item => { |
|||
uni.hideLoading() |
|||
console.log('item', item); |
|||
that.datacontent = item; |
|||
that.jobStatus = item.jobStatus |
|||
that.details = item.details; |
|||
}) |
|||
.catch(err => { |
|||
uni.hideLoading() |
|||
this.showMessage('未查找到详细信息') |
|||
}); |
|||
}, |
|||
|
|||
|
|||
getScanCount() { |
|||
this.scanCount = this.datacontent.details.filter(r => r.scaned).length; |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
if (this.allCount == this.scanCount) { |
|||
this.$refs.scanPopup.closeScanPopup(); |
|||
} |
|||
}, |
|||
|
|||
|
|||
submit() { |
|||
showConfirmMsg("是否确认执行?", callback => { |
|||
if (callback) { |
|||
this.finsh(); |
|||
} |
|||
}) |
|||
|
|||
}, |
|||
|
|||
async finsh() { |
|||
uni.showLoading({ |
|||
title:"提交中", |
|||
mask:true |
|||
}) |
|||
try{ |
|||
var jobList = await getCoatingRequestJobByRequest(this.datacontent.number) |
|||
var handleResult = await coatingRequestHandle(this.datacontent.id) |
|||
|
|||
var isHaveNewJobList=[]; |
|||
jobList.forEach(res=>{ |
|||
isHaveNewJobList.push(res.coatingRequestNumber); |
|||
}) |
|||
var isHaveNewJob = await isCoatingHasNewJob(isHaveNewJobList) |
|||
uni.hideLoading() |
|||
this.showMessage(isHaveNewJob) |
|||
}catch(error){ |
|||
uni.hideLoading() |
|||
this.showMessage(error) |
|||
} |
|||
}, |
|||
|
|||
showCommitSuccessMessage() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
|
|||
closeCommitMessage() { |
|||
navigateBack(1); //点关闭直接返回列表 |
|||
uni.hideLoading(); |
|||
}, |
|||
|
|||
|
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,195 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<win-empty-view v-if="deliverList.length==0"></win-empty-view> |
|||
<view hover-class="uni-list-cell-hover" v-for="(item, index) in deliverList" :key="item.id" |
|||
@click="openDetail(item)"> |
|||
<comKittingRequestItem :dataContent="item" @handle="handle"> |
|||
</comKittingRequestItem> |
|||
<!-- <comInjectIssue :dataContent="item"></comInjectIssue> --> |
|||
</view> |
|||
<uni-load-more :status="loadingType" v-if="deliverList.length>0" /> |
|||
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'> |
|||
</win-mulit-scan> --> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
|
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getInjectionRequestList, |
|||
injectionRequestHandle, |
|||
getInjectionRequestJobByRequest, |
|||
isInjectionHasNewJob |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
goHome |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' |
|||
import comInjectIssue from '@/mycomponents/coms/task/comInjectIssue.vue'; |
|||
import comKittingRequestItem from '@/mycomponents/comRequest/comKittingRequestItem.vue'; |
|||
|
|||
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
|
|||
export default { |
|||
name: 'deliver', |
|||
components: { |
|||
winEmptyView, |
|||
winScanButton, |
|||
winMulitScan, |
|||
comInjectIssue, |
|||
comKittingRequestItem, |
|||
comMessage |
|||
}, |
|||
data() { |
|||
return { |
|||
deliverList: [], |
|||
reload: false, |
|||
status: '', |
|||
contentText: { |
|||
contentdown: '上拉加载更多', |
|||
contentrefresh: '加载中', |
|||
contentnomore: '没有更多' |
|||
}, |
|||
pageSize: this.modelConfig, |
|||
pageIndex: 1, |
|||
isTimeWindowSorting: false, |
|||
isToday: true, |
|||
titleArray: ['任务编号'], |
|||
loadingType: "nomore" |
|||
|
|||
}; |
|||
}, |
|||
props: { |
|||
datacontent: { |
|||
type: Object, |
|||
value: null |
|||
} |
|||
}, |
|||
onShow: function() { |
|||
this.getList('refresh'); |
|||
}, |
|||
onReachBottom() { |
|||
//避免多次触发 |
|||
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
|||
return; |
|||
} |
|||
this.getList("more"); |
|||
}, |
|||
onPullDownRefresh() { |
|||
this.getList('refresh'); |
|||
}, |
|||
//后退按钮 |
|||
onBackPress(options) { |
|||
if (options.from === 'navigateBack') { |
|||
return false; |
|||
} |
|||
goHome(); |
|||
return true; |
|||
}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
}else if(e.index === 1){ |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
methods: { |
|||
async handle(item){ |
|||
uni.showLoading({ |
|||
title:"提交中", |
|||
mask:true |
|||
}) |
|||
try{ |
|||
var jobList = await getInjectionRequestJobByRequest(item.number) |
|||
var handleResult = await injectionRequestHandle(item.id) |
|||
|
|||
var isHaveNewJobList=[]; |
|||
jobList.forEach(res=>{ |
|||
isHaveNewJobList.push(res.injectionRequestNumber); |
|||
}) |
|||
var isHaveNewJob = await isInjectionHasNewJob(isHaveNewJobList) |
|||
uni.hideLoading() |
|||
this.showMessage(isHaveNewJob) |
|||
}catch(error){ |
|||
uni.hideLoading() |
|||
this.showMessage(error) |
|||
} |
|||
|
|||
|
|||
}, |
|||
openScanPopup() { |
|||
this.$refs.scanPopup.openScanPopup(); |
|||
}, |
|||
//按时间窗口排序 |
|||
timeSortingChange: function(e) { |
|||
this.isTimeWindowSorting = e.detail.value |
|||
this.getList() |
|||
}, |
|||
|
|||
//只看当天到货 |
|||
isTodayChange: function(e) { |
|||
this.isToday = e.detail.value |
|||
this.getList() |
|||
}, |
|||
|
|||
//查询发货任务 |
|||
getList(type) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
this.loadingType = "loading"; |
|||
if (type === "refresh") { |
|||
this.pageIndex = 1; |
|||
this.deliverList = []; |
|||
} |
|||
getInjectionRequestList(that.pageIndex,that.pageSize,false) |
|||
.then(res => { |
|||
uni.hideLoading(); |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
var list = res.items; |
|||
this.loadingType = "loadmore"; |
|||
if (list == null || list.length == 0) { |
|||
//没数据了 |
|||
this.loadingType = "nomore"; |
|||
return; |
|||
} |
|||
// that.deliverList = [...that.deliverList, ...list]; |
|||
that.deliverList = type === "refresh" ? list : this.deliverList.concat(list); |
|||
that.pageIndex++; |
|||
}) |
|||
.catch(err => { |
|||
this.loadingType = ""; |
|||
this.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
openDetail(item) { |
|||
uni.navigateTo({ |
|||
url: './kittingIssueRequestListDetail?id=' + item.id + '&jobStatus=' + item.jobStatus |
|||
}); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,222 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<view class="top_card"> |
|||
<view class="top_wrap" v-if="details.length>0"> |
|||
<view class="top_card"> |
|||
|
|||
<view class="device-detail"> |
|||
<view class="list-style nopad"> |
|||
<view class="ljh_box nopad"> |
|||
<view class="tit_ljh uni-flex"> |
|||
<text class="font_xl text_black text_bold">位置码 : {{details[0].positionCode}}</text> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
|
|||
<scroll-view scroll-y="true" @scroll="scroll" class="scroll-detail"> |
|||
|
|||
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id"> |
|||
|
|||
|
|||
<view class="detail-content"> |
|||
<view class="choose_main"> |
|||
<view class="ljh_box"> |
|||
<view class="tit_ljh">{{ item.itemCode }}</view> |
|||
<view class="ljh_left desc_ljh"> |
|||
<view class="font_xs text_lightblue">{{ item.itemName }}</view> |
|||
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="list_form"> |
|||
<view class="uni-container"> |
|||
<uni-table style="overflow-x: hidden;"> |
|||
<uni-tr> |
|||
<uni-th width="70">库位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.toLocationCode }} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="70">叫料数量</text></uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode" |
|||
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> |
|||
{{item.issuedQty}} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="70">单位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.uom }} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="70">标包数</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_black">{{item.stdPackQty }}</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
</uni-table> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
|
|||
<div class="new_bot_box"> |
|||
<view class="new_btn_bot bot_pos uni-flex"> |
|||
<button class="new_save_btn " style="width: 100%;" @click="submit()">执行</button> |
|||
</view> |
|||
</div> |
|||
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getInjectionRequestList, |
|||
injectionRequestHandle, |
|||
getInjectionRequestJobByRequest, |
|||
isInjectionHasNewJob |
|||
} from '@/api/index.js'; |
|||
import { |
|||
showConfirmMsg, |
|||
goHome, |
|||
navigateBack |
|||
} from '@/common/basic.js'; |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue' |
|||
|
|||
export default { |
|||
components: { |
|||
comMessage, |
|||
comJobScanDetail, |
|||
}, |
|||
data() { |
|||
return { |
|||
id: "", |
|||
datacontent: {}, |
|||
details: [], |
|||
jobStatus: "", |
|||
} |
|||
}, |
|||
onLoad(param) { |
|||
this.id = param.id; |
|||
this.getDetail(); |
|||
}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} else if (e.index === 1) { |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
mounted() { |
|||
uni.setNavigationBarColor({ |
|||
frontColor: '#ffffff', |
|||
backgroundColor: "#5A7CF3 !important" |
|||
}) |
|||
}, |
|||
methods: { |
|||
|
|||
//加载零件信息 |
|||
getDetail() { |
|||
uni.showLoading({ |
|||
title:"加载中", |
|||
mask:false |
|||
}) |
|||
let that = this; |
|||
getInjectionRequestList(that.id) |
|||
.then(item => { |
|||
uni.hideLoading() |
|||
console.log('item', item); |
|||
that.datacontent = item; |
|||
that.jobStatus = item.jobStatus |
|||
that.details = item.details; |
|||
}) |
|||
.catch(err => { |
|||
uni.hideLoading() |
|||
this.showMessage('未查找到详细信息') |
|||
}); |
|||
}, |
|||
|
|||
|
|||
getScanCount() { |
|||
this.scanCount = this.datacontent.details.filter(r => r.scaned).length; |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
if (this.allCount == this.scanCount) { |
|||
this.$refs.scanPopup.closeScanPopup(); |
|||
} |
|||
}, |
|||
|
|||
|
|||
submit() { |
|||
showConfirmMsg("是否确认执行?", callback => { |
|||
if (callback) { |
|||
this.finsh(); |
|||
} |
|||
}) |
|||
|
|||
}, |
|||
|
|||
async finsh() { |
|||
uni.showLoading({ |
|||
title:"提交中", |
|||
mask:true |
|||
}) |
|||
try{ |
|||
var jobList = await getInjectionRequestJobByRequest(this.datacontent.number) |
|||
var handleResult = await injectionRequestHandle(this.datacontent.id) |
|||
|
|||
var isHaveNewJobList=[]; |
|||
jobList.forEach(res=>{ |
|||
isHaveNewJobList.push(res.injectionRequestNumber); |
|||
}) |
|||
var isHaveNewJob = await isInjectionHasNewJob(isHaveNewJobList) |
|||
uni.hideLoading() |
|||
this.showMessage(isHaveNewJob) |
|||
}catch(error){ |
|||
uni.hideLoading() |
|||
this.showMessage(error) |
|||
} |
|||
}, |
|||
|
|||
showCommitSuccessMessage() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
|
|||
closeCommitMessage() { |
|||
navigateBack(1); //点关闭直接返回列表 |
|||
uni.hideLoading(); |
|||
}, |
|||
|
|||
|
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,242 @@ |
|||
<template> |
|||
|
|||
<view class="page-wraper"> |
|||
|
|||
<view class="page-header"> |
|||
<view class="" style="margin: 10rpx;"> |
|||
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" |
|||
activeColor="#007AFF"></uni-segmented-control> |
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
<view class="page-main"> |
|||
<scroll-view scroll-y="true" class="page-main-scroll"> |
|||
<view class="uni-flex uni-row" style="flex-wrap: wrap; margin: 10rpx;"> |
|||
<view class="uni-flex" style=" width: 50%; justify-content: center; margin-top: 40rpx; " |
|||
v-for="(item, index) in showList" :key="index"> |
|||
<uni-tag style="width: 100%; margin-left: 20rpx;" :inverted="!item.checked" :circle="false" :text="item.code+'\n'+item.desc1" type="primary" |
|||
@click="setContainerModel(item)" /> |
|||
</view> |
|||
|
|||
</view> |
|||
</scroll-view> |
|||
</view> |
|||
|
|||
<view class="page-footer"> |
|||
<div class="new_bot_box"> |
|||
<win-collapse-location scanTitle='扫描目标库位' ref='comCollapseLocation' |
|||
@getLocationCode='getDefaultToLocation' @clear='clearDefaultLocation'> |
|||
</win-collapse-location> |
|||
<view class="new_btn_bot bot_pos uni-flex"> |
|||
<button class="new_save_btn " style="width: 100%;" @click="submit()">提交</button> |
|||
</view> |
|||
</div> |
|||
</view> |
|||
|
|||
<com-message ref="comMessage"></com-message> |
|||
</view> |
|||
</template> |
|||
<script> |
|||
import { |
|||
injectionIssuePlanRequest, |
|||
getItemCategoryList, |
|||
locations |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
goHome, |
|||
dateFormat, |
|||
getContainerTypeName, |
|||
showConfirmMsg, |
|||
getISODateTime |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' |
|||
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue' |
|||
export default { |
|||
components: { |
|||
winEmptyView, |
|||
comJobTopInfo, |
|||
comMessage, |
|||
winCollapseLocation |
|||
}, |
|||
data() { |
|||
return { |
|||
items: ['保险杠', '轮眉', '车门装饰板'], |
|||
current: 0, |
|||
pageSize: this.modelConfig, |
|||
pageIndex: 1, |
|||
loadingType: "nomore", |
|||
dataList: [], |
|||
showList: [], |
|||
toLocationInfo: null |
|||
}; |
|||
}, |
|||
filters: { |
|||
formatDate: function(val) { |
|||
return dateFormat(val) |
|||
}, |
|||
}, |
|||
|
|||
onShow() {}, |
|||
onLoad() { |
|||
uni.showLoading({ |
|||
title:"加载中", |
|||
mask:true |
|||
}) |
|||
getItemCategoryList().then(res => { |
|||
uni.hideLoading() |
|||
this.dataList = res; |
|||
this.dataList.forEach(res => { |
|||
res.checked = true; |
|||
}) |
|||
this.onClickItem({ |
|||
currentIndex: 0 |
|||
}) |
|||
}).catch(error => { |
|||
uni.hideLoading() |
|||
this.showMessage("获取分类信息失败"+error) |
|||
}) |
|||
}, |
|||
onReachBottom() {}, |
|||
onPullDownRefresh() {}, |
|||
//后退按钮 |
|||
onBackPress(options) { |
|||
if (options.from === 'navigateBack') { |
|||
return false; |
|||
} |
|||
goHome(); |
|||
return true; |
|||
}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} else if (e.index === 1) { |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
methods: { |
|||
clearDefaultLocation() { |
|||
this.toLocationInfo = null |
|||
}, |
|||
//扫描默认目标库位 |
|||
getDefaultToLocation(locationCode) { |
|||
uni.showLoading({ |
|||
title: "扫描中", |
|||
mask: true |
|||
}); |
|||
locations(locationCode).then(res => { |
|||
uni.hideLoading(); |
|||
if (res) { |
|||
this.toLocationInfo = res |
|||
} else { |
|||
this.showMessage('目标库位【' + locationCode + '】不存在'); |
|||
} |
|||
|
|||
}).catch(err => { |
|||
uni.hideLoading(); |
|||
this.toLocationInfo = null |
|||
this.showMessage(err.message); |
|||
|
|||
}) |
|||
}, |
|||
setContainerModel(item) { |
|||
this.showList.forEach(res => { |
|||
res.checked = false |
|||
}) |
|||
item.checked = true; |
|||
this.$forceUpdate() |
|||
}, |
|||
onClickItem(item) { |
|||
if (item.currentIndex == 0) { |
|||
this.showList = this.dataList.filter(res => res.category == "保险杠") |
|||
} else if (item.currentIndex == 1) { |
|||
this.showList = this.dataList.filter(res => res.category == "轮眉") |
|||
} else if (item.currentIndex == 2) { |
|||
this.showList = this.dataList.filter(res => res.category == "车门装饰板") |
|||
} |
|||
this.showList.forEach(res => { |
|||
res.checked = false; |
|||
}) |
|||
}, |
|||
|
|||
//查询发货任务 |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
showCommitSuccessMessage() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
clearData() { |
|||
this.onClickItem({ |
|||
currentIndex: 0 |
|||
}) |
|||
}, |
|||
submit(item) { |
|||
var checked = this.showList.filter(r=>r.checked) |
|||
if (checked.length==0) { |
|||
this.showMessage("请选择零件") |
|||
return; |
|||
} |
|||
|
|||
if (this.toLocationInfo == null) { |
|||
this.showMessage("请先扫描目标库位") |
|||
return; |
|||
} |
|||
|
|||
|
|||
uni.showLoading({ |
|||
title: "提交中...", |
|||
mask: true |
|||
}); |
|||
var params = { |
|||
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN, |
|||
activeDate: getISODateTime(), |
|||
useOnTheWayLocation: false, |
|||
type: "Qty", |
|||
details: [ |
|||
|
|||
] |
|||
} |
|||
var item = { |
|||
remark: "", |
|||
itemCode: checked[0].code, |
|||
itemName: checked[0].name, |
|||
itemDesc1: checked[0].desc1, |
|||
itemDesc2: checked[0].desc2, |
|||
uom: checked[0].basicUom, |
|||
qty: 1, |
|||
stdPackQty: checked[0].stdPackQty, |
|||
toLocationCode: this.toLocationInfo.code, |
|||
toLocationArea: this.toLocationInfo.areaCode, |
|||
toLocationGroup: this.toLocationInfo.locationGroupCode, |
|||
toLocationErpCode: this.toLocationInfo.erpLocationCode, |
|||
toWarehouseCode: localStorage.warehouseCode, |
|||
positionCode: "", |
|||
recommendType: "SEMI", |
|||
boxQty: 1 |
|||
} |
|||
params.details.push(item) |
|||
console.log("测试", JSON.stringify(params)); |
|||
injectionIssuePlanRequest( params) |
|||
.then(res => { |
|||
uni.hideLoading(); |
|||
if (res) { |
|||
this.showCommitSuccessMessage(); |
|||
this.clearData(); |
|||
}else { |
|||
this.showMessage("提交失败"); |
|||
} |
|||
}) |
|||
.catch(err => { |
|||
this.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
@ -0,0 +1,648 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<win-blank-view @goScan='openScanPopup' v-if="fromLocation==null"></win-blank-view> |
|||
<scroll-view scroll-y="true" class="scroll-detail" style="margin-top: 20rpx;padding-bottom:100px"> |
|||
<view class="top_wrap" v-if="fromLocation!=null"> |
|||
<view class="top_card"> |
|||
<view class="uni-flex space-between top_lines_info"> |
|||
<view class="font_sm"> |
|||
来源库位: |
|||
<text class="text_bold">{{fromLocation.code}}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<uni-collapse v-if="fromLocation!=null"> |
|||
<view class="pop_list list_info semi_col" v-for="(label, index) in itemList" :key="label.id"> |
|||
<semi-collapse-item :open="true" :title="label.itemCode" :item="label" :scanCount="label.scanQty" |
|||
style="font-size: 20px; "> |
|||
<view v-for="(item, index) in label.labelList" :key="item.id"> |
|||
<uni-swipe-action> |
|||
<uni-swipe-action-item :right-options="options" :auto-close="false" |
|||
@click="swipeClick($event,label,index)" style='background-color: #ffffff;'> |
|||
<view class="common_card" style='margin-left: 10px;'> |
|||
<view class="ljh_box"> |
|||
<view class="ljh_info"> |
|||
<view class="tit_ljh">{{ item.itemCode }}</view> |
|||
<view class="label_xm font_xs fr">{{ item.packingCode }}</view> |
|||
</view> |
|||
<view class="uni-flex space-between desc_card"> |
|||
<view class="ljh_left"> |
|||
<view class="text_lightblue font_xs">{{item.itemName }}</view> |
|||
</view> |
|||
<view class="ljh_right"> |
|||
<text class="tnum">{{item.qty}}</text> |
|||
<text class="tunit">{{item.uom}}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="cell_box"> |
|||
<view class="uni-flex uni-row fl"> |
|||
<view class="cell_info"> |
|||
<view class="text_lightblue">源库位</view> |
|||
<view class="text_black font_sm">{{ item.locationCode }} |
|||
</view> |
|||
</view> |
|||
<view class="cell_info"> |
|||
<view class="text_lightblue">目标库位</view> |
|||
<view class="text_black font_sm">{{item.toLocationCode }}</view> |
|||
</view> |
|||
</view> |
|||
<view class="scan_btn_fr fr" @click="scanToLocation(item)"> |
|||
<text>扫描目标库位</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</uni-swipe-action-item> |
|||
</uni-swipe-action> |
|||
</view> |
|||
</semi-collapse-item> |
|||
</view> |
|||
</uni-collapse> |
|||
</scroll-view> |
|||
<div class="new_bot_box" v-show="fromLocation!=null"> |
|||
<win-collapse-location scanTitle='扫描默认目标库位' ref='comCollapseLocation' |
|||
@getLocationCode='getDefaultToLocation' @clear='clearDefaultLocation'> |
|||
</win-collapse-location> |
|||
<view class="new_btn_bot bot_pos uni-flex"> |
|||
<button class="new_clear_btn btn_double" @click="cancel()">清空</button> |
|||
<button class="new_save_btn btn_double" @click="submit()">提交</button> |
|||
</view> |
|||
</div> |
|||
<win-scan-button @goScan='openScanPopup' v-if="fromLocation!=null"></win-scan-button> |
|||
<win-scan-by-code ref="scanFromLocationPopup" title="来源库位" @getScanCode='scanFromLocation'></win-scan-by-code> |
|||
<win-scan-by-code ref="scanToLocationPopup" title="目标库位" @getScanCode='getToLocation'></win-scan-by-code> |
|||
<win-scan-by-pack ref="scanPackPopup" @getScanResult='getScanResult'></win-scan-by-pack> |
|||
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
|||
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan' |
|||
@afterCloseCommitMessage='closeCommitMessage'> |
|||
</com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
locations, |
|||
getBalancesByFilterAsync, |
|||
getWipListAsync, |
|||
returnToWarehouse, |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
showConfirmMsg, |
|||
goHome, |
|||
getRemoveOption |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winBlankView from '@/mycomponents/wincom/winBlankView.vue' |
|||
import comBaseItem from '@/mycomponents/comItem/comBaseItem.vue' |
|||
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' |
|||
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue' |
|||
import comScanSemiPutaway from '@/mycomponents/scan/comScanSemiPutaway.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comBalance from '@/mycomponents/common/comBalance.vue' |
|||
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue' |
|||
import SemiCollapseItem from '@/mycomponents/common/SemiCollapseItem.vue' |
|||
|
|||
export default { |
|||
name: 'returnToWarehouse', |
|||
components: { |
|||
winBlankView, |
|||
comBaseItem, |
|||
comMessage, |
|||
winScanButton, |
|||
winScanByPack, |
|||
winScanByCode, |
|||
comScanSemiPutaway, |
|||
comBalance, |
|||
winCollapseLocation, |
|||
SemiCollapseItem |
|||
}, |
|||
data() { |
|||
return { |
|||
options: [], |
|||
itemList: [], |
|||
fromLocation: null, |
|||
toLocation: null, |
|||
defaultToLocation: null, |
|||
currentItem: {} |
|||
}; |
|||
}, |
|||
props: { |
|||
|
|||
}, |
|||
|
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
}else if(e.index === 1){ |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
mounted: function() { |
|||
this.options = getRemoveOption(); |
|||
this.openScanPopup(); |
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
//扫描源库位 |
|||
scanFromLocation(code) { |
|||
let that = this; |
|||
if (code == '') return; |
|||
uni.showLoading({ |
|||
title: '扫描中...', |
|||
mask: true |
|||
}); |
|||
locations(code).then(res => { |
|||
if (res != null) { |
|||
if (res.type == 3||res.type == 4||res.type == 5) { |
|||
that.fromLocation = res; |
|||
this.openPackLabel(); |
|||
this.closeScanFromLocationPopup(); |
|||
} else { |
|||
that.showMessage('扫描的库位【' + code + '】不是【半成品库】或【线边库位】或【成品库位】'); |
|||
} |
|||
} else { |
|||
that.showMessage('未查询到库位【' + code + '】'); |
|||
} |
|||
uni.hideLoading(); |
|||
}).catch(err => { |
|||
uni.hideLoading(); |
|||
that.showMessage(err.message); |
|||
}); |
|||
}, |
|||
|
|||
scanConfirm(fromLocation, itemList) { |
|||
this.fromLocation = fromLocation; |
|||
this.itemList = itemList; |
|||
}, |
|||
|
|||
swipeClick(e, label, index) { |
|||
let { |
|||
content |
|||
} = e; |
|||
if (content.text === '移除') { |
|||
uni.showModal({ |
|||
title: '提示', |
|||
content: '是否移除选择的行?', |
|||
success: res => { |
|||
if (res.confirm) { |
|||
let item = label.labelList[index]; |
|||
label.scanQty = label.scanQty - item.qty; |
|||
this.removeLabel(label, index) |
|||
//label.labelList.splice(index, 1); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
}, |
|||
|
|||
removeLabel(label, index) { |
|||
label.labelList.splice(index, 1); |
|||
if (label.labelList.length == 0) { |
|||
for (var i = 0; i < this.itemList.length; i++) { |
|||
let item = this.itemList[i]; |
|||
if (item.itemCode == label.itemCode) { |
|||
this.itemList.splice(i, 1) |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
let that = this; |
|||
that.currentLabel = result.data; |
|||
let code = result.data.code; |
|||
if (code) { |
|||
let datas = []; |
|||
//判断是否重复扫描 |
|||
this.itemList.filter(r => { |
|||
if (r.toPackingCode == code) { |
|||
datas.push(r); |
|||
return; |
|||
} |
|||
}) |
|||
if (datas.length > 0) { |
|||
this.showRescanMessage('箱码【' + code + '】已经存在,是否要重新扫描?'); |
|||
// showConfirmMsg('箱码【' + code + '】已经存在,是否要重新扫描?', confirm => { |
|||
// if (confirm) { |
|||
// that.itemList.forEach((r, i) => { |
|||
// if (r.toPackingCode == code) { |
|||
// that.itemList.splice(i, 1); |
|||
// return; |
|||
// } |
|||
// }); |
|||
// that.getLabel(); |
|||
// } |
|||
// }); |
|||
} else { |
|||
that.getLabel(); |
|||
} |
|||
|
|||
} else { |
|||
this.showMessage('请先扫描箱标签'); |
|||
return; |
|||
} |
|||
}, |
|||
|
|||
//重新扫描 |
|||
afterRescan(val) { |
|||
let that = this; |
|||
if (confirm) { |
|||
that.itemList.forEach((r, i) => { |
|||
if (r.toPackingCode == that.currentLabel.packingCode) { |
|||
that.itemList.splice(i, 1); |
|||
return; |
|||
} |
|||
}); |
|||
that.getLabel(); |
|||
} else { |
|||
this.scanPopupGetFocus(); |
|||
} |
|||
}, |
|||
|
|||
async getLabel() { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: '扫描中...', |
|||
mask: true |
|||
}) |
|||
|
|||
let balanceParams = { |
|||
pageSize: 100, |
|||
pageIndex: 1, |
|||
packingCode: that.currentLabel.packingCode, |
|||
}; |
|||
|
|||
let balanceRes = await getBalancesByFilterAsync(balanceParams); |
|||
if (balanceRes.totalCount > 0) { |
|||
let locationCode = balanceRes.items[0].locationCode; |
|||
this.showScanMessage('箱码【' + that.currentLabel.packingCode + '】在【' + locationCode + |
|||
'】库位已经有库存信息,请重新扫描箱码'); |
|||
} else { |
|||
let itemInfo = that.itemList.find(r => { |
|||
return r.itemCode == that.currentLabel.itemCode |
|||
}) |
|||
if (itemInfo == undefined) { |
|||
let params = { |
|||
locationCode: that.fromLocation.code, |
|||
itemCode: that.currentLabel.itemCode |
|||
}; |
|||
|
|||
let wipRes = await getWipListAsync(params); |
|||
if (wipRes.totalCount == 0) { |
|||
this.showScanMessage('零件【' + that.currentLabel.itemCode + '】在【' + this.fromLocation.code + |
|||
'】库位没有库存信息,不可以退库'); |
|||
} else { |
|||
let balanceItem = wipRes.items[0]; |
|||
let item = { |
|||
itemCode: that.currentLabel.itemCode, |
|||
totalQty: balanceItem.qty, |
|||
uom: balanceItem.uom, |
|||
scanQty: 0, |
|||
status: balanceItem.status, |
|||
balanceItem: balanceItem, |
|||
labelList: [] |
|||
}; |
|||
this.addLabel(item); |
|||
} |
|||
} else { |
|||
this.addLabel(itemInfo); |
|||
} |
|||
} |
|||
uni.hideLoading(); |
|||
}, |
|||
|
|||
addLabel(item) { |
|||
//没有标签 |
|||
if (item.labelList.length == 0) { |
|||
if (this.currentLabel.qty > item.totalQty) { |
|||
this.showScanMessage('标签数量【' + this.currentLabel.qty + |
|||
'】大于零件的库存数量【' + item.totalQty + '】,不可以退库') |
|||
} else { |
|||
let data = this.itemList.find(r => r.itemCode == item.itemCode) |
|||
if (data == undefined) { |
|||
this.itemList.push(item) |
|||
} |
|||
this.calcScanQty(item, 0) |
|||
item.labelList.unshift(this.currentLabel); |
|||
this.scanPopupGetFocus(); |
|||
} |
|||
} else { |
|||
let scanQty = 0; |
|||
item.labelList.forEach(r => { |
|||
scanQty += Number(r.qty) |
|||
}) |
|||
if (scanQty + this.currentLabel.qty > item.totalQty) { |
|||
this.showScanMessage('已扫描数量【' + scanQty + '】加标签数量【' + this.currentLabel.qty + |
|||
'】大于零件的库存数量【' + item.totalQty + '】,不可以退库') |
|||
} else { |
|||
this.calcScanQty(item, scanQty) |
|||
item.labelList.unshift(this.currentLabel); |
|||
this.scanPopupGetFocus(); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
calcScanQty(item, scanQty) { |
|||
item.scanQty = scanQty + this.currentLabel.qty; |
|||
|
|||
//标签赋默认值 |
|||
this.currentLabel.locationCode = this.fromLocation.code; |
|||
this.currentLabel.status = 2; |
|||
}, |
|||
|
|||
scanToLocation(item) { |
|||
this.currentItem = item; |
|||
this.openScanToLocationPopup(); |
|||
}, |
|||
|
|||
//扫描默认目标库位 |
|||
getDefaultToLocation(locationCode) { |
|||
let that = this; |
|||
|
|||
uni.showLoading({ |
|||
title: "扫描中", |
|||
mask: true |
|||
}); |
|||
locations(locationCode).then(res => { |
|||
if (res == null) { |
|||
that.showMessage('目标库位【' + locationCode + '】不存在'); |
|||
} else { |
|||
if (res.type == 2 || res.type == 3||res.type == 4 ||res.type == 6) { |
|||
|
|||
showConfirmMsg('是否要将所有未扫描目标库位的零件,指定目标库位【' + locationCode + '】', |
|||
confirm => { |
|||
if (confirm) { |
|||
that.defaultToLocation = res; |
|||
that.itemList.forEach(r => { |
|||
r.labelList.forEach(l => { |
|||
if (l.toLocationCode == '' || l |
|||
.toLocationCode == undefined) { |
|||
that.handledToLocation(l, res); |
|||
} |
|||
}); |
|||
}) |
|||
} |
|||
}); |
|||
} else { |
|||
that.showMessage('目标库位的库位类型必须是【原料库】或【半成品库】或【成品库】或【隔离库】') |
|||
} |
|||
} |
|||
uni.hideLoading(); |
|||
}).catch(err => { |
|||
that.toLocation = null; |
|||
that.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}) |
|||
}, |
|||
|
|||
getToLocation(code) { |
|||
if (code == '') { |
|||
this.showMessage('目标库位不能为空'); |
|||
return; |
|||
} |
|||
if (code == this.currentItem.fromLocationCode) { |
|||
this.showMessage('源库位【' + this.currentItem.fromLocationCode + '】与目标库位【' + code + '】不能相同'); |
|||
return; |
|||
} |
|||
uni.showLoading({ |
|||
title: "扫描中", |
|||
mask: true |
|||
}); |
|||
let that = this; |
|||
locations(code).then(res => { |
|||
if (res == null) { |
|||
that.showMessage('目标库位【' + code + '】不存在'); |
|||
} else { |
|||
|
|||
if (res.type == 2 || res.type == 3||res.type == 4||res.type == 6) { |
|||
this.handledToLocation(this.currentItem, res); |
|||
} else { |
|||
this.showMessage('目标库位的库位类型必须是【原料库】或【半成品库】或【成品库】或【隔离库】') |
|||
} |
|||
} |
|||
uni.hideLoading(); |
|||
}).catch(err => { |
|||
that.toLocation = null; |
|||
that.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}) |
|||
}, |
|||
|
|||
handledToLocation(item, location) { |
|||
item.toLocationCode = location.code; |
|||
item.toLocationGroup = location.locationGroupCode; |
|||
item.toLocationArea = location.areaCode; |
|||
item.toLocationErpCode = location.erpLocationCode; |
|||
this.$forceUpdate(); |
|||
this.closeScanToLocationPopup(); |
|||
}, |
|||
|
|||
clearDefaultLocation() { |
|||
let that = this; |
|||
that.defaultToLocation = null; |
|||
}, |
|||
|
|||
submit() { |
|||
let that = this; |
|||
if (that.itemList.length === 0) { |
|||
that.showMessage('请扫描要退库的零件'); |
|||
return; |
|||
} |
|||
|
|||
let noToLocations = []; |
|||
that.itemList.forEach(r => { |
|||
r.labelList.filter(l => { |
|||
if (l.toLocationCode == '' || l.toLocationCode == undefined) { |
|||
noToLocations.push(l.itemCode) |
|||
} |
|||
}) |
|||
}) |
|||
if (noToLocations.length > 0) { |
|||
that.showMessage('还有未扫描目标库位的零件,请先扫描目标库位'); |
|||
return; |
|||
} |
|||
|
|||
uni.showLoading({ |
|||
title: "提交中....", |
|||
mask: true |
|||
}); |
|||
|
|||
let item = this.getSubmitParam(); |
|||
let params = JSON.stringify(item); |
|||
returnToWarehouse(params) |
|||
.then(res => { |
|||
that.showCommitSuccess(); |
|||
that.clearInfo(); |
|||
uni.hideLoading(); |
|||
}) |
|||
.catch(err => { |
|||
that.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
|
|||
|
|||
getSubmitParam() { |
|||
let that = this; |
|||
let item = { |
|||
number: "", |
|||
worker: localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN, |
|||
putawayType: 2, |
|||
details: [] |
|||
} |
|||
|
|||
that.itemList.forEach(i => { |
|||
let balanceItem = i.balanceItem; |
|||
i.labelList.forEach(l => { |
|||
let detail = {}; |
|||
detail.itemCode = balanceItem.itemCode; |
|||
detail.itemName = balanceItem.itemName; |
|||
detail.itemDesc1 = balanceItem.itemDesc1; |
|||
detail.itemDesc2 = balanceItem.itemDesc2; |
|||
detail.uom = l.uom; |
|||
detail.qty = l.qty; |
|||
detail.stdPackQty = balanceItem.stdPackQty; |
|||
|
|||
detail.fromPackingCode = balanceItem.packingCode; |
|||
detail.toPackingCode = l.packingCode; |
|||
detail.fromLot = balanceItem.lot; |
|||
detail.toLot = l.lot; |
|||
|
|||
detail.fromLocationCode = that.fromLocation.code; |
|||
detail.fromLocationErpCode = that.fromLocation.erpLocationCode; |
|||
detail.fromLocationGroup = that.fromLocation.locationGroupCode; |
|||
detail.fromLocationArea = that.fromLocation.areaCode; |
|||
|
|||
detail.toLocationCode = l.toLocationCode ?? that.defaultToLocation.code; |
|||
detail.toLocationGroup = l.toLocationGroup ?? that.defaultToLocation |
|||
.locationGroupCode; |
|||
detail.toLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode; |
|||
detail.toLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation |
|||
.erpLocationCode; |
|||
|
|||
detail.fromStatus = balanceItem.status; |
|||
detail.toStatus = l.status; |
|||
|
|||
detail.fromWarehouseCode = localStorage.warehouseCode; |
|||
detail.toWarehouseCode = localStorage.warehouseCode; |
|||
|
|||
detail.supplierBatch = balanceItem.supplierBatch; |
|||
detail.arriveDate = balanceItem.arriveDate; |
|||
detail.produceDate = balanceItem.produceDate; |
|||
detail.expireDate = balanceItem.expireDate; |
|||
//=========================================== |
|||
detail.recommendContainerCode = that.fromLocation.code; |
|||
detail.recommendPackingCode = balanceItem.packingCode; |
|||
detail.recommendSupplierBatch = l.supplierBatch; |
|||
detail.recommendArriveDate = l.arriveDate; |
|||
detail.recommendProduceDate = l.produceDate; |
|||
detail.recommendExpireDate = l.expireDate; |
|||
detail.recommendLot = balanceItem.lot;; |
|||
detail.recommendToLocationCode = l.toLocationCode ?? that.defaultToLocation.code; |
|||
detail.recommendToLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode; |
|||
detail.recommendToLocationGroup = l.toLocationGroup ?? that.defaultToLocation |
|||
.locationGroupCode; |
|||
detail.recommendToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation |
|||
.erpLocationCode; |
|||
detail.recommendToWarehouseCode = localStorage.warehouseCode; |
|||
detail.recommendQty = balanceItem.qty; |
|||
|
|||
|
|||
detail.handledContainerCode = l.containerCode; |
|||
detail.handledPackingCode = l.packingCode; |
|||
detail.handledSupplierBatch = l.supplierBatch; |
|||
detail.handledArriveDate = l.arriveDate; |
|||
detail.handledProduceDate = l.produceDate; |
|||
detail.handledExpireDate = l.expireDate; |
|||
detail.handledLot = l.lot; |
|||
detail.handledToLocationCode = l.toLocationCode ?? that.defaultToLocation.code; |
|||
detail.handledToLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode; |
|||
detail.handledToLocationGroup = l.toLocationGroup ?? that.defaultToLocation |
|||
.locationGroupCode; |
|||
detail.handledToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation |
|||
.erpLocationCode; |
|||
detail.handledToWarehouseCode = localStorage.warehouseCode; |
|||
detail.handledQty = l.qty; |
|||
item.details.push(detail); |
|||
}); |
|||
}) |
|||
return item; |
|||
}, |
|||
|
|||
cancel() { |
|||
let that = this; |
|||
showConfirmMsg('是否要清空已扫描的零件和库位信息?', confirm => { |
|||
if (confirm) { |
|||
that.clearInfo(); |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
clearInfo() { |
|||
let that = this; |
|||
that.itemList = []; |
|||
that.fromLocation = null; |
|||
that.toLocation = null; |
|||
that.defaultToLocation = null; |
|||
}, |
|||
|
|||
openScanPopup() { |
|||
if (this.fromLocation == null) { //扫描来源库位 |
|||
this.openScanFromLocationPopup(); |
|||
} else { //扫描箱标签 |
|||
this.openPackLabel(); |
|||
} |
|||
}, |
|||
|
|||
scanPopupGetFocus() { |
|||
this.$refs.scanPackPopup.getfocus(); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
showCommitSuccess() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
showRescanMessage(message) { |
|||
this.$refs.comMessage.showRescanMessage(message); |
|||
}, |
|||
showScanMessage(message) { |
|||
this.$refs.comMessage.showScanMessage(message); |
|||
}, |
|||
closeCommitMessage() { |
|||
// this.openScanPopup(); |
|||
}, |
|||
closeScanMessage() { |
|||
this.scanPopupGetFocus(); |
|||
}, |
|||
openPackLabel() { |
|||
this.$refs.scanPackPopup.openScanPopup() |
|||
}, |
|||
|
|||
openScanFromLocationPopup() { |
|||
this.$refs.scanFromLocationPopup.openScanPopup() |
|||
}, |
|||
|
|||
closeScanFromLocationPopup() { |
|||
this.$refs.scanFromLocationPopup.closeScanPopup(); |
|||
}, |
|||
|
|||
openScanToLocationPopup() { |
|||
this.$refs.scanToLocationPopup.openScanPopup() |
|||
}, |
|||
|
|||
closeScanToLocationPopup() { |
|||
this.$refs.scanToLocationPopup.closeScanPopup(); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,648 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<win-blank-view @goScan='openScanPopup' v-if="fromLocation==null"></win-blank-view> |
|||
<scroll-view scroll-y="true" class="scroll-detail" style="margin-top: 20rpx;padding-bottom:100px"> |
|||
<view class="top_wrap" v-if="fromLocation!=null"> |
|||
<view class="top_card"> |
|||
<view class="uni-flex space-between top_lines_info"> |
|||
<view class="font_sm"> |
|||
来源库位: |
|||
<text class="text_bold">{{fromLocation.code}}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<uni-collapse v-if="fromLocation!=null"> |
|||
<view class="pop_list list_info semi_col" v-for="(label, index) in itemList" :key="label.id"> |
|||
<semi-collapse-item :open="true" :title="label.itemCode" :item="label" :scanCount="label.scanQty" |
|||
style="font-size: 20px; "> |
|||
<view v-for="(item, index) in label.labelList" :key="item.id"> |
|||
<uni-swipe-action> |
|||
<uni-swipe-action-item :right-options="options" :auto-close="false" |
|||
@click="swipeClick($event,label,index)" style='background-color: #ffffff;'> |
|||
<view class="common_card" style='margin-left: 10px;'> |
|||
<view class="ljh_box"> |
|||
<view class="ljh_info"> |
|||
<view class="tit_ljh">{{ item.itemCode }}</view> |
|||
<view class="label_xm font_xs fr">{{ item.packingCode }}</view> |
|||
</view> |
|||
<view class="uni-flex space-between desc_card"> |
|||
<view class="ljh_left"> |
|||
<view class="text_lightblue font_xs">{{item.itemName }}</view> |
|||
</view> |
|||
<view class="ljh_right"> |
|||
<text class="tnum">{{item.qty}}</text> |
|||
<text class="tunit">{{item.uom}}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="cell_box"> |
|||
<view class="uni-flex uni-row fl"> |
|||
<view class="cell_info"> |
|||
<view class="text_lightblue">源库位</view> |
|||
<view class="text_black font_sm">{{ item.locationCode }} |
|||
</view> |
|||
</view> |
|||
<view class="cell_info"> |
|||
<view class="text_lightblue">目标库位</view> |
|||
<view class="text_black font_sm">{{item.toLocationCode }}</view> |
|||
</view> |
|||
</view> |
|||
<view class="scan_btn_fr fr" @click="scanToLocation(item)"> |
|||
<text>扫描目标库位</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</uni-swipe-action-item> |
|||
</uni-swipe-action> |
|||
</view> |
|||
</semi-collapse-item> |
|||
</view> |
|||
</uni-collapse> |
|||
</scroll-view> |
|||
<div class="new_bot_box" v-show="fromLocation!=null"> |
|||
<win-collapse-location scanTitle='扫描默认目标库位' ref='comCollapseLocation' |
|||
@getLocationCode='getDefaultToLocation' @clear='clearDefaultLocation'> |
|||
</win-collapse-location> |
|||
<view class="new_btn_bot bot_pos uni-flex"> |
|||
<button class="new_clear_btn btn_double" @click="cancel()">清空</button> |
|||
<button class="new_save_btn btn_double" @click="submit()">提交</button> |
|||
</view> |
|||
</div> |
|||
<win-scan-button @goScan='openScanPopup' v-if="fromLocation!=null"></win-scan-button> |
|||
<win-scan-by-code ref="scanFromLocationPopup" title="来源库位" @getScanCode='scanFromLocation'></win-scan-by-code> |
|||
<win-scan-by-code ref="scanToLocationPopup" title="目标库位" @getScanCode='getToLocation'></win-scan-by-code> |
|||
<win-scan-by-pack ref="scanPackPopup" @getScanResult='getScanResult'></win-scan-by-pack> |
|||
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
|||
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan' |
|||
@afterCloseCommitMessage='closeCommitMessage'> |
|||
</com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
locations, |
|||
getBalancesByFilterAsync, |
|||
getWipListAsync, |
|||
returnToWarehouse, |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
showConfirmMsg, |
|||
goHome, |
|||
getRemoveOption |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winBlankView from '@/mycomponents/wincom/winBlankView.vue' |
|||
import comBaseItem from '@/mycomponents/comItem/comBaseItem.vue' |
|||
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' |
|||
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue' |
|||
import comScanSemiPutaway from '@/mycomponents/scan/comScanSemiPutaway.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comBalance from '@/mycomponents/common/comBalance.vue' |
|||
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue' |
|||
import SemiCollapseItem from '@/mycomponents/common/SemiCollapseItem.vue' |
|||
|
|||
export default { |
|||
name: 'returnToWarehouse', |
|||
components: { |
|||
winBlankView, |
|||
comBaseItem, |
|||
comMessage, |
|||
winScanButton, |
|||
winScanByPack, |
|||
winScanByCode, |
|||
comScanSemiPutaway, |
|||
comBalance, |
|||
winCollapseLocation, |
|||
SemiCollapseItem |
|||
}, |
|||
data() { |
|||
return { |
|||
options: [], |
|||
itemList: [], |
|||
fromLocation: null, |
|||
toLocation: null, |
|||
defaultToLocation: null, |
|||
currentItem: {} |
|||
}; |
|||
}, |
|||
props: { |
|||
|
|||
}, |
|||
|
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
}else if(e.index === 1){ |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
mounted: function() { |
|||
this.options = getRemoveOption(); |
|||
this.openScanPopup(); |
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
//扫描源库位 |
|||
scanFromLocation(code) { |
|||
let that = this; |
|||
if (code == '') return; |
|||
uni.showLoading({ |
|||
title: '扫描中...', |
|||
mask: true |
|||
}); |
|||
locations(code).then(res => { |
|||
if (res != null) { |
|||
if (res.type == 3||res.type == 4||res.type == 5) { |
|||
that.fromLocation = res; |
|||
this.openPackLabel(); |
|||
this.closeScanFromLocationPopup(); |
|||
} else { |
|||
that.showMessage('扫描的库位【' + code + '】不是【半成品库】或【线边库位】或【成品库位】'); |
|||
} |
|||
} else { |
|||
that.showMessage('未查询到库位【' + code + '】'); |
|||
} |
|||
uni.hideLoading(); |
|||
}).catch(err => { |
|||
uni.hideLoading(); |
|||
that.showMessage(err.message); |
|||
}); |
|||
}, |
|||
|
|||
scanConfirm(fromLocation, itemList) { |
|||
this.fromLocation = fromLocation; |
|||
this.itemList = itemList; |
|||
}, |
|||
|
|||
swipeClick(e, label, index) { |
|||
let { |
|||
content |
|||
} = e; |
|||
if (content.text === '移除') { |
|||
uni.showModal({ |
|||
title: '提示', |
|||
content: '是否移除选择的行?', |
|||
success: res => { |
|||
if (res.confirm) { |
|||
let item = label.labelList[index]; |
|||
label.scanQty = label.scanQty - item.qty; |
|||
this.removeLabel(label, index) |
|||
//label.labelList.splice(index, 1); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
}, |
|||
|
|||
removeLabel(label, index) { |
|||
label.labelList.splice(index, 1); |
|||
if (label.labelList.length == 0) { |
|||
for (var i = 0; i < this.itemList.length; i++) { |
|||
let item = this.itemList[i]; |
|||
if (item.itemCode == label.itemCode) { |
|||
this.itemList.splice(i, 1) |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
let that = this; |
|||
that.currentLabel = result.data; |
|||
let code = result.data.code; |
|||
if (code) { |
|||
let datas = []; |
|||
//判断是否重复扫描 |
|||
this.itemList.filter(r => { |
|||
if (r.toPackingCode == code) { |
|||
datas.push(r); |
|||
return; |
|||
} |
|||
}) |
|||
if (datas.length > 0) { |
|||
this.showRescanMessage('箱码【' + code + '】已经存在,是否要重新扫描?'); |
|||
// showConfirmMsg('箱码【' + code + '】已经存在,是否要重新扫描?', confirm => { |
|||
// if (confirm) { |
|||
// that.itemList.forEach((r, i) => { |
|||
// if (r.toPackingCode == code) { |
|||
// that.itemList.splice(i, 1); |
|||
// return; |
|||
// } |
|||
// }); |
|||
// that.getLabel(); |
|||
// } |
|||
// }); |
|||
} else { |
|||
that.getLabel(); |
|||
} |
|||
|
|||
} else { |
|||
this.showMessage('请先扫描箱标签'); |
|||
return; |
|||
} |
|||
}, |
|||
|
|||
//重新扫描 |
|||
afterRescan(val) { |
|||
let that = this; |
|||
if (confirm) { |
|||
that.itemList.forEach((r, i) => { |
|||
if (r.toPackingCode == that.currentLabel.packingCode) { |
|||
that.itemList.splice(i, 1); |
|||
return; |
|||
} |
|||
}); |
|||
that.getLabel(); |
|||
} else { |
|||
this.scanPopupGetFocus(); |
|||
} |
|||
}, |
|||
|
|||
async getLabel() { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: '扫描中...', |
|||
mask: true |
|||
}) |
|||
|
|||
let balanceParams = { |
|||
pageSize: 100, |
|||
pageIndex: 1, |
|||
packingCode: that.currentLabel.packingCode, |
|||
}; |
|||
|
|||
let balanceRes = await getBalancesByFilterAsync(balanceParams); |
|||
if (balanceRes.totalCount > 0) { |
|||
let locationCode = balanceRes.items[0].locationCode; |
|||
this.showScanMessage('箱码【' + that.currentLabel.packingCode + '】在【' + locationCode + |
|||
'】库位已经有库存信息,请重新扫描箱码'); |
|||
} else { |
|||
let itemInfo = that.itemList.find(r => { |
|||
return r.itemCode == that.currentLabel.itemCode |
|||
}) |
|||
if (itemInfo == undefined) { |
|||
let params = { |
|||
locationCode: that.fromLocation.code, |
|||
itemCode: that.currentLabel.itemCode |
|||
}; |
|||
|
|||
let wipRes = await getWipListAsync(params); |
|||
if (wipRes.totalCount == 0) { |
|||
this.showScanMessage('零件【' + that.currentLabel.itemCode + '】在【' + this.fromLocation.code + |
|||
'】库位没有库存信息,不可以退库'); |
|||
} else { |
|||
let balanceItem = wipRes.items[0]; |
|||
let item = { |
|||
itemCode: that.currentLabel.itemCode, |
|||
totalQty: balanceItem.qty, |
|||
uom: balanceItem.uom, |
|||
scanQty: 0, |
|||
status: balanceItem.status, |
|||
balanceItem: balanceItem, |
|||
labelList: [] |
|||
}; |
|||
this.addLabel(item); |
|||
} |
|||
} else { |
|||
this.addLabel(itemInfo); |
|||
} |
|||
} |
|||
uni.hideLoading(); |
|||
}, |
|||
|
|||
addLabel(item) { |
|||
//没有标签 |
|||
if (item.labelList.length == 0) { |
|||
if (this.currentLabel.qty > item.totalQty) { |
|||
this.showScanMessage('标签数量【' + this.currentLabel.qty + |
|||
'】大于零件的库存数量【' + item.totalQty + '】,不可以退库') |
|||
} else { |
|||
let data = this.itemList.find(r => r.itemCode == item.itemCode) |
|||
if (data == undefined) { |
|||
this.itemList.push(item) |
|||
} |
|||
this.calcScanQty(item, 0) |
|||
item.labelList.unshift(this.currentLabel); |
|||
this.scanPopupGetFocus(); |
|||
} |
|||
} else { |
|||
let scanQty = 0; |
|||
item.labelList.forEach(r => { |
|||
scanQty += Number(r.qty) |
|||
}) |
|||
if (scanQty + this.currentLabel.qty > item.totalQty) { |
|||
this.showScanMessage('已扫描数量【' + scanQty + '】加标签数量【' + this.currentLabel.qty + |
|||
'】大于零件的库存数量【' + item.totalQty + '】,不可以退库') |
|||
} else { |
|||
this.calcScanQty(item, scanQty) |
|||
item.labelList.unshift(this.currentLabel); |
|||
this.scanPopupGetFocus(); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
calcScanQty(item, scanQty) { |
|||
item.scanQty = scanQty + this.currentLabel.qty; |
|||
|
|||
//标签赋默认值 |
|||
this.currentLabel.locationCode = this.fromLocation.code; |
|||
this.currentLabel.status = 2; |
|||
}, |
|||
|
|||
scanToLocation(item) { |
|||
this.currentItem = item; |
|||
this.openScanToLocationPopup(); |
|||
}, |
|||
|
|||
//扫描默认目标库位 |
|||
getDefaultToLocation(locationCode) { |
|||
let that = this; |
|||
|
|||
uni.showLoading({ |
|||
title: "扫描中", |
|||
mask: true |
|||
}); |
|||
locations(locationCode).then(res => { |
|||
if (res == null) { |
|||
that.showMessage('目标库位【' + locationCode + '】不存在'); |
|||
} else { |
|||
if (res.type == 2 || res.type == 3||res.type == 4 ||res.type == 6) { |
|||
|
|||
showConfirmMsg('是否要将所有未扫描目标库位的零件,指定目标库位【' + locationCode + '】', |
|||
confirm => { |
|||
if (confirm) { |
|||
that.defaultToLocation = res; |
|||
that.itemList.forEach(r => { |
|||
r.labelList.forEach(l => { |
|||
if (l.toLocationCode == '' || l |
|||
.toLocationCode == undefined) { |
|||
that.handledToLocation(l, res); |
|||
} |
|||
}); |
|||
}) |
|||
} |
|||
}); |
|||
} else { |
|||
that.showMessage('目标库位的库位类型必须是【原料库】或【半成品库】或【成品库】或【隔离库】') |
|||
} |
|||
} |
|||
uni.hideLoading(); |
|||
}).catch(err => { |
|||
that.toLocation = null; |
|||
that.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}) |
|||
}, |
|||
|
|||
getToLocation(code) { |
|||
if (code == '') { |
|||
this.showMessage('目标库位不能为空'); |
|||
return; |
|||
} |
|||
if (code == this.currentItem.fromLocationCode) { |
|||
this.showMessage('源库位【' + this.currentItem.fromLocationCode + '】与目标库位【' + code + '】不能相同'); |
|||
return; |
|||
} |
|||
uni.showLoading({ |
|||
title: "扫描中", |
|||
mask: true |
|||
}); |
|||
let that = this; |
|||
locations(code).then(res => { |
|||
if (res == null) { |
|||
that.showMessage('目标库位【' + code + '】不存在'); |
|||
} else { |
|||
|
|||
if (res.type == 2 || res.type == 3||res.type == 4||res.type == 6) { |
|||
this.handledToLocation(this.currentItem, res); |
|||
} else { |
|||
this.showMessage('目标库位的库位类型必须是【原料库】或【半成品库】或【成品库】或【隔离库】') |
|||
} |
|||
} |
|||
uni.hideLoading(); |
|||
}).catch(err => { |
|||
that.toLocation = null; |
|||
that.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}) |
|||
}, |
|||
|
|||
handledToLocation(item, location) { |
|||
item.toLocationCode = location.code; |
|||
item.toLocationGroup = location.locationGroupCode; |
|||
item.toLocationArea = location.areaCode; |
|||
item.toLocationErpCode = location.erpLocationCode; |
|||
this.$forceUpdate(); |
|||
this.closeScanToLocationPopup(); |
|||
}, |
|||
|
|||
clearDefaultLocation() { |
|||
let that = this; |
|||
that.defaultToLocation = null; |
|||
}, |
|||
|
|||
submit() { |
|||
let that = this; |
|||
if (that.itemList.length === 0) { |
|||
that.showMessage('请扫描要退库的零件'); |
|||
return; |
|||
} |
|||
|
|||
let noToLocations = []; |
|||
that.itemList.forEach(r => { |
|||
r.labelList.filter(l => { |
|||
if (l.toLocationCode == '' || l.toLocationCode == undefined) { |
|||
noToLocations.push(l.itemCode) |
|||
} |
|||
}) |
|||
}) |
|||
if (noToLocations.length > 0) { |
|||
that.showMessage('还有未扫描目标库位的零件,请先扫描目标库位'); |
|||
return; |
|||
} |
|||
|
|||
uni.showLoading({ |
|||
title: "提交中....", |
|||
mask: true |
|||
}); |
|||
|
|||
let item = this.getSubmitParam(); |
|||
let params = JSON.stringify(item); |
|||
returnToWarehouse(params) |
|||
.then(res => { |
|||
that.showCommitSuccess(); |
|||
that.clearInfo(); |
|||
uni.hideLoading(); |
|||
}) |
|||
.catch(err => { |
|||
that.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
|
|||
|
|||
getSubmitParam() { |
|||
let that = this; |
|||
let item = { |
|||
number: "", |
|||
worker: localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN, |
|||
putawayType: 2, |
|||
details: [] |
|||
} |
|||
|
|||
that.itemList.forEach(i => { |
|||
let balanceItem = i.balanceItem; |
|||
i.labelList.forEach(l => { |
|||
let detail = {}; |
|||
detail.itemCode = balanceItem.itemCode; |
|||
detail.itemName = balanceItem.itemName; |
|||
detail.itemDesc1 = balanceItem.itemDesc1; |
|||
detail.itemDesc2 = balanceItem.itemDesc2; |
|||
detail.uom = l.uom; |
|||
detail.qty = l.qty; |
|||
detail.stdPackQty = balanceItem.stdPackQty; |
|||
|
|||
detail.fromPackingCode = balanceItem.packingCode; |
|||
detail.toPackingCode = l.packingCode; |
|||
detail.fromLot = balanceItem.lot; |
|||
detail.toLot = l.lot; |
|||
|
|||
detail.fromLocationCode = that.fromLocation.code; |
|||
detail.fromLocationErpCode = that.fromLocation.erpLocationCode; |
|||
detail.fromLocationGroup = that.fromLocation.locationGroupCode; |
|||
detail.fromLocationArea = that.fromLocation.areaCode; |
|||
|
|||
detail.toLocationCode = l.toLocationCode ?? that.defaultToLocation.code; |
|||
detail.toLocationGroup = l.toLocationGroup ?? that.defaultToLocation |
|||
.locationGroupCode; |
|||
detail.toLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode; |
|||
detail.toLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation |
|||
.erpLocationCode; |
|||
|
|||
detail.fromStatus = balanceItem.status; |
|||
detail.toStatus = l.status; |
|||
|
|||
detail.fromWarehouseCode = localStorage.warehouseCode; |
|||
detail.toWarehouseCode = localStorage.warehouseCode; |
|||
|
|||
detail.supplierBatch = balanceItem.supplierBatch; |
|||
detail.arriveDate = balanceItem.arriveDate; |
|||
detail.produceDate = balanceItem.produceDate; |
|||
detail.expireDate = balanceItem.expireDate; |
|||
//=========================================== |
|||
detail.recommendContainerCode = that.fromLocation.code; |
|||
detail.recommendPackingCode = balanceItem.packingCode; |
|||
detail.recommendSupplierBatch = l.supplierBatch; |
|||
detail.recommendArriveDate = l.arriveDate; |
|||
detail.recommendProduceDate = l.produceDate; |
|||
detail.recommendExpireDate = l.expireDate; |
|||
detail.recommendLot = balanceItem.lot;; |
|||
detail.recommendToLocationCode = l.toLocationCode ?? that.defaultToLocation.code; |
|||
detail.recommendToLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode; |
|||
detail.recommendToLocationGroup = l.toLocationGroup ?? that.defaultToLocation |
|||
.locationGroupCode; |
|||
detail.recommendToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation |
|||
.erpLocationCode; |
|||
detail.recommendToWarehouseCode = localStorage.warehouseCode; |
|||
detail.recommendQty = balanceItem.qty; |
|||
|
|||
|
|||
detail.handledContainerCode = l.containerCode; |
|||
detail.handledPackingCode = l.packingCode; |
|||
detail.handledSupplierBatch = l.supplierBatch; |
|||
detail.handledArriveDate = l.arriveDate; |
|||
detail.handledProduceDate = l.produceDate; |
|||
detail.handledExpireDate = l.expireDate; |
|||
detail.handledLot = l.lot; |
|||
detail.handledToLocationCode = l.toLocationCode ?? that.defaultToLocation.code; |
|||
detail.handledToLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode; |
|||
detail.handledToLocationGroup = l.toLocationGroup ?? that.defaultToLocation |
|||
.locationGroupCode; |
|||
detail.handledToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation |
|||
.erpLocationCode; |
|||
detail.handledToWarehouseCode = localStorage.warehouseCode; |
|||
detail.handledQty = l.qty; |
|||
item.details.push(detail); |
|||
}); |
|||
}) |
|||
return item; |
|||
}, |
|||
|
|||
cancel() { |
|||
let that = this; |
|||
showConfirmMsg('是否要清空已扫描的零件和库位信息?', confirm => { |
|||
if (confirm) { |
|||
that.clearInfo(); |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
clearInfo() { |
|||
let that = this; |
|||
that.itemList = []; |
|||
that.fromLocation = null; |
|||
that.toLocation = null; |
|||
that.defaultToLocation = null; |
|||
}, |
|||
|
|||
openScanPopup() { |
|||
if (this.fromLocation == null) { //扫描来源库位 |
|||
this.openScanFromLocationPopup(); |
|||
} else { //扫描箱标签 |
|||
this.openPackLabel(); |
|||
} |
|||
}, |
|||
|
|||
scanPopupGetFocus() { |
|||
this.$refs.scanPackPopup.getfocus(); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
showCommitSuccess() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
showRescanMessage(message) { |
|||
this.$refs.comMessage.showRescanMessage(message); |
|||
}, |
|||
showScanMessage(message) { |
|||
this.$refs.comMessage.showScanMessage(message); |
|||
}, |
|||
closeCommitMessage() { |
|||
// this.openScanPopup(); |
|||
}, |
|||
closeScanMessage() { |
|||
this.scanPopupGetFocus(); |
|||
}, |
|||
openPackLabel() { |
|||
this.$refs.scanPackPopup.openScanPopup() |
|||
}, |
|||
|
|||
openScanFromLocationPopup() { |
|||
this.$refs.scanFromLocationPopup.openScanPopup() |
|||
}, |
|||
|
|||
closeScanFromLocationPopup() { |
|||
this.$refs.scanFromLocationPopup.closeScanPopup(); |
|||
}, |
|||
|
|||
openScanToLocationPopup() { |
|||
this.$refs.scanToLocationPopup.openScanPopup() |
|||
}, |
|||
|
|||
closeScanToLocationPopup() { |
|||
this.$refs.scanToLocationPopup.closeScanPopup(); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,547 @@ |
|||
<!-- 发料任务详情 --> |
|||
<template> |
|||
<page-meta root-font-size="16px"></page-meta> |
|||
<view class=""> |
|||
<view class="top_card"> |
|||
<com-job-scan-detail |
|||
:jobContent="datacontent" |
|||
:allCount="allCount" |
|||
:isShowScanHint="true" |
|||
scanHint="已发数" |
|||
:scanCount="scanCount" |
|||
:isShowOther="true" |
|||
:isShowShouRong="true" |
|||
:shouRongCount="shouRongCount" |
|||
> |
|||
</com-job-scan-detail> |
|||
</view> |
|||
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" |
|||
class="scroll-detail" style="padding-bottom: 40rpx;"> |
|||
<view class="" v-for="(item, index) in details" :key="index"> |
|||
<view class="detail-list margin_top"> |
|||
<!-- 单选卡片 --> |
|||
<view class="detail-content"> |
|||
<view class="choose_main"> |
|||
<view class="ljh_box"> |
|||
<view class="tit_ljh">{{ item.itemCode }}</view> |
|||
<view class="ljh_left"> |
|||
<view class="font_xs text_lightblue">{{ item.itemName }}</view> |
|||
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="list_form hold_form"> |
|||
<view class="uni-container"> |
|||
<uni-table style=""> |
|||
<uni-tr> |
|||
<uni-th width="100" align="center"> |
|||
<text |
|||
style="font-weight:800; font-size: 35rpx; color: black; ">推荐</text> |
|||
</uni-th> |
|||
<uni-th width="120" align="center">来源</uni-th> |
|||
<uni-th width="120" align="center">目标</uni-th> |
|||
</uni-tr> |
|||
|
|||
<uni-tr> |
|||
<uni-td width="100" align="center">库位</uni-td> |
|||
<uni-td width="120" align="center"> |
|||
{{item.recommendFromLocationCode}}</uni-td> |
|||
<uni-td width="120" align="center"> |
|||
{{item.recommendToLocationCode}}</uni-td> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-td width="100" align="center">数量({{item.uom}})</uni-td> |
|||
<uni-td width="120" align="center">{{item.recommendFromQty}}</uni-td> |
|||
<uni-td width="120" align="center">{{item.recommendToQty }}</uni-td> |
|||
</uni-tr> |
|||
|
|||
</uni-table> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="list_form hold_form"> |
|||
<view class="uni-container"> |
|||
<uni-table style=""> |
|||
<uni-tr> |
|||
<uni-th width="100" align="center"> |
|||
<text |
|||
style="font-weight:800; font-size: 35rpx; color: black; ">实际</text></uni-th> |
|||
<uni-th width="120" align="center">来源</uni-th> |
|||
<uni-th width="120" align="center">目标</uni-th> |
|||
</uni-tr> |
|||
|
|||
<uni-tr> |
|||
<uni-td width="100" align="center">库位</uni-td> |
|||
<uni-td width="120" align="center"> |
|||
{{item.handledFromLocationCode}}</uni-td> |
|||
<uni-td width="120" align="center"> {{item.handledToLocationCode}}</uni-td> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-td width="100" align="center">数量({{item.uom}})</uni-td> |
|||
<uni-td width="120" align="center">{{item.tempHandledFromQty}}</uni-td> |
|||
<uni-td width="120" align="center"> |
|||
<view |
|||
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> |
|||
<com-number-box ref="comNumberBoxRef" v-model="item.tempHandledToQty" |
|||
:max="999999" :min="0" style='width: 100px;' |
|||
@change="qtyChanged($event,item,index)"> |
|||
</com-number-box> |
|||
</view> |
|||
</uni-td> |
|||
</uni-tr> |
|||
|
|||
</uni-table> |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="" style="margin-left: 50rpx; margin-right: 50rpx;"> |
|||
<button type="primary" size="default" @click="recommend"> 推荐</button> |
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
</scroll-view> |
|||
<view class="" |
|||
style=" display: flex; width: 100%;padding-bottom: 150rpx; flex-direction: row; justify-content: space-around;"> |
|||
<view class="" style=" align-items: center;"> |
|||
<view class="scan_float_top" @click="openScanPopup"> |
|||
<image src="@/static/icons_ui/icon_scan_white.svg"></image> |
|||
<view>单件码</view> |
|||
</view> |
|||
</view> |
|||
<view class="" style=""> |
|||
<view class="scan_float_top" @click="openLocationFrom"> |
|||
<image src="@/static/icons_ui/icon_scan_white.svg"></image> |
|||
<view>来源库位</view> |
|||
</view> |
|||
</view> |
|||
<view class="" style=""> |
|||
<view class="scan_float_top" @click="openLocationTo"> |
|||
<image src="@/static/icons_ui/icon_scan_white.svg"></image> |
|||
<view>目标库位</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
<view class="uni-flex uni-row new_btn_bot"> |
|||
<button class="new_clear_btn btn_double" @click="clear()">清空</button> |
|||
<button class="new_save_btn btn_double" @click="submit()">提交</button> |
|||
</view> |
|||
<selectClickList ref="selectPopup" title="推荐信息" @select="selectPlan"></selectClickList> |
|||
<winScanLocationCode ref="locationFrom" title="来源库位" @getLocation="getFromLocation"></winScanLocationCode> |
|||
<winScanLocationCode ref="locationTo" title="目标库位" @getLocation="getToLocation"></winScanLocationCode> |
|||
|
|||
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode> |
|||
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()' |
|||
@afterCloseScanMessage='closeScanMessage'></com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getKittingIssueDetail, |
|||
takeKittingIssueJob, |
|||
cancelTakeKittingIssueJob, |
|||
finshKittingIssueJob, |
|||
getCountByItemCode, |
|||
getRecommendBalance |
|||
} from '@/api/index.js'; |
|||
import { |
|||
getJobStatuStyle, |
|||
getJobStatuDesc, |
|||
showConfirmMsg, |
|||
goHome, |
|||
compareDesc, |
|||
compareStr, |
|||
getCurrDateTime, |
|||
navigateBack |
|||
} from '@/common/basic.js'; |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import winScanButtonLeft from '@/mycomponents/wincom/winScanButtonLeft.vue' |
|||
import winScanButtonTop from '@/mycomponents/wincom/winScanButtonTop.vue' |
|||
import winScanButtonBottom from '@/mycomponents/wincom/winScanButtonBottom.vue' |
|||
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
|||
import comBalance from '@/mycomponents/common/comBalance.vue' |
|||
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue' |
|||
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' |
|||
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
|||
import winScanLocationCode from '@/mycomponents/wincom/winScanLocationCode.vue'; |
|||
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue' |
|||
import selectClickList from "@/mycomponents/popup/selectClickList.vue" |
|||
|
|||
export default { |
|||
components: { |
|||
comMessage, |
|||
winScanButtonLeft, |
|||
winScanButtonTop, |
|||
winScanButtonBottom, |
|||
winMulitScan, |
|||
comBalance, |
|||
comJobScanDetail, |
|||
winScanByPack, |
|||
comNumberBox, |
|||
winScanLocationCode, |
|||
winScanByProductCode, |
|||
selectClickList |
|||
}, |
|||
data() { |
|||
return { |
|||
id: "", |
|||
datacontent: {}, |
|||
details: [], |
|||
toLocation: '', |
|||
ispending: false, |
|||
allCount: 0, |
|||
scanCount:0, |
|||
isPack: true, |
|||
titleArray: ['箱标签'], |
|||
jobStatus: "", |
|||
toLocationInfo: {}, |
|||
singCode: "", |
|||
shouRongCount:null |
|||
} |
|||
}, |
|||
props: { |
|||
itemCode: "", |
|||
}, |
|||
onLoad(param) { |
|||
this.id = param.id; |
|||
if (param.jobStatus == 1) { |
|||
this.receive((callback => { |
|||
this.getDetail(); |
|||
})); |
|||
} else { |
|||
this.getDetail(); |
|||
} |
|||
}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} else if (e.index === 1) { |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
//拦截返回按钮事件 |
|||
onBackPress(e) { |
|||
//已经接收但是没提交任务 |
|||
if (e.from == 'backbutton') { |
|||
if (this.jobStatus == 2) { |
|||
//取消承接任务 |
|||
cancelTakeKittingIssueJob(this.id).then(res => { |
|||
uni.navigateBack(); |
|||
}).catch(error => { |
|||
uni.navigateBack(); |
|||
}) |
|||
} else { |
|||
uni.navigateBack(); |
|||
} |
|||
return true; |
|||
} |
|||
}, |
|||
mounted() { |
|||
uni.setNavigationBarColor({ |
|||
frontColor: '#ffffff', |
|||
backgroundColor: "#5A7CF3 !important" |
|||
}) |
|||
}, |
|||
methods: { |
|||
openScanPopup() { |
|||
this.$refs.scanPackPopup.openScanPopup(); |
|||
}, |
|||
openLocationTo() { |
|||
this.$refs.locationTo.openScanPopup() |
|||
}, |
|||
openLocationFrom() { |
|||
this.$refs.locationFrom.openScanPopup() |
|||
}, |
|||
getFromLocation(locationInfo) { |
|||
var current = this.details[0] |
|||
if (locationInfo.code != current.recommendFromLocationCode) { |
|||
this.showMessage(" 扫描来源库位[" + locationInfo.code + "]与推荐来源库位[" + current |
|||
.recommendFromLocationCode + "]不一致,请重新扫描") |
|||
return; |
|||
} |
|||
|
|||
current.handledFromLocationCode = locationInfo.code |
|||
current.handledFromLocationArea = locationInfo.locationArea |
|||
current.handledFromLocationGroup = locationInfo.locationGroup |
|||
current.handledFromLocationErpCode = locationInfo.locationErpCode |
|||
current.handledFromWarehouseCode = locationInfo.warehouseCode |
|||
current.handledFromPackingCode = "" |
|||
current.handledFromLot = "" |
|||
|
|||
}, |
|||
|
|||
getToLocation(locationInfo) { |
|||
var current = this.details[0] |
|||
if (locationInfo.code != current.recommendToLocationCode) { |
|||
this.showMessage("扫描目标库位[" + locationInfo.code + "]与推荐目标库位[" + current |
|||
.recommendToLocationCode + "]不一致,请重新扫描") |
|||
return; |
|||
} |
|||
this.toLocationInfo = locationInfo |
|||
current.handledToLocationCode = locationInfo.code |
|||
current.handledToLocationArea = locationInfo.locationArea |
|||
current.handledToLocationGroup = locationInfo.locationGroup |
|||
current.handledToLocationErpCode = locationInfo.locationErpCode |
|||
current.handledToWarehouseCode = locationInfo.warehouseCode |
|||
current.handledToPackingCode = "" |
|||
current.handledToLot = "" |
|||
}, |
|||
//加载零件信息 |
|||
getDetail() { |
|||
let that = this; |
|||
if (that.id == undefined) { |
|||
return; |
|||
} |
|||
uni.showLoading({ |
|||
title: '加载中...', |
|||
mask: true |
|||
}) |
|||
let params = { |
|||
id: that.id, |
|||
}; |
|||
getKittingIssueDetail(params) |
|||
.then(item => { |
|||
console.log('item', item); |
|||
that.datacontent = item; |
|||
that.jobStatus = item.jobStatus; |
|||
that.details = item.details; |
|||
if (that.details != null) { |
|||
that.details.forEach( |
|||
r => { |
|||
r.scaned = false; |
|||
r.scanDate = new Date() |
|||
|
|||
} |
|||
); |
|||
that.ispending = item.jobStatus === 2; |
|||
this.allCount = that.details[0].recommendFromQty; |
|||
this.scanCount = that.details[0].handledToQty; |
|||
that.details[0].defaultHandleQty = that.details[0].handledFromQty; |
|||
that.details[0].tempHandledToQty =0 |
|||
that.details[0].tempHandledFromQty =0 |
|||
//查找收容数 |
|||
getCountByItemCode(that.details[0].itemCode).then(res => { |
|||
if (res) { |
|||
uni.hideLoading(); |
|||
var qty = res.qty; |
|||
this.shouRongCount = qty; |
|||
this.details[0].tempHandledToQty = qty; |
|||
this.details[0].tempHandledFromQty = qty; |
|||
this.$forceUpdate() |
|||
} else { |
|||
this.showMessage("没有查找到[" + that.details[0].itemCode + "]的收容数") |
|||
} |
|||
}).catch(error => { |
|||
uni.hideLoading(); |
|||
this.showMessage(error) |
|||
}) |
|||
} |
|||
|
|||
}) |
|||
.catch(err => { |
|||
this.showMessage('未查找到详细信息') |
|||
|
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
getScanResult(result) { |
|||
let item = this.details.find(r => { |
|||
return r.itemCode == result.itemCode |
|||
}); |
|||
|
|||
if (item == undefined) { |
|||
this.showMessage('在任务详情中,未找到物料号【' + result.itemCode + '】'); |
|||
return; |
|||
} |
|||
this.singCode = result.itemCode |
|||
|
|||
|
|||
}, |
|||
|
|||
recommend(){ |
|||
var itemCode =this.details[0].itemCode |
|||
var productLine =this.details[0].prodLine |
|||
if(!itemCode){ |
|||
this.showMessage("物料为空") |
|||
return; |
|||
} |
|||
if(!productLine){ |
|||
this.showMessage("生产线为空") |
|||
return; |
|||
} |
|||
|
|||
uni.showLoading({ |
|||
title: "加载中", |
|||
mask: true |
|||
}) |
|||
|
|||
getRecommendBalance(itemCode,productLine,false).then(res=>{ |
|||
uni.hideLoading() |
|||
if (res.length > 0) { |
|||
var list = []; |
|||
list = res.Result; |
|||
list.forEach(res => { |
|||
res.label = res.PLAN_NO; |
|||
res.value = res.SHIFT_CODE |
|||
}) |
|||
this.$refs.selectPopup.openScanPopup(list) |
|||
} |
|||
|
|||
else { |
|||
this.showMessage("推荐列表为0") |
|||
} |
|||
}).catch(error=>{ |
|||
uni.hideLoading() |
|||
this.showMessage(error) |
|||
}) |
|||
}, |
|||
|
|||
// //接收 |
|||
receive(callback) { |
|||
let params = { |
|||
id: this.id |
|||
}; |
|||
takeKittingIssueJob(params) |
|||
.then(res => { |
|||
callback(true); |
|||
}) |
|||
.catch(err => { |
|||
this.showMessage(err.message); |
|||
callback(false); |
|||
}); |
|||
}, |
|||
|
|||
submit() { |
|||
let that = this; |
|||
if (that.details.length === 0) { |
|||
this.showMessage('该任务没有零件'); |
|||
return; |
|||
} |
|||
if (this.singCode == "") { |
|||
this.showMessage('请先扫描单件码'); |
|||
return; |
|||
} |
|||
|
|||
if (!that.details[0].handledFromLocationCode) { |
|||
this.showMessage('请先扫描来源库位'); |
|||
return; |
|||
} |
|||
if (!that.details[0].handledToLocationCode) { |
|||
this.showMessage('请先扫描目标库位'); |
|||
return; |
|||
} |
|||
|
|||
if (that.details[0].itempHandledToQty == 0 || that.details[0].itempHandledToQty == "") { |
|||
this.showMessage('发料数量必须大于0'); |
|||
return; |
|||
} |
|||
that.finsh(); |
|||
|
|||
}, |
|||
|
|||
|
|||
finsh() { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "提交中...", |
|||
mask: true |
|||
}); |
|||
that.details[0].handledFromQty =that.details[0].tempHandledToQty |
|||
that.details[0].handledToQty =that.details[0].tempHandledToQty |
|||
let params = that.details[0]; |
|||
finshKittingIssueJob(that.id, params.id, params) |
|||
.then(res => { |
|||
uni.hideLoading(); |
|||
if (res != null) { |
|||
that.showCommitSuccessMessage(); |
|||
} |
|||
}) |
|||
.catch(err => { |
|||
that.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
|
|||
clear() { |
|||
this.singCode == "" |
|||
this.getDetail(); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
showScanMessage(message) { |
|||
this.$refs.comMessage.showScanMessage(message); |
|||
}, |
|||
|
|||
showCommitSuccessMessage() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
|
|||
closeCommitMessage() { |
|||
navigateBack(1) |
|||
uni.hideLoading(); |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
this.$refs.scanPopupForm.closeScanPopup(); |
|||
}, |
|||
|
|||
closeScanMessage() { |
|||
this.scanPopupGetFocus(); |
|||
}, |
|||
|
|||
scanPopupGetFocus() { |
|||
this.$refs.scanPopupForm.getfocus(); |
|||
}, |
|||
|
|||
qtyChanged(value, item, index) { |
|||
if (item.tempHandledToQty == 0) { |
|||
this.$refs.comNumberBoxRef[0].setValue(0); |
|||
this.showMessage('请先扫描单件码') |
|||
return; |
|||
} |
|||
if (value == 0) { |
|||
this.showMessage('发料数量必须大于0') |
|||
item.tempHandledToQty =item.tempHandledFromQty |
|||
this.$refs.comNumberBoxRef[0].setValue(item.tempHandledToQty); |
|||
return; |
|||
} |
|||
item.tempHandledFromQty =value; |
|||
console.log('item', item.tempHandledFromQty); |
|||
this.$forceUpdate(); |
|||
|
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
.scan_float_top { |
|||
opacity: 0.4; |
|||
width: 110rpx; |
|||
height: 110rpx; |
|||
color: #000; |
|||
background-color: #5A7CF3; |
|||
border-radius: 50%; |
|||
text-align: center; |
|||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); |
|||
} |
|||
|
|||
.scan_float_top image { |
|||
width: 40rpx; |
|||
height: 40rpx; |
|||
margin-top: 10rpx; |
|||
} |
|||
|
|||
.scan_float_top view { |
|||
color: #fff; |
|||
font-size: .725rem; |
|||
margin-top: -8rpx; |
|||
} |
|||
</style> |
@ -0,0 +1,169 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<win-empty-view v-if="deliverList.length==0"></win-empty-view> |
|||
<view hover-class="uni-list-cell-hover" v-for="(item, index) in deliverList" :key="item.id" |
|||
@click="openDetail(item)"> |
|||
<comInjectIssue :dataContent="item"></comInjectIssue> |
|||
</view> |
|||
<uni-load-more :status="loadingType" v-if="deliverList.length>0" /> |
|||
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'> |
|||
</win-mulit-scan> --> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
|
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getInjectionPlanJobList, |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
goHome |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' |
|||
import comInjectIssue from '@/mycomponents/coms/task/comInjectIssue.vue'; |
|||
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
export default { |
|||
name: 'deliver', |
|||
components: { |
|||
winEmptyView, |
|||
winScanButton, |
|||
winMulitScan, |
|||
comInjectIssue, |
|||
comMessage |
|||
}, |
|||
data() { |
|||
return { |
|||
deliverList: [], |
|||
reload: false, |
|||
status: '', |
|||
contentText: { |
|||
contentdown: '上拉加载更多', |
|||
contentrefresh: '加载中', |
|||
contentnomore: '没有更多' |
|||
}, |
|||
pageSize: this.modelConfig, |
|||
pageIndex: 1, |
|||
isTimeWindowSorting: false, |
|||
isToday: true, |
|||
titleArray: ['任务编号'], |
|||
loadingType: "nomore" |
|||
|
|||
}; |
|||
}, |
|||
props: { |
|||
datacontent: { |
|||
type: Object, |
|||
value: null |
|||
} |
|||
}, |
|||
onShow: function() { |
|||
this.getList('refresh'); |
|||
}, |
|||
onReachBottom() { |
|||
//避免多次触发 |
|||
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
|||
return; |
|||
} |
|||
this.getList("more"); |
|||
}, |
|||
onPullDownRefresh() { |
|||
this.getList('refresh'); |
|||
}, |
|||
//后退按钮 |
|||
onBackPress(options) { |
|||
if (options.from === 'navigateBack') { |
|||
return false; |
|||
} |
|||
goHome(); |
|||
return true; |
|||
}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
}else if(e.index === 1){ |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
methods: { |
|||
openScanPopup() { |
|||
this.$refs.scanPopup.openScanPopup(); |
|||
}, |
|||
//按时间窗口排序 |
|||
timeSortingChange: function(e) { |
|||
this.isTimeWindowSorting = e.detail.value |
|||
this.getList() |
|||
}, |
|||
|
|||
//只看当天到货 |
|||
isTodayChange: function(e) { |
|||
this.isToday = e.detail.value |
|||
this.getList() |
|||
}, |
|||
|
|||
//查询发货任务 |
|||
getList(type) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
this.loadingType = "loading"; |
|||
if (type === "refresh") { |
|||
this.pageIndex = 1; |
|||
this.deliverList = []; |
|||
} |
|||
let params = { |
|||
pageSize: that.pageSize, |
|||
pageIndex: that.pageIndex, |
|||
// isCreationTimeSorting: that.isTimeWindowSorting, |
|||
// isToday: that.isToday |
|||
}; |
|||
getInjectionPlanJobList(params) |
|||
.then(res => { |
|||
uni.hideLoading(); |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
var list = res.items; |
|||
this.loadingType = "loadmore"; |
|||
if (list == null || list.length == 0) { |
|||
//没数据了 |
|||
this.loadingType = "nomore"; |
|||
return; |
|||
} |
|||
// that.deliverList = [...that.deliverList, ...list]; |
|||
that.deliverList = type === "refresh" ? list : this.deliverList.concat(list); |
|||
that.pageIndex++; |
|||
}) |
|||
.catch(err => { |
|||
this.loadingType = ""; |
|||
this.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
openDetail(item) { |
|||
uni.navigateTo({ |
|||
url: './injectionPlanJobDetail?id=' + item.id + '&jobStatus=' + item.jobStatus |
|||
}); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,464 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<view class="top_card"> |
|||
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount"> |
|||
</com-job-scan-detail> |
|||
</view> |
|||
<!-- <view class="uni-flex uni-row" style="background-color: #fff; padding: 20rpx; align-items: center;"> |
|||
<view class="" style="font-size: 35rpx; font-weight: bold; margin-right: 10rpx;"> |
|||
来源库位 : |
|||
</view> |
|||
<uni-data-select v-model="value" :localdata="range" @change="change" label="来源库位"></uni-data-select> |
|||
</view> --> |
|||
|
|||
|
|||
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" |
|||
class="scroll-detail"> |
|||
<view class="uni-flex uni-col" style="flex-direction: column"> |
|||
<view class="" v-for="(item, index) in details" :key="index"> |
|||
<view class="detail-list margin_top"> |
|||
<!-- 单选卡片 --> |
|||
<view class="detail-content"> |
|||
<view class="choose_main"> |
|||
<view class="ljh_box"> |
|||
<view class="tit_ljh">{{ item.itemCode }}</view> |
|||
<view class="ljh_left"> |
|||
<view class="font_xs text_lightblue">{{ item.itemName }}</view> |
|||
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view> |
|||
</view> |
|||
</view> |
|||
<view class="list_form hold_form"> |
|||
<view class="uni-container"> |
|||
<uni-table style="overflow-x: hidden;"> |
|||
<!-- <uni-tr> |
|||
<uni-th width="70"></uni-th> |
|||
<uni-th width="120" align="center">推荐</uni-th> |
|||
<uni-th width="120" align="center"></uni-th> |
|||
</uni-tr> --> |
|||
<uni-tr> |
|||
<uni-th width="70">收容数</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view class="text_black">{{item.requestQty}}({{item.uom}})</text> |
|||
</view> |
|||
</uni-th> |
|||
<!-- --> |
|||
<!-- <uni-th width="120" align="center"> |
|||
<view class="" v-if="item.scaned"> |
|||
<com-number-box :ref="'comNumberBox_'+index" |
|||
v-model="item.handledQty" :max="99999" :min="0" |
|||
@change="qtyChanged($event,item,index)"> |
|||
</com-number-box> |
|||
</view> --> |
|||
<!-- <view v-if="dataContent.scaned" class="text_black"> |
|||
{{dataContent.handledQty}}({{dataContent.uom}}) |
|||
</view> --> |
|||
<!-- </uni-th> --> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="70">来源库位</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view class="text_black">{{ item.recommendFromLocationCode }}</view> |
|||
</uni-th> |
|||
<!-- <uni-th width="120" align="center"> |
|||
<view class=""> |
|||
<button v-if="item.scaned" type="primary" size="mini" |
|||
style="margin-left: 30rpx;" |
|||
@click="remove(dataContent,index)">移除</button> |
|||
</view> |
|||
</uni-th> --> |
|||
</uni-tr> |
|||
</uni-table> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="choose_marked" v-if="item.scaned"> |
|||
<image src="@/static/image_marked.svg"></image> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
</scroll-view> |
|||
|
|||
<div class="new_bot_box"> |
|||
<!-- <win-collapse-location scanTitle='扫描目标库位' ref='comCollapseLocation' @getLocationCode='getDefaultToLocation' |
|||
@clear='clearDefaultLocation'> |
|||
</win-collapse-location> --> |
|||
<view class="new_btn_bot bot_pos uni-flex"> |
|||
<!-- <button class="new_clear_btn btn_double" @click="cancel()">清空</button> --> |
|||
<button class="new_save_btn " style="width: 100%;" @click="submit()">提交</button> |
|||
</view> |
|||
</div> |
|||
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode> |
|||
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getInjectionPlanDetail, |
|||
takeInjectionPlanJob, |
|||
cancelTakeInjectionPlanJob, |
|||
finshInjectionPlanJob, |
|||
locations |
|||
} from '@/api/index.js'; |
|||
import { |
|||
showConfirmMsg, |
|||
goHome, |
|||
navigateBack |
|||
} from '@/common/basic.js'; |
|||
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
|||
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue' |
|||
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue' |
|||
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue' |
|||
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
|||
import comProductCode from '@/mycomponents/coms/task/comProductCode.vue'; |
|||
|
|||
|
|||
|
|||
export default { |
|||
components: { |
|||
winScanButton, |
|||
winMulitScan, |
|||
winScanByPack, |
|||
comMessage, |
|||
comJobScanDetail, |
|||
winCollapseLocation, |
|||
winScanByProductCode, |
|||
comNumberBox, |
|||
comProductCode |
|||
}, |
|||
data() { |
|||
return { |
|||
type: '', |
|||
id: "", |
|||
datacontent: {}, |
|||
details: [], |
|||
toLocation: '', |
|||
scrollTop: 0, |
|||
old: { |
|||
scrollTop: 0 |
|||
}, |
|||
ispending: false, |
|||
balancesItem: {}, |
|||
titleArray: ['箱标签', '目标库位'], |
|||
allCount: 0, |
|||
scanCount: 0, |
|||
jobStatus: "", |
|||
toLocationInfo: null, |
|||
value: 0, |
|||
range: [{ |
|||
value: 0, |
|||
text: "篮球" |
|||
}, |
|||
{ |
|||
value: 1, |
|||
text: "足球" |
|||
}, |
|||
{ |
|||
value: 2, |
|||
text: "游泳" |
|||
}, |
|||
{ |
|||
value: 0, |
|||
text: "篮球" |
|||
}, |
|||
{ |
|||
value: 1, |
|||
text: "足球" |
|||
}, |
|||
{ |
|||
value: 2, |
|||
text: "游泳" |
|||
}, |
|||
{ |
|||
value: 0, |
|||
text: "篮球" |
|||
}, |
|||
{ |
|||
value: 1, |
|||
text: "足球" |
|||
}, |
|||
{ |
|||
value: 2, |
|||
text: "游泳" |
|||
}, |
|||
{ |
|||
value: 0, |
|||
text: "篮球" |
|||
}, |
|||
{ |
|||
value: 1, |
|||
text: "足球" |
|||
}, |
|||
{ |
|||
value: 2, |
|||
text: "游泳" |
|||
}, |
|||
], |
|||
} |
|||
}, |
|||
onLoad(param) { |
|||
this.id = param.id; |
|||
if (param.jobStatus == 1) { |
|||
this.receive((callback => { |
|||
this.getDetail(); |
|||
})); |
|||
} else { |
|||
this.getDetail(); |
|||
} |
|||
}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} else if (e.index === 1) { |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
//拦截返回按钮事件 |
|||
onBackPress(e) { |
|||
//已经接收但是没提交任务 |
|||
if (e.from == 'backbutton') { |
|||
if (this.jobStatus == 2) { |
|||
//取消承接任务 |
|||
cancelTakeInjectionPlanJob(this.id).then(res => { |
|||
uni.navigateBack(); |
|||
}).catch(error => { |
|||
uni.navigateBack(); |
|||
}) |
|||
} else { |
|||
uni.navigateBack(); |
|||
} |
|||
return true; |
|||
} |
|||
}, |
|||
mounted() { |
|||
uni.setNavigationBarColor({ |
|||
frontColor: '#ffffff', |
|||
backgroundColor: "#5A7CF3 !important" |
|||
}) |
|||
}, |
|||
methods: { |
|||
change(e) { |
|||
console.log("e:", e); |
|||
}, |
|||
//扫描默认目标库位 |
|||
getDefaultToLocation(locationCode) { |
|||
uni.showLoading({ |
|||
title: "扫描中", |
|||
mask: true |
|||
}); |
|||
locations(locationCode).then(res => { |
|||
uni.hideLoading(); |
|||
if (res) { |
|||
this.toLocationInfo = res |
|||
} else { |
|||
this.showMessage('目标库位【' + locationCode + '】不存在'); |
|||
} |
|||
|
|||
}).catch(err => { |
|||
uni.hideLoading(); |
|||
this.toLocationInfo = null |
|||
this.showMessage(err.message); |
|||
|
|||
}) |
|||
}, |
|||
|
|||
clearDefaultLocation() { |
|||
this.toLocationInfo = null |
|||
}, |
|||
remove(item, index) { |
|||
showConfirmMsg("是否移除当前【" + item.itemCode + "】扫描信息", res => { |
|||
if (res) { |
|||
item.scaned = false; |
|||
item.handledQty = null; |
|||
this.getScanCount() |
|||
} |
|||
}) |
|||
}, |
|||
qtyChanged(value, item, index) { |
|||
if (value <= 0) { |
|||
this.showMessage('收货货数量必须大于0') |
|||
item.qty = item.handledQty |
|||
this.$refs['comNumberBox_' + index][0].setValue(item.qty); |
|||
} |
|||
}, |
|||
openScanPopup() { |
|||
this.$refs.scanPackPopup.openScanPopup(); |
|||
}, |
|||
//加载零件信息 |
|||
getDetail() { |
|||
let that = this; |
|||
let params = { |
|||
id: that.id, |
|||
}; |
|||
getInjectionPlanDetail(params) |
|||
.then(item => { |
|||
console.log('item', item); |
|||
that.datacontent = item; |
|||
that.jobStatus = item.jobStatus |
|||
that.details = item.details; |
|||
that.details.forEach(res => { |
|||
res.scaned = false; |
|||
}) |
|||
that.ispending = item.jobStatus === 2; |
|||
that.allCount = item.details.length; |
|||
// that.toLocation = item.details[0].recommendLocationCode; |
|||
}) |
|||
.catch(err => { |
|||
this.showMessage('未查找到详细信息') |
|||
}); |
|||
}, |
|||
//扫描箱标签 |
|||
getScanResult(result) { |
|||
let item = this.details.find(r => { |
|||
return r.itemCode == result.itemCode |
|||
}); |
|||
|
|||
if (item === undefined) { |
|||
this.showMessage('在任务详情中,未找到物料号【' + result.itemCode + '】'); |
|||
return; |
|||
} else { |
|||
if (item.scaned) { |
|||
this.showMessage('物料号【' + result.itemCode + '】已经扫描,请扫描下一箱零件'); |
|||
return; |
|||
} else { |
|||
item.scaned = true; |
|||
item.handledQty = item.recommendQty; |
|||
this.getScanCount() |
|||
setTimeout(res => { |
|||
this.$forceUpdate() |
|||
}, 1000) |
|||
|
|||
} |
|||
} |
|||
|
|||
}, |
|||
|
|||
|
|||
getScanCount() { |
|||
this.scanCount = this.datacontent.details.filter(r => r.scaned).length; |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
if (this.allCount == this.scanCount) { |
|||
this.$refs.scanPopup.closeScanPopup(); |
|||
} |
|||
}, |
|||
|
|||
cancel() { |
|||
showConfirmMsg("是否清除已经扫描的数据?", res => { |
|||
if (res) { |
|||
this.getDetail(); |
|||
} |
|||
}) |
|||
|
|||
}, |
|||
|
|||
|
|||
//接收 |
|||
receive(callback) { |
|||
let params = { |
|||
id: this.id |
|||
}; |
|||
takeInjectionPlanJob(params) |
|||
.then(res => { |
|||
callback(true); |
|||
}) |
|||
.catch(err => { |
|||
this.showMessage(err.message); |
|||
callback(false); |
|||
}); |
|||
}, |
|||
|
|||
submit() { |
|||
this.finsh(); |
|||
}, |
|||
|
|||
finsh() { |
|||
uni.showLoading({ |
|||
title: "提交中..." |
|||
}); |
|||
this.setParams(); |
|||
let params = JSON.stringify(this.datacontent); |
|||
console.log("提交", params); |
|||
finshInjectionPlanJob(this.id, params) |
|||
.then(res => { |
|||
uni.hideLoading(); |
|||
if (res != null) { |
|||
this.showCommitSuccessMessage(); |
|||
} |
|||
}) |
|||
.catch(err => { |
|||
this.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
setParams() { |
|||
this.datacontent.details.forEach(res => { |
|||
res.handledFromContainerCode = res.recommendFromContainerCode; |
|||
res.handledFromPackingCode = res.recommendFromPackingCode; |
|||
res.handledFromSupplierBatch = res.recommendFromSupplierBatch; |
|||
res.handledFromArriveDate = res.recommendFromArriveDate; |
|||
res.handledFromProduceDate =res.recommendFromProduceDate; |
|||
res.handledFromExpireDate = res.recommendFromExpireDate; |
|||
res.handledFromLot = res.recommendFromLot; |
|||
res.handledFromLocationCode = res.recommendFromLocationCode; |
|||
res.handledFromLocationArea = res.recommendFromLocationArea; |
|||
res.handledFromLocationGroup = res.recommendFromLocationGroup; |
|||
res.handledFromLocationErpCode = res.recommendFromLocationErpCode; |
|||
res.handledFromWarehouseCode = res.recommendFromWarehouseCode; |
|||
res.handledFromQty =res.recommendFromQty; |
|||
res.handledToContainerCode = res.recommendToContainerCode; |
|||
res.handledToPackingCode = res.recommendToPackingCode; |
|||
res.handledToSupplierBatch = res.recommendToSupplierBatch; |
|||
res.handledToArriveDate = res.recommendToArriveDate; |
|||
res.handledToProduceDate = res.recommendToProduceDate; |
|||
res.handledToExpireDate =res.recommendToExpireDate; |
|||
res.handledToLot = res.recommendToLot; |
|||
res.handledToLocationCode = res.recommendToLocationCode; |
|||
res.handledToLocationArea = res.recommendToLocationArea; |
|||
res.handledToLocationGroup = res.recommendToLocationGroup; |
|||
res.handledToLocationErpCode = res.recommendToLocationErpCode; |
|||
res.handledToWarehouseCode = res.recommendToWarehouseCode; |
|||
res.handledToQty = res.recommendToQty |
|||
|
|||
}) |
|||
|
|||
}, |
|||
|
|||
showCommitSuccessMessage() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
|
|||
closeCommitMessage() { |
|||
navigateBack(1); //点关闭直接返回列表 |
|||
uni.hideLoading(); |
|||
}, |
|||
|
|||
|
|||
clearScanLocation() { |
|||
// this.$refs.scanLocation.getfocus(); |
|||
// this.$refs.scanLocation.clear(); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
|
|||
scroll: function(e) { |
|||
this.old.scrollTop = e.detail.scrollTop; |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
Loading…
Reference in new issue