|
|
@ -9,7 +9,8 @@ |
|
|
|
<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" |
|
|
|
<uni-swipe-action-item |
|
|
|
:right-options="item.status=='2'?detailGiveupOptions:item.status=='1'?detailCloseOptions:detailOptions" |
|
|
|
@click="swipeClick($event,item)"> |
|
|
|
|
|
|
|
<com-issue-job-card :dataContent="item" @click='openJobDetail(item)'></com-issue-job-card> |
|
|
@ -34,7 +35,8 @@ |
|
|
|
import { |
|
|
|
cancleTakeIssueJob, |
|
|
|
getIssueJobList, |
|
|
|
getIssueJobByProductionline |
|
|
|
getIssueJobByProductionline, |
|
|
|
closeTakeIssueJob |
|
|
|
} from '@/api/request2.js'; |
|
|
|
import { |
|
|
|
goHome, |
|
|
@ -43,7 +45,8 @@ |
|
|
|
|
|
|
|
import { |
|
|
|
getDetailOption, |
|
|
|
getDetailGiveupOption |
|
|
|
getDetailGiveupOption, |
|
|
|
getDetailCloseOption |
|
|
|
} from '@/common/array.js'; |
|
|
|
|
|
|
|
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' |
|
|
@ -80,7 +83,8 @@ |
|
|
|
status: '1,2', //待处理 、进行中 |
|
|
|
detailOptions: [], |
|
|
|
detailGiveupOptions: [], |
|
|
|
productionlineList: [], |
|
|
|
productionlineList: [], |
|
|
|
detailCloseOptions: [], |
|
|
|
title:'', |
|
|
|
productionLine:"", |
|
|
|
fromLocation:"" |
|
|
@ -97,6 +101,7 @@ |
|
|
|
onReady() { |
|
|
|
this.detailOptions = getDetailOption(); |
|
|
|
this.detailGiveupOptions = getDetailGiveupOption(); |
|
|
|
this.detailCloseOptions = getDetailCloseOption(); |
|
|
|
}, |
|
|
|
onReachBottom() { |
|
|
|
//避免多次触发 |
|
|
@ -289,11 +294,18 @@ |
|
|
|
this.openjobInfoPopup(dataContent); |
|
|
|
} else if (e.content.text == "放弃") { |
|
|
|
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
this.cancleJob(dataContent.masterId); |
|
|
|
} |
|
|
|
}); |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
this.cancleJob(dataContent.masterId); |
|
|
|
} |
|
|
|
}); |
|
|
|
}else if (e.content.text == "关闭") { |
|
|
|
this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
this.closeJob(dataContent.masterId); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -315,6 +327,27 @@ |
|
|
|
this.showMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
closeJob(id) { |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
|
|
|
|
closeTakeIssueJob(id).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if(res.data){ |
|
|
|
this.getList("refresh") |
|
|
|
uni.showToast({ |
|
|
|
title:"关闭任务成功" |
|
|
|
}) |
|
|
|
}else { |
|
|
|
this.showMessage("关闭任务失败") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
switchChangeToday(state, creationTime) { |
|
|
|
this.checkedToday = state; |
|
|
|