lijuncheng
8 months ago
13 changed files with 1787 additions and 0 deletions
@ -0,0 +1,40 @@ |
|||
<template> |
|||
<job-com-main-card :dataContent="dataContent"> |
|||
<view class="task_item"> |
|||
<view class="task_item"> |
|||
<view class="task_text"> |
|||
<view class=""> |
|||
申请单号 : {{dataContent.requestNumber}} |
|||
</view> |
|||
</view> |
|||
</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,39 @@ |
|||
<template> |
|||
<request-com-main-card :dataContent="dataContent"> |
|||
<view class="task_item"> |
|||
<view class="task_text"> |
|||
收货单号 : {{dataContent.purchaseReceiptRecordNumber}} |
|||
</view> |
|||
<view class="task_text"> |
|||
供应商代码 : {{dataContent.supplierCode}} |
|||
</view> |
|||
</view> |
|||
</request-com-main-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import requestComMainCard from '@/mycomponents/request/requestComMainCard.vue' |
|||
export default { |
|||
components: { |
|||
requestComMainCard, |
|||
}, |
|||
data() { |
|||
return {}; |
|||
}, |
|||
|
|||
props: { |
|||
dataContent: { |
|||
type: Object, |
|||
default: {} |
|||
}, |
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
|
|||
</style> |
@ -0,0 +1,57 @@ |
|||
<template> |
|||
<view class=""> |
|||
<uni-popup ref="popup"> |
|||
<detail-common-info :dataContent="dataContent" @onClose="closePopup"> |
|||
<view class=""> |
|||
<view class="uni-flex uni-column"> |
|||
<view class="item"> |
|||
<text class="item_title">订单号 : </text> |
|||
<text class="text_wrap">{{dataContent.poNumber}} </text> |
|||
</view> |
|||
<view class="item"> |
|||
<text class="item_title">订单行 : </text> |
|||
<text class="text_wrap">{{dataContent.poLine}} </text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</detail-common-info> |
|||
</uni-popup> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import detailCommonInfo from '@/mycomponents/detail/detailCommonInfo.vue' |
|||
export default { |
|||
components: { |
|||
detailCommonInfo |
|||
}, |
|||
data() { |
|||
return { |
|||
dataContent: { |
|||
type: Object, |
|||
default: {} |
|||
} |
|||
} |
|||
}, |
|||
|
|||
mounted() {}, |
|||
props: {}, |
|||
|
|||
methods: { |
|||
openPopup(val) { |
|||
this.dataContent = val; |
|||
setTimeout(res=>{ |
|||
this.$refs.popup.open('bottom') |
|||
},500) |
|||
}, |
|||
closePopup() { |
|||
this.$refs.popup.close() |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
|
|||
|
|||
</style> |
@ -0,0 +1,105 @@ |
|||
<template> |
|||
<view class=""> |
|||
<uni-popup ref="popup"> |
|||
<request-detail-common-info :dataContent="dataContent" @onClose="closePopup"> |
|||
<view class=""> |
|||
<u-line></u-line> |
|||
<view class="uni-flex uni-column"> |
|||
<view class="item"> |
|||
<text class="item_title">订单号 : </text> |
|||
<text class="text_wrap">{{dataContent.poNumber}} </text> |
|||
</view> |
|||
<view class="item"> |
|||
<text class="item_title">订单行 : </text> |
|||
<text class="text_wrap">{{dataContent.poLine}} </text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</request-detail-common-info> |
|||
</uni-popup> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import requestDetailCommonInfo from '@/mycomponents/detail/requestDetailCommonInfo.vue' |
|||
import comListItem from '@/mycomponents/common/comListItem.vue'; |
|||
export default { |
|||
|
|||
components: { |
|||
requestDetailCommonInfo, |
|||
comListItem |
|||
}, |
|||
data() { |
|||
return { |
|||
dataContent: { |
|||
type: Object, |
|||
default: {} |
|||
}, |
|||
dataList: [] |
|||
} |
|||
}, |
|||
watch: { |
|||
dataContent: { |
|||
handler(newName, oldName) { |
|||
this.dataList = [{ |
|||
title: '包装号', |
|||
content: this.dataContent.packingNumber |
|||
}, { |
|||
title: '器具号', |
|||
content: this.dataContent.containerNumber |
|||
}, { |
|||
title: '批次', |
|||
content: this.dataContent.batch |
|||
}, { |
|||
title: '替代批次', |
|||
content: this.dataContent.altBatch, |
|||
}, { |
|||
title: '到库位代码', |
|||
content: this.dataContent.toLocationCode |
|||
}, { |
|||
title: '库存状态', |
|||
content: this.dataContent.inventoryStatus, |
|||
type: "inventoryStatus" |
|||
}, { |
|||
title: '订单号', |
|||
content: this.dataContent.poNumber |
|||
}, { |
|||
title: '订单行', |
|||
content: this.dataContent.poLine |
|||
}, { |
|||
title: '原因', |
|||
content: this.dataContent.reason |
|||
}, { |
|||
title: '从货主代码', |
|||
content: this.dataContent.fromOwnerCode, |
|||
}, { |
|||
title: '到货主代码', |
|||
content: this.dataContent.toOwnerCode, |
|||
}]; |
|||
}, |
|||
immediate: true, |
|||
deep: true |
|||
} |
|||
}, |
|||
|
|||
mounted() {}, |
|||
props: {}, |
|||
|
|||
methods: { |
|||
openPopup(val) { |
|||
this.dataContent = val; |
|||
setTimeout(res => { |
|||
this.$refs.popup.open('bottom') |
|||
}, 500) |
|||
}, |
|||
closePopup() { |
|||
this.$refs.popup.close() |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
|
|||
|
|||
</style> |
@ -0,0 +1,102 @@ |
|||
<template> |
|||
<view class=""> |
|||
<uni-popup ref="popup"> |
|||
<request-common-info :dataContent="dataContent" @onClose="closePopup"> |
|||
<view class=""> |
|||
<comListItem :dataList="dataList"></comListItem> |
|||
</view> |
|||
<u-line></u-line> |
|||
</request-common-info> |
|||
</uni-popup> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import requestCommonInfo from '@/mycomponents/request/requestCommonInfo.vue' |
|||
import comListItem from '@/mycomponents/common/comListItem.vue'; |
|||
export default { |
|||
components: { |
|||
requestCommonInfo, |
|||
comListItem |
|||
}, |
|||
data() { |
|||
return { |
|||
dataContent:{}, |
|||
dataList:[] |
|||
} |
|||
}, |
|||
watch:{ |
|||
}, |
|||
|
|||
mounted() {}, |
|||
props: { |
|||
}, |
|||
|
|||
methods: { |
|||
openPopup(val) { |
|||
this.dataContent = val; |
|||
this.dataList=[{ |
|||
title: '采购收货记录单号', |
|||
content: this.dataContent.purchaseReceiptRecordNumber |
|||
}, { |
|||
title: '发货单号', |
|||
content: this.dataContent.asnNumber |
|||
},{ |
|||
title: '要货计划单号', |
|||
content: this.dataContent.ppNumber, |
|||
},{ |
|||
title: '供应商代码', |
|||
content: this.dataContent.supplierCode, |
|||
},{ |
|||
title: '承运商', |
|||
content: this.dataContent.carrierCode, |
|||
},{ |
|||
title: '运输方式', |
|||
content: this.dataContent.transferMode, |
|||
type:"transferMode", |
|||
},{ |
|||
title: '车牌号', |
|||
content: this.dataContent.vehiclePlateNumber, |
|||
},{ |
|||
title: '从仓库代码', |
|||
content: this.dataContent.fromWarehouseCode, |
|||
},{ |
|||
title: '到仓库代码', |
|||
content: this.dataContent.toWarehouseCode, |
|||
},{ |
|||
title: '从库位类型范围', |
|||
content: this.dataContent.fromLocationTypes, |
|||
type:"locationType" |
|||
}, |
|||
{ |
|||
title: '到库位类型范围', |
|||
content: this.dataContent.toLocationTypes, |
|||
type:"locationType" |
|||
}, |
|||
{ |
|||
title: '从库区代码范围', |
|||
content: this.dataContent.fromAreaCodes, |
|||
}, |
|||
{ |
|||
title: '到库区代码范围', |
|||
content: this.dataContent.toAreaCodes |
|||
}, |
|||
{ |
|||
title: '从月台代码', |
|||
content: this.dataContent.fromDockCode |
|||
}]; |
|||
setTimeout(res => { |
|||
this.$refs.popup.open('bottom') |
|||
}, 500) |
|||
}, |
|||
closePopup() { |
|||
this.$refs.popup.close() |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
|
|||
|
|||
</style> |
@ -0,0 +1,79 @@ |
|||
<template> |
|||
<view class=""> |
|||
<uni-popup ref="popup"> |
|||
<job-common-info :dataContent="dataContent" @onClose="closePopup"> |
|||
<view class=""> |
|||
<view class="uni-flex uni-column"> |
|||
<view class="item"> |
|||
<text class="item_title">发货单号 : </text> |
|||
<text class="text_wrap">{{dataContent.asnNumber}} </text> |
|||
</view> |
|||
<view class="item"> |
|||
<text class="item_title">要货计划单号 : </text> |
|||
<text class="text_wrap">{{dataContent.ppNumber}} </text> |
|||
</view> |
|||
<view class="item"> |
|||
<text class="item_title">供应商代码 : </text> |
|||
<text class="text_wrap">{{dataContent.supplierCode}} </text> |
|||
</view> |
|||
<view class="item"> |
|||
<text class="item_title">承运商 : </text> |
|||
<text class="text_wrap">{{dataContent.carrierCode}} </text> |
|||
</view> |
|||
<view class="item"> |
|||
<text class="item_title">运输方式 : </text> |
|||
<text class="text_wrap">{{getTransferModeName(dataContent.transferMode)}} </text> |
|||
</view> |
|||
<view class="item"> |
|||
<text class="item_title">车牌号 : </text> |
|||
<text class="text_wrap">{{dataContent.vehiclePlateNumber}} </text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<u-line></u-line> |
|||
</job-common-info> |
|||
</uni-popup> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import jobCommonInfo from '@/mycomponents/job/jobCommonInfo.vue' |
|||
import {getTransferModeName} from '@/common/directory.js' |
|||
export default { |
|||
components: { |
|||
jobCommonInfo, |
|||
}, |
|||
data() { |
|||
return { |
|||
dataContent: { |
|||
type: Object, |
|||
default: {} |
|||
} |
|||
} |
|||
}, |
|||
|
|||
mounted() {}, |
|||
props: {}, |
|||
|
|||
methods: { |
|||
openPopup(val) { |
|||
this.dataContent = val; |
|||
setTimeout(res=>{ |
|||
this.$refs.popup.open('bottom') |
|||
},500) |
|||
|
|||
}, |
|||
closePopup() { |
|||
this.$refs.popup.close() |
|||
}, |
|||
getTransferModeName(value){ |
|||
return getTransferModeName(value) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
|
|||
|
|||
</style> |
@ -0,0 +1,52 @@ |
|||
<template> |
|||
<uni-popup ref="popupItems"> |
|||
<com-popup @onClose="closePopup"> |
|||
<view v-for="(item, index) in receiptList" :key="index"> |
|||
<com-return-job-card :dataContent="item" @click='selectItem(item)'></com-return-job-card> |
|||
<u-line></u-line> |
|||
</view> |
|||
</com-popup> |
|||
</uni-popup> |
|||
</template> |
|||
|
|||
<script> |
|||
import comPopup from '@/mycomponents/common/comPopup.vue' |
|||
import comReturnJobCard from '@/pages/purchaseReturn/coms/comReturnJobCard.vue' |
|||
|
|||
export default { |
|||
emits: ["selectedItem"], |
|||
components: { |
|||
comPopup, |
|||
comReturnJobCard |
|||
}, |
|||
props: { |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
receiptList: [] |
|||
} |
|||
}, |
|||
methods: { |
|||
openPopup(items) { |
|||
this.receiptList = items; |
|||
this.$refs['popupItems'].open("center"); |
|||
// setTimeout(res=>{ |
|||
// this.receiptList = items; |
|||
// this.$refs['popupItems'].open("center"); |
|||
// },100) |
|||
|
|||
}, |
|||
closePopup() { |
|||
this.$refs.popupItems.close() |
|||
}, |
|||
selectItem(item) { |
|||
this.$emit("selectedItem", item); |
|||
this.$refs['popupItems'].close(); |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,306 @@ |
|||
<template> |
|||
<view class=""> |
|||
<com-empty-view v-if="jobList.length==0"></com-empty-view> |
|||
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" |
|||
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" @onScanAsnNumber="getScanAsnNumber" |
|||
: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)"> |
|||
<comRecycleJobCard :dataContent="item" @click='openJobDetail(item)'></comRecycleJobCard> |
|||
</uni-swipe-action-item> |
|||
</view> |
|||
</uni-swipe-action> |
|||
<return-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></return-job-list-popup> |
|||
<return-info-popup ref='jobInfoPopup'></return-info-popup> |
|||
<uni-load-more :status="loadingType" v-if="jobList.length>0" /> |
|||
|
|||
</view> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { |
|||
getProductRecycleJobList, |
|||
cancleTakeProductRecycleJob |
|||
} 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 comRecycleJobCard from '@/pages/productRecycle/coms/comRecycleJobCard.vue' |
|||
import returnJobListPopup from '@/pages/productRecycle/coms/returnJobListPopup.vue' |
|||
import returnInfoPopup from '@/pages/productRecycle/coms/returnInfoPopup.vue' |
|||
|
|||
export default { |
|||
name: 'receipt', |
|||
components: { |
|||
comEmptyView, |
|||
jobFilter, |
|||
comRecycleJobCard, |
|||
returnInfoPopup, |
|||
returnJobListPopup, |
|||
}, |
|||
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, |
|||
} |
|||
|
|||
getProductRecycleJobList(params).then(res => { |
|||
uni.hideLoading(); |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
var list = res.data.list; |
|||
this.totalCount = res.data.total |
|||
updateTitle("制品回收任务(" + this.totalCount + ")"); |
|||
this.loadingType = "loadmore"; |
|||
if (list == null || list.length == 0) { |
|||
this.loadingType = "nomore"; |
|||
return; |
|||
} |
|||
this.jobList = type === "refresh" ? list : this.jobList.concat(list); |
|||
this.pageNo++; |
|||
|
|||
|
|||
}).catch(error => { |
|||
if (type === "refresh") { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
updateTitle("制品回收任务"); |
|||
this.loadingType = ""; |
|||
uni.hideLoading(); |
|||
that.showErrorMessage(error) |
|||
}) |
|||
}, |
|||
|
|||
|
|||
openJobDetail(item) { |
|||
uni.navigateTo({ |
|||
url: './productRecycleJobDetail?id=' + item.id + '&status=' + item.status |
|||
}); |
|||
}, |
|||
|
|||
showItemList(itemList) { |
|||
this.$refs.jobListPopup.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) { |
|||
cancleTakeProductRecycleJob(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"); |
|||
}, |
|||
|
|||
|
|||
getScanAsnNumber(code) { |
|||
this.getDataListByType(code, "asnNumber") |
|||
}, |
|||
|
|||
getScanNumber(code) { |
|||
this.getDataListByType(code, "number") |
|||
}, |
|||
getDataListByType(code, type) { |
|||
let that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
var filters = [] |
|||
filters.push({ |
|||
column: "status", |
|||
action: "in", |
|||
value: '1,2' |
|||
}) |
|||
if (type == "asnNumber") { |
|||
filters.push({ |
|||
column: "asn_number", |
|||
action: "==", |
|||
value: code |
|||
}) |
|||
} else if (type == "number") { |
|||
filters.push({ |
|||
column: "number", |
|||
action: "==", |
|||
value: code |
|||
}) |
|||
} |
|||
|
|||
var params = { |
|||
filters: filters, |
|||
pageNo: 1, |
|||
pageSize: 100, |
|||
} |
|||
getProductRecycleJobList(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]); |
|||
} else { |
|||
if (type == "asnNumber") { |
|||
that.showItemList(res.data.list); |
|||
} |
|||
} |
|||
}).catch(error => { |
|||
uni.hideLoading(); |
|||
that.showMessage(error); |
|||
}) |
|||
}, |
|||
|
|||
showErrorMessage(message) { |
|||
this.$refs.comMessage.showErrorMessage(message, res => { |
|||
if (res) { |
|||
|
|||
} |
|||
}); |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
</style> |
@ -0,0 +1,474 @@ |
|||
<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> |
|||
<u-line color="#D8D8D8"></u-line> |
|||
</view> |
|||
|
|||
<view class="page-main"> |
|||
<scroll-view scroll-y="true" class="page-main-scroll"> |
|||
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|||
<view class=""> |
|||
<com-detail-card :dataContent="item" :settingParam="jobContent" @remove="updateData" |
|||
@updateData='updateData' @openDetail="openDetail"> |
|||
</com-detail-card> |
|||
</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=""> |
|||
</view> |
|||
<view class=" uni-flex uni-row"> |
|||
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
<win-scan-pack-and-location ref="scanPopup" title="制品标签" @getResult='getScanResult'></win-scan-pack-and-location> |
|||
<recycleDetailInfoPopup ref="jobDetailPopup"></recycleDetailInfoPopup> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getBasicLocationByCode, |
|||
getProductRecycleDetail, |
|||
productRecycleJobsubmit, |
|||
cancleTakeProductRecycleJob, |
|||
takeProductRecycleJob |
|||
} from '@/api/request2.js'; |
|||
|
|||
import { |
|||
goHome, |
|||
getCurrDateTime, |
|||
getPackingNumberAndBatch, |
|||
navigateBack |
|||
} from '@/common/basic.js'; |
|||
import { |
|||
getInventoryStatusName |
|||
} from '@/common/directory.js'; |
|||
|
|||
import { |
|||
getDataSource, |
|||
createRecordInfo, |
|||
calcHandleQty, |
|||
getScanCount |
|||
} from '@/common/detail.js'; |
|||
|
|||
import { |
|||
getManagementPrecisions |
|||
} from '@/common/balance.js'; |
|||
|
|||
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|||
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|||
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" |
|||
import recycleDetailInfoPopup from '@/pages/productRecycle/coms/recycleDetailInfoPopup.vue' |
|||
import jobTop from '@/mycomponents/job/jobTop.vue' |
|||
|
|||
export default { |
|||
name: 'returnDetail', |
|||
components: { |
|||
winScanButton, |
|||
winScanPackAndLocation, |
|||
comDetailCard, |
|||
recycleDetailInfoPopup, |
|||
jobTop |
|||
}, |
|||
data() { |
|||
return { |
|||
id: '', |
|||
scanCount: 0, |
|||
jobContent: {}, //任务内容 |
|||
subList: [], //接口返回的任务subList |
|||
detailSource: [], //绑定在页面上的数据源 |
|||
businessTypeInfo: {}, |
|||
managementList: [], |
|||
jobStatus: "" |
|||
}; |
|||
}, |
|||
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") { |
|||
//取消承接任务 |
|||
cancleTakeProductRecycleJob(this.id).then(res => { |
|||
uni.navigateBack(); |
|||
}).catch(error => { |
|||
uni.navigateBack(); |
|||
}) |
|||
} else { |
|||
uni.navigateBack(); |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
|
|||
}, |
|||
|
|||
onPullDownRefresh() { |
|||
this.getDetail(); |
|||
uni.stopPullDownRefresh(); |
|||
}, |
|||
|
|||
mounted() { |
|||
|
|||
}, |
|||
methods: { |
|||
//接收 |
|||
receive(callback) { |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
if (this.id != null) { |
|||
takeProductRecycleJob(this.id).then(res => { |
|||
uni.hideLoading(); |
|||
callback(); |
|||
}).catch(error => { |
|||
uni.hideLoading(); |
|||
this.showErrorMessage(error) |
|||
}) |
|||
} |
|||
}, |
|||
|
|||
getDetail() { |
|||
var that = this; |
|||
uni.showLoading({ |
|||
title: "加载中....", |
|||
mask: true |
|||
}); |
|||
|
|||
getProductRecycleDetail(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.subList.forEach(res=>{ |
|||
res.fromLocationCode =res.toLocationCode |
|||
}) |
|||
that.toLocationCode = that.jobContent.toLocationCode |
|||
that.detailSource = getDataSource(that.subList); |
|||
} else { |
|||
that.showMessage('列表数据为0'); |
|||
} |
|||
} |
|||
}).catch(error => { |
|||
uni.hideLoading() |
|||
this.showErrorMessage(error) |
|||
}) |
|||
}, |
|||
|
|||
calcHandleQty() { |
|||
calcHandleQty(this.detailSource) |
|||
this.continueScan() |
|||
this.$forceUpdate(); |
|||
}, |
|||
|
|||
calcScanCount(closeScan) { |
|||
let items = this.subList.filter(r => { |
|||
if (r.scaned) { |
|||
return r; |
|||
} |
|||
}) |
|||
this.scanCount = items != null ? items.length : 0; |
|||
if (this.scanCount == this.subList.length) { |
|||
this.closeScanPopup(); |
|||
} |
|||
}, |
|||
|
|||
//继续扫描 |
|||
continueScan() { |
|||
this.scanCount = getScanCount(this.subList); |
|||
if (this.scanCount == this.subList.length) { |
|||
this.closeScanPopup(); |
|||
} else { |
|||
this.scanPopupGetFocus(); |
|||
} |
|||
}, |
|||
|
|||
updateData() { |
|||
this.calcHandleQty(); |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
try { |
|||
var packingNumber = result.label.packingNumber; |
|||
var batch = result.label.batch; |
|||
var qty = result.label.qty; |
|||
var itemCode = result.label.itemCode; |
|||
var itemDetail = undefined; |
|||
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|||
if (detail == undefined) { |
|||
this.showMessage("物料号【" + itemCode + "】不在列表中") |
|||
} else { |
|||
//箱码、批次、库位、 |
|||
itemDetail = detail.subList.find(r => { |
|||
return r.packingNumber == packingNumber && |
|||
r.batch == batch && |
|||
r.fromLocationCode == result.fromLocationCode |
|||
}) |
|||
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); |
|||
//不存在提示 |
|||
if (itemDetail == undefined) { |
|||
this.showErrorMessage("箱码【" + packingNumber + "】<br>批次【" + batch + "】<br>库位【" + result |
|||
.fromLocationCode + "】<br>状态【" + balanceStatus + "】<br>已经扫描") |
|||
return; |
|||
} else { |
|||
itemDetail = detail.subList.find(r => { |
|||
return r.packingNumber == packingNumber && |
|||
r.batch == batch && |
|||
r.fromLocationCode == result.fromLocationCode && |
|||
r.inventoryStatus == result.balance.inventoryStatus |
|||
}) |
|||
//箱码、批次、库位、状态不一致 |
|||
if (itemDetail == undefined) { |
|||
itemDetail = detail.subList.find(r => { |
|||
return r.packingNumber == packingNumber && |
|||
r.batch == batch && |
|||
r.fromLocationCode == result.fromLocationCode |
|||
}) |
|||
if (itemDetail.scaned) { |
|||
this.showErrorMessage("箱码【" + packingNumber + "】<br>批次【" + batch + "】<br>库位【" + result |
|||
.fromLocationCode + "】<br>状态【" + balanceStatus + "】<br>已经扫描") |
|||
return; |
|||
} |
|||
|
|||
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); |
|||
if (this.jobContent.allowModifyInventoryStatus == "TRUE") { |
|||
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + |
|||
']不一致,是否继续退货?', res => { |
|||
if (res) { |
|||
itemDetail.scaned = true; |
|||
itemDetail.handleQty = Number(result.balance.qty); |
|||
itemDetail.toInventoryStatus = result.balance.inventoryStatus; |
|||
itemDetail.inventoryStatus =result.balance.inventoryStatus; |
|||
itemDetail.balance = result.balance; |
|||
itemDetail.balance.balanceQty = result.balance.qty; |
|||
itemDetail.balance.packQty = result.package.packQty |
|||
itemDetail.balance.packUnit = result.package.packUnit |
|||
this.calcHandleQty(); |
|||
} else { |
|||
this.scanPopupGetFocus(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + |
|||
itemStatus + |
|||
']不一致,不允许转移!', res => { |
|||
this.scanPopupGetFocus(); |
|||
}); |
|||
} |
|||
|
|||
|
|||
} else { |
|||
// 箱码、批次、库位、状态一致 |
|||
if (itemDetail.scaned) { |
|||
this.showErrorMessage("箱码【" + packingNumber + "】<br>批次【" + batch + "】<br>库位【" + result |
|||
.fromLocationCode + "】<br>状态【" + balanceStatus + "】<br>已经扫描") |
|||
return; |
|||
} else { |
|||
itemDetail.scaned = true; |
|||
itemDetail.handleQty = Number(result.balance.qty); |
|||
itemDetail.toInventoryStatus = result.balance.inventoryStatus; |
|||
itemDetail.inventoryStatus =result.balance.inventoryStatus; |
|||
itemDetail.balance = result.balance; |
|||
itemDetail.balance.balanceQty = Number(result.balance.qty); |
|||
itemDetail.balance.packQty = Number(result.package.packQty) |
|||
itemDetail.balance.packUnit = result.package.packUnit |
|||
this.calcHandleQty(); |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
|||
this.scanPopupGetFocus(); |
|||
} catch (e) { |
|||
this.showErrorMessage(e.message); |
|||
} |
|||
}, |
|||
|
|||
commit() { |
|||
this.scanCount = getScanCount(this.subList); |
|||
if (this.scanCount == 0) { |
|||
this.showErrorMessage("扫描数为0,请先扫描") |
|||
return; |
|||
} |
|||
//允许部分提交 |
|||
//扫描数量和任务数量相等,直接提交 |
|||
if (this.scanCount == this.subList.length) { |
|||
this.submitJob(); |
|||
} else if (this.scanCount < this.subList.length) { |
|||
//扫描数量小于任务数量,判断是否允许部分提交 |
|||
if (this.jobContent.allowPartialComplete == "TRUE") { |
|||
//提交 |
|||
this.submitJob(); |
|||
} else { |
|||
//不允许部分提交,提示 |
|||
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount + |
|||
"]箱总共[" + this |
|||
.subList.length + "]箱", res => { |
|||
if (res) { |
|||
this.openScanPopup(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
submitJob() { |
|||
uni.showLoading({ |
|||
title: "提交中....", |
|||
mask: true |
|||
}); |
|||
|
|||
var params = this.setParams() |
|||
console.log("提交参数", JSON.stringify(params)); |
|||
productRecycleJobsubmit(params).then(res => { |
|||
uni.hideLoading() |
|||
if (res.data) { |
|||
this.showCommitSuccessMessage(res.data) |
|||
} else { |
|||
this.showErrorMessage("提交失败[" + res.msg + "]") |
|||
} |
|||
}).catch(error => { |
|||
uni.hideLoading() |
|||
this.showErrorMessage(error) |
|||
}) |
|||
|
|||
}, |
|||
|
|||
setParams() { |
|||
var subList = [] |
|||
var creator = this.$store.state.user.id |
|||
|
|||
this.detailSource.forEach(item => { |
|||
item.subList.forEach(detail => { |
|||
if (detail.scaned) { |
|||
detail.toPackingNumber = detail.packingNumber; |
|||
detail.toContainerNumber = detail.containerNumber; |
|||
detail.toBatch = detail.batch; |
|||
|
|||
detail.toLocationCode = detail.toLocationCode; |
|||
subList.push(detail) |
|||
} |
|||
}) |
|||
}) |
|||
this.jobContent.subList = subList |
|||
this.jobContent.creator = creator; |
|||
return this.jobContent; |
|||
}, |
|||
|
|||
openScanPopup() { |
|||
let fromlocationCode = ''; |
|||
let fromlocationList = []; |
|||
for (var i = 0; i < this.detailSource.length; i++) { |
|||
let item = this.detailSource[i]; |
|||
item.subList.forEach(l => { |
|||
//重复的库位不往里面插入 |
|||
var location = fromlocationList.find(res => res == l.fromLocationCode) |
|||
if (location == undefined) { |
|||
fromlocationList.push(l.fromLocationCode); |
|||
} |
|||
//来源库位赋默认值 |
|||
if (fromlocationCode == '') { |
|||
if (!l.scaned) { |
|||
fromlocationCode = l.fromLocationCode; |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent); |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
this.$refs.scanPopup.closeScanPopup(); |
|||
}, |
|||
|
|||
scanPopupGetFocus() { |
|||
this.$refs.scanPopup.packGetFocus(); |
|||
}, |
|||
|
|||
scanPopupLoseFocus() { |
|||
this.$refs.scanPopup.packLoseFocus(); |
|||
}, |
|||
|
|||
openDetail(item) { |
|||
this.$refs.jobDetailPopup.openPopup(item) |
|||
}, |
|||
|
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message, res => { |
|||
if (res) { |
|||
this.scanPopupGetFocus() |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
showErrorMessage(message) { |
|||
this.$refs.comMessage.showErrorMessage(message, res => { |
|||
if (res) { |
|||
this.scanPopupGetFocus() |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
showQuestionMessage(message, callback) { |
|||
setTimeout(r => { |
|||
this.scanPopupLoseFocus(); |
|||
this.$refs.comMessage.showQuestionMessage(message, res => { |
|||
if (res) { |
|||
callback(res); |
|||
} |
|||
}); |
|||
}) |
|||
}, |
|||
|
|||
showCommitSuccessMessage(number) { |
|||
this.$refs.comMessage.showSuccessMessage('提交成功<br>生成退货记录:' + number, res => { |
|||
navigateBack(1) |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
</style> |
@ -0,0 +1,395 @@ |
|||
<template> |
|||
<view class="page-wraper"> |
|||
<view class=""> |
|||
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> |
|||
</view> |
|||
<view class="page-wraper" v-if="detailSource.length>0"> |
|||
<view class="page-header"> |
|||
<view class="header_item"> |
|||
供应商代码:{{supplierCode}} |
|||
</view> |
|||
<view class="header_item"> |
|||
采购订单:{{poNumber}} |
|||
</view> |
|||
<u-line color="#D8D8D8"></u-line> |
|||
</view> |
|||
|
|||
<view class="page-main"> |
|||
<scroll-view scroll-y="true" class="page-main-scroll"> |
|||
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|||
<view class=""> |
|||
<record-com-detail-card :dataContent="item" @removeItem="removeItem(index,item)" |
|||
@updateData="updateData" @removePack="removePack" :isShowToLocation="false"> |
|||
</record-com-detail-card> |
|||
</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=""> |
|||
</view> |
|||
<view class=" uni-flex uni-row"> |
|||
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|||
</view> |
|||
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'> |
|||
</win-scan-pack-and-location> |
|||
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation' |
|||
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
productRecycleRecordSubmit, |
|||
} from '@/api/request2.js'; |
|||
import { |
|||
goHome, |
|||
updateTitle, |
|||
navigateBack, |
|||
deepCopyData |
|||
} from '@/common/basic.js'; |
|||
|
|||
import { |
|||
getBusinessType, |
|||
createItemInfo, |
|||
createDetailInfo, |
|||
calcHandleQty |
|||
} from '@/common/record.js'; |
|||
|
|||
import { |
|||
getManagementPrecisions |
|||
} from '@/common/balance.js'; |
|||
|
|||
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|||
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|||
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|||
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|||
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|||
|
|||
export default { |
|||
components: { |
|||
winScanButton, |
|||
comBlankView, |
|||
winScanLocation, |
|||
winScanPackAndLocation, |
|||
recordComDetailCard |
|||
|
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
id: '', |
|||
submitMainContent: {}, //提交内容 |
|||
subList: [], //接口返回的任务subList |
|||
detailSource: [], //绑定在页面上的数据源 |
|||
fromLocationCode: "", |
|||
fromLocationAreaTypeList: [], |
|||
businessType: {}, //业务类型 |
|||
supplierCode: '', //供应商代码 |
|||
poNumber: '', |
|||
fromType: "", |
|||
dataContent: {} |
|||
}; |
|||
}, |
|||
|
|||
onLoad(option) { |
|||
this.fromType = option.fromType |
|||
if (this.fromType == "requestType") { |
|||
updateTitle("采购退货申请") |
|||
} else { |
|||
updateTitle("采购退货记录") |
|||
} |
|||
var typeCode = "PurchaseReturn" |
|||
getBusinessType(typeCode, res => { |
|||
if (res.success) { |
|||
this.businessType = res.businessType; |
|||
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList; |
|||
this.showFromLocationPopup(); |
|||
} else { |
|||
this.showErrorMessage(res.message) |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
//返回首页 |
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} |
|||
}, |
|||
//拦截返回按钮事件 |
|||
onBackPress(e) {}, |
|||
|
|||
onPullDownRefresh() {}, |
|||
|
|||
mounted() { |
|||
|
|||
}, |
|||
methods: { |
|||
showFromLocationPopup() { |
|||
this.$nextTick(() => { |
|||
this.$refs.scanFromLocationCode.openScanPopup(); |
|||
}) |
|||
}, |
|||
|
|||
openScanPopup() { |
|||
if (this.fromLocationCode == "") { |
|||
this.showFromLocationPopup(); |
|||
return |
|||
} |
|||
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
if (this.supplierCode == '') { |
|||
this.supplierCode = result.label.supplierCode; |
|||
} else { |
|||
if (this.supplierCode != result.label.supplierCode) { |
|||
this.showErrorMessage('扫描的供应商代码[' + result.label.supplierCode + ']与默认供应商代码[' + this.poNumber + ']不一致') |
|||
return; |
|||
} |
|||
} |
|||
|
|||
if (this.poNumber == '') { |
|||
this.poNumber = result.label.poNumber; |
|||
} else { |
|||
if (this.poNumber != result.label.poNumber) { |
|||
this.showErrorMessage('扫描的采购订单号[' + result.label.poNumber + ']与默认采购订单号[' + this.poNumber + ']不一致') |
|||
return; |
|||
} |
|||
} |
|||
this.getDataSource(result) |
|||
}, |
|||
|
|||
getDataSource(result) { |
|||
let balance = result.balance; |
|||
let label = result.label; |
|||
let pack = result.package; |
|||
|
|||
var item = this.detailSource.find(res => { |
|||
if (res.itemCode == balance.itemCode) { |
|||
return res |
|||
} |
|||
}) |
|||
if (item == undefined) { |
|||
var itemInfo = createItemInfo(balance, pack); |
|||
let newDetail = createDetailInfo(balance, pack); |
|||
itemInfo.subList.push(newDetail); |
|||
this.detailSource.push(itemInfo) |
|||
} else { |
|||
var detail = item.subList.find(r => { |
|||
if (r.packingNumber == balance.packingNumber && |
|||
r.batch == balance.batch && |
|||
r.locationCode == balance.locationCode && |
|||
r.inventoryStatus == balance.inventoryStatus && |
|||
r.scaned == true) { |
|||
return r; |
|||
} |
|||
}) |
|||
|
|||
if (detail == undefined) { |
|||
let newDetail = createDetailInfo(balance, pack); |
|||
item.subList.push(newDetail); |
|||
} else { |
|||
this.showErrorMessage('箱码[' + balance.packingNumber + "]已经在列表中") |
|||
} |
|||
} |
|||
calcHandleQty(this.detailSource); |
|||
}, |
|||
|
|||
updateData() { |
|||
calcHandleQty(this.detailSource); |
|||
for (var i = 0; i < this.detailSource.length; i++) { |
|||
let item = this.detailSource[i]; |
|||
if (item.qty == 0) { |
|||
this.detailSource.splice(i, 1) |
|||
} |
|||
} |
|||
}, |
|||
|
|||
removePack() { |
|||
for (var i = 0; i < this.detailSource.length; i++) { |
|||
var item = this.detailSource[i]; |
|||
if (item.subList.length == 0) { |
|||
this.detailSource.splice(i, 1) |
|||
} |
|||
} |
|||
this.updateData(); |
|||
}, |
|||
|
|||
removeItem(index, item) { |
|||
this.detailSource.splice(index, 1) |
|||
}, |
|||
|
|||
commit() { |
|||
uni.showLoading({ |
|||
title: "提交中....", |
|||
mask: true |
|||
}); |
|||
|
|||
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|||
//直接创建申请 |
|||
|
|||
//直接创建记录 |
|||
//采购退货直接出库,不用查询管理模式 |
|||
var params = this.setRecordParams(true) |
|||
console.log("提交参数", JSON.stringify(params)); |
|||
|
|||
productRecycleRecordSubmit(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) |
|||
}) |
|||
} else { |
|||
this.showErrorMessage("没有要提交的数据") |
|||
} |
|||
}, |
|||
|
|||
|
|||
setRecordParams(queryModel) { |
|||
var subList = [] |
|||
var creator = this.$store.state.user.id |
|||
this.dataContent.creator = creator; |
|||
|
|||
this.detailSource.forEach(item => { |
|||
item.subList.forEach(detail => { |
|||
if (detail.scaned) { |
|||
var submitItem = deepCopyData(detail) |
|||
submitItem.itemCode = detail.itemCode; |
|||
submitItem.inventoryStatus = detail.inventoryStatus; |
|||
|
|||
submitItem.fromPackingNumber = detail.packingNumber; |
|||
submitItem.toPackingNumber = detail.packingNumber;; |
|||
|
|||
submitItem.fromContainerNumber = detail.containerNumber; |
|||
submitItem.toContainerNumber = detail.containerNumber |
|||
|
|||
submitItem.fromBatch = detail.batch; |
|||
submitItem.toBatch = detail.batch; |
|||
|
|||
submitItem.fromLocationCode = detail.locationCode; |
|||
submitItem.toLocationCode = ''; //采购退货直接出库,目标库位为空 |
|||
|
|||
submitItem.qty = detail.handleQty; |
|||
submitItem.package = ""; |
|||
subList.push(submitItem) |
|||
} |
|||
}) |
|||
}) |
|||
this.dataContent.subList = subList |
|||
this.dataContent.creator = creator; |
|||
// this.dataContent.jobNumber = ''; |
|||
return this.dataContent; |
|||
}, |
|||
|
|||
|
|||
showMessage(message) { |
|||
setTimeout(r => { |
|||
this.scanPopupLoseFocus(); |
|||
this.$refs.comMessage.showMessage(message, res => { |
|||
if (res) { |
|||
this.scanPopupGetFocus(); |
|||
} |
|||
}); |
|||
}) |
|||
}, |
|||
|
|||
showErrorMessage(message) { |
|||
setTimeout(r => { |
|||
this.scanPopupLoseFocus(); |
|||
this.$refs.comMessage.showErrorMessage(message, res => { |
|||
if (res) { |
|||
this.scanPopupGetFocus(); |
|||
} |
|||
}); |
|||
}) |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
this.$refs.scanPopup.closeScanPopup(); |
|||
}, |
|||
|
|||
scanPopupGetFocus() { |
|||
this.$refs.scanPopup.packGetFocus(); |
|||
}, |
|||
|
|||
scanPopupLoseFocus() { |
|||
this.$refs.scanPopup.packLoseFocus(); |
|||
}, |
|||
|
|||
getFromLocation(location, code) { |
|||
this.getFromLocationCode(location, code) |
|||
}, |
|||
|
|||
getFromLocationCode(location, code) { |
|||
this.fromLocationCode = code; |
|||
this.openScanPopup(); |
|||
}, |
|||
|
|||
showCommitSuccessMessage(hint) { |
|||
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|||
if (this.fromType == "requestType") { |
|||
navigateBack(1) |
|||
} else { |
|||
//清空 |
|||
this.subList = []; |
|||
this.detailSource = []; |
|||
this.toLocationInfo = {} |
|||
} |
|||
|
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</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