|
|
@ -36,9 +36,15 @@ |
|
|
|
import { |
|
|
|
goHome, |
|
|
|
updateTitle, |
|
|
|
clearTirmAndWrap |
|
|
|
} from '@/common/basic.js'; |
|
|
|
import { |
|
|
|
getPurchaseReturnRequestList, |
|
|
|
purchaseReturnRequestClose, |
|
|
|
purchaseReturnRequestSubmitApprove, |
|
|
|
purchaseReturnRequestSubmitApproveAgree, |
|
|
|
purchaseReturnRequestSubmitApproveRefused, |
|
|
|
purchaseReturnRequestHandle |
|
|
|
} from '@/api/request2.js'; |
|
|
|
import { |
|
|
|
getDetailOption, |
|
|
@ -113,8 +119,6 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
requestConfirm(action, item) {}, |
|
|
|
|
|
|
|
openRequestDetail(item) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: './returnRequestDetail?id=' + item.id + '&fromType=' + this.fromType |
|
|
@ -170,12 +174,12 @@ |
|
|
|
updateTitle("采购退货申请(" + this.totalCount + ")"); |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (type === "refresh") { |
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
} |
|
|
|
updateTitle("采购退货申请"); |
|
|
|
this.loadingType = ""; |
|
|
|
uni.hideLoading(); |
|
|
|
that.showMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
@ -202,21 +206,40 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
swipeClick(e, dataContent) { |
|
|
|
if (e.content.text == "详情") { |
|
|
|
console.log("详情", dataContent.id) |
|
|
|
var text = clearTirmAndWrap(e.content.text) |
|
|
|
if (text == "详情") { |
|
|
|
this.openRequestInfoPopup(dataContent); |
|
|
|
} else if (e.content.text == "处理") { |
|
|
|
console.log("处理") |
|
|
|
} else if (e.content.text == "审批") { |
|
|
|
console.log("审批") |
|
|
|
} else if (e.content.text == "审批通过") { |
|
|
|
console.log("审批通过") |
|
|
|
} else if (e.content.text == "审批驳回") { |
|
|
|
console.log("审批驳回") |
|
|
|
} else if (e.content.text == "关闭") { |
|
|
|
console.log("关闭") |
|
|
|
} else if (text == "处理") { |
|
|
|
this.showQuestionMessage("确定要处理当前申请吗?",res=>{ |
|
|
|
this.purchaseReturnRequestHandle(dataContent.id) |
|
|
|
}) |
|
|
|
} else if (text == "提交审批") { |
|
|
|
this.showQuestionMessage("确定要审批当前申请吗?",res=>{ |
|
|
|
this.purchaseReturnRequestSubmitApprove(dataContent.id) |
|
|
|
}) |
|
|
|
} else if (text=="审批通过") { |
|
|
|
this.showQuestionMessage("确定要审批通过当前申请吗?",res=>{ |
|
|
|
this.purchaseReturnRequestSubmitApproveAgree(dataContent.id) |
|
|
|
}) |
|
|
|
} else if (text == "审批驳回") { |
|
|
|
this.showQuestionMessage("确定要审批驳回当前申请吗?",res=>{ |
|
|
|
this.purchaseReturnRequestSubmitApproveRefused(dataContent.id) |
|
|
|
}) |
|
|
|
} else if (text == "关闭") { |
|
|
|
this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ |
|
|
|
this.purchaseReturnRequestClose(dataContent.id) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
showQuestionMessage(hint,callBack){ |
|
|
|
this.$refs.comMessage.showQuestionMessage(hint, |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
callBack() |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
switchChangeWait(state, jobStatus) { |
|
|
|
this.checkedWaitTask = state; |
|
|
|
this.status = jobStatus; |
|
|
@ -266,6 +289,88 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
purchaseReturnRequestSubmitApprove(id) { |
|
|
|
purchaseReturnRequestSubmitApprove(id).then(res => { |
|
|
|
if (res.data) { |
|
|
|
this.getList("refresh") |
|
|
|
uni.showToast({ |
|
|
|
title: "申请提交审批成功" |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.showMessage("申请提交审批失败") |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
this.showMessage(error) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
purchaseReturnRequestClose(id) { |
|
|
|
purchaseReturnRequestClose(id).then(res => { |
|
|
|
if (res.data) { |
|
|
|
this.getList("refresh") |
|
|
|
uni.showToast({ |
|
|
|
title: "申请关闭成功" |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.showMessage("申请关闭失败") |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
this.showMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
purchaseReturnRequestSubmitApproveAgree(id) { |
|
|
|
purchaseReturnRequestSubmitApproveAgree(id).then(res => { |
|
|
|
if (res.data) { |
|
|
|
this.getList("refresh") |
|
|
|
uni.showToast({ |
|
|
|
title: "申请审批通过成功" |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.showMessage("申请审批通过失败") |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
this.showMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
purchaseReturnRequestSubmitApproveRefused(id) { |
|
|
|
purchaseReturnRequestSubmitApproveRefused(id).then(res => { |
|
|
|
if (res.data) { |
|
|
|
this.getList("refresh") |
|
|
|
uni.showToast({ |
|
|
|
title: "申请审批驳回成功" |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.showMessage("申请审批驳回失败") |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
this.showMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
purchaseReturnRequestHandle(id) { |
|
|
|
purchaseReturnRequestSubmitApproveRefused(id).then(res => { |
|
|
|
if (res.data) { |
|
|
|
this.getList("refresh") |
|
|
|
uni.showToast({ |
|
|
|
title: "申请处理成功" |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.showMessage("申请处理失败") |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
this.showMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|