|
@ -7,7 +7,7 @@ |
|
|
<view v-if="requestList.length>0"> |
|
|
<view v-if="requestList.length>0"> |
|
|
<uni-swipe-action ref="swipeAction"> |
|
|
<uni-swipe-action ref="swipeAction"> |
|
|
<view v-for="(item, index) in requestList" :key="index"> |
|
|
<view v-for="(item, index) in requestList" :key="index"> |
|
|
<uni-swipe-action-item :right-options="detailOptions" @click="swipeClick($event,item)"> |
|
|
<uni-swipe-action-item :right-options="item.options" @click="swipeClick($event,item)"> |
|
|
<comInspectRequestCard :dataContent="item" @click='openRequestDetail(item)'> |
|
|
<comInspectRequestCard :dataContent="item" @click='openRequestDetail(item)'> |
|
|
</comInspectRequestCard> |
|
|
</comInspectRequestCard> |
|
|
</uni-swipe-action-item> |
|
|
</uni-swipe-action-item> |
|
@ -28,10 +28,17 @@ |
|
|
import requestInfoPopup from '@/pages/inspect/coms/requestInfoPopup.vue' |
|
|
import requestInfoPopup from '@/pages/inspect/coms/requestInfoPopup.vue' |
|
|
import { |
|
|
import { |
|
|
goHome, |
|
|
goHome, |
|
|
updateTitle |
|
|
updateTitle, |
|
|
|
|
|
clearTirmAndWrap |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
import { |
|
|
import { |
|
|
getInspectRequestList, |
|
|
getInspectRequestList, |
|
|
|
|
|
inspectRequestClose, |
|
|
|
|
|
inspectRequestApprove, |
|
|
|
|
|
inspectRequestApproveAgree, |
|
|
|
|
|
inspectRequestApproveRefused, |
|
|
|
|
|
inspectRequestHandle, |
|
|
|
|
|
inspectRequestAddAgain |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -39,7 +46,8 @@ |
|
|
getDetailAndApproveOption, |
|
|
getDetailAndApproveOption, |
|
|
getDetailAndApprovePassAndApproveNoOption, |
|
|
getDetailAndApprovePassAndApproveNoOption, |
|
|
getDetailAndHandleOption, |
|
|
getDetailAndHandleOption, |
|
|
getDetailAndCloseOption |
|
|
getDetailAndCloseOption, |
|
|
|
|
|
getAddAgainOption |
|
|
} from '@/common/array.js'; |
|
|
} from '@/common/array.js'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -64,17 +72,19 @@ |
|
|
detailAndApprovePassAndApproveNoOption: [], |
|
|
detailAndApprovePassAndApproveNoOption: [], |
|
|
detailAndHandleOption: [], |
|
|
detailAndHandleOption: [], |
|
|
detailAndCloseOption: [], |
|
|
detailAndCloseOption: [], |
|
|
|
|
|
addAgainOption:[], |
|
|
showOptions: [], |
|
|
showOptions: [], |
|
|
fromType: "requestType", |
|
|
fromType: "requestType", |
|
|
loadingType: "nomore", |
|
|
loadingType: "nomore", |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onReady() { |
|
|
onLoad() { |
|
|
this.detailOptions = getDetailOption(); |
|
|
this.detailOptions = getDetailOption(); |
|
|
|
|
|
this.addAgainOption = getAddAgainOption(); |
|
|
this.detailAndApproveOptions = getDetailAndApproveOption() |
|
|
this.detailAndApproveOptions = getDetailAndApproveOption() |
|
|
this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), |
|
|
this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), |
|
|
this.detailAndHandleOption = getDetailAndHandleOption() |
|
|
this.detailAndHandleOption = getDetailAndHandleOption() |
|
|
this.detailAndCloseOption = getDetailAndCloseOption() |
|
|
this.detailAndCloseOption = getDetailAndCloseOption() |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
@ -124,7 +134,9 @@ |
|
|
this.showOptions = this.detailAndHandleOption; |
|
|
this.showOptions = this.detailAndHandleOption; |
|
|
} else if (status == "4") { |
|
|
} else if (status == "4") { |
|
|
this.showOptions = this.detailAndCloseOption; |
|
|
this.showOptions = this.detailAndCloseOption; |
|
|
} else { |
|
|
} else if(status == "5"){ |
|
|
|
|
|
this.showOptions = this.addAgainOption; |
|
|
|
|
|
}else { |
|
|
this.showOptions = this.detailOptions; |
|
|
this.showOptions = this.detailOptions; |
|
|
} |
|
|
} |
|
|
return this.showOptions |
|
|
return this.showOptions |
|
@ -187,21 +199,43 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
swipeClick(e, dataContent) { |
|
|
swipeClick(e, dataContent) { |
|
|
if (e.content.text == "详情") { |
|
|
var text = clearTirmAndWrap(e.content.text) |
|
|
console.log("详情", dataContent.id) |
|
|
if (text == "详情") { |
|
|
this.openRequestInfoPopup(dataContent); |
|
|
this.openRequestInfoPopup(dataContent); |
|
|
} else if (e.content.text == "处理") { |
|
|
} else if (text == "处理") { |
|
|
console.log("处理") |
|
|
this.showQuestionMessage("确定要处理当前申请吗?",res=>{ |
|
|
} else if (e.content.text == "审批") { |
|
|
this.inspectRequestHandle(dataContent.id) |
|
|
console.log("审批") |
|
|
}) |
|
|
} else if (e.content.text == "审批通过") { |
|
|
} else if (text == "提交审批") { |
|
|
console.log("审批通过") |
|
|
this.showQuestionMessage("确定要审批当前申请吗?",res=>{ |
|
|
} else if (e.content.text == "审批驳回") { |
|
|
this.inspectRequestApprove(dataContent.id) |
|
|
console.log("审批驳回") |
|
|
}) |
|
|
} else if (e.content.text == "关闭") { |
|
|
} else if (text=="审批通过") { |
|
|
console.log("关闭") |
|
|
this.showQuestionMessage("确定要审批通过当前申请吗?",res=>{ |
|
|
|
|
|
this.inspectRequestApproveAgree(dataContent.id) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (text == "审批驳回") { |
|
|
|
|
|
this.showQuestionMessage("确定要审批驳回当前申请吗?",res=>{ |
|
|
|
|
|
this.inspectRequestApproveRefused(dataContent.id) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (text == "关闭") { |
|
|
|
|
|
this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ |
|
|
|
|
|
this.inspectRequestClose(dataContent.id) |
|
|
|
|
|
}) |
|
|
|
|
|
}else if(text == "重新添加"){ |
|
|
|
|
|
this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{ |
|
|
|
|
|
this.inspectRequestAddAgain(dataContent.id) |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
showQuestionMessage(hint,callBack){ |
|
|
|
|
|
this.$refs.comMessage.showQuestionMessage(hint, |
|
|
|
|
|
res => { |
|
|
|
|
|
if (res) { |
|
|
|
|
|
callBack() |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
switchChangeWait(state, jobStatus) { |
|
|
switchChangeWait(state, jobStatus) { |
|
|
this.checkedWaitTask = state; |
|
|
this.checkedWaitTask = state; |
|
|
this.status = jobStatus; |
|
|
this.status = jobStatus; |
|
@ -249,6 +283,98 @@ |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
inspectRequestApprove(id) { |
|
|
|
|
|
inspectRequestApprove(id).then(res => { |
|
|
|
|
|
if (res.data) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: "申请提交审批成功" |
|
|
|
|
|
}) |
|
|
|
|
|
this.getList("refresh") |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showMessage("申请提交审批失败") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
this.showMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
inspectRequestClose(id) { |
|
|
|
|
|
inspectRequestClose(id).then(res => { |
|
|
|
|
|
if (res.data) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: "申请关闭成功" |
|
|
|
|
|
}) |
|
|
|
|
|
this.getList("refresh") |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showMessage("申请关闭失败") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
this.showMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
inspectRequestAddAgain(id) { |
|
|
|
|
|
inspectRequestAddAgain(id).then(res => { |
|
|
|
|
|
if (res.data) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: "申请重新添加成功" |
|
|
|
|
|
}) |
|
|
|
|
|
this.getList("refresh") |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showMessage("申请重新添加失败") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
this.showMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
inspectRequestApproveAgree(id) { |
|
|
|
|
|
inspectRequestApproveAgree(id).then(res => { |
|
|
|
|
|
if (res.data) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: "申请审批通过成功" |
|
|
|
|
|
}) |
|
|
|
|
|
this.getList("refresh") |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showMessage("申请审批通过失败") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
this.showMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
inspectRequestApproveRefused(id) { |
|
|
|
|
|
inspectRequestApproveRefused(id).then(res => { |
|
|
|
|
|
if (res.data) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: "申请审批驳回成功" |
|
|
|
|
|
}) |
|
|
|
|
|
this.getList("refresh") |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showMessage("申请审批驳回失败") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
this.showMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
inspectRequestHandle(id) { |
|
|
|
|
|
inspectRequestHandle(id).then(res => { |
|
|
|
|
|
if (res.data) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: "申请处理成功" |
|
|
|
|
|
}) |
|
|
|
|
|
this.getList("refresh") |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showMessage("申请处理失败") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
this.showMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|