lijuncheng
2 months ago
6 changed files with 979 additions and 21 deletions
@ -0,0 +1,57 @@ |
|||||
|
<template> |
||||
|
<view class="page-wraper"> |
||||
|
<comMoveJob :title="title" ref="comMoveJob" businessTypeCode='HoldToWip'> </comMoveJob> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import comMoveJob from '@/pages/inventoryMove/coms/comMoveJob.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
comMoveJob |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
title:'' |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
onLoad(option){ |
||||
|
this.title = option.title |
||||
|
}, |
||||
|
onShow() { |
||||
|
if(this.$refs.comMoveJob){ |
||||
|
this.$refs.comMoveJob.refresh(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
onPullDownRefresh() { |
||||
|
if(this.$refs.comMoveJob){ |
||||
|
this.$refs.comMoveJob.refresh(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
onReachBottom() { |
||||
|
if(this.$refs.comMoveJob){ |
||||
|
this.$refs.comMoveJob.onReach(); |
||||
|
} |
||||
|
}, |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
this.$refs.comMoveJob.toHome(); |
||||
|
} else if (e.index == 1) { |
||||
|
this.$refs.comMoveJob.openFilter(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,354 @@ |
|||||
|
<template> |
||||
|
<view class="uni-flex" style="flex-direction: column;;"> |
||||
|
|
||||
|
|
||||
|
<job-filter ref="filter" otherTitle="ASN" :isShowProductionLineCode="false" :isShowItemCode="false" |
||||
|
:isShowQurery='true' @onQuery="getListByFilter"> |
||||
|
</job-filter> |
||||
|
<com-empty-view v-if="recordList.length==0"></com-empty-view> |
||||
|
<view v-if="recordList.length>0"> |
||||
|
<uni-swipe-action ref="swipeAction"> |
||||
|
<view v-for="(item, index) in recordList" :key="index"> |
||||
|
<uni-swipe-action-item |
||||
|
> |
||||
|
<comReturnRecordCard :dataContent="item" @click='openJobDetail(item)'> |
||||
|
</comReturnRecordCard> |
||||
|
</uni-swipe-action-item> |
||||
|
</view> |
||||
|
</uni-swipe-action> |
||||
|
|
||||
|
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup> |
||||
|
<job-info-popup ref='jobInfoPopup'></job-info-popup> |
||||
|
|
||||
|
<uni-load-more :status="loadingType" /> |
||||
|
</view> |
||||
|
<win-scan-button @goScan='openScanPopup' v-if="recordList.length>0"></win-scan-button> |
||||
|
<winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob> |
||||
|
<jobList ref="recordList" @selectItem="selectItem"></jobList> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getProductreceiptRecordList, |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
import { |
||||
|
goHome, |
||||
|
updateTitle |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
import { |
||||
|
planRefreshTime, |
||||
|
productionReceiptJobFilter |
||||
|
} from '@/common/config.js'; |
||||
|
|
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getDetailGiveupOption |
||||
|
} from '@/common/array.js'; |
||||
|
|
||||
|
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' |
||||
|
import jobFilter from '@/mycomponents/job/jobFilter.vue' |
||||
|
|
||||
|
import comReturnRecordCard from '@/pages/customerReturn/coms/comReturnRecordCard.vue' |
||||
|
import jobListPopup from '@/pages/productionReceipt/coms/jobListPopup.vue' |
||||
|
import jobInfoPopup from '@/pages/productionReceipt/coms/jobInfoPopup.vue' |
||||
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
||||
|
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" |
||||
|
import jobList from '@/mycomponents/jobList/jobList.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: 'productionReceipt', |
||||
|
components: { |
||||
|
comEmptyView, |
||||
|
jobFilter, |
||||
|
comReturnRecordCard, |
||||
|
jobListPopup, |
||||
|
jobInfoPopup, |
||||
|
winScanPackJob, |
||||
|
winScanButton, |
||||
|
jobList |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
recordList: [], |
||||
|
pageNo: 1, |
||||
|
pageSize: 10, |
||||
|
totalCount: 0, |
||||
|
loadingType: "nomore", |
||||
|
checkedToday: false, |
||||
|
checkedWaitTask: false, |
||||
|
todayTime: "", |
||||
|
detailOptions: [], |
||||
|
detailGiveupOptions: [], |
||||
|
title: '', |
||||
|
scanMessage: "", |
||||
|
filterItemCode: "", |
||||
|
queryParams:{ |
||||
|
creationTime:"", |
||||
|
receiveStatus:"", |
||||
|
itemCode:"" |
||||
|
} |
||||
|
}; |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
this.title = option.title |
||||
|
}, |
||||
|
|
||||
|
onShow() { |
||||
|
this.getList('refresh') |
||||
|
}, |
||||
|
|
||||
|
onReady() { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
this.detailGiveupOptions = getDetailGiveupOption(); |
||||
|
}, |
||||
|
|
||||
|
onReachBottom() { |
||||
|
//避免多次触发 |
||||
|
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
||||
|
return; |
||||
|
} |
||||
|
this.getList('more') |
||||
|
}, |
||||
|
|
||||
|
onPullDownRefresh() { |
||||
|
this.getList('refresh') |
||||
|
}, |
||||
|
|
||||
|
//后退按钮 |
||||
|
onBackPress(options) { |
||||
|
if (options.from === 'navigateBack') { |
||||
|
uni.navigateBack({ |
||||
|
delta: 1 |
||||
|
}) |
||||
|
return false; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//返回首页 |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
} else if (e.index == 1) { |
||||
|
this.$refs.filter.openFilter(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
|
||||
|
setQueryParam() { |
||||
|
var filterParams = [] |
||||
|
|
||||
|
//只看当天 |
||||
|
if (this.queryParams.creationTime) { |
||||
|
filterParams.push({ |
||||
|
column: "create_time", |
||||
|
action: "betweeen", |
||||
|
value: this.queryParams.creationTime |
||||
|
}) |
||||
|
} |
||||
|
//只看待处理 |
||||
|
if (this.queryParams.receiveStatus) { |
||||
|
filterParams.push({ |
||||
|
column: "receiveStatus", |
||||
|
action: "in", |
||||
|
value: this.queryParams.receiveStatus |
||||
|
}) |
||||
|
} else { |
||||
|
filterParams.push({ |
||||
|
column: "receiveStatus", |
||||
|
action: "in", |
||||
|
value: "0" |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//物料代码 |
||||
|
if (this.queryParams.itemCode) { |
||||
|
filterParams.push({ |
||||
|
column: "itemCode", |
||||
|
action: "like", |
||||
|
value: this.queryParams.itemCode |
||||
|
}) |
||||
|
this.filterItemCode = this.queryParams.itemCode |
||||
|
}else { |
||||
|
if(this.filterItemCode){ |
||||
|
filterParams.push({ |
||||
|
column: "itemCode", |
||||
|
action: "like", |
||||
|
value: this.filterItemCode |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
return filterParams; |
||||
|
|
||||
|
}, |
||||
|
getList(type) { |
||||
|
let that = this; |
||||
|
uni.showLoading({ |
||||
|
title: "加载中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
|
||||
|
this.loadingType = "loading"; |
||||
|
if (type === "refresh") { |
||||
|
this.pageNo = 1; |
||||
|
this.recordList = []; |
||||
|
} |
||||
|
var queryFiltersParams = this.setQueryParam() |
||||
|
var params = { |
||||
|
filters: queryFiltersParams, |
||||
|
pageNo: this.pageNo, |
||||
|
pageSize: this.pageSize, |
||||
|
} |
||||
|
|
||||
|
console.log("查询条件",JSON.stringify(params)) |
||||
|
|
||||
|
getProductreceiptRecordList(params).then(res => { |
||||
|
uni.hideLoading(); |
||||
|
if (type === "refresh") { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
} |
||||
|
|
||||
|
var list = res.data.list; |
||||
|
this.totalCount = res.data.total |
||||
|
updateTitle(this.title + "(" + this.totalCount + ")"); |
||||
|
this.loadingType = "loadmore"; |
||||
|
if (list == null || list.length == 0) { |
||||
|
this.loadingType = "nomore"; |
||||
|
return; |
||||
|
} |
||||
|
list.forEach(item=>{ |
||||
|
item.packingNumber =item.toPackingNumber |
||||
|
}) |
||||
|
this.recordList = type === "refresh" ? list : this.recordList.concat(list); |
||||
|
this.pageNo++; |
||||
|
|
||||
|
}).catch(error => { |
||||
|
if (type === "refresh") { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
} |
||||
|
this.loadingType = ""; |
||||
|
updateTitle(this.title); |
||||
|
uni.hideLoading(); |
||||
|
that.showMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
openJobDetail(item, scanMessage = '') { |
||||
|
uni.navigateTo({ |
||||
|
url: './recordListDetail?id=' + item.masterId + '&receiveStatus=' + item.receiveStatus + |
||||
|
'&scanMessage=' + scanMessage + '&title=' + this.title |
||||
|
}); |
||||
|
this.scanMessage = "" |
||||
|
}, |
||||
|
|
||||
|
showItemList(itemList) { |
||||
|
this.$refs.jobListPopup.openPopup(itemList); |
||||
|
}, |
||||
|
|
||||
|
selectedItem(item) { |
||||
|
this.openJobDetail(item); |
||||
|
}, |
||||
|
|
||||
|
openjobInfoPopup(item) { |
||||
|
this.$refs.jobInfoPopup.openPopup(item) |
||||
|
}, |
||||
|
|
||||
|
showMessage(message) { |
||||
|
if (this.$refs.scanPopup) { |
||||
|
this.$refs.scanPopup.packLoseFocus() |
||||
|
} |
||||
|
this.$refs.comMessage.showErrorMessage(message, res => { |
||||
|
if (res) { |
||||
|
if (this.$refs.scanPopup) { |
||||
|
this.$refs.scanPopup.packGetFocus() |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
openScanPopup() { |
||||
|
this.$refs.scanPopup.openScanPopup(); |
||||
|
}, |
||||
|
selectItem(item) { |
||||
|
this.$refs.scanPopup.closeScanPopup(); |
||||
|
this.openJobDetail(item, this.scanMessage); |
||||
|
}, |
||||
|
getScanResult(result) { |
||||
|
try { |
||||
|
this.scanMessage = "" |
||||
|
var filters = [{ |
||||
|
column: "toPackingNumber", |
||||
|
action: "in", |
||||
|
value: result.package.number + "," + result.package.parentNumber |
||||
|
}, |
||||
|
{ |
||||
|
column: "receiveStatus", |
||||
|
action: "in", |
||||
|
value: '0' |
||||
|
}, |
||||
|
{ |
||||
|
column: "toBatch", |
||||
|
action: "==", |
||||
|
value: result.label.batch |
||||
|
}, |
||||
|
{ |
||||
|
column: "itemCode", |
||||
|
action: "==", |
||||
|
value: result.label.itemCode |
||||
|
}, |
||||
|
] |
||||
|
|
||||
|
getProductreceiptRecordList({ |
||||
|
filters: filters, |
||||
|
pageNo: 1, |
||||
|
pageSize: 100, |
||||
|
}).then(res => { |
||||
|
this.scanMessage = result.scanMessage |
||||
|
let resultList = res.data.list; |
||||
|
if (resultList.length > 0) { |
||||
|
resultList.forEach(item => { |
||||
|
item.title = item.number; |
||||
|
item.selected = false |
||||
|
}) |
||||
|
let list = [] |
||||
|
resultList.forEach(item => { |
||||
|
if (!list.find(subItem => subItem.title == item.title)) { |
||||
|
list.push(item) |
||||
|
} |
||||
|
}) |
||||
|
if (list.length > 1) { |
||||
|
this.$refs.recordList.openList(list) |
||||
|
} else { |
||||
|
this.selectItem(list[0]) |
||||
|
} |
||||
|
} else { |
||||
|
this.showMessage("未查找到任务\n" + "扫描[" + result.scanMessage + "]") |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
this.showMessage(error + "\n扫描[" + result.scanMessage + "]") |
||||
|
}) |
||||
|
|
||||
|
} catch (e) { |
||||
|
this.showMessage(e.message) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
getListByFilter(params) { |
||||
|
this.queryParams.creationTime=params.creationTime |
||||
|
this.queryParams.receiveStatus=params.receiveStatus |
||||
|
this.queryParams.itemCode=params.itemCode |
||||
|
this.getList('refresh') |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,430 @@ |
|||||
|
<template> |
||||
|
<view class="page-wraper"> |
||||
|
<view class="page-main"> |
||||
|
<view class="page-header"> |
||||
|
<view class="header-view"> |
||||
|
<view class="header_job_top"> |
||||
|
<receive-top :dataContent="recordContent"></receive-top> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view v-if="detailSource.length>0" class="uni-flex uni-row " |
||||
|
style=";margin-top: 15rpx; margin-bottom: 15rpx; margin-left: 20rpx; text-align: right;"> |
||||
|
<view class="font_default" style="display: block; font-weight: bold;"> |
||||
|
整单接收 |
||||
|
</view> |
||||
|
<view class="uni-flex" style="margin-left: 20rpx; align-items: center; text-align: center;"> |
||||
|
<u-switch v-model="isAllReceived" active-color="#5FCB94" inactive-color="#eee" size="35" |
||||
|
@change="switchChange"></u-switch> |
||||
|
</view> |
||||
|
</view> |
||||
|
<scroll-view scroll-y="true"> |
||||
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
||||
|
<view class=""> |
||||
|
<com-detail-card :dataContent="item" :index="index" :settingParam="recordContent" |
||||
|
@remove="updateData" :isShowToLocation="true" @updateData="updateData" |
||||
|
@openDetail="openDetail"> |
||||
|
</com-detail-card> |
||||
|
|
||||
|
<view class='split_line'></view> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="page-footer"> |
||||
|
<view class="uni-flex u-col-center space-between padding_10" |
||||
|
style="background-color:ghostwhite; width: 100%; "> |
||||
|
<view class=" uni-flex uni-row"> |
||||
|
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after" |
||||
|
@click="reject">拒绝</button> |
||||
|
</view> |
||||
|
<view class=" uni-flex uni-row"> |
||||
|
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after" |
||||
|
@click="receive" :disabled="receiveDisable">接收</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
||||
|
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ"></win-scan-pack> |
||||
|
|
||||
|
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> |
||||
|
|
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import { |
||||
|
getProductreceiptRecordDetail, |
||||
|
productreceiptRecordRefuse, |
||||
|
productreceiptRecordReceive, |
||||
|
} from '@/api/request2.js'; |
||||
|
import { |
||||
|
goHome, |
||||
|
navigateBack, |
||||
|
getCurrDateTime, |
||||
|
getInventoryStatusName, |
||||
|
getSwitchInfoByCode |
||||
|
} from '@/common/basic.js'; |
||||
|
import { |
||||
|
getDataSource, |
||||
|
calcHandleQty, |
||||
|
getScanCount |
||||
|
} from '@/common/detail.js'; |
||||
|
|
||||
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
||||
|
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" |
||||
|
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue' |
||||
|
import receiveTop from '@/mycomponents/receive/receiveTop.vue' |
||||
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
||||
|
import comMoveRecordCard from '@/pages/itemHold/coms/comMoveRecordCard.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
winScanButton, |
||||
|
winScanPack, |
||||
|
comDetailCard, |
||||
|
detailInfoPopup, |
||||
|
receiveTop, |
||||
|
comMoveRecordCard |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
id: '', |
||||
|
scanCount: 0, |
||||
|
recordContent: {}, //任务内容 |
||||
|
subList: [], //接口返回的任务subList |
||||
|
detailSource: [], //绑定在页面上的数据源 |
||||
|
fromLocationCode: "", |
||||
|
toLocationCode: "", |
||||
|
isAllReceived: false, |
||||
|
receiveDisable: true //默认不可点击 |
||||
|
}; |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
uni.setNavigationBarTitle({ |
||||
|
title: option.title + '详情' |
||||
|
}) |
||||
|
this.id = option.id; |
||||
|
if (this.id != undefined) { |
||||
|
//新建的任务自动接收 |
||||
|
if (option.receiveStatus == "0") { |
||||
|
this.getDetail(); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
//返回首页 |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
} |
||||
|
}, |
||||
|
//拦截返回按钮事件 |
||||
|
onBackPress(e) { |
||||
|
//已经接收但是没提交任务 |
||||
|
if (e.from == 'backbutton') { |
||||
|
uni.navigateBack(); |
||||
|
return true; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
mounted() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
//接收 |
||||
|
getDetail() { |
||||
|
var that = this; |
||||
|
uni.showLoading({ |
||||
|
title: "加载中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
getProductreceiptRecordDetail(that.id).then(res => { |
||||
|
uni.hideLoading(); |
||||
|
this.isAllReceived= false |
||||
|
this.receiveDisable = true |
||||
|
if (res.data == null) { |
||||
|
that.showMessage('未获取到详情'); |
||||
|
} else { |
||||
|
if (res.data.list.length > 0) { |
||||
|
that.recordContent = res.data.list[0]; |
||||
|
that.subList = res.data.list; |
||||
|
that.subList.forEach(item => { |
||||
|
item.batch = item.toBatch; |
||||
|
item.packingNumber = item.toPackingNumber; |
||||
|
item.inventoryStatus= item.fromInventoryStatus |
||||
|
item.toInventoryStatus =item.toInventoryStatus |
||||
|
}) |
||||
|
that.detailSource = getDataSource(that.subList) |
||||
|
} else { |
||||
|
that.showMessage('列表数据为0'); |
||||
|
} |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
calcHandleQty() { |
||||
|
calcHandleQty(this.detailSource); |
||||
|
this.updateBtn() |
||||
|
this.continueScan() |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
updateBtn() { |
||||
|
this.scanCount = getScanCount(this.subList); |
||||
|
//扫描数量和任务数量相等,直接提交 |
||||
|
if (this.scanCount == this.subList.length) { |
||||
|
this.receiveDisable = false; |
||||
|
}else { |
||||
|
this.receiveDisable = true; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//继续扫描 |
||||
|
continueScan() { |
||||
|
this.scanCount = getScanCount(this.subList); |
||||
|
if (this.scanCount == this.subList.length) { |
||||
|
this.closeScanPopup(); |
||||
|
} else { |
||||
|
this.scanPopupGetFocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
updateData() { |
||||
|
this.calcHandleQty(); |
||||
|
this.updateBtn() |
||||
|
}, |
||||
|
|
||||
|
openDetail(item) { |
||||
|
this.$refs.detailInfoPopup.openPopup(item) |
||||
|
}, |
||||
|
|
||||
|
openScanPopup() { |
||||
|
this.$refs.scanPopup.openScanPopup(); |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup() { |
||||
|
this.$refs.scanPopup.closeScanPopup(); |
||||
|
}, |
||||
|
|
||||
|
getScanResult(result) { |
||||
|
try { |
||||
|
var itemCode = result.label.itemCode; |
||||
|
var packingNumber = result.package.number; |
||||
|
var batch = result.label.batch; |
||||
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
||||
|
|
||||
|
if (detail == undefined) { |
||||
|
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
||||
|
} else { |
||||
|
var itemDetail = detail.subList.find(r => { |
||||
|
return r.packingNumber == packingNumber && |
||||
|
r.batch == batch |
||||
|
}) |
||||
|
if (itemDetail == undefined) { |
||||
|
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中") |
||||
|
} else { |
||||
|
if (itemDetail.scaned) { |
||||
|
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描") |
||||
|
} else { |
||||
|
itemDetail.scaned = true; |
||||
|
itemDetail.handleQty = Number(itemDetail.qty) |
||||
|
this.calcHandleQty(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} catch (e) { |
||||
|
this.showMessage(e.message) |
||||
|
} |
||||
|
}, |
||||
|
reject() { |
||||
|
this.showQuestionMessage("是否拒绝接收?", res => { |
||||
|
if (res) { |
||||
|
uni.showLoading({ |
||||
|
title: "提交中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
productreceiptRecordRefuse(this.id).then(res=>{ |
||||
|
uni.hideLoading() |
||||
|
if(res.data){ |
||||
|
this.showCommitSuccessMessage("拒绝成功") |
||||
|
}else { |
||||
|
this.showErrorMessage("拒绝失败[" + res.msg + "]") |
||||
|
} |
||||
|
}).catch(error=>{ |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
receive() { |
||||
|
this.scanCount = getScanCount(this.subList); |
||||
|
if (this.scanCount == 0) { |
||||
|
this.showErrorMessage("扫描数为0,请先扫描") |
||||
|
return; |
||||
|
} |
||||
|
if (this.scanCount < this.subList.length) { |
||||
|
this.showErrorMessage("还有未扫描的数据,请先扫描") |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
//扫描数量和任务数量相等,直接提交 |
||||
|
if (this.scanCount == this.subList.length) { |
||||
|
this.receiveSubmit(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
showMessageHint(hint, callback) { |
||||
|
this.$refs.comMessage.showErrorMessage(hint, res => { |
||||
|
if (res) { |
||||
|
callback() |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
receiveSubmit() { |
||||
|
uni.showLoading({ |
||||
|
title: "提交中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
productreceiptRecordReceive(this.id).then(res => { |
||||
|
uni.hideLoading() |
||||
|
if (res.data) { |
||||
|
this.showCommitSuccessMessage("接收成功") |
||||
|
} else { |
||||
|
this.showErrorMessage("接收失败[" + res.msg + "]") |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
showMessage(message) { |
||||
|
setTimeout(r => { |
||||
|
this.scanPopupLoseFocus(); |
||||
|
this.$refs.comMessage.showMessage(message, res => { |
||||
|
if (res) { |
||||
|
this.afterCloseMessage() |
||||
|
} |
||||
|
}); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
showErrorMessage(message) { |
||||
|
setTimeout(r => { |
||||
|
this.scanPopupLoseFocus(); |
||||
|
this.$refs.comMessage.showErrorMessage(message, res => { |
||||
|
if (res) { |
||||
|
this.afterCloseMessage() |
||||
|
} |
||||
|
}); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
showQuestionMessage(message, callback) { |
||||
|
setTimeout(r => { |
||||
|
this.scanPopupLoseFocus(); |
||||
|
this.$refs.comMessage.showQuestionMessage(message, res => { |
||||
|
if (res) { |
||||
|
callback(res); |
||||
|
} |
||||
|
}); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
scanPopupGetFocus() { |
||||
|
if (this.$refs.scanPopup) { |
||||
|
this.$refs.scanPopup.getfocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
scanPopupLoseFocus() { |
||||
|
if (this.$refs.scanPopup) { |
||||
|
this.$refs.scanPopup.losefocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
afterCloseMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
showCommitSuccessMessage(hint) { |
||||
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
||||
|
navigateBack(1) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
switchChange(isOn) { |
||||
|
this.isAllReceived = isOn |
||||
|
if(this.isAllReceived){ |
||||
|
this.detailSource.forEach(item=>{ |
||||
|
item.subList.forEach(info=>{ |
||||
|
info.scaned=true; |
||||
|
info.handleQty=Number(info.qty) |
||||
|
}) |
||||
|
|
||||
|
}) |
||||
|
this.calcHandleQty(); |
||||
|
}else { |
||||
|
this.$refs.comMessage.showQuestionMessage("是否要关闭整单收货?", res => { |
||||
|
if (res) { |
||||
|
this.getDetail() |
||||
|
} else { |
||||
|
this.isAllReceived=true |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
page { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
background-color: #fff; |
||||
|
} |
||||
|
|
||||
|
.page-wraper { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.page-main { |
||||
|
flex: 1; |
||||
|
position: relative; |
||||
|
} |
||||
|
|
||||
|
.page-main-scroll { |
||||
|
position: absolute; |
||||
|
left: 0; |
||||
|
right: 0; |
||||
|
top: 0; |
||||
|
bottom: 0; |
||||
|
} |
||||
|
|
||||
|
.page-main-list { |
||||
|
/* height: 80rpx; |
||||
|
line-height: 80rpx; */ |
||||
|
text-align: center; |
||||
|
background: #e0e0e0; |
||||
|
|
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue