28 changed files with 1923 additions and 300 deletions
@ -0,0 +1,187 @@ |
|||
<template> |
|||
<view class="" > |
|||
<view class="uni-list"> |
|||
<view class="uni-list-cell " style="padding:10rpx; "> |
|||
<view class="" style="color: red; font-size: 40rpx; "> |
|||
* |
|||
</view> |
|||
<view class="uni-list-cell-left" style="font-size:35rpx"> |
|||
器具类型 : |
|||
</view> |
|||
<view class="uni-list-cell-db"> |
|||
<picker @change="containerTypeChange" :value="typeIndex" :range="containerTypeList" range-key="name" > |
|||
<view class="uni-input" style="font-size:35rpx">{{containerType}}</view> |
|||
</picker> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="uni-list"> |
|||
<view class="uni-list-cell" style="padding:10rpx"> |
|||
<view class="" style="color: red; font-size: 40rpx; "> |
|||
* |
|||
</view> |
|||
<view class="uni-list-cell-left" style="font-size:35rpx"> |
|||
器具规格 : |
|||
</view> |
|||
<view class="uni-list-cell-db"> |
|||
<picker @change="containerModelChange" :value="modelIndex" :range="containerModelList" range-key="name"> |
|||
<view class="uni-input" style="font-size:35rpx">{{containerModel}}</view> |
|||
</picker> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="uni-list"> |
|||
<view class="uni-list-cell" style="padding-left: 15rpx; padding-top: 20rpx;padding-bottom:20rpx; padding-right: 15rpx; ; align-items: center; display: flex;"> |
|||
<view class="" style="color: red; font-size: 40rpx; "> |
|||
* |
|||
</view> |
|||
<view class="uni-list-cell-left" style="font-size:35rpx; align-items: center;display: flex; text-align: center;"> |
|||
呼叫库位 : |
|||
</view> |
|||
<view class="uni-list-cell-db" style="font-size:35rpx" @click="openScanLocation"> |
|||
<text>{{locationCode}}</text> |
|||
<text v-if="locationName!=''">({{locationName}})</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="new_btn_bot"> |
|||
<button class="new_save_btn" @click="submit()">提交</button> |
|||
</view> |
|||
<win-scan-by-code ref="scanLocation" title="库位" @getScanCode='getLocation'></win-scan-by-code> |
|||
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterClose='afterClose' |
|||
@afterCloseCommitMessage='closeCommitMessage'> |
|||
</com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
locations, |
|||
} from '@/api/index.js'; |
|||
import { |
|||
goHome, |
|||
} from '@/common/basic.js'; |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue' |
|||
export default { |
|||
components: { |
|||
comMessage, |
|||
winScanByCode |
|||
}, |
|||
data() { |
|||
return { |
|||
containerTypeList: [ { |
|||
name: '内物流', |
|||
value: "1", |
|||
test:"test1" |
|||
}, { |
|||
name: '外物流', |
|||
value: "2", |
|||
test:"test2" |
|||
}], |
|||
containerModelList: [ { |
|||
name: '小器具', |
|||
value: "1", |
|||
test:"test1" |
|||
}, { |
|||
name: '大器具', |
|||
value: "2", |
|||
test:"test2" |
|||
}], |
|||
typeIndex:0, |
|||
modelIndex:0, |
|||
location:"", |
|||
locationCode:"请扫描库位", |
|||
locationName:"", |
|||
containerType:"请选择器具类型", |
|||
containerModel:"请选择器具规格" |
|||
} |
|||
}, |
|||
onLoad() {}, |
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
}else if(e.index === 1){ |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
methods: { |
|||
containerTypeChange(e) { |
|||
this.typeIndex = e.detail.value |
|||
var select =this.containerTypeList[this.typeIndex]; |
|||
this.containerType =select.name |
|||
console.log(select) |
|||
}, |
|||
containerModelChange(e) { |
|||
this.modelIndex = e.detail.value |
|||
var select =this.containerModelList[this.typeIndex]; |
|||
this.containerModel =select.name |
|||
console.log(select) |
|||
}, |
|||
openScanLocation() { |
|||
this.$refs.scanLocation.openScanPopup() |
|||
}, |
|||
|
|||
closeScanLocation() { |
|||
this.$refs.scanLocation.closeScanPopup(); |
|||
}, |
|||
//扫描源库位 |
|||
getLocation(code) { |
|||
let that = this; |
|||
if (code == '') return; |
|||
uni.showLoading({ |
|||
title: '扫描中...', |
|||
mask: true |
|||
}); |
|||
locations(code).then(res => { |
|||
if (res == null) { |
|||
that.scanPopupLoseFocus(); |
|||
that.showMessage('未查询到库位【' + code + '】'); |
|||
} else { |
|||
that.locationCode = res.code; |
|||
that.locationName = res.name |
|||
that.closeScanLocation(); |
|||
} |
|||
uni.hideLoading(); |
|||
}).catch(err => { |
|||
uni.hideLoading(); |
|||
that.showMessage(err.message); |
|||
}); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
afterClose() { |
|||
this.scanPopupGetFocus(); |
|||
}, |
|||
scanPopupGetFocus() { |
|||
this.$refs.scanLocation.getfocus(); |
|||
}, |
|||
scanPopupLoseFocus() { |
|||
this.$refs.scanLocation.losefocus(); |
|||
}, |
|||
submit(){ |
|||
if(this.containerCode =="请选择器具类型"){ |
|||
this.showMessage("请选择器具类型") |
|||
return; |
|||
} |
|||
|
|||
if(this.containerModel =="请选择器具规格"){ |
|||
this.showMessage("请选择器具规格") |
|||
return; |
|||
} |
|||
|
|||
if(this.locationCode =="请扫描库位"){ |
|||
this.showMessage("请扫描库位") |
|||
return; |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,192 @@ |
|||
<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)"> |
|||
<com-deliver :dataContent="item"></com-deliver> |
|||
</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 { |
|||
getPlasticsList, |
|||
getDeliverJobByNumber |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
goHome |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' |
|||
import comDeliver from '@/mycomponents/coms/task/comDeliver.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, |
|||
comDeliver, |
|||
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 |
|||
}; |
|||
getPlasticsList(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(); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
getScanResult(type, result) { |
|||
if (type == '任务编号') { |
|||
this.getByNumber(type, result.data.code); |
|||
} |
|||
}, |
|||
|
|||
getByNumber(type, code) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
getDeliverJobByNumber(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) { |
|||
uni.navigateTo({ |
|||
url: './containerMoveDetail?id=' + item.id + '&jobStatus=' + item.jobStatus |
|||
}); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,413 @@ |
|||
<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> |
|||
|
|||
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @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"> |
|||
<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="90"></uni-th> |
|||
<uni-th width="100" align="center">推荐</uni-th> |
|||
<uni-th width="100" align="center">实际</uni-th> --> |
|||
<uni-th width="50"></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="50">数量</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view class="text_black">{{item.recommendQty}}({{item.uom}})</text> |
|||
</view> |
|||
</uni-th> |
|||
<!-- --> |
|||
<uni-th width="120" align="center"> |
|||
<view v-if="item.scaned" class="text_black"> |
|||
{{item.handledQty}}({{item.uom}}) |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">箱码</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view class="text_packingCode">{{ item.recommendPackingCode }}</view> |
|||
</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view v-if="item.scaned" class="text_packingCode"> |
|||
{{ item.handledPackingCode }} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">批次</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view><text class="text_black">{{item.recommendLot }}</text> |
|||
</view> |
|||
</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view v-if="item.scaned"> |
|||
<text class="text_black">{{item.handledLot }}</text> |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">库位</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view class="text_black">{{ item.recommendLocationCode }}</view> |
|||
</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view v-if="item.scaned" class="text_black"> |
|||
{{ item.handledFromLocationCode }} |
|||
</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> |
|||
|
|||
<view class="new_btn_bot count_shadow"> |
|||
<button type="primary" class="new_save_btn" @click="submit()">提交</button> |
|||
</view> |
|||
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack> |
|||
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
|||
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getDeliverDetail, |
|||
takeDeliverJob, |
|||
cancelTakeDeliverJob, |
|||
finshDeliverJob, |
|||
balances |
|||
} 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 comBalance from '@/mycomponents/common/comBalance.vue' |
|||
|
|||
export default { |
|||
components: { |
|||
winScanButton, |
|||
winMulitScan, |
|||
winScanByPack, |
|||
comMessage, |
|||
comJobScanDetail, |
|||
comBalance |
|||
}, |
|||
data() { |
|||
return { |
|||
type: '', |
|||
id: "", |
|||
datacontent: {}, |
|||
details: {}, |
|||
toLocation: '', |
|||
scrollTop: 0, |
|||
old: { |
|||
scrollTop: 0 |
|||
}, |
|||
ispending: false, |
|||
balancesItem: {}, |
|||
titleArray: ['箱标签', '目标库位'], |
|||
allCount: 0, |
|||
scanCount: 0, |
|||
jobStatus:"" |
|||
} |
|||
}, |
|||
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) { |
|||
//取消承接任务 |
|||
cancelTakeDeliverJob(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.scanPopup.openScanPopup(); |
|||
}, |
|||
//加载零件信息 |
|||
getDetail() { |
|||
let that = this; |
|||
let params = { |
|||
id: that.id, |
|||
}; |
|||
getDeliverDetail(params) |
|||
.then(item => { |
|||
console.log('item', item); |
|||
that.datacontent = item; |
|||
that.jobStatus = item.jobStatus |
|||
that.details = item.details; |
|||
that.details.forEach(r => r.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 that = this; |
|||
let code = result.data.code; |
|||
let item = this.details.find(r => { |
|||
return r.recommendPackingCode === code |
|||
}); |
|||
|
|||
if (item === undefined) { |
|||
this.showMessage('在发货任务详情中,未找到箱码【' + code + '】'); |
|||
return; |
|||
} else { |
|||
if (item.scaned) { |
|||
this.showMessage('箱码【' + code + '】已经扫描,请扫描下一箱零件'); |
|||
return; |
|||
} |
|||
} |
|||
//按照零件号和箱码去查询库存 |
|||
let params = { |
|||
pageSize: 1000, |
|||
pageIndex: 1, |
|||
packingCode: code, |
|||
locationTypes: [4], //成品 |
|||
inventoryStatuses: [2], //合格 |
|||
}; |
|||
balances(params) |
|||
.then(res => { |
|||
try { |
|||
if (res.totalCount == 0) { |
|||
this.showMessage('箱码【' + code + '】在【成品库】未查询到库存信息'); |
|||
} else if (res.totalCount == 1) { |
|||
that.balancesItem = res.items[0]; |
|||
this.createItem(item); |
|||
} else { |
|||
this.$refs.balanceItems.openPopup(res.items); |
|||
} |
|||
uni.hideLoading(); |
|||
} catch (e) { |
|||
this.showMessage(e.message) |
|||
} |
|||
}) |
|||
.catch(err => { |
|||
this.showMessage(err.message) |
|||
}); |
|||
}, |
|||
|
|||
createItem(item) { |
|||
let that = this; |
|||
if (that.balancesItem != null || that.balancesItem != undefined) { |
|||
// if (that.balancesItem.qty != item.recommendQty) { |
|||
// this.showMessage('库存余额数量【' + that.balancesItem.qty + '】不等于推荐数量【' + item.recommendQty + '】,不可以进行发货') |
|||
// } else { |
|||
item.scaned = true; |
|||
item.handledContainerCode = that.balancesItem.containerCode; |
|||
item.handledPackingCode = that.balancesItem.packingCode; |
|||
item.handledBatch = that.balancesItem.batch; |
|||
item.handledLot = that.balancesItem.lot; |
|||
item.handledFromLocationArea = that.balancesItem.locationCode; |
|||
item.handledQty = that.balancesItem.qty; |
|||
|
|||
|
|||
// ================================== |
|||
// item.recommendFromLocationCode = string; |
|||
// item.recommendFromLocationArea = string; |
|||
// item.recommendFromLocationGroup = string; |
|||
// item.recommendFromLocationErpCode = string; |
|||
// item.recommendFromWarehouseCode = string; |
|||
// item.uom = string; |
|||
// item.recommendQty = 0; |
|||
// item.handledFromLocationCode = string; |
|||
// item.handledFromLocationArea = string; |
|||
// item.handledFromLocationGroup = string; |
|||
// item.handledFromLocationErpCode = string; |
|||
// item.handledFromWarehouseCode = string; |
|||
// item.handledQty = that.balancesItem.qty; |
|||
// item.toLocationCode = string; |
|||
// item.toLocationArea = string; |
|||
// item.toLocationGroup = string; |
|||
// item.toLocationErpCode = string; |
|||
// item.toWarehouseCode = string; |
|||
// item.onTheWayLocationCode = string; |
|||
|
|||
|
|||
this.getScanCount(); |
|||
this.closeScanPopup(); |
|||
that.$forceUpdate(); |
|||
// } |
|||
} |
|||
}, |
|||
|
|||
|
|||
getScanCount() { |
|||
this.scanCount = this.datacontent.details.filter(r => r.scaned).length; |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
if (this.allCount == this.scanCount) { |
|||
this.$refs.scanPopup.closeScanPopup(); |
|||
} |
|||
}, |
|||
|
|||
selectedBalanceItem(balanceItem) { |
|||
that.balancesItem = balanceItem; |
|||
this.createItem(item); |
|||
}, |
|||
|
|||
//接收 |
|||
receive(callback) { |
|||
let params = { |
|||
id: this.id |
|||
}; |
|||
takeDeliverJob(params) |
|||
.then(res => { |
|||
callback(true); |
|||
}) |
|||
.catch(err => { |
|||
this.showMessage(err.message); |
|||
callback(false); |
|||
}); |
|||
}, |
|||
|
|||
submit() { |
|||
let that = this; |
|||
if (that.datacontent.details.length === 0) { |
|||
this.showMessage('该任务没有要发货的零件'); |
|||
return; |
|||
} |
|||
let items = that.datacontent.details.filter(r => r.scaned); |
|||
if (items.length === 0) { |
|||
this.showMessage('请扫描要发货的零件'); |
|||
return; |
|||
} else if (items.length < that.datacontent.details.length) { |
|||
this.showMessage('还有未扫描的零件,不可以发货'); |
|||
return; |
|||
} else { |
|||
that.finsh(); |
|||
} |
|||
}, |
|||
|
|||
finsh() { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "提交中..." |
|||
}); |
|||
|
|||
let params = JSON.stringify(that.datacontent); |
|||
console.log(params); |
|||
// finshDeliverJob(that.id, params) |
|||
// .then(res => { |
|||
// uni.hideLoading(); |
|||
// if (res != null) { |
|||
// that.showCommitSuccessMessage(); |
|||
// navigateBack(1) |
|||
// } |
|||
// }) |
|||
// .catch(err => { |
|||
// this.showMessage(err.message); |
|||
// uni.hideLoading(); |
|||
// }); |
|||
|
|||
}, |
|||
|
|||
|
|||
showCommitSuccessMessage() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
|
|||
closeCommitMessage() { |
|||
navigateBack(1)//点关闭直接返回列表 |
|||
uni.hideLoading(); |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
if (this.allCount == this.scanCount) { |
|||
this.$refs.scanPopup.closeScanPopup(); |
|||
} |
|||
}, |
|||
|
|||
clearScanLocation() { |
|||
// this.$refs.scanLocation.getfocus(); |
|||
// this.$refs.scanLocation.clear(); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
scroll: function(e) { |
|||
// console.log(e) |
|||
this.old.scrollTop = e.detail.scrollTop; |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,176 @@ |
|||
<template> |
|||
<view style="padding: 15rpx;"> |
|||
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" |
|||
activeColor="#007AFF"></uni-segmented-control> |
|||
<view class="content"> |
|||
<view v-show="current === 0"> |
|||
<win-empty-view v-if="dataList.length==0"></win-empty-view> |
|||
<view class="" v-for="(item, index) in dataList"> |
|||
<view class="device-detail"> |
|||
<view>物料:</view> |
|||
<view>零件:</view> |
|||
<button type="primary" style="width: 140rpx; font-size: 32rpx; float: right;" >完成</button> |
|||
</view> |
|||
</view> |
|||
选项卡1的内容 |
|||
</view> |
|||
<view v-show="current === 1"> |
|||
<win-empty-view v-if="dataList.length==0"></win-empty-view> |
|||
<view class="" v-for="(item, index) in dataList"> |
|||
<view class="" v-for="(item, index) in dataList"> |
|||
<view class="device-detail"> |
|||
<view>物料:</view> |
|||
<view>零件:</view> |
|||
<button type="primary" style="width: 140rpx; font-size: 32rpx; float: right;" >完成</button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
选项卡2的内容 |
|||
</view> |
|||
</view> |
|||
<uni-load-more :status="loadingType" v-if="dataList.length>0" /> |
|||
</view> |
|||
</template> |
|||
<script> |
|||
import { |
|||
getPlasticsList, |
|||
} from '@/api/index.js'; |
|||
import { |
|||
goHome |
|||
} from '@/common/basic.js'; |
|||
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' |
|||
export default { |
|||
components: { |
|||
winEmptyView |
|||
}, |
|||
data() { |
|||
return { |
|||
items: ['已完成', '未完成'], |
|||
current: 0, |
|||
pageSize: this.modelConfig, |
|||
pageIndex: 1, |
|||
loadingType: "nomore", |
|||
dataList:[] |
|||
}; |
|||
}, |
|||
|
|||
onShow() { |
|||
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: { |
|||
onClickItem(item){ |
|||
this.current = item.currentIndex; |
|||
console.log("点击",this.current) |
|||
this.getList("refresh"); |
|||
}, |
|||
openScanPopup() { |
|||
this.$refs.scanPopup.openScanPopup(); |
|||
}, |
|||
|
|||
//查询发货任务 |
|||
getList(type) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
this.loadingType = "loading"; |
|||
if (type === "refresh") { |
|||
this.pageIndex = 1; |
|||
this.dataList = []; |
|||
} |
|||
let params = { |
|||
pageSize: that.pageSize, |
|||
pageIndex: that.pageIndex, |
|||
// isCreationTimeSorting: that.isTimeWindowSorting, |
|||
// isToday: that.isToday |
|||
}; |
|||
getPlasticsList(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.dataList = [...that.dataList, ...list]; |
|||
that.dataList = type === "refresh" ? list : this.dataList.concat(list); |
|||
that.pageIndex++; |
|||
}) |
|||
.catch(err => { |
|||
this.loadingType = ""; |
|||
this.showMessage(err.message); |
|||
uni.hideLoading(); |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
getScanResult(type, result) { |
|||
if (type == '任务编号') { |
|||
this.getByNumber(type, result.data.code); |
|||
} |
|||
}, |
|||
|
|||
getByNumber(type, code) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
getDeliverJobByNumber(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) { |
|||
uni.navigateTo({ |
|||
url: './plasticsInventoryMoveDetail?id=' + item.id + '&jobStatus=' + item.jobStatus |
|||
}); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
@ -0,0 +1,192 @@ |
|||
<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)"> |
|||
<com-deliver :dataContent="item"></com-deliver> |
|||
</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 { |
|||
getPlasticsList, |
|||
getDeliverJobByNumber |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
goHome |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' |
|||
import comDeliver from '@/mycomponents/coms/task/comDeliver.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, |
|||
comDeliver, |
|||
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 |
|||
}; |
|||
getPlasticsList(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(); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
getScanResult(type, result) { |
|||
if (type == '任务编号') { |
|||
this.getByNumber(type, result.data.code); |
|||
} |
|||
}, |
|||
|
|||
getByNumber(type, code) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
getDeliverJobByNumber(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) { |
|||
uni.navigateTo({ |
|||
url: './plasticsInventoryMoveDetail?id=' + item.id + '&jobStatus=' + item.jobStatus |
|||
}); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
</style> |
@ -0,0 +1,412 @@ |
|||
<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> |
|||
|
|||
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @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"> |
|||
<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="90"></uni-th> |
|||
<uni-th width="100" align="center">推荐</uni-th> |
|||
<uni-th width="100" align="center">实际</uni-th> --> |
|||
<uni-th width="50"></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="50">数量</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view class="text_black">{{item.recommendQty}}({{item.uom}})</text> |
|||
</view> |
|||
</uni-th> |
|||
<!-- --> |
|||
<uni-th width="120" align="center"> |
|||
<view v-if="item.scaned" class="text_black"> |
|||
{{item.handledQty}}({{item.uom}}) |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">箱码</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view class="text_packingCode">{{ item.recommendPackingCode }}</view> |
|||
</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view v-if="item.scaned" class="text_packingCode"> |
|||
{{ item.handledPackingCode }} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">批次</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view><text class="text_black">{{item.recommendLot }}</text> |
|||
</view> |
|||
</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view v-if="item.scaned"> |
|||
<text class="text_black">{{item.handledLot }}</text> |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">库位</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view class="text_black">{{ item.recommendLocationCode }}</view> |
|||
</uni-th> |
|||
<uni-th width="120" align="center"> |
|||
<view v-if="item.scaned" class="text_black"> |
|||
{{ item.handledFromLocationCode }} |
|||
</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> |
|||
|
|||
<view class="new_btn_bot count_shadow"> |
|||
<button type="primary" class="new_save_btn" @click="submit()">提交</button> |
|||
</view> |
|||
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack> |
|||
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
|||
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getDeliverDetail, |
|||
takeDeliverJob, |
|||
cancelTakeDeliverJob, |
|||
finshDeliverJob, |
|||
balances |
|||
} 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 comBalance from '@/mycomponents/common/comBalance.vue' |
|||
|
|||
export default { |
|||
components: { |
|||
winScanButton, |
|||
winMulitScan, |
|||
winScanByPack, |
|||
comMessage, |
|||
comJobScanDetail, |
|||
comBalance |
|||
}, |
|||
data() { |
|||
return { |
|||
type: '', |
|||
id: "", |
|||
datacontent: {}, |
|||
details: {}, |
|||
toLocation: '', |
|||
scrollTop: 0, |
|||
old: { |
|||
scrollTop: 0 |
|||
}, |
|||
ispending: false, |
|||
balancesItem: {}, |
|||
titleArray: ['箱标签', '目标库位'], |
|||
allCount: 0, |
|||
scanCount: 0, |
|||
jobStatus:"" |
|||
} |
|||
}, |
|||
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) { |
|||
//取消承接任务 |
|||
cancelTakeDeliverJob(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.scanPopup.openScanPopup(); |
|||
}, |
|||
//加载零件信息 |
|||
getDetail() { |
|||
let that = this; |
|||
let params = { |
|||
id: that.id, |
|||
}; |
|||
getDeliverDetail(params) |
|||
.then(item => { |
|||
console.log('item', item); |
|||
that.datacontent = item; |
|||
that.jobStatus = item.jobStatus; |
|||
that.details = item.details; |
|||
that.details.forEach(r => r.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 that = this; |
|||
let code = result.data.code; |
|||
let item = this.details.find(r => { |
|||
return r.recommendPackingCode === code |
|||
}); |
|||
|
|||
if (item === undefined) { |
|||
this.showMessage('在发货任务详情中,未找到箱码【' + code + '】'); |
|||
return; |
|||
} else { |
|||
if (item.scaned) { |
|||
this.showMessage('箱码【' + code + '】已经扫描,请扫描下一箱零件'); |
|||
return; |
|||
} |
|||
} |
|||
//按照零件号和箱码去查询库存 |
|||
let params = { |
|||
pageSize: 1000, |
|||
pageIndex: 1, |
|||
packingCode: code, |
|||
locationTypes: [4], //成品 |
|||
inventoryStatuses: [2], //合格 |
|||
}; |
|||
balances(params) |
|||
.then(res => { |
|||
try { |
|||
if (res.totalCount == 0) { |
|||
this.showMessage('箱码【' + code + '】在【成品库】未查询到库存信息'); |
|||
} else if (res.totalCount == 1) { |
|||
that.balancesItem = res.items[0]; |
|||
this.createItem(item); |
|||
} else { |
|||
this.$refs.balanceItems.openPopup(res.items); |
|||
} |
|||
uni.hideLoading(); |
|||
} catch (e) { |
|||
this.showMessage(e.message) |
|||
} |
|||
}) |
|||
.catch(err => { |
|||
this.showMessage(err.message) |
|||
}); |
|||
}, |
|||
|
|||
createItem(item) { |
|||
let that = this; |
|||
if (that.balancesItem != null || that.balancesItem != undefined) { |
|||
// if (that.balancesItem.qty != item.recommendQty) { |
|||
// this.showMessage('库存余额数量【' + that.balancesItem.qty + '】不等于推荐数量【' + item.recommendQty + '】,不可以进行发货') |
|||
// } else { |
|||
item.scaned = true; |
|||
item.handledContainerCode = that.balancesItem.containerCode; |
|||
item.handledPackingCode = that.balancesItem.packingCode; |
|||
item.handledBatch = that.balancesItem.batch; |
|||
item.handledLot = that.balancesItem.lot; |
|||
item.handledFromLocationArea = that.balancesItem.locationCode; |
|||
item.handledQty = that.balancesItem.qty; |
|||
|
|||
|
|||
// ================================== |
|||
// item.recommendFromLocationCode = string; |
|||
// item.recommendFromLocationArea = string; |
|||
// item.recommendFromLocationGroup = string; |
|||
// item.recommendFromLocationErpCode = string; |
|||
// item.recommendFromWarehouseCode = string; |
|||
// item.uom = string; |
|||
// item.recommendQty = 0; |
|||
// item.handledFromLocationCode = string; |
|||
// item.handledFromLocationArea = string; |
|||
// item.handledFromLocationGroup = string; |
|||
// item.handledFromLocationErpCode = string; |
|||
// item.handledFromWarehouseCode = string; |
|||
// item.handledQty = that.balancesItem.qty; |
|||
// item.toLocationCode = string; |
|||
// item.toLocationArea = string; |
|||
// item.toLocationGroup = string; |
|||
// item.toLocationErpCode = string; |
|||
// item.toWarehouseCode = string; |
|||
// item.onTheWayLocationCode = string; |
|||
|
|||
|
|||
this.getScanCount(); |
|||
this.closeScanPopup(); |
|||
that.$forceUpdate(); |
|||
// } |
|||
} |
|||
}, |
|||
|
|||
|
|||
getScanCount() { |
|||
this.scanCount = this.datacontent.details.filter(r => r.scaned).length; |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
if (this.allCount == this.scanCount) { |
|||
this.$refs.scanPopup.closeScanPopup(); |
|||
} |
|||
}, |
|||
|
|||
selectedBalanceItem(balanceItem) { |
|||
that.balancesItem = balanceItem; |
|||
this.createItem(item); |
|||
}, |
|||
|
|||
//接收 |
|||
receive(callback) { |
|||
let params = { |
|||
id: this.id |
|||
}; |
|||
takeDeliverJob(params) |
|||
.then(res => { |
|||
callback(true); |
|||
}) |
|||
.catch(err => { |
|||
this.showMessage(err.message); |
|||
callback(false); |
|||
}); |
|||
}, |
|||
|
|||
submit() { |
|||
let that = this; |
|||
if (that.datacontent.details.length === 0) { |
|||
this.showMessage('该任务没有要发货的零件'); |
|||
return; |
|||
} |
|||
let items = that.datacontent.details.filter(r => r.scaned); |
|||
if (items.length === 0) { |
|||
this.showMessage('请扫描要发货的零件'); |
|||
return; |
|||
} else if (items.length < that.datacontent.details.length) { |
|||
this.showMessage('还有未扫描的零件,不可以发货'); |
|||
return; |
|||
} else { |
|||
that.finsh(); |
|||
} |
|||
}, |
|||
|
|||
finsh() { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "提交中..." |
|||
}); |
|||
|
|||
let params = JSON.stringify(that.datacontent); |
|||
console.log(params); |
|||
// finshDeliverJob(that.id, params) |
|||
// .then(res => { |
|||
// uni.hideLoading(); |
|||
// if (res != null) { |
|||
// that.showCommitSuccessMessage(); |
|||
// that.backJobList(1000); |
|||
// navigateBack(1) |
|||
// } |
|||
// }) |
|||
// .catch(err => { |
|||
// this.showMessage(err.message); |
|||
// uni.hideLoading(); |
|||
// }); |
|||
}, |
|||
|
|||
showCommitSuccessMessage() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
|
|||
closeCommitMessage() { |
|||
navigateBack(1) |
|||
uni.hideLoading(); |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
if (this.allCount == this.scanCount) { |
|||
this.$refs.scanPopup.closeScanPopup(); |
|||
} |
|||
}, |
|||
|
|||
clearScanLocation() { |
|||
// this.$refs.scanLocation.getfocus(); |
|||
// this.$refs.scanLocation.clear(); |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
|
|||
scroll: function(e) { |
|||
// console.log(e) |
|||
this.old.scrollTop = e.detail.scrollTop; |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
Loading…
Reference in new issue