diff --git a/api/request2.js b/api/request2.js index f1143e82..4b08c50b 100644 --- a/api/request2.js +++ b/api/request2.js @@ -501,6 +501,79 @@ export function getInspectRequestDetail(id) { }); } +/** + * 检验单申请 关闭任务 + * @param {*} params + */ +export function inspectRequestClose(id) { + return request({ + url: baseApi + "/wms/inspect-request-main/close?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 检验单申请 提交审批 + * @param {*} params + */ +export function inspectRequestApprove(id) { + return request({ + url: baseApi + "/wms/inspect-request-main/submit?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 检验单申请 提交审批通过 + * @param {*} params + */ + +export function inspectRequestApproveAgree(id) { + return request({ + url: baseApi + "/wms/inspect-request-main/agree?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 检验单申请 审批驳回 + * @param {*} params + */ +export function inspectRequestApproveRefused(id) { + return request({ + url: baseApi + "/wms/inspect-request-main/refused?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 检验单申请 处理 + * @param {*} params + */ +export function inspectRequestHandle(id) { + return request({ + url: baseApi + "/wms/inspect-request-main/handle?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 检验单申请 重新添加 + * @param {*} params + */ +export function inspectRequestAddAgain(id) { + return request({ + url: baseApi + "/wms/inspect-request-main/reAdd?id=" + id, + method: "put", + data: {}, + }); +} + /** * 采购收货 任务 * status 任务状态 @@ -728,6 +801,19 @@ export function purchaseReturnRequestHandle(id) { }); } +/** + * 采购退货申请 重新添加 + * @param {*} params + */ +export function purchaseReturnRequestAddAgain(id) { + return request({ + url: baseApi + "/wms/purchasereturn-request-main/reAdd?id=" + id, + method: "put", + data: {}, + }); +} + + /** * 采购退货申请 提交 @@ -935,6 +1021,80 @@ export function putawayRequestSubmit(params) { }); } +/** + * 原料上架申请 关闭任务 + * @param {*} params + */ +export function putawayRequestClose(id) { + return request({ + url: baseApi + "/wms/putaway-request-main/close?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 原料上架申请 提交审批 + * @param {*} params + */ +export function putawayRequestApprove(id) { + return request({ + url: baseApi + "/wms/putaway-request-main/submit?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 原料上架申请 提交审批通过 + * @param {*} params + */ +export function putawayRequestApproveAgree(id) { + return request({ + url: baseApi + "/wms/putaway-request-main/agree?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 原料上架申请 审批驳回 + * @param {*} params + */ +export function putawayRequestApproveRefused(id) { + return request({ + url: baseApi + "/wms/putaway-request-main/refused?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 原料上架申请 处理 + * @param {*} params + */ +export function putawayRequestHandle(id) { + return request({ + url: baseApi + "/wms/putaway-request-main/handle?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 原料上架申请 重新添加 + * @param {*} params + */ +export function putawayRequestAddAgain(id) { + return request({ + url: baseApi + "/wms/putaway-request-main/reAdd?id=" + id, + method: "put", + data: {}, + }); +} + + + /** * 原料上架记录 提交 * @param {*} params @@ -1404,6 +1564,18 @@ export function unPlannedReceiptRequestHandle(id) { }); } +/** + * 计划外入库申请 重新添加 + * @param {*} params + */ +export function unPlannedReceiptRequestAddAgain(id) { + return request({ + url: baseApi + "/wms/unplannedreceipt-request-main/reAdd?id=" + id, + method: "put", + data: {}, + }); +} + /** * 计划外入库记录 提交 @@ -1485,6 +1657,7 @@ export function unPlannedIssueJobSubmit(params) { }); } + /** * 计划外出库申请 提交 * @param {*} params @@ -1557,6 +1730,19 @@ export function unPlannedIssueRequestHandle(id) { }); } +/** + * 计划外出库申请 重新添加 + * @param {*} params + */ + +export function unPlannedIssueRequestAddAgain(id) { + return request({ + url: baseApi + "/wms/unplannedissue-request-main/reAdd?id=" + id, + method: "put", + data: {}, + }); +} + /** * 计划外出库记录 提交 @@ -1931,6 +2117,78 @@ export function deliverRequestSubmit(params) { }); } +/** + * 制品发货申请 关闭任务 + * @param {*} params + */ +export function deliverRequestClose(id) { + return request({ + url: baseApi + "/wms/deliver-request-main/close?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 制品发货申请 提交审批 + * @param {*} params + */ +export function deliverRequestApprove(id) { + return request({ + url: baseApi + "/wms/deliver-request-main/submit?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 制品发货申请 提交审批通过 + * @param {*} params + */ +export function deliverRequestApproveAgree(id) { + return request({ + url: baseApi + "/wms/deliver-request-main/agree?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 制品发货申请 审批驳回 + * @param {*} params + */ +export function deliverRequestApproveRefused(id) { + return request({ + url: baseApi + "/wms/deliver-request-main/refused?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 制品发货申请 处理 + * @param {*} params + */ +export function deliverRequestHandle(id) { + return request({ + url: baseApi + "/wms/deliver-request-main/handle?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 制品发货申请 重新添加 + * @param {*} params + */ +export function deliverRequestAddAgain(id) { + return request({ + url: baseApi + "/wms/deliver-request-main/reAdd/reAdd?id=" + id, + method: "put", + data: {}, + }); +} + /** * 制品发货记录 提交 * @param {*} params @@ -2056,6 +2314,78 @@ export function customerReturnRequestSubmit(params) { }); } +/** + * 客户退货申请 关闭任务 + * @param {*} params + */ +export function customerReturnRequestClose(id) { + return request({ + url: baseApi + "/wms/customerreturn-request-main/close?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 客户退货申请 提交审批 + * @param {*} params + */ +export function customerReturnRequestApprove(id) { + return request({ + url: baseApi + "/wms/customerreturn-request-main/submit?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 客户退货申请 提交审批通过 + * @param {*} params + */ +export function customerReturnRequestApproveAgree(id) { + return request({ + url: baseApi + "/wms/customerreturn-request-main/agree?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 客户退货申请 审批驳回 + * @param {*} params + */ +export function customerReturnRequestApproveRefused(id) { + return request({ + url: baseApi + "/wms/customerreturn-request-main/refused?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 客户退货申请 处理 + * @param {*} params + */ +export function customerReturnRequestHandle(id) { + return request({ + url: baseApi + "/wms/customerreturn-request-main/handle?id=" + id, + method: "put", + data: {}, + }); +} + +/** + * 客户退货申请 重新添加 + * @param {*} params + */ +export function customerReturnRequestAddAgain(id) { + return request({ + url: baseApi + "/wms/customerreturn-request-main/reAdd?id=" + id, + method: "put", + data: {}, + }); +} + /** * 客户退货 记录提交 * @param {*} params @@ -2285,6 +2615,18 @@ export function productPutawayRequestHandle(id) { }); } +/** + * 制品上架申请 重新添加 + * @param {*} params + */ +export function productPutawayRequestAddAgain(id) { + return request({ + url: baseApi + "/wms/productputaway-request-main/reAdd?id=" + id, + method: "put", + data: {}, + }); +} + /** * 制品上架申请 提交审批 * @param {*} params @@ -2430,6 +2772,18 @@ export function issueRequestClose(id) { }); } +/** + * 发料申请 重新添加 + * @param {*} params + */ +export function issueRequestAddAgain(id) { + return request({ + url: baseApi + "/wms/issue-request-main/reAdd?id=" + id, + method: "put", + data: {}, + }); +} + /** * 发料记录 提交 * @param {*} params @@ -2609,6 +2963,19 @@ export function productionReturnRequestClose(id) { }); } +/** + * 生产退料申请 重新添加 + * @param {*} id + * + */ +export function productionReturnRequestAddAgain(id) { + return request({ + url: baseApi + "/wms/productionreturn-request-main/reAdd?id=" + id, + method: "put", + data: {}, + }); +} + /** @@ -2876,6 +3243,17 @@ export function scrapRequestHandle(id) { data: {}, }); } +/** + * 报废出库申请 重新添加 + * @param {*} params + */ +export function scrapRequestAddAgain(id) { + return request({ + url: baseApi + "/wms/scrap-request-main/reAdd?id=" + id, + method: "put", + data: {}, + }); +} /** * 报废出库记录 提交 diff --git a/common/array.js b/common/array.js index 5bc8ea6f..878a0de8 100644 --- a/common/array.js +++ b/common/array.js @@ -40,6 +40,12 @@ export function getDetailAndApprovePassAndApproveNoOption() { style: { backgroundColor: '#F56C6C' } + }, + { + text: '关闭', + style: { + backgroundColor: '#ff0000' + } } ]; return option_detail; @@ -57,6 +63,12 @@ export function getDetailAndHandleOption() { style: { backgroundColor: '#00CC33' } + }, + { + text: '关闭', + style: { + backgroundColor: '#ff0000' + } } ]; return option_detail; @@ -131,6 +143,16 @@ export function getRemoveOption() { return option_detail_remove; } +export function getAddAgainOption() { + let option_detail_remove = [{ + text: '重新\n添加', + style: { + backgroundColor: '#E6A23C' + } + }]; + return option_detail_remove; +} + export function getEditOption() { diff --git a/pages/customerReturn/request/customerReturnRequest.vue b/pages/customerReturn/request/customerReturnRequest.vue index 77f1b3b1..05dbe91b 100644 --- a/pages/customerReturn/request/customerReturnRequest.vue +++ b/pages/customerReturn/request/customerReturnRequest.vue @@ -31,18 +31,26 @@ import { goHome, - updateTitle + updateTitle, + clearTirmAndWrap } from '@/common/basic.js'; import { getCustomerReturnRequestList, + customerReturnRequestClose, + customerReturnRequestApprove, + customerReturnRequestApproveAgree, + customerReturnRequestApproveRefused, + customerReturnRequestHandle, + customerReturnRequestAddAgain } from '@/api/request2.js'; import { getDetailOption, getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, - getDetailAndCloseOption + getDetailAndCloseOption, + getAddAgainOption } from '@/common/array.js'; export default { @@ -67,6 +75,7 @@ detailAndApprovePassAndApproveNoOption: [], detailAndHandleOption: [], detailAndCloseOption: [], + addAgainOption:[], showOptions: [], fromType: "requestType", loadingType: "nomore", @@ -75,9 +84,10 @@ }, onReady() { this.detailOptions = getDetailOption(); + this.addAgainOption = getAddAgainOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), - this.detailAndHandleOption = getDetailAndHandleOption() + this.detailAndHandleOption = getDetailAndHandleOption() this.detailAndCloseOption = getDetailAndCloseOption() }, @@ -185,7 +195,9 @@ this.showOptions = this.detailAndHandleOption; } else if (status == "4") { this.showOptions = this.detailAndCloseOption; - } else { + } else if(status == "5"){ + this.showOptions = this.addAgainOption; + }else { this.showOptions = this.detailOptions; } return this.showOptions @@ -199,21 +211,43 @@ 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.customerReturnRequestHandle(dataContent.id) + }) + } else if (text == "提交审批") { + this.showQuestionMessage("确定要审批当前申请吗?",res=>{ + this.customerReturnRequestApprove(dataContent.id) + }) + } else if (text=="审批通过") { + this.showQuestionMessage("确定要审批通过当前申请吗?",res=>{ + this.customerReturnRequestApproveAgree(dataContent.id) + }) + } else if (text == "审批驳回") { + this.showQuestionMessage("确定要审批驳回当前申请吗?",res=>{ + this.customerReturnRequestApproveRefused(dataContent.id) + }) + } else if (text == "关闭") { + this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ + this.customerReturnRequestClose(dataContent.id) + }) + }else if(text == "重新添加"){ + this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{ + this.customerReturnRequestAddAgain(dataContent.id) + }) } }, + showQuestionMessage(hint,callBack){ + this.$refs.comMessage.showQuestionMessage(hint, + res => { + if (res) { + callBack() + } + }); + }, switchChangeWait(state, jobStatus) { this.checkedWaitTask = state; @@ -263,6 +297,98 @@ } }); }, + customerReturnRequestApprove(id) { + customerReturnRequestApprove(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请提交审批成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请提交审批失败") + } + + }).catch(error => { + this.showMessage(error) + }) + + }, + + customerReturnRequestClose(id) { + customerReturnRequestClose(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请关闭成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请关闭失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + customerReturnRequestAddAgain(id) { + customerReturnRequestAddAgain(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请重新添加成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请重新添加失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + customerReturnRequestApproveAgree(id) { + customerReturnRequestApproveAgree(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请审批通过成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请审批通过失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + customerReturnRequestApproveRefused(id) { + customerReturnRequestApproveRefused(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请审批驳回成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请审批驳回失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + customerReturnRequestHandle(id) { + customerReturnRequestHandle(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请处理成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请处理失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, } } diff --git a/pages/deliver/request/deliverRequest.vue b/pages/deliver/request/deliverRequest.vue index 4c0f5792..2d64b186 100644 --- a/pages/deliver/request/deliverRequest.vue +++ b/pages/deliver/request/deliverRequest.vue @@ -35,13 +35,20 @@ } from '@/common/basic.js'; import { getDeliverRequestList, + deliverRequestClose, + deliverRequestApprove, + deliverRequestApproveAgree, + deliverRequestApproveRefused, + deliverRequestHandle, + deliverRequestAddAgain } from '@/api/request2.js'; import { getDetailOption, getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, - getDetailAndCloseOption + getDetailAndCloseOption, + getAddAgainOption } from '@/common/array.js'; export default { @@ -67,6 +74,7 @@ detailAndApprovePassAndApproveNoOption: [], detailAndHandleOption: [], detailAndCloseOption: [], + addAgainOption: [], showOptions: [], fromType: "requestType", loadingType: "nomore", @@ -75,9 +83,10 @@ }, onReady() { this.detailOptions = getDetailOption(); + this.addAgainOption = getAddAgainOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), - this.detailAndHandleOption = getDetailAndHandleOption() + this.detailAndHandleOption = getDetailAndHandleOption() this.detailAndCloseOption = getDetailAndCloseOption() }, @@ -182,7 +191,9 @@ this.showOptions = this.detailAndHandleOption; } else if (status == "4") { this.showOptions = this.detailAndCloseOption; - } else { + } else if(status == "5"){ + this.showOptions = this.addAgainOption; + }else { this.showOptions = this.detailOptions; } return this.showOptions @@ -196,21 +207,43 @@ 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.deliverRequestHandle(dataContent.id) + }) + } else if (text == "提交审批") { + this.showQuestionMessage("确定要审批当前申请吗?",res=>{ + this.deliverRequestApprove(dataContent.id) + }) + } else if (text=="审批通过") { + this.showQuestionMessage("确定要审批通过当前申请吗?",res=>{ + this.deliverRequestApproveAgree(dataContent.id) + }) + } else if (text == "审批驳回") { + this.showQuestionMessage("确定要审批驳回当前申请吗?",res=>{ + this.deliverRequestApproveRefused(dataContent.id) + }) + } else if (text == "关闭") { + this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ + this.deliverRequestClose(dataContent.id) + }) + }else if(text == "重新添加"){ + this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{ + this.deliverRequestAddAgain(dataContent.id) + }) } }, + showQuestionMessage(hint,callBack){ + this.$refs.comMessage.showQuestionMessage(hint, + res => { + if (res) { + callBack() + } + }); + }, switchChangeWait(state, jobStatus) { this.checkedWaitTask = state; @@ -260,6 +293,98 @@ } }); }, + deliverRequestApprove(id) { + deliverRequestApprove(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请提交审批成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请提交审批失败") + } + + }).catch(error => { + this.showMessage(error) + }) + + }, + + deliverRequestClose(id) { + deliverRequestClose(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请关闭成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请关闭失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + deliverRequestAddAgain(id) { + deliverRequestAddAgain(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请重新添加成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请重新添加失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + deliverRequestApproveAgree(id) { + deliverRequestApproveAgree(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请审批通过成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请审批通过失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + deliverRequestApproveRefused(id) { + deliverRequestApproveRefused(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请审批驳回成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请审批驳回失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + deliverRequestHandle(id) { + deliverRequestHandle(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请处理成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请处理失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, } } diff --git a/pages/inspect/request/inspectRequest.vue b/pages/inspect/request/inspectRequest.vue index 2eb51254..f08d58a4 100644 --- a/pages/inspect/request/inspectRequest.vue +++ b/pages/inspect/request/inspectRequest.vue @@ -7,7 +7,7 @@ - + @@ -28,10 +28,17 @@ import requestInfoPopup from '@/pages/inspect/coms/requestInfoPopup.vue' import { goHome, - updateTitle + updateTitle, + clearTirmAndWrap } from '@/common/basic.js'; import { getInspectRequestList, + inspectRequestClose, + inspectRequestApprove, + inspectRequestApproveAgree, + inspectRequestApproveRefused, + inspectRequestHandle, + inspectRequestAddAgain } from '@/api/request2.js'; import { @@ -39,7 +46,8 @@ getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, - getDetailAndCloseOption + getDetailAndCloseOption, + getAddAgainOption } from '@/common/array.js'; @@ -64,17 +72,19 @@ detailAndApprovePassAndApproveNoOption: [], detailAndHandleOption: [], detailAndCloseOption: [], + addAgainOption:[], showOptions: [], fromType: "requestType", loadingType: "nomore", }; }, - onReady() { + onLoad() { this.detailOptions = getDetailOption(); + this.addAgainOption = getAddAgainOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), - this.detailAndHandleOption = getDetailAndHandleOption() + this.detailAndHandleOption = getDetailAndHandleOption() this.detailAndCloseOption = getDetailAndCloseOption() }, @@ -124,7 +134,9 @@ this.showOptions = this.detailAndHandleOption; } else if (status == "4") { this.showOptions = this.detailAndCloseOption; - } else { + } else if(status == "5"){ + this.showOptions = this.addAgainOption; + }else { this.showOptions = this.detailOptions; } return this.showOptions @@ -187,21 +199,43 @@ }, 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.inspectRequestHandle(dataContent.id) + }) + } else if (text == "提交审批") { + this.showQuestionMessage("确定要审批当前申请吗?",res=>{ + this.inspectRequestApprove(dataContent.id) + }) + } else if (text=="审批通过") { + 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) { this.checkedWaitTask = state; 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) + }) + }, } } diff --git a/pages/issue/request/issueRequest.vue b/pages/issue/request/issueRequest.vue index 8d7793ce..3a131d9d 100644 --- a/pages/issue/request/issueRequest.vue +++ b/pages/issue/request/issueRequest.vue @@ -42,14 +42,16 @@ issueRequestSubmitApproveRefused, issueRequestSubmitApproveAgree, issueRequestSubmitApprove, - issueRequestHandle + issueRequestHandle, + issueRequestAddAgain } from '@/api/request2.js'; import { getDetailOption, getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, - getDetailAndCloseOption + getDetailAndCloseOption, + getAddAgainOption } from '@/common/array.js'; export default { @@ -75,6 +77,7 @@ detailAndApprovePassAndApproveNoOption: [], detailAndHandleOption: [], detailAndCloseOption: [], + addAgainOption:[], showOptions: [], fromType: "requestType", loadingType: "nomore", @@ -190,7 +193,9 @@ this.showOptions = this.detailAndHandleOption; } else if (status == "4") { this.showOptions = this.detailAndCloseOption; - } else { + } else if(status == "5"){ + this.showOptions = this.addAgainOption; + }else { this.showOptions = this.detailOptions; } return this.showOptions @@ -226,6 +231,10 @@ this.showQuestionMessage("确定要关闭当前申请吗?", res => { this.issueRequestClose(dataContent.id) }) + }else if(text == "重新添加"){ + this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{ + this.issueRequestAddAgain(dataContent.id) + }) } }, @@ -368,12 +377,22 @@ }) }, }, + issueRequestAddAgain(id) { + issueRequestAddAgain(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请重新添加成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请重新添加失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, - requestConfirmsss(action, item) { - uni.navigateTo({ - url: './issueRequestDetail?type=add&item=' + item.id - }); - } } diff --git a/pages/productPutaway/request/putawayRequest.vue b/pages/productPutaway/request/putawayRequest.vue index b76a4c2c..fbb1e7ca 100644 --- a/pages/productPutaway/request/putawayRequest.vue +++ b/pages/productPutaway/request/putawayRequest.vue @@ -43,14 +43,16 @@ productPutawayRequestApprove, productPutawayRequestApproveAgree, productPutawayRequestApproveRefused, - productPutawayRequestHandle + productPutawayRequestHandle, + productPutawayRequestAddAgain } from '@/api/request2.js'; import { getDetailOption, getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, - getDetailAndCloseOption + getDetailAndCloseOption, + getAddAgainOption } from '@/common/array.js'; export default { @@ -75,6 +77,7 @@ detailAndApprovePassAndApproveNoOption: [], detailAndHandleOption: [], detailAndCloseOption: [], + addAgainOption:[], showOptions: [], loadingType: "nomore", @@ -82,6 +85,7 @@ }, onReady() { this.detailOptions = getDetailOption(); + this.addAgainOption = getAddAgainOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), this.detailAndHandleOption = getDetailAndHandleOption() @@ -197,7 +201,9 @@ this.showOptions = this.detailAndHandleOption; } else if (status == "4") { this.showOptions = this.detailAndCloseOption; - } else { + } else if(status == "5"){ + this.showOptions = this.addAgainOption; + }else{ this.showOptions = this.detailOptions; } return this.showOptions @@ -234,6 +240,10 @@ this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ this.productPutawayRequestClose(dataContent.id) }) + }else if(text == "重新添加"){ + this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{ + this.productPutawayRequestAddAgain(dataContent.id) + }) } }, showQuestionMessage(hint,callBack){ @@ -369,6 +379,21 @@ this.showMessage(error) }) }, + productPutawayRequestAddAgain(id) { + productPutawayRequestAddAgain(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请重新添加成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请重新添加失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, } } diff --git a/pages/productionReturn/coms/comReturnCommonRequest.vue b/pages/productionReturn/coms/comReturnCommonRequest.vue index c8798c02..39bc8d79 100644 --- a/pages/productionReturn/coms/comReturnCommonRequest.vue +++ b/pages/productionReturn/coms/comReturnCommonRequest.vue @@ -36,7 +36,8 @@ productionReturnRequestSubmitApprove, productionReturnRequestSubmitApproveAgree, productionReturnRequestSubmitApproveRefused, - productionReturnRequestClose + productionReturnRequestClose, + productionReturnRequestAddAgain } from '@/api/request2.js'; import { goHome, @@ -49,7 +50,8 @@ getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, - getDetailAndCloseOption + getDetailAndCloseOption, + getAddAgainOption } from '@/common/array.js'; export default { @@ -75,6 +77,7 @@ detailAndApprovePassAndApproveNoOption: [], detailAndHandleOption: [], detailAndCloseOption: [], + addAgainOption:[], showOptions: [], loadingType: "nomore", title:"", @@ -103,9 +106,10 @@ mounted() { this.detailOptions = getDetailOption(); + this.addAgainOption = getAddAgainOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), - this.detailAndHandleOption = getDetailAndHandleOption() + this.detailAndHandleOption = getDetailAndHandleOption() this.detailAndCloseOption = getDetailAndCloseOption() this.updateTitle(); this.getList('refresh'); @@ -144,7 +148,7 @@ }, openRequestDetail(item) { uni.navigateTo({ - url: './requestDetail?id=' + item.id + url: './requestDetail?id=' + item.id + '&businessType=' + this.businessType }); }, getList(type) { @@ -220,7 +224,9 @@ this.showOptions = this.detailAndHandleOption; } else if (status == "4") { this.showOptions = this.detailAndCloseOption; - } else { + } else if(status == "5"){ + this.showOptions = this.addAgainOption; + }else { this.showOptions = this.detailOptions; } return this.showOptions @@ -259,6 +265,10 @@ this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ this.productionReturnRequestClose(dataContent.id) }) + }else if(text == "重新添加"){ + this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{ + this.productionReturnRequestAddAgain(dataContent.id) + }) } }, @@ -396,6 +406,21 @@ this.showMessage(error) }) }, + productionReturnRequestAddAgain(id) { + productionReturnRequestAddAgain(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请重新添加成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请重新添加失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, } } diff --git a/pages/purchaseReturn/request/returnRequest.vue b/pages/purchaseReturn/request/returnRequest.vue index 901f6f03..9d7890a4 100644 --- a/pages/purchaseReturn/request/returnRequest.vue +++ b/pages/purchaseReturn/request/returnRequest.vue @@ -41,14 +41,16 @@ purchaseReturnRequestApprove, purchaseReturnRequestApproveAgree, purchaseReturnRequestApproveRefused, - purchaseReturnRequestHandle + purchaseReturnRequestHandle, + purchaseReturnRequestAddAgain } from '@/api/request2.js'; import { getDetailOption, getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, - getDetailAndCloseOption + getDetailAndCloseOption, + getAddAgainOption } from '@/common/array.js'; export default { @@ -74,6 +76,7 @@ detailAndApprovePassAndApproveNoOption: [], detailAndHandleOption: [], detailAndCloseOption: [], + addAgainOption:[], showOptions: [], fromType: "requestType", loadingType: "nomore", @@ -82,9 +85,10 @@ }, onReady() { this.detailOptions = getDetailOption(); + this.addAgainOption = getAddAgainOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), - this.detailAndHandleOption = getDetailAndHandleOption() + this.detailAndHandleOption = getDetailAndHandleOption() this.detailAndCloseOption = getDetailAndCloseOption() }, @@ -190,7 +194,9 @@ this.showOptions = this.detailAndHandleOption; } else if (status == "4") { this.showOptions = this.detailAndCloseOption; - } else { + } else if(status == "5"){ + this.showOptions = this.addAgainOption; + }else { this.showOptions = this.detailOptions; } return this.showOptions @@ -226,6 +232,10 @@ this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ this.purchaseReturnRequestClose(dataContent.id) }) + }else if(text == "重新添加"){ + this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{ + this.purchaseReturnRequestAddAgain(dataContent.id) + }) } }, showQuestionMessage(hint,callBack){ @@ -319,6 +329,21 @@ this.showMessage(error) }) }, + purchaseReturnRequestAddAgain(id) { + purchaseReturnRequestAddAgain(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请重新添加成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请重新添加失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, purchaseReturnRequestApproveAgree(id) { purchaseReturnRequestApproveAgree(id).then(res => { if (res.data) { diff --git a/pages/putaway/request/putawayRequest.vue b/pages/putaway/request/putawayRequest.vue index 3e88b1bb..f07db12f 100644 --- a/pages/putaway/request/putawayRequest.vue +++ b/pages/putaway/request/putawayRequest.vue @@ -32,18 +32,26 @@ import { goHome, - updateTitle + updateTitle, + clearTirmAndWrap } from '@/common/basic.js'; import { getPutawayRequestList, + putawayRequestClose, + putawayRequestApprove, + putawayRequestApproveAgree, + putawayRequestApproveRefused, + putawayRequestHandle, + putawayRequestAddAgain } from '@/api/request2.js'; import { getDetailOption, getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, - getDetailAndCloseOption + getDetailAndCloseOption, + getAddAgainOption } from '@/common/array.js'; export default { @@ -69,6 +77,7 @@ detailAndApprovePassAndApproveNoOption: [], detailAndHandleOption: [], detailAndCloseOption: [], + addAgainOption:[], showOptions: [], fromType: "requestType", loadingType: "nomore", @@ -76,9 +85,10 @@ }, onReady() { this.detailOptions = getDetailOption(); + this.addAgainOption = getAddAgainOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), - this.detailAndHandleOption = getDetailAndHandleOption() + this.detailAndHandleOption = getDetailAndHandleOption() this.detailAndCloseOption = getDetailAndCloseOption() }, @@ -185,7 +195,9 @@ this.showOptions = this.detailAndHandleOption; } else if (status == "4") { this.showOptions = this.detailAndCloseOption; - } else { + } else if(status == "5"){ + this.showOptions = this.addAgainOption; + }else { this.showOptions = this.detailOptions; } return this.showOptions @@ -203,21 +215,44 @@ 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.putawayRequestHandle(dataContent.id) + }) + } else if (text == "提交审批") { + this.showQuestionMessage("确定要审批当前申请吗?",res=>{ + this.putawayRequestApprove(dataContent.id) + }) + } else if (text=="审批通过") { + this.showQuestionMessage("确定要审批通过当前申请吗?",res=>{ + this.putawayRequestApproveAgree(dataContent.id) + }) + } else if (text == "审批驳回") { + this.showQuestionMessage("确定要审批驳回当前申请吗?",res=>{ + this.putawayRequestApproveRefused(dataContent.id) + }) + } else if (text == "关闭") { + this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ + this.putawayRequestClose(dataContent.id) + }) + }else if(text == "重新添加"){ + this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{ + this.putawayRequestAddAgain(dataContent.id) + }) } }, + showQuestionMessage(hint,callBack){ + this.$refs.comMessage.showQuestionMessage(hint, + res => { + if (res) { + callBack() + } + }); + }, + switchChangeWait(state, jobStatus) { this.checkedWaitTask = state; this.status = jobStatus; @@ -258,7 +293,6 @@ }) }, - showMessage(message) { this.$refs.comMessage.showMessage(message, res => { if (res) { @@ -266,6 +300,98 @@ } }); }, + putawayRequestApprove(id) { + putawayRequestApprove(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请提交审批成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请提交审批失败") + } + + }).catch(error => { + this.showMessage(error) + }) + + }, + + putawayRequestClose(id) { + putawayRequestClose(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请关闭成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请关闭失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + putawayRequestAddAgain(id) { + putawayRequestAddAgain(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请重新添加成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请重新添加失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + putawayRequestApproveAgree(id) { + putawayRequestApproveAgree(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请审批通过成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请审批通过失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + putawayRequestApproveRefused(id) { + putawayRequestApproveRefused(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请审批驳回成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请审批驳回失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + putawayRequestHandle(id) { + putawayRequestHandle(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请处理成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请处理失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, } } diff --git a/pages/repleinsh/request/repleinshRequest.vue b/pages/repleinsh/request/repleinshRequest.vue index 4196fbec..cdd22c2f 100644 --- a/pages/repleinsh/request/repleinshRequest.vue +++ b/pages/repleinsh/request/repleinshRequest.vue @@ -110,10 +110,6 @@ }, methods: { - requestConfirm(action, item) { - console.log("提交", action) - console.log("提交2", item) - }, openRequestDetail(item) { uni.navigateTo({ diff --git a/pages/scrap/request/scrapRrequest.vue b/pages/scrap/request/scrapRrequest.vue index 7af80876..b48abdbf 100644 --- a/pages/scrap/request/scrapRrequest.vue +++ b/pages/scrap/request/scrapRrequest.vue @@ -31,7 +31,8 @@ import requestButton from '@/mycomponents/button/requestButton.vue' import { goHome, - updateTitle + updateTitle, + clearTirmAndWrap } from '@/common/basic.js'; import { @@ -40,14 +41,16 @@ scrapRequestClose, scrapRequestApproveAgree, scrapRequestApproveRefused, - scrapRequestHandle + scrapRequestHandle, + scrapRequestAddAgain } from '@/api/request2.js'; import { getDetailOption, getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, - getDetailAndCloseOption + getDetailAndCloseOption, + getAddAgainOption } from '@/common/array.js'; export default { @@ -72,6 +75,7 @@ detailAndApprovePassAndApproveNoOption: [], detailAndHandleOption: [], detailAndCloseOption: [], + addAgainOption:[], showOptions: [], fromType: "requestType", loadingType: "nomore", @@ -80,9 +84,10 @@ }, onReady() { this.detailOptions = getDetailOption(); + this.addAgainOption = getAddAgainOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), - this.detailAndHandleOption = getDetailAndHandleOption() + this.detailAndHandleOption = getDetailAndHandleOption() this.detailAndCloseOption = getDetailAndCloseOption() }, @@ -188,7 +193,9 @@ this.showOptions = this.detailAndHandleOption; } else if (status == "4") { this.showOptions = this.detailAndCloseOption; - } else { + } else if(status == "5"){ + this.showOptions = this.addAgainOption; + }else { this.showOptions = this.detailOptions; } return this.showOptions @@ -200,7 +207,6 @@ }) }, - swipeClick(e, dataContent) { var text = clearTirmAndWrap(e.content.text) if (text == "详情") { @@ -225,6 +231,10 @@ this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ this.scrapRequestClose(dataContent.id) }) + }else if(text == "重新添加"){ + this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{ + this.scrapRequestAddAgain(dataContent.id) + }) } }, showQuestionMessage(hint,callBack){ @@ -361,6 +371,21 @@ this.showMessage(error) }) }, + scrapRequestAddAgain(id) { + scrapRequestAddAgain(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请重新添加成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请重新添加失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, } } diff --git a/pages/unPlanned/request/issueRequest.vue b/pages/unPlanned/request/issueRequest.vue index fea2284c..01dbcb42 100644 --- a/pages/unPlanned/request/issueRequest.vue +++ b/pages/unPlanned/request/issueRequest.vue @@ -43,14 +43,16 @@ unPlannedIssueRequestClose, unPlannedIssueRequestApproveAgree, unPlannedIssueRequestApproveRefused, - unPlannedIssueRequestHandle + unPlannedIssueRequestHandle, + unPlannedIssueRequestAddAgain } from '@/api/request2.js'; import { getDetailOption, getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, - getDetailAndCloseOption + getDetailAndCloseOption, + getAddAgainOption } from '@/common/array.js'; export default { @@ -76,6 +78,7 @@ detailAndApprovePassAndApproveNoOption: [], detailAndHandleOption: [], detailAndCloseOption: [], + addAgainOption:[], showOptions: [], fromType: "requestType", loadingType: "nomore", @@ -84,6 +87,7 @@ }, onReady() { this.detailOptions = getDetailOption(); + this.addAgainOption = getAddAgainOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), this.detailAndHandleOption = getDetailAndHandleOption() @@ -195,7 +199,9 @@ this.showOptions = this.detailAndHandleOption; } else if (status == "4") { this.showOptions = this.detailAndCloseOption; - } else { + } else if(status == "5"){ + this.showOptions = this.addAgainOption; + }else { this.showOptions = this.detailOptions; } return this.showOptions @@ -231,6 +237,10 @@ this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ this.unPlannedIssueRequestClose(dataContent.id) }) + }else if(text == "重新添加"){ + this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{ + this.unPlannedIssueRequestAddAgain(dataContent.id) + }) } }, showQuestionMessage(hint,callBack){ @@ -369,6 +379,21 @@ this.showMessage(error) }) }, + unPlannedIssueRequestAddAgain(id) { + unPlannedIssueRequestAddAgain(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请重新添加成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请重新添加失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, } } diff --git a/pages/unPlanned/request/receiptRequest.vue b/pages/unPlanned/request/receiptRequest.vue index d304ef4c..03986ace 100644 --- a/pages/unPlanned/request/receiptRequest.vue +++ b/pages/unPlanned/request/receiptRequest.vue @@ -42,14 +42,16 @@ unPlannedReceiptRequestClose, unPlannedReceiptRequestApproveAgree, unPlannedReceiptRequestApproveRefused, - unPlannedReceiptRequestHandle + unPlannedReceiptRequestHandle, + unPlannedReceiptRequestAddAgain } from '@/api/request2.js'; import { getDetailOption, getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, - getDetailAndCloseOption + getDetailAndCloseOption, + getAddAgainOption } from '@/common/array.js'; export default { @@ -75,6 +77,7 @@ detailAndApprovePassAndApproveNoOption: [], detailAndHandleOption: [], detailAndCloseOption: [], + addAgainOption:[], showOptions: [], fromType: "requestType", loadingType: "nomore", @@ -83,6 +86,7 @@ }, onReady() { this.detailOptions = getDetailOption(); + this.addAgainOption = getAddAgainOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), this.detailAndHandleOption = getDetailAndHandleOption() @@ -192,7 +196,9 @@ this.showOptions = this.detailAndHandleOption; } else if (status == "4") { this.showOptions = this.detailAndCloseOption; - } else { + } else if(status == "5"){ + this.showOptions = this.addAgainOption; + }else { this.showOptions = this.detailOptions; } return this.showOptions @@ -228,6 +234,10 @@ this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ this.unPlannedReceiptRequestClose(dataContent.id) }) + }else if(text == "重新添加"){ + this.showQuestionMessage("确定要重新添加当前申请吗?",res=>{ + this.unPlannedReceiptRequestAddAgain(dataContent.id) + }) } }, showQuestionMessage(hint,callBack){ @@ -365,6 +375,21 @@ this.showMessage(error) }) }, + unPlannedReceiptRequestAddAgain(id) { + unPlannedReceiptRequestAddAgain(id).then(res => { + if (res.data) { + uni.showToast({ + title: "申请重新添加成功" + }) + this.getList("refresh") + } else { + this.showMessage("申请重新添加失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, } }