19 changed files with 2346 additions and 47 deletions
@ -0,0 +1,280 @@ |
|||
<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="80">库位</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="80">箱码/数量</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="80">单位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.basicUom }} |
|||
</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 { |
|||
sparePartIssueRequest |
|||
} 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)) |
|||
sparePartIssueRequest(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 { |
|||
getSparePartRequestList, |
|||
sparePartRequestHandle, |
|||
getSparePartRequestJobByRequest, |
|||
isSparePartHasNewJob |
|||
} 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 getSparePartRequestJobByRequest(item.number) |
|||
var handleResult = await sparePartRequestHandle(item.id) |
|||
|
|||
var isHaveNewJobList=[]; |
|||
jobList.forEach(res=>{ |
|||
isHaveNewJobList.push(res.kittingRequestNumber); |
|||
}) |
|||
var isHaveNewJob = await isSparePartHasNewJob(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 = []; |
|||
} |
|||
getSparePartRequestList(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: './sparePartIssueRequestListDetail?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 { |
|||
getSparePartRequestDetail, |
|||
sparePartRequestHandle, |
|||
getSparePartRequestJobByRequest, |
|||
isSparePartHasNewJob |
|||
} 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 |
|||
}) |
|||
getSparePartRequestDetail(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 getSparePartRequestJobByRequest(this.datacontent.number) |
|||
var handleResult = await sparePartRequestHandle(this.datacontent.id) |
|||
|
|||
var isHaveNewJobList=[]; |
|||
jobList.forEach(res=>{ |
|||
isHaveNewJobList.push(res.SparePartRequestNumber); |
|||
}) |
|||
var isHaveNewJob = await isSparePartHasNewJob(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,249 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<!-- <view class="uni-flex uni-row require_wrap"> |
|||
<button @click="isTodayChange" :class="[isToday==true?'require_cell require_active':'require_cell']"> |
|||
<text></text> |
|||
只看当天发料 |
|||
</button> |
|||
<button @click="timeSortingChange" |
|||
:class="[isIssueTimeChange==true?'require_cell require_active':'require_cell']"> |
|||
<text></text> |
|||
按发料时间排序 |
|||
</button> |
|||
</view> --> |
|||
|
|||
<win-empty-view v-if="issueList.length==0"></win-empty-view> |
|||
|
|||
<view hover-class="uni-list-cell-hover" v-for="(item, index) in issueList" :key="item.id" |
|||
@click="openDetail(item)"> |
|||
<comKittingIssue :dataContent="item"></comKittingIssue> |
|||
</view> |
|||
<uni-load-more :status="loadingType" v-if="issueList.length>0" /> |
|||
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'> |
|||
</win-mulit-scan> |
|||
<com-scan-issue-list ref="scanList" @selectedItem="selectedItem"></com-scan-issue-list> |
|||
<!-- com-message必须放在最下层 --> |
|||
<com-message ref="comMessage"></com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getSparePartIssueList, |
|||
getSparePartIssueJobByNumber, |
|||
getSparePartIssueListByRequest |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
goHome |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' |
|||
import issueDetail from './issue_detail.vue'; |
|||
import comKittingIssue from '@/mycomponents/coms/task/comKittingIssue.vue'; |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
|||
import comScanIssueList from '@/mycomponents/scan/comScanIssueList.vue' |
|||
|
|||
export default { |
|||
name: 'issue', |
|||
components: { |
|||
winEmptyView, |
|||
comKittingIssue, |
|||
issueDetail, |
|||
comMessage, |
|||
winScanButton, |
|||
winMulitScan, |
|||
comScanIssueList |
|||
}, |
|||
data() { |
|||
return { |
|||
//popup |
|||
type: '', |
|||
issueList: [], |
|||
reload: false, |
|||
status: '', |
|||
contentText: { |
|||
contentdown: '上拉加载更多', |
|||
contentrefresh: '加载中', |
|||
contentnomore: '没有更多' |
|||
}, |
|||
pageSize: this.modelConfig, |
|||
pageIndex: 1, |
|||
isIssueTimeChange: false, |
|||
isToday: false, |
|||
titleArray: ['任务编号'], |
|||
loadingType: "nomore" |
|||
}; |
|||
}, |
|||
props: { |
|||
datacontent: { |
|||
type: Object, |
|||
value: null |
|||
}, |
|||
isByFIFO: { |
|||
type: Boolean, |
|||
value: false |
|||
} |
|||
}, |
|||
onShow() { |
|||
this.getList('refresh'); |
|||
}, |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
}else if(e.index === 1){ |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
methods: { |
|||
openScanPopup() { |
|||
this.$refs.scanPopup.openScanPopup(); |
|||
}, |
|||
|
|||
//按时间窗口排序 |
|||
timeSortingChange() { |
|||
this.isIssueTimeChange = !this.isIssueTimeChange; |
|||
this.getList() |
|||
}, |
|||
//只看当天到货 |
|||
isTodayChange() { |
|||
this.isToday = !this.isToday |
|||
this.getList() |
|||
}, |
|||
|
|||
//查询发料任务 |
|||
getList(type) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
this.loadingType = "loading"; |
|||
if (type === "refresh") { |
|||
this.pageIndex = 1; |
|||
this.issueList = []; |
|||
} |
|||
getSparePartIssueList(that.pageIndex,that.pageSize,false) |
|||
.then(res => { |
|||
uni.hideLoading(); |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
res.items.forEach(item=>{ |
|||
item.requestNumber =item.sparePartRequestNumber |
|||
}) |
|||
var list = res.items; |
|||
this.loadingType = "loadmore"; |
|||
if (list == null || list.length == 0) { |
|||
//没数据了 |
|||
this.loadingType = "nomore"; |
|||
return; |
|||
} |
|||
that.issueList = type === "refresh" ? list : this.issueList.concat(list); |
|||
that.pageIndex++; |
|||
}) |
|||
.catch(err => { |
|||
this.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
|
|||
getScanResult(type, result) { |
|||
let code = result.data.code; |
|||
if (code == '') { |
|||
this.showMessage('扫描的内容不能为空') |
|||
return; |
|||
} |
|||
if (type == '申请单号') { |
|||
this.scanByRequesNumber(code, type); |
|||
} else if (type == '任务编号') { |
|||
this.scanByNumber(code, type); |
|||
} |
|||
}, |
|||
|
|||
//扫描申请单号 |
|||
scanByRequesNumber(code, type) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
getSparePartIssueListByRequest(code).then(res => { |
|||
uni.hideLoading(); |
|||
let items = res.items; |
|||
if (res.totalCount > 0) { |
|||
if (res.totalCount == 1) { |
|||
that.openDetail(items[0]); |
|||
} else { |
|||
that.showItemList(items); |
|||
} |
|||
} else { |
|||
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务'); |
|||
} |
|||
}).catch(err => { |
|||
that.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
|
|||
//扫描申请单号 |
|||
scanByNumber(code, type) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
getSparePartIssueJobByNumber(code).then(res => { |
|||
uni.hideLoading(); |
|||
if (res != null) { |
|||
that.openDetail(res); |
|||
} else { |
|||
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务'); |
|||
} |
|||
}).catch(err => { |
|||
that.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
|
|||
openDetail(item) { |
|||
if(item.enumIssueSendType==1){ |
|||
uni.navigateTo({ |
|||
url: './sparePartIssueJobDetailByQty?id=' + item.id + '&jobStatus=' + item.jobStatus |
|||
}); |
|||
}else { |
|||
uni.navigateTo({ |
|||
url: './sparePartIssueJobDetail?id=' + item.id + '&jobStatus=' + item.jobStatus |
|||
}); |
|||
} |
|||
|
|||
}, |
|||
|
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
onPull() { |
|||
this.getList('refresh'); |
|||
}, |
|||
onReachBottom() { |
|||
//避免多次触发 |
|||
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
|||
return; |
|||
} |
|||
this.getList('more'); |
|||
}, |
|||
showItemList(itemList) { |
|||
this.$refs.scanList.openPopup(itemList); |
|||
}, |
|||
selectedItem(item) { |
|||
this.openDetail(item); |
|||
} |
|||
} |
|||
}; |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,627 @@ |
|||
<!-- 发料任务详情 --> |
|||
<template> |
|||
<page-meta root-font-size="16px"></page-meta> |
|||
<view class=""> |
|||
<view class="top_card"> |
|||
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :isShowScanHint="false" |
|||
allCountHint="箱数"> |
|||
</com-job-scan-detail> |
|||
</view> |
|||
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" |
|||
class="scroll-detail"> |
|||
<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.recommendFromPackingCode}}</uni-td> |
|||
<uni-td width="120" align="center"> {{item.recommendToPackingCode}}</uni-td> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-td width="100" align="center">批次</uni-td> |
|||
<uni-td width="120" align="center">{{item.recommendFromLot}}</uni-td> |
|||
<uni-td width="120" align="center">{{item.recommendToLot}}</uni-td> |
|||
</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> |
|||
<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.transferLibFromPackingCode}}</uni-td> |
|||
<uni-td width="120" align="center"> |
|||
{{item.transferLibToPackingCode}}</uni-td> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-td width="100" align="center">批次</uni-td> |
|||
<uni-td width="120" align="center">{{item.transferLibFromLot}}</uni-td> |
|||
<uni-td width="120" align="center">{{item.transferLibToLot}}</uni-td> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-td width="100" align="center">库位</uni-td> |
|||
<uni-td width="120" align="center"> |
|||
{{item.transferLibFromLocationCode}}</uni-td> |
|||
<uni-td width="120" align="center"> |
|||
{{item.transferLibToLocationCode}}</uni-td> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-td width="100" align="center">数量({{item.uom}})</uni-td> |
|||
<uni-td width="120" align="center">{{item.transferLibFromQty}}</uni-td> |
|||
<uni-td width="120" align="center">{{item.transferLibToQty}}</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.handledFromPackingCode}}</uni-td> |
|||
<uni-td width="120" align="center"> {{item.handledToPackingCode}}</uni-td> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-td width="100" align="center">批次</uni-td> |
|||
<uni-td width="120" align="center">{{item.handledFromLot}}</uni-td> |
|||
<uni-td width="120" align="center">{{item.handledToLot}}</uni-td> |
|||
</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.handledFromQty}}</uni-td> |
|||
<uni-td width="120" align="center">{{item.handledToQty}}</uni-td> |
|||
</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 class="" style="margin-left: 50rpx; margin-right: 50rpx;"> |
|||
<button type="primary" size="default" @click="recommend"> 推荐库存</button> |
|||
</view> |
|||
</view> |
|||
|
|||
</scroll-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> |
|||
<winScanButtonTop @goScan='openScanPopupTo' title="箱码"></winScanButtonTop> |
|||
<win-scan-button @goScan='openLocationFrom' title="来源库位"></win-scan-button> |
|||
<winScanButtonBottom @goScan='openLocationTo' title="目标库位"></winScanButtonBottom> |
|||
<win-scan-by-pack ref="scanPopupTo" @getScanResult='getScanResultTo' title="箱码"></win-scan-by-pack> |
|||
<winScanLocationCode ref="locationFrom" title="来源库位" @getLocation="geFromLocation"></winScanLocationCode> |
|||
<winScanLocationCode ref="locationTo" title="目标库位" @getLocation="geToLocation"></winScanLocationCode> |
|||
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()' |
|||
@afterCloseScanMessage='closeScanMessage'></com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getSparePartIssueDetail, |
|||
takeSparePartIssueJob, |
|||
cancelTakeSparePartIssueJob, |
|||
finshSparePartIssueJob, |
|||
getRecommendBalance, |
|||
balances |
|||
} 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 winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winScanButtonTop from '@/mycomponents/wincom/winScanButtonTop.vue' |
|||
import winScanButtonBottom from '@/mycomponents/wincom/winScanButtonBottom.vue' |
|||
|
|||
import winMulitScan from '@/mycomponents/wincom/winMulitScan.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 selectClickList from "@/mycomponents/popup/selectClickList.vue" |
|||
|
|||
export default { |
|||
components: { |
|||
comMessage, |
|||
winScanButton, |
|||
winScanButtonTop, |
|||
winScanButtonBottom, |
|||
winMulitScan, |
|||
comJobScanDetail, |
|||
winScanByPack, |
|||
comNumberBox, |
|||
winScanLocationCode, |
|||
selectClickList |
|||
}, |
|||
data() { |
|||
return { |
|||
id: "", |
|||
datacontent: {}, |
|||
details: {}, |
|||
toLocation: '', |
|||
scrollTop: 0, |
|||
old: { |
|||
scrollTop: 0 |
|||
}, |
|||
ispending: false, |
|||
balancesItem: null, |
|||
allCount: 0, |
|||
isPack: true, |
|||
titleArray: ['箱标签'], |
|||
jobStatus: "", |
|||
toLocationInfo: {}, |
|||
handleToPackingCodeLocationCode: "" |
|||
} |
|||
}, |
|||
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) { |
|||
//取消承接任务 |
|||
cancelTakeSparePartIssueJob(this.id).then(res => { |
|||
uni.navigateBack(); |
|||
}).catch(error => { |
|||
uni.navigateBack(); |
|||
}) |
|||
} else { |
|||
uni.navigateBack(); |
|||
} |
|||
return true; |
|||
} |
|||
}, |
|||
mounted() { |
|||
uni.setNavigationBarColor({ |
|||
frontColor: '#ffffff', |
|||
backgroundColor: "#5A7CF3 !important" |
|||
}) |
|||
}, |
|||
methods: { |
|||
openScanPopupTo() { |
|||
this.$refs.scanPopupTo.openScanPopup(); |
|||
}, |
|||
openLocationTo() { |
|||
this.$refs.locationTo.openScanPopup() |
|||
}, |
|||
openLocationFrom() { |
|||
this.$refs.locationFrom.openScanPopup() |
|||
}, |
|||
|
|||
|
|||
geFromLocation(locationInfo) { |
|||
var current = this.details[0] |
|||
if (!current.handledToPackingCode) { |
|||
this.showMessage("请先扫描箱码") |
|||
return; |
|||
} |
|||
|
|||
if (locationInfo.code != current.handleToPackingCodeLocationCode) { |
|||
this.showMessage("扫描来源库位[" + locationInfo.code + "]与箱码[" + current.handledToPackingCode + |
|||
"]对应的库位[" + current.handleToPackingCodeLocationCode + "]不一致,请重新扫描") |
|||
return; |
|||
} |
|||
|
|||
current.handledFromLocationCode = locationInfo.code |
|||
current.handledFromLocationArea = locationInfo.locationArea |
|||
current.handledFromLocationGroup = locationInfo.locationGroup |
|||
current.handledFromLocationErpCode = locationInfo.locationErpCode |
|||
}, |
|||
|
|||
geToLocation(locationInfo) { |
|||
var current = this.details[0] |
|||
if (locationInfo.code != current.recommendToLocationCode) { |
|||
this.showMessage(" 扫描目标库位[" + locationInfo.code + "]与推荐目标库位[" + current |
|||
.recommendToLocationCode + "]不一致,请重新扫描") |
|||
return; |
|||
} |
|||
current.handledToLocationCode = locationInfo.code |
|||
current.handledToLocationArea = locationInfo.locationArea |
|||
current.handledToLocationGroup = locationInfo.locationGroup |
|||
current.handledToLocationErpCode = locationInfo.locationErpCode |
|||
}, |
|||
//加载零件信息 |
|||
getDetail() { |
|||
let that = this; |
|||
if (that.id == undefined) { |
|||
return; |
|||
} |
|||
uni.showLoading({ |
|||
title: '加载中...', |
|||
mask: true |
|||
}) |
|||
let params = { |
|||
id: that.id, |
|||
}; |
|||
getSparePartIssueDetail(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() |
|||
r.handledFromContainerCode = r.recommendFromContainerCode |
|||
r.handledFromPackingCode = r.recommendFromPackingCode |
|||
r.handledFromSupplierBatch = r.recommendFromSupplierBatch |
|||
r.handledFromArriveDate = r.recommendFromArriveDate |
|||
r.handledFromProduceDate = r.recommendFromProduceDate |
|||
r.handledFromExpireDate = r.recommendFromExpireDate |
|||
r.handledFromLot = r.recommendFromLot |
|||
// r.handledFromLocationCode = r.recommendFromLocationCode |
|||
// r.handledFromLocationArea = r.recommendFromLocationArea |
|||
// r.handledFromLocationGroup = r.recommendFromLocationGroup |
|||
// r.handledFromLocationErpCode = r.recommendFromLocationErpCode |
|||
// r.handledFromWarehouseCode = r.recommendFromWarehouseCode |
|||
r.handledFromQty = r.recommendFromQty |
|||
// r.handledToQty = r.handledFromQty |
|||
} |
|||
); |
|||
that.ispending = item.jobStatus === 2; |
|||
this.allCount = that.details.length; |
|||
|
|||
} |
|||
uni.hideLoading(); |
|||
}) |
|||
.catch(err => { |
|||
this.showMessage('未查找到详细信息') |
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
|
|||
getScanResultTo(result) { |
|||
var fromData = result.data; |
|||
var data = this.details.filter(r => r.itemCode == result.data.itemCode) |
|||
if (data.length == 0) { |
|||
this.showMessage("扫描的箱码[" + fromData.code + "]的物品不在列表中") |
|||
return; |
|||
} |
|||
this.getBalance(result, res => { |
|||
if (res.totalCount > 0) { |
|||
var balancesItem = res.items[0]; |
|||
var item = data[0]; |
|||
if (balancesItem.lot == item.recommendToLot) { |
|||
item.handledToContainerCode = balancesItem.containerCode |
|||
item.handledToPackingCode = balancesItem.packingCode |
|||
item.handledToSupplierBatch = balancesItem.supplierBatch |
|||
item.handledToArriveDate = balancesItem.arriveDate |
|||
item.handledToProduceDate = balancesItem.produceDate |
|||
item.handledToExpireDate = balancesItem.expireDate |
|||
item.handledToLot = balancesItem.lot |
|||
item.handledToWarehouseCode = balancesItem.warehouseCode |
|||
item.handledToQty = balancesItem.qty |
|||
|
|||
item.handledFromContainerCode = balancesItem.containerCode |
|||
item.handledFromPackingCode = balancesItem.packingCode |
|||
item.handledFromSupplierBatch = balancesItem.supplierBatch |
|||
item.handledFromArriveDate = balancesItem.arriveDate |
|||
item.handledFromProduceDate = balancesItem.produceDate |
|||
item.handledFromExpireDate = balancesItem.expireDate |
|||
item.handledFromLot = balancesItem.lot |
|||
item.handledFromWarehouseCode = balancesItem.warehouseCode |
|||
item.handledFromQty = balancesItem.qty |
|||
item.handleToPackingCodeLocationCode = balancesItem.locationCode |
|||
} else { |
|||
showConfirmMsg("箱码[" + fromData.code + "]的批次[" + balancesItem.lot + "]与推荐目标批次[" + item |
|||
.recommendToLot + "]不一致,是否继续发料", res => { |
|||
if (res) { |
|||
item.handledToContainerCode = balancesItem.containerCode |
|||
item.handledToPackingCode = balancesItem.packingCode |
|||
item.handledToSupplierBatch = balancesItem.supplierBatch |
|||
item.handledToArriveDate = balancesItem.arriveDate |
|||
item.handledToProduceDate = balancesItem.produceDate |
|||
item.handledToExpireDate = balancesItem.expireDate |
|||
item.handledToLot = balancesItem.lot |
|||
item.handledToWarehouseCode = balancesItem.warehouseCode |
|||
item.handledToQty = balancesItem.qty |
|||
|
|||
item.handledFromContainerCode = balancesItem.containerCode |
|||
item.handledFromPackingCode = balancesItem.packingCode |
|||
item.handledFromSupplierBatch = balancesItem.supplierBatch |
|||
item.handledFromArriveDate = balancesItem.arriveDate |
|||
item.handledFromProduceDate = balancesItem.produceDate |
|||
item.handledFromExpireDate = balancesItem.expireDate |
|||
item.handledFromLot = balancesItem.lot |
|||
item.handledFromWarehouseCode = balancesItem.warehouseCode |
|||
item.handledFromQty = balancesItem.qty |
|||
item.handleToPackingCodeLocationCode = balancesItem.locationCode |
|||
} |
|||
}) |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
this.$forceUpdate() |
|||
} |
|||
}); |
|||
|
|||
}, |
|||
|
|||
|
|||
//查询库存记录 |
|||
getBalance(result, callback) { |
|||
uni.showLoading({ |
|||
title: '扫描中...', |
|||
mask: true |
|||
}) |
|||
let params = { |
|||
pageSize: 1000, |
|||
pageIndex: 1, |
|||
packingCode: result.data.code, |
|||
// itemCode: result.data.itemCode, |
|||
// lot: result.data.lot, |
|||
// inventoryStatus: 2, //库存状态默认2 |
|||
// locationTypes: [2, 3], |
|||
// sortBy: 'PackingCode asc' |
|||
|
|||
}; |
|||
balances(params) |
|||
.then(res => { |
|||
if (res.totalCount === 0) { |
|||
this.showScanMessage('按箱码【' + result.data.code + '】未查询到库存信息'); |
|||
} else { |
|||
callback(res); |
|||
} |
|||
uni.hideLoading(); |
|||
}) |
|||
.catch(err => { |
|||
this.showScanMessage(err.message); |
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
|
|||
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, true).then(res => { |
|||
uni.hideLoading() |
|||
if (res.length > 0) { |
|||
this.$refs.selectPopup.openScanPopup(res) |
|||
} else { |
|||
this.showMessage("暂无推荐库存") |
|||
} |
|||
}).catch(error => { |
|||
uni.hideLoading() |
|||
this.showMessage(error) |
|||
}) |
|||
}, |
|||
|
|||
// //接收 |
|||
receive(callback) { |
|||
let params = { |
|||
id: this.id |
|||
}; |
|||
takeSparePartIssueJob(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 (!that.details[0].handledToPackingCode) { |
|||
this.showMessage('请先扫描箱码'); |
|||
return; |
|||
} |
|||
if (!that.details[0].handledToLocationCode) { |
|||
this.showMessage('请先扫描目标库位'); |
|||
return; |
|||
} |
|||
if (!that.details[0].handledFromLocationCode) { |
|||
this.showMessage('请先扫描来源库位'); |
|||
return; |
|||
} |
|||
that.finsh(); |
|||
|
|||
}, |
|||
|
|||
|
|||
finsh() { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "提交中...", |
|||
mask: true |
|||
}); |
|||
let params = that.details[0]; |
|||
// console.log("提交",JSON.stringify(params)) |
|||
finshSparePartIssueJob(that.id, params.id, params) |
|||
.then(res => { |
|||
uni.hideLoading(); |
|||
if (res != null) { |
|||
that.showCommitSuccessMessage(); |
|||
} |
|||
}) |
|||
.catch(err => { |
|||
that.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
}); |
|||
}, |
|||
|
|||
clear() { |
|||
this.handleToPackingCodeLocationCode = "" |
|||
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(); |
|||
}, |
|||
|
|||
scrollToTop() { |
|||
let that = this; |
|||
// 解决view层不同步的问题 |
|||
that.scrollTop = that.old.scrollTop |
|||
this.$nextTick(function() { |
|||
that.scrollTop = 0 |
|||
}); |
|||
}, |
|||
|
|||
scroll: function(e) { |
|||
// console.log(e) |
|||
this.old.scrollTop = e.detail.scrollTop; |
|||
}, |
|||
qtyChanged(value, item, index) { |
|||
if (value <= 0) { |
|||
this.showMessage('发料数量不能小于或等于0') |
|||
item.handledQty = item.defaultHandleQty |
|||
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|||
} else if (value > item.defaultHandleQty) { |
|||
item.handledQty = item.defaultHandleQty |
|||
this.showMessage('发料数量不能大于叫料数量:' + item.handledQty) |
|||
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|||
} |
|||
}, |
|||
} |
|||
} |
|||
</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 { |
|||
getSparePartIssueDetail, |
|||
takeSparePartIssueJob, |
|||
cancelTakeSparePartIssueJob, |
|||
finshSparePartIssueJob, |
|||
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) { |
|||
//取消承接任务 |
|||
cancelTakeSparePartIssueJob(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, |
|||
}; |
|||
getSparePartIssueDetail(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 |
|||
}; |
|||
takeSparePartIssueJob(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]; |
|||
finshSparePartIssueJob(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> |
Loading…
Reference in new issue