lijuncheng
8 months ago
15 changed files with 1224 additions and 46 deletions
@ -0,0 +1,39 @@ |
|||||
|
<template> |
||||
|
<job-com-main-card :dataContent="dataContent"> |
||||
|
<view class="task_item"> |
||||
|
<view class="task_text"> |
||||
|
申请单号 {{dataContent.requestNumber}} |
||||
|
</view> |
||||
|
<view class="task_text"> |
||||
|
车间 {{dataContent.workShopCode}} |
||||
|
</view> |
||||
|
</view> |
||||
|
</job-com-main-card> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue' |
||||
|
export default { |
||||
|
components: { |
||||
|
jobComMainCard, |
||||
|
}, |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
|
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,188 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode" |
||||
|
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> --> |
||||
|
|
||||
|
<view v-for="(item,index) in dataContent.Items" :key="index"> |
||||
|
<uni-collapse ref="collapse"> |
||||
|
<uni-collapse-item :open="true"> |
||||
|
<template v-slot:title> |
||||
|
<!-- 物品 --> |
||||
|
<uni-swipe-action ref="swipeAction"> |
||||
|
<uni-swipe-action-item @click="itemCoceClick($event,item,index)" |
||||
|
:right-options="removeOptions"> |
||||
|
<item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty> |
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
<!-- <com-issue-request-info :workShopCode="dataContent.workShopCode" :dataContent="dataContent"> |
||||
|
</com-issue-request-info> --> |
||||
|
</template> |
||||
|
<u-line /> |
||||
|
<view v-for="(loacation,index) in item.Locations" :key="index"> |
||||
|
<view> |
||||
|
<view class="uni-flex uni-row space-between"> |
||||
|
<!-- 推荐库位 --> |
||||
|
<location :locationCode="loacation.fromLocationCode"> |
||||
|
</location> |
||||
|
</view> |
||||
|
<view v-for="(batch,index) in loacation.Batchs" :key="index"> |
||||
|
<recommend-balance style='margin-left: 0rpx;' :detail="batch" :isShowLocation="false" |
||||
|
:isShowPack="batch.packingNumber!=null && batch.packingNumber!=''"> |
||||
|
</recommend-balance> |
||||
|
<view class="uni-flex uni-row " v-if='batch.Records.length>0'> |
||||
|
<view class="center " style=" width: 20px;background-color: #0CC2B6; color: #fff; margin-left: 40px;padding: 0px 2px;"> |
||||
|
扫描 |
||||
|
</view> |
||||
|
<view class="uni-flex uni-column scan_view" style="width: 100%;"> |
||||
|
<view v-for="(record,index) in batch.Records" :key="index"> |
||||
|
<uni-swipe-action ref="swipeAction"> |
||||
|
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)" |
||||
|
:right-options="scanOptions"> |
||||
|
<handle-balance :detail="record" :isShowLocation="false" |
||||
|
:isShowBatch="batch.packingNumber!=null"> |
||||
|
</handle-balance> |
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-collapse-item> |
||||
|
</uni-collapse> |
||||
|
</view> |
||||
|
</view> |
||||
|
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit> |
||||
|
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> |
||||
|
<comMessage ref="message"></comMessage> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import itemQty from '@/mycomponents/item/itemQty.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue' |
||||
|
import handleBalance from '@/mycomponents/balance/handleBalance.vue' |
||||
|
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' |
||||
|
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' |
||||
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
||||
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue' |
||||
|
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue' |
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getEditRemoveOption, |
||||
|
getRemoveOption |
||||
|
} from '@/common/array.js'; |
||||
|
|
||||
|
export default { |
||||
|
emits: ['updateData',"removeItemCode"], |
||||
|
components: { |
||||
|
itemQty, |
||||
|
recommend, |
||||
|
recommendBalance, |
||||
|
handleBalance, |
||||
|
recommendQtyEdit, |
||||
|
requiredLocation, |
||||
|
balanceQtyEdit, |
||||
|
location, |
||||
|
detailInfoPopup, |
||||
|
comIssueRequestInfo |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
option: [], |
||||
|
showItem: {}, |
||||
|
editItem: {}, |
||||
|
batchItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [], |
||||
|
removeOptions:[] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
this.scanOptions = getEditRemoveOption(); |
||||
|
this.removeOptions = getRemoveOption() |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
resizeCollapse() { |
||||
|
this.$nextTick(r => { |
||||
|
this.$refs.collapse.forEach(r => { |
||||
|
r.childrens.forEach(i => { |
||||
|
i.init(); |
||||
|
}) |
||||
|
r.resize(); |
||||
|
}) |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
swipeClick(e, batch, record, index) { |
||||
|
if (e.content.text == "编辑") { |
||||
|
this.edit(batch, record) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.remove(batch, record, index) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
itemCoceClick(e,item,index){ |
||||
|
if (e.content.text == "移除") { |
||||
|
this.dataContent.Items.splice(index, 1); |
||||
|
this.$emit('removeItemCode') |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
edit(batch, item) { |
||||
|
let that = this; |
||||
|
that.editItem = item; |
||||
|
that.batchItem = batch; |
||||
|
item.balance.balanceQty = item.balance.qty; |
||||
|
that.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty); |
||||
|
}, |
||||
|
|
||||
|
detail(item) { |
||||
|
this.showItem = item; |
||||
|
this.$refs.receiptHint.openScanPopup() |
||||
|
}, |
||||
|
remove(batch, record, index) { |
||||
|
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
batch.Records.splice(index, 1); |
||||
|
this.resizeCollapse(); |
||||
|
this.$emit('updateData', record) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
confirm(val) { |
||||
|
this.editItem.qty = val; |
||||
|
this.$emit('updateData', this.editItem) |
||||
|
// let qty = 0; |
||||
|
// this.batchItem.Records.forEach(r => { |
||||
|
// qty += Number(r.qty); |
||||
|
// }) |
||||
|
// this.batchItem.handleQty = qty; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,305 @@ |
|||||
|
<template> |
||||
|
<view class=""> |
||||
|
<com-empty-view v-if="jobList.length==0"></com-empty-view> |
||||
|
<job-filter ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" |
||||
|
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" |
||||
|
:checkedWaitTask="checkedWaitTask"> |
||||
|
</job-filter> |
||||
|
<view v-if="jobList.length>0"> |
||||
|
<uni-swipe-action ref="swipeAction"> |
||||
|
<view v-for="(item, index) in jobList" :key="index"> |
||||
|
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions" |
||||
|
@click="swipeClick($event,item)"> |
||||
|
<comOverPackJobCard :dataContent="item" @click='openJobDetail(item)'></comOverPackJobCard> |
||||
|
</uni-swipe-action-item> |
||||
|
</view> |
||||
|
</uni-swipe-action> |
||||
|
|
||||
|
<job-info-popup ref='jobInfoPopup'></job-info-popup> |
||||
|
|
||||
|
<uni-load-more :status="loadingType" v-if="jobList.length>0" /> |
||||
|
</view> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
cancleTakeOverPageJob, |
||||
|
getOverPageJobList, |
||||
|
} from '@/api/request2.js'; |
||||
|
import { |
||||
|
goHome, |
||||
|
updateTitle |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getDetailGiveupOption |
||||
|
} from '@/common/array.js'; |
||||
|
|
||||
|
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' |
||||
|
import jobFilter from '@/mycomponents/job/jobFilter.vue' |
||||
|
import comOverPackJobCard from '@/pages/package/coms/comOverPackJobCard.vue' |
||||
|
import jobInfoPopup from '@/pages/issue/coms/jobInfoPopup.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: 'issue', |
||||
|
components: { |
||||
|
comEmptyView, |
||||
|
jobFilter, |
||||
|
comOverPackJobCard, |
||||
|
jobInfoPopup |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
jobList: [], |
||||
|
pageNo: 1, |
||||
|
pageSize: 10, |
||||
|
totalCount: 0, |
||||
|
loadingType: "nomore", |
||||
|
checkedToday: false, |
||||
|
checkedWaitTask: false, |
||||
|
todayTime: "", |
||||
|
status: '1,2', //待处理 、进行中 |
||||
|
detailOptions: [], |
||||
|
detailGiveupOptions: [], |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
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: { |
||||
|
getList(type) { |
||||
|
let that = this; |
||||
|
uni.showLoading({ |
||||
|
title: "加载中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
|
||||
|
this.loadingType = "loading"; |
||||
|
if (type === "refresh") { |
||||
|
this.pageNo = 1; |
||||
|
this.jobList = []; |
||||
|
} |
||||
|
var filters = [] |
||||
|
if (this.checkedToday) { |
||||
|
filters.push({ |
||||
|
column: "request_time", |
||||
|
action: "betweeen", |
||||
|
value: this.todayTime |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
filters.push({ |
||||
|
column: "status", |
||||
|
action: "in", |
||||
|
value: this.status |
||||
|
}) |
||||
|
|
||||
|
var params = { |
||||
|
filters: filters, |
||||
|
pageNo: this.pageNo, |
||||
|
pageSize: this.pageSize, |
||||
|
} |
||||
|
getOverPageJobList(params).then(res => { |
||||
|
uni.hideLoading(); |
||||
|
if (type === "refresh") { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
} |
||||
|
var list = res.data.list; |
||||
|
this.totalCount = res.data.total |
||||
|
this.loadingType = "loadmore"; |
||||
|
if (list == null || list.length == 0) { |
||||
|
this.loadingType = "nomore"; |
||||
|
return; |
||||
|
} |
||||
|
this.jobList = type === "refresh" ? list : this.jobList.concat(list); |
||||
|
this.pageNo++; |
||||
|
updateTitle("翻包任务(" + this.totalCount + ")"); |
||||
|
|
||||
|
}).catch(error => { |
||||
|
if (type === "refresh") { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
} |
||||
|
updateTitle("翻包任务"); |
||||
|
this.loadingType = ""; |
||||
|
uni.hideLoading(); |
||||
|
that.showMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
getByAsnNumber(code) { |
||||
|
let that = this; |
||||
|
uni.showLoading({ |
||||
|
title: "加载中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
|
||||
|
getPurchasereceiptByAsnNumber(code).then(res => { |
||||
|
uni.hideLoading(); |
||||
|
if (res.data.total == 0) { |
||||
|
that.showMessage('未查找到' + '【' + code + '】的收货任务'); |
||||
|
} else if (res.data.total == 1) { |
||||
|
this.$refs.scanAsnNumber.closeScanPopup(); |
||||
|
that.openJobDetail(res.data.list[0]); |
||||
|
} else { |
||||
|
this.$refs.scanAsnNumber.closeScanPopup(); |
||||
|
that.showItemList(res.data.list); |
||||
|
} |
||||
|
|
||||
|
}).catch(error => { |
||||
|
uni.hideLoading(); |
||||
|
that.showErrorMessage(error); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
openJobDetail(item) { |
||||
|
uni.navigateTo({ |
||||
|
url: './overPackageJobDetail?id=' + item.id + '&status=' + item.status |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
showItemList(itemList) { |
||||
|
this.$refs.scanList.openPopup(itemList); |
||||
|
}, |
||||
|
|
||||
|
selectedItem(item) { |
||||
|
this.openJobDetail(item); |
||||
|
}, |
||||
|
|
||||
|
swipeClick(e, dataContent) { |
||||
|
if (e.content.text == "详情") { |
||||
|
this.openjobInfoPopup(dataContent); |
||||
|
} else if (e.content.text == "放弃") { |
||||
|
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
this.cancleJob(dataContent.id); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
openjobInfoPopup(item) { |
||||
|
this.$refs.jobInfoPopup.openPopup(item) |
||||
|
}, |
||||
|
|
||||
|
cancleJob(id) { |
||||
|
cancleTakeOverPageJob(id).then(res => { |
||||
|
if(res.data){ |
||||
|
this.getList("refresh") |
||||
|
uni.showToast({ |
||||
|
title:"放弃任务成功" |
||||
|
}) |
||||
|
}else { |
||||
|
this.showMessage("放弃任务失败") |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
this.showMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
switchChangeToday(state, creationTime) { |
||||
|
this.checkedToday = state; |
||||
|
this.todayTime = creationTime; |
||||
|
this.getList("refresh"); |
||||
|
}, |
||||
|
|
||||
|
switchChangeWait(state, jobStatus) { |
||||
|
this.checkedWaitTask = state; |
||||
|
this.status = jobStatus; |
||||
|
this.getList("refresh"); |
||||
|
}, |
||||
|
|
||||
|
getScanNumber(code) { |
||||
|
this.getDataListByType(code) |
||||
|
}, |
||||
|
getDataListByType(code) { |
||||
|
let that = this; |
||||
|
uni.showLoading({ |
||||
|
title: "加载中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
var filters = [] |
||||
|
filters.push({ |
||||
|
column: "status", |
||||
|
action: "in", |
||||
|
value: '1,2' |
||||
|
}) |
||||
|
filters.push({ |
||||
|
column: "number", |
||||
|
action: "==", |
||||
|
value: code |
||||
|
}) |
||||
|
|
||||
|
var params = { |
||||
|
filters: filters, |
||||
|
pageNo: 1, |
||||
|
pageSize: 100, |
||||
|
} |
||||
|
getOverPageJobList(params).then(res => { |
||||
|
uni.hideLoading(); |
||||
|
if (res.data.list.length == 0) { |
||||
|
that.showMessage('未查找到' + '【' + code + '】的发料任务'); |
||||
|
} else if (res.data.list.length == 1) { |
||||
|
that.openJobDetail(res.data.list[0]); |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading(); |
||||
|
that.showMessage(error); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showErrorMessage(message, res => { |
||||
|
if (res) { |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,518 @@ |
|||||
|
<template> |
||||
|
<view class="page-wraper"> |
||||
|
<view class="page-header"> |
||||
|
<view class="header_job_top"> |
||||
|
<job-top :dataContent="jobContent"></job-top> |
||||
|
</view> |
||||
|
<view class="header_item"> |
||||
|
申请单号 : {{jobContent.requestNumber}} |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="page-main"> |
||||
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
||||
|
<view v-for="(toLocation, index) in detailSource" :key="index"> |
||||
|
<work-station :workshopCode="jobContent.workShopCode" |
||||
|
:productionLineCode="toLocation.productionLineCode" |
||||
|
:workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode"> |
||||
|
</work-station> |
||||
|
<comOverPackJobDetailCard ref='comOverPackJobDetailCard' :dataContent="toLocation" @updateData='updateData'> |
||||
|
</comOverPackJobDetailCard> |
||||
|
</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=""> |
||||
|
</view> |
||||
|
<view class=" uni-flex uni-row"> |
||||
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit()">提交</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button> |
||||
|
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'> |
||||
|
</com-scan-issue-pack> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
takeOverPageJob, |
||||
|
cancleTakeOverPageJob, |
||||
|
getOverPageJobDetail, |
||||
|
overPageSubmit |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
import { |
||||
|
goHome, |
||||
|
updateTitle, |
||||
|
navigateBack, |
||||
|
getRemoveOption, |
||||
|
getCurrDateTime, |
||||
|
getDirectoryItemArray, |
||||
|
getPackingNumberAndBatch, |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
import { |
||||
|
getDataSource |
||||
|
} from '@/pages/issue/js/issue.js'; |
||||
|
|
||||
|
import { |
||||
|
getManagementPrecisions |
||||
|
} from '@/common/balance.js'; |
||||
|
|
||||
|
import { |
||||
|
calc |
||||
|
} from '@/common/calc.js'; |
||||
|
|
||||
|
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' |
||||
|
import comOverPackJobDetailCard from '@/pages/package/coms/comOverPackJobDetailCard.vue' |
||||
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
||||
|
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue' |
||||
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
||||
|
import workStation from '@/mycomponents/workStation/workStation.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: 'issueDetail', |
||||
|
components: { |
||||
|
jobDetailPopup, |
||||
|
winScanButton, |
||||
|
comOverPackJobDetailCard, |
||||
|
comScanIssuePack, |
||||
|
jobTop, |
||||
|
workStation |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
id: '', |
||||
|
jobContent: {}, //任务内容 |
||||
|
subList: [], //接口返回的任务subList |
||||
|
detailSource: [], //绑定在页面上的数据源 |
||||
|
detailOptions: [], |
||||
|
scanOptions: [], |
||||
|
jobStatus:"" |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
props: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
onLoad(option) { |
||||
|
this.id = option.id; |
||||
|
if (this.id != undefined) { |
||||
|
//新建的任务自动接收 |
||||
|
if (option.status == "1") { |
||||
|
this.receive((callback => { |
||||
|
this.getDetail(); |
||||
|
})); |
||||
|
} else { |
||||
|
this.getDetail(); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//拦截返回按钮事件 |
||||
|
onBackPress(e) { |
||||
|
//已经接收但是没提交任务 |
||||
|
if (e.from === 'backbutton') { |
||||
|
if (this.jobStatus=="2") { |
||||
|
//取消承接任务 |
||||
|
cancleTakeOverPageJob(this.id).then(res => { |
||||
|
uni.navigateBack(); |
||||
|
}).catch(error => { |
||||
|
uni.navigateBack(); |
||||
|
}) |
||||
|
} else { |
||||
|
uni.navigateBack(); |
||||
|
} |
||||
|
|
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
watch: { |
||||
|
locationTypes(newVal) { |
||||
|
let value = newVal; |
||||
|
}, |
||||
|
}, |
||||
|
mounted: function() { |
||||
|
// this.resizeCollapse(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
resizeCollapse() { |
||||
|
this.$nextTick(r => { |
||||
|
this.$refs.comOverPackJobDetailCard.forEach(r => { |
||||
|
r.resizeCollapse(); |
||||
|
}) |
||||
|
// this.$refs.mainCollapse.forEach(r => { |
||||
|
// r.childrens.forEach(i => { |
||||
|
// i.init(); |
||||
|
// }) |
||||
|
// r.resize(); |
||||
|
// }) |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
//接收 |
||||
|
receive(callback) { |
||||
|
if (this.id != null) { |
||||
|
takeOverPageJob(this.id).then(res => { |
||||
|
callback(); |
||||
|
}).catch(error => { |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
getDetail() { |
||||
|
var that = this; |
||||
|
uni.showLoading({ |
||||
|
title: "加载中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
getOverPageJobDetail(that.id).then(res => { |
||||
|
uni.hideLoading(); |
||||
|
if (res.data == null) { |
||||
|
that.showMessage('未获取到详情'); |
||||
|
} else { |
||||
|
if (res.data.subList.length > 0) { |
||||
|
that.jobContent = res.data; |
||||
|
that.jobStatus = res.data.status |
||||
|
that.subList = res.data.subList; |
||||
|
that.detailSource = getDataSource(that.detailSource, that.subList) |
||||
|
|
||||
|
setTimeout(r => { |
||||
|
that.resizeCollapse(); |
||||
|
}, 100) |
||||
|
|
||||
|
uni.hideLoading(); |
||||
|
} else { |
||||
|
that.showMessage('列表数据为0'); |
||||
|
} |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
closeScan() { |
||||
|
this.resizeCollapse(); |
||||
|
}, |
||||
|
|
||||
|
// submit() { |
||||
|
//3.如果是按批次先进先出发料提交时如果扫描的箱码不是先进的批次,则报错 |
||||
|
//:请扫描XXX批次,改批次满足先进先出规则。否则可以直接提交 |
||||
|
// var isOutIn = getApp().globalData.feed_configList.filter( |
||||
|
// res => { |
||||
|
// if (res.name == 'feed_isOutIn') { |
||||
|
// return res; |
||||
|
// } |
||||
|
// }); |
||||
|
|
||||
|
|
||||
|
// this.dataContent.itemCodeList.forEach(res => { |
||||
|
// if (res.handleQty > res.recommendQty) { |
||||
|
// this.$refs.modal.showConfirmMessageModal('实际数量大于需求数量,是否提交?', confirm => { |
||||
|
// if (confirm) { |
||||
|
// //提交 |
||||
|
// uni.showToast({ |
||||
|
// title: "提交" |
||||
|
// }) |
||||
|
// } |
||||
|
// }) |
||||
|
// } else { |
||||
|
// uni.showToast({ |
||||
|
// title: "扫描的数量" + res.handleQty + "]小于推荐数量[" + res.recommendQty + "]" |
||||
|
// }) |
||||
|
// } |
||||
|
// }) |
||||
|
// }, |
||||
|
|
||||
|
submit() { |
||||
|
uni.showLoading({ |
||||
|
title: "提交中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
|
||||
|
//目前任务只到一个库位 |
||||
|
var itemCodes = [] |
||||
|
let locationCode = this.detailSource[0].toLocationCode |
||||
|
this.detailSource.forEach(toLocation => { |
||||
|
toLocation.Items.forEach(item => { |
||||
|
itemCodes.push(item.itemCode) |
||||
|
}) |
||||
|
}) |
||||
|
|
||||
|
//使用在途库,不查询管理模式 |
||||
|
if (this.jobContent.useOnTheWayLocation == 'TRUE') { |
||||
|
this.submitJob(); |
||||
|
} else { |
||||
|
//获取管理模式,封装参数 |
||||
|
getManagementPrecisions(itemCodes, locationCode, res => { |
||||
|
if (res.success) { |
||||
|
this.managementList = res.list; |
||||
|
this.submitJob(); |
||||
|
} else { |
||||
|
uni.hideLoading(); |
||||
|
this.showErrorMessage(res.message); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
submitJob() { |
||||
|
var params = this.setParams() |
||||
|
console.log("提交参数", JSON.stringify(params)); |
||||
|
|
||||
|
overPageSubmit(params).then(res => { |
||||
|
uni.hideLoading() |
||||
|
if (res.data) { |
||||
|
this.showCommitSuccessMessage("提交成功<br>生成发料记录<br>" + res.data) |
||||
|
} else { |
||||
|
this.showErrorMessage("提交失败[" + res.msg+"]") |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
setParams() { |
||||
|
var subList = [] |
||||
|
var createTime = getCurrDateTime(); |
||||
|
var creator = this.$store.state.user.id |
||||
|
this.detailSource.forEach(toLocationCode => { |
||||
|
toLocationCode.Items.forEach(item => { |
||||
|
item.Locations.forEach(fromLocation => { |
||||
|
fromLocation.Batchs.forEach(batch => { |
||||
|
let subItem = batch.detail; |
||||
|
if (subItem != undefined) { |
||||
|
subItem.recordList = []; |
||||
|
if (batch.Records.length > 0) { |
||||
|
batch.Records.forEach(r => { |
||||
|
let record = {}; |
||||
|
record.handleQty = r.qty; |
||||
|
|
||||
|
record.fromPackingNumber = r |
||||
|
.packingNumber; |
||||
|
record.fromBatch = r.batch; |
||||
|
record.fromContainerNumber = r |
||||
|
.ContainerNumber; |
||||
|
|
||||
|
record.toContainerNumber = r |
||||
|
.ContainerNumber; |
||||
|
record.toInventoryStatus = r |
||||
|
.inventoryStatus; |
||||
|
record.toLocationCode = subItem |
||||
|
.toLocationCode; |
||||
|
record.supplierCode = r.supplierCode; |
||||
|
|
||||
|
let single_price = r.balance |
||||
|
.singlePrice == null ? 0 : r |
||||
|
.balance |
||||
|
.singlePrice; |
||||
|
|
||||
|
record.singlePrice = single_price; |
||||
|
record.amount = single_price * r.qty; |
||||
|
|
||||
|
//使用在途库不改变管理模式 |
||||
|
if (this.jobContent |
||||
|
.useOnTheWayLocation == |
||||
|
'TRUE') { |
||||
|
record.toPackingNumber = r |
||||
|
.packingNumber; |
||||
|
record.toBatch = r.batch; |
||||
|
} else { |
||||
|
var info = |
||||
|
getPackingNumberAndBatch( |
||||
|
this.managementList, r |
||||
|
.itemCode, |
||||
|
r.packingNumber, r |
||||
|
.batch); |
||||
|
record.toPackingNumber = info |
||||
|
.packingNumber; |
||||
|
record.toBatch = info.batch; |
||||
|
} |
||||
|
subItem.recordList.push(record); |
||||
|
}) |
||||
|
subList.push(subItem); |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
}) |
||||
|
}) |
||||
|
|
||||
|
this.jobContent.subList = subList |
||||
|
this.jobContent.createTime = createTime; |
||||
|
this.jobContent.creator = creator; |
||||
|
return this.jobContent; |
||||
|
}, |
||||
|
|
||||
|
cancel() { |
||||
|
let that = this; |
||||
|
this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', res => { |
||||
|
if (res) { |
||||
|
that.clearInfo(); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
clearInfo() { |
||||
|
this.dataContent.itemCodeList.forEach(res => { |
||||
|
if (res.recommendList != null) { |
||||
|
res.recommendList.forEach(res1 => { |
||||
|
if (res1.locationCodeList != null) { |
||||
|
res1.locationCodeList.forEach(res2 => { |
||||
|
if (res2.packingCodeList != null) { |
||||
|
res2.packingCodeList.forEach(res3 => { |
||||
|
res3.itemCode = ""; |
||||
|
res3.qty = 0; |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
updateData(record) { |
||||
|
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode); |
||||
|
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode); |
||||
|
let itemHandleQty = 0; |
||||
|
if (item != undefined) { |
||||
|
item.Locations.forEach(l => { |
||||
|
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b |
||||
|
.packingNumber == null || b.packingNumber == '') && b.batch == |
||||
|
record.batch); |
||||
|
let handleQty = 0; |
||||
|
if (batch != undefined) { |
||||
|
batch.Records.forEach(res => { |
||||
|
handleQty = calc.add(handleQty,res.qty) |
||||
|
}) |
||||
|
batch.handleQty = handleQty; |
||||
|
itemHandleQty = calc.add(itemHandleQty,handleQty) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
this.resizeCollapse(); |
||||
|
item.handleQty = itemHandleQty; |
||||
|
}, |
||||
|
|
||||
|
scanPopupGetFocus() { |
||||
|
if (this.$refs.scanPopup != undefined) { |
||||
|
this.$refs.scanPopup.getfocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showMessage(message, res => { |
||||
|
if (res) { |
||||
|
this.afterCloseMessage() |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
showErrorMessage(message) { |
||||
|
this.$refs.comMessage.showErrorMessage(message, res => { |
||||
|
if (res) { |
||||
|
this.afterCloseMessage() |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
showScanMessage(message) { |
||||
|
this.$refs.comMessage.showScanMessage(message); |
||||
|
}, |
||||
|
|
||||
|
showCommitSuccess() { |
||||
|
this.$refs.comMessage.showCommitSuccess(); |
||||
|
}, |
||||
|
|
||||
|
showCommitSuccessMessage(hint) { |
||||
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
||||
|
navigateBack(1) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
showRescanMessage(message) { |
||||
|
this.$refs.comMessage.showRescanMessage(message); |
||||
|
}, |
||||
|
|
||||
|
afterCloseMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
|
||||
|
showScanMessage(message) { |
||||
|
this.$refs.comMessage.showScanMessage(message); |
||||
|
}, |
||||
|
|
||||
|
closeScanMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
confirm(data) { |
||||
|
this.dataContent = data; |
||||
|
}, |
||||
|
confirmResult(result) { |
||||
|
this.dataContent = result; |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
openScanDetailPopup() { |
||||
|
var datacontent = {} |
||||
|
//克隆对象,深度克隆,防止双向绑定同一个变量 |
||||
|
// Object.assign(datacontent, this.detailSource); |
||||
|
this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent); |
||||
|
}, |
||||
|
closeScanPopup() { |
||||
|
this.updateCommitBtn(); |
||||
|
}, |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.uni-numbox__value { |
||||
|
width: 40px; |
||||
|
} |
||||
|
|
||||
|
button[disabled] { |
||||
|
background-color: #3C9CFF; |
||||
|
color: #fff; |
||||
|
opacity: 0.7; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// /deep/ .input-value { |
||||
|
// font-size: 16px; |
||||
|
// } |
||||
|
|
||||
|
// /deep/ .uni-collapse-item__title-text { |
||||
|
// font-size: 16px; |
||||
|
// } |
||||
|
|
||||
|
// /deep/ .uni-collapse-item--border { |
||||
|
// border-bottom-width: 0px; |
||||
|
// border-bottom-color: #ebeef5; |
||||
|
// } |
||||
|
|
||||
|
// /deep/ .uni-collapse-item--border { |
||||
|
// border-bottom-width: 1px; |
||||
|
// border-bottom-color: #ebeef5; |
||||
|
// } |
||||
|
</style> |
Loading…
Reference in new issue