yufei0306
6 months ago
2 changed files with 369 additions and 310 deletions
@ -1,309 +1,334 @@ |
|||||
<template> |
<template> |
||||
<view class=""> |
<view class=""> |
||||
<com-empty-view v-if="jobList.length==0"></com-empty-view> |
<com-empty-view v-if="jobList.length==0"></com-empty-view> |
||||
<job-filter ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" |
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" ref="filter" otherTitle="" |
||||
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" |
@switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" |
||||
:checkedWaitTask="checkedWaitTask"> |
:checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" @productionLineCode="productionLineCode" |
||||
</job-filter> |
@fromLocationCode="fromLocationCode"> |
||||
<view v-if="jobList.length>0"> |
</job-filter> |
||||
<uni-swipe-action ref="swipeAction"> |
<view v-if="jobList.length>0"> |
||||
<view v-for="(item, index) in jobList" :key="index"> |
<uni-swipe-action ref="swipeAction"> |
||||
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions" |
<view v-for="(item, index) in jobList" :key="index"> |
||||
@click="swipeClick($event,item)"> |
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions" |
||||
<com-issue-job-card :dataContent="item" @click='openJobDetail(item)'></com-issue-job-card> |
@click="swipeClick($event,item)"> |
||||
</uni-swipe-action-item> |
<com-issue-job-card :dataContent="item" @click='openJobDetail(item)'></com-issue-job-card> |
||||
</view> |
</uni-swipe-action-item> |
||||
</uni-swipe-action> |
</view> |
||||
|
</uni-swipe-action> |
||||
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup> |
|
||||
<job-info-popup ref='jobInfoPopup'></job-info-popup> |
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup> |
||||
|
<job-info-popup ref='jobInfoPopup'></job-info-popup> |
||||
<uni-load-more :status="loadingType" v-if="jobList.length>0" /> |
|
||||
</view> |
<uni-load-more :status="loadingType" v-if="jobList.length>0" /> |
||||
<comMessage ref="comMessage"></comMessage> |
</view> |
||||
</view> |
<comMessage ref="comMessage"></comMessage> |
||||
</template> |
</view> |
||||
|
</template> |
||||
<script> |
|
||||
import { |
<script> |
||||
cancleTakeIssueJob, |
import { |
||||
getIssueJobList, |
cancleTakeIssueJob, |
||||
} from '@/api/request2.js'; |
getIssueJobList, |
||||
import { |
} from '@/api/request2.js'; |
||||
goHome, |
import { |
||||
updateTitle |
goHome, |
||||
} from '@/common/basic.js'; |
updateTitle |
||||
|
} from '@/common/basic.js'; |
||||
import { |
|
||||
getDetailOption, |
import { |
||||
getDetailGiveupOption |
getDetailOption, |
||||
} from '@/common/array.js'; |
getDetailGiveupOption |
||||
|
} from '@/common/array.js'; |
||||
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' |
|
||||
import jobFilter from '@/mycomponents/job/jobFilter.vue' |
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' |
||||
import comIssueJobCard from '@/pages/issue/coms/comIssueJobCard.vue' |
import jobFilter from '@/mycomponents/job/jobFilter.vue' |
||||
import jobListPopup from '@/pages/issue/coms/jobListPopup.vue' |
import comIssueJobCard from '@/pages/issue/coms/comIssueJobCard.vue' |
||||
import jobInfoPopup from '@/pages/issue/coms/jobInfoPopup.vue' |
import jobListPopup from '@/pages/issue/coms/jobListPopup.vue' |
||||
|
import jobInfoPopup from '@/pages/issue/coms/jobInfoPopup.vue' |
||||
export default { |
|
||||
name: 'issue', |
export default { |
||||
components: { |
name: 'issue', |
||||
comEmptyView, |
components: { |
||||
jobFilter, |
comEmptyView, |
||||
comIssueJobCard, |
jobFilter, |
||||
jobListPopup, |
comIssueJobCard, |
||||
jobInfoPopup |
jobListPopup, |
||||
}, |
jobInfoPopup |
||||
data() { |
}, |
||||
return { |
data() { |
||||
jobList: [], |
return { |
||||
pageNo: 1, |
jobList: [], |
||||
pageSize: 10, |
pageNo: 1, |
||||
totalCount: 0, |
pageSize: 10, |
||||
loadingType: "nomore", |
totalCount: 0, |
||||
checkedToday: false, |
loadingType: "nomore", |
||||
checkedWaitTask: false, |
checkedToday: false, |
||||
todayTime: "", |
checkedWaitTask: false, |
||||
status: '1,2', //待处理 、进行中 |
todayTime: "", |
||||
detailOptions: [], |
status: '1,2', //待处理 、进行中 |
||||
detailGiveupOptions: [], |
detailOptions: [], |
||||
}; |
detailGiveupOptions: [], |
||||
}, |
}; |
||||
|
}, |
||||
onShow() { |
|
||||
this.getList('refresh'); |
onShow() { |
||||
}, |
this.getList('refresh'); |
||||
|
}, |
||||
onReady() { |
|
||||
this.detailOptions = getDetailOption(); |
onReady() { |
||||
this.detailGiveupOptions = getDetailGiveupOption(); |
this.detailOptions = getDetailOption(); |
||||
}, |
this.detailGiveupOptions = getDetailGiveupOption(); |
||||
onReachBottom() { |
}, |
||||
//避免多次触发 |
onReachBottom() { |
||||
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
//避免多次触发 |
||||
return; |
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
||||
} |
return; |
||||
this.getList("more"); |
} |
||||
}, |
this.getList("more"); |
||||
|
}, |
||||
onPullDownRefresh() { |
|
||||
this.getList('refresh'); |
onPullDownRefresh() { |
||||
}, |
this.getList('refresh'); |
||||
|
}, |
||||
//后退按钮 |
|
||||
onBackPress(options) { |
//后退按钮 |
||||
if (options.from === 'navigateBack') { |
onBackPress(options) { |
||||
uni.navigateBack({ |
if (options.from === 'navigateBack') { |
||||
delta: 1 |
uni.navigateBack({ |
||||
}) |
delta: 1 |
||||
return false; |
}) |
||||
} |
return false; |
||||
}, |
} |
||||
|
}, |
||||
//返回首页 |
|
||||
onNavigationBarButtonTap(e) { |
//返回首页 |
||||
if (e.index === 0) { |
onNavigationBarButtonTap(e) { |
||||
goHome(); |
if (e.index === 0) { |
||||
} else if (e.index == 1) { |
goHome(); |
||||
this.$refs.filter.openFilter(); |
} else if (e.index == 1) { |
||||
} |
this.$refs.filter.openFilter(); |
||||
}, |
} |
||||
|
}, |
||||
methods: { |
|
||||
getList(type) { |
methods: { |
||||
let that = this; |
getList(type, fromLocationCode = '', productionLineCode = '') { |
||||
uni.showLoading({ |
let that = this; |
||||
title: "加载中....", |
uni.showLoading({ |
||||
mask: true |
title: "加载中....", |
||||
}); |
mask: true |
||||
|
}); |
||||
this.loadingType = "loading"; |
|
||||
if (type === "refresh") { |
this.loadingType = "loading"; |
||||
this.pageNo = 1; |
if (type === "refresh") { |
||||
this.jobList = []; |
this.pageNo = 1; |
||||
} |
this.jobList = []; |
||||
var filters = [] |
} |
||||
if (this.checkedToday) { |
var filters = [] |
||||
filters.push({ |
if (this.checkedToday) { |
||||
column: "request_time", |
filters.push({ |
||||
action: "betweeen", |
column: "request_time", |
||||
value: this.todayTime |
action: "betweeen", |
||||
}) |
value: this.todayTime |
||||
} |
}) |
||||
|
} |
||||
filters.push({ |
|
||||
column: "status", |
filters.push({ |
||||
action: "in", |
column: "status", |
||||
value: this.status |
action: "in", |
||||
}) |
value: this.status |
||||
|
}) |
||||
var params = { |
|
||||
filters: filters, |
if (fromLocationCode != '') { |
||||
pageNo: this.pageNo, |
// 来源库位 |
||||
pageSize: this.pageSize, |
filters.push({ |
||||
} |
column: "fromLocationCode", |
||||
getIssueJobList(params).then(res => { |
action: "==", |
||||
uni.hideLoading(); |
value: fromLocationCode |
||||
if (type === "refresh") { |
}) |
||||
uni.stopPullDownRefresh(); |
} |
||||
} |
if (productionLineCode != '') { |
||||
var list = res.data.list; |
// 生产线 |
||||
this.totalCount = res.data.total |
filters.push({ |
||||
updateTitle("发料任务(" + this.totalCount + ")"); |
column: "productionLineCode", |
||||
this.loadingType = "loadmore"; |
action: "==", |
||||
if (list == null || list.length == 0) { |
value: productionLineCode |
||||
this.loadingType = "nomore"; |
}) |
||||
return; |
} |
||||
} |
|
||||
this.jobList = type === "refresh" ? list : this.jobList.concat(list); |
var params = { |
||||
this.pageNo++; |
filters: filters, |
||||
|
pageNo: this.pageNo, |
||||
|
pageSize: this.pageSize, |
||||
}).catch(error => { |
} |
||||
if (type === "refresh") { |
getIssueJobList(params).then(res => { |
||||
uni.stopPullDownRefresh(); |
uni.hideLoading(); |
||||
} |
if (type === "refresh") { |
||||
updateTitle("发料任务"); |
uni.stopPullDownRefresh(); |
||||
this.loadingType = ""; |
} |
||||
uni.hideLoading(); |
var list = res.data.list; |
||||
that.showMessage(error) |
this.totalCount = res.data.total |
||||
}) |
updateTitle("发料任务(" + this.totalCount + ")"); |
||||
}, |
this.loadingType = "loadmore"; |
||||
|
if (list == null || list.length == 0) { |
||||
getByAsnNumber(code) { |
this.loadingType = "nomore"; |
||||
let that = this; |
return; |
||||
uni.showLoading({ |
} |
||||
title: "加载中....", |
this.jobList = type === "refresh" ? list : this.jobList.concat(list); |
||||
mask: true |
this.pageNo++; |
||||
}); |
|
||||
|
|
||||
getPurchasereceiptByAsnNumber(code).then(res => { |
}).catch(error => { |
||||
uni.hideLoading(); |
if (type === "refresh") { |
||||
if (res.data.total == 0) { |
uni.stopPullDownRefresh(); |
||||
that.showMessage('未查找到' + '【' + code + '】的收货任务'); |
} |
||||
} else if (res.data.total == 1) { |
updateTitle("发料任务"); |
||||
this.$refs.scanAsnNumber.closeScanPopup(); |
this.loadingType = ""; |
||||
that.openJobDetail(res.data.list[0]); |
uni.hideLoading(); |
||||
} else { |
that.showMessage(error) |
||||
this.$refs.scanAsnNumber.closeScanPopup(); |
}) |
||||
that.showItemList(res.data.list); |
}, |
||||
} |
fromLocationCode(fromLocationCode) { |
||||
|
console.log('fromLocationCode', fromLocationCode) |
||||
}).catch(error => { |
this.getList('refresh', fromLocationCode, '') |
||||
uni.hideLoading(); |
}, |
||||
that.showErrorMessage(error); |
productionLineCode(productionLineCode) { |
||||
}) |
console.log('productionLineCode', productionLineCode) |
||||
}, |
this.getList('refresh', '', productionLineCode) |
||||
|
}, |
||||
|
getByAsnNumber(code) { |
||||
openJobDetail(item) { |
let that = this; |
||||
uni.navigateTo({ |
uni.showLoading({ |
||||
url: './issueDetail?id=' + item.masterId + '&status=' + item.status |
title: "加载中....", |
||||
}); |
mask: true |
||||
}, |
}); |
||||
|
|
||||
showItemList(itemList) { |
getPurchasereceiptByAsnNumber(code).then(res => { |
||||
this.$refs.scanList.openPopup(itemList); |
uni.hideLoading(); |
||||
}, |
if (res.data.total == 0) { |
||||
|
that.showMessage('未查找到' + '【' + code + '】的收货任务'); |
||||
selectedItem(item) { |
} else if (res.data.total == 1) { |
||||
this.openJobDetail(item); |
this.$refs.scanAsnNumber.closeScanPopup(); |
||||
}, |
that.openJobDetail(res.data.list[0]); |
||||
|
} else { |
||||
swipeClick(e, dataContent) { |
this.$refs.scanAsnNumber.closeScanPopup(); |
||||
if (e.content.text == "详情") { |
that.showItemList(res.data.list); |
||||
this.openjobInfoPopup(dataContent); |
} |
||||
} else if (e.content.text == "放弃") { |
|
||||
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?", |
}).catch(error => { |
||||
res => { |
uni.hideLoading(); |
||||
if (res) { |
that.showErrorMessage(error); |
||||
this.cancleJob(dataContent.masterId); |
}) |
||||
} |
}, |
||||
}); |
|
||||
} |
|
||||
}, |
openJobDetail(item) { |
||||
|
uni.navigateTo({ |
||||
openjobInfoPopup(item) { |
url: './issueDetail?id=' + item.masterId + '&status=' + item.status |
||||
this.$refs.jobInfoPopup.openPopup(item) |
}); |
||||
}, |
}, |
||||
|
|
||||
cancleJob(id) { |
showItemList(itemList) { |
||||
cancleTakeIssueJob(id).then(res => { |
this.$refs.scanList.openPopup(itemList); |
||||
if(res.data){ |
}, |
||||
this.getList("refresh") |
|
||||
uni.showToast({ |
selectedItem(item) { |
||||
title:"放弃任务成功" |
this.openJobDetail(item); |
||||
}) |
}, |
||||
}else { |
|
||||
this.showMessage("放弃任务失败") |
swipeClick(e, dataContent) { |
||||
} |
if (e.content.text == "详情") { |
||||
}).catch(error => { |
this.openjobInfoPopup(dataContent); |
||||
this.showMessage(error) |
} else if (e.content.text == "放弃") { |
||||
}) |
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?", |
||||
}, |
res => { |
||||
|
if (res) { |
||||
switchChangeToday(state, creationTime) { |
this.cancleJob(dataContent.masterId); |
||||
this.checkedToday = state; |
} |
||||
this.todayTime = creationTime; |
}); |
||||
this.getList("refresh"); |
} |
||||
}, |
}, |
||||
|
|
||||
switchChangeWait(state, jobStatus) { |
openjobInfoPopup(item) { |
||||
this.checkedWaitTask = state; |
this.$refs.jobInfoPopup.openPopup(item) |
||||
this.status = jobStatus; |
}, |
||||
this.getList("refresh"); |
|
||||
}, |
cancleJob(id) { |
||||
|
cancleTakeIssueJob(id).then(res => { |
||||
getScanNumber(code) { |
if (res.data) { |
||||
this.getDataListByType(code) |
this.getList("refresh") |
||||
}, |
uni.showToast({ |
||||
getDataListByType(code) { |
title: "放弃任务成功" |
||||
let that = this; |
}) |
||||
uni.showLoading({ |
} else { |
||||
title: "加载中....", |
this.showMessage("放弃任务失败") |
||||
mask: true |
} |
||||
}); |
}).catch(error => { |
||||
var filters = [] |
this.showMessage(error) |
||||
filters.push({ |
}) |
||||
column: "status", |
}, |
||||
action: "in", |
|
||||
value: '1,2' |
switchChangeToday(state, creationTime) { |
||||
}) |
this.checkedToday = state; |
||||
filters.push({ |
this.todayTime = creationTime; |
||||
column: "number", |
this.getList("refresh"); |
||||
action: "==", |
}, |
||||
value: code |
|
||||
}) |
switchChangeWait(state, jobStatus) { |
||||
|
this.checkedWaitTask = state; |
||||
var params = { |
this.status = jobStatus; |
||||
filters: filters, |
this.getList("refresh"); |
||||
pageNo: 1, |
}, |
||||
pageSize: 100, |
|
||||
} |
getScanNumber(code) { |
||||
getIssueJobList(params).then(res => { |
this.getDataListByType(code) |
||||
uni.hideLoading(); |
}, |
||||
if (res.data.list.length == 0) { |
getDataListByType(code) { |
||||
that.showMessage('未查找到' + '【' + code + '】的收货任务'); |
let that = this; |
||||
} else if (res.data.list.length == 1) { |
uni.showLoading({ |
||||
that.openJobDetail(res.data.list[0]); |
title: "加载中....", |
||||
} |
mask: true |
||||
}).catch(error => { |
}); |
||||
uni.hideLoading(); |
var filters = [] |
||||
that.showMessage(error); |
filters.push({ |
||||
}) |
column: "status", |
||||
}, |
action: "in", |
||||
|
value: '1,2' |
||||
showMessage(message) { |
}) |
||||
this.$refs.comMessage.showErrorMessage(message, res => { |
filters.push({ |
||||
if (res) { |
column: "number", |
||||
|
action: "==", |
||||
} |
value: code |
||||
}); |
}) |
||||
}, |
|
||||
} |
var params = { |
||||
} |
filters: filters, |
||||
</script> |
pageNo: 1, |
||||
|
pageSize: 100, |
||||
<style scoped lang="scss"> |
} |
||||
|
getIssueJobList(params).then(res => { |
||||
</style> |
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> |
Loading…
Reference in new issue