From f342af4604b52310c32df7c51bc836ae6b2515e7 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Mon, 4 Dec 2023 13:58:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=87=87=E8=B4=AD=E9=80=80=E8=B4=A7?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=B7=BB=E5=8A=A0=E5=AE=A1=E6=89=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/request2.js | 63 ++++++++ common/basic.js | 4 + .../request/requestListCommonInfo.vue | 6 +- pages/count/job/countJob.vue | 2 +- pages/purchaseReturn/job/returnJob.vue | 3 +- .../purchaseReturn/request/returnRequest.vue | 137 ++++++++++++++++-- .../request/returnRequestDetail.vue | 1 + 7 files changed, 194 insertions(+), 22 deletions(-) diff --git a/api/request2.js b/api/request2.js index e1b48b61..4a005e5d 100644 --- a/api/request2.js +++ b/api/request2.js @@ -618,6 +618,67 @@ export function getPurchaseReturnRequestDetail(id) { }); } +/** + * 采购退货申请 关闭任务 + * @param {*} params + */ +export function purchaseReturnRequestClose(id) { + return request({ + url: baseApi + "/wms/purchasereturn-request-main/close?id="+id, + method: "put", + data: {}, + }); +} + +/** + * 采购退货申请 提交审批 + * @param {*} params + */ +export function purchaseReturnRequestSubmitApprove(id) { + return request({ + url: baseApi + "/wms/purchasereturn-request-main/submit?id="+id, + method: "put", + data: {}, + }); +} + +/** + * 采购退货申请 提交审批通过 + * @param {*} params + */ +export function purchaseReturnRequestSubmitApproveAgree(id) { + return request({ + url: baseApi + "/wms/purchasereturn-request-main/agree?id="+id, + method: "put", + data: {}, + }); +} + +/** + * 采购退货申请 审批驳回 + * @param {*} params + */ +export function purchaseReturnRequestSubmitApproveRefused(id) { + return request({ + url: baseApi + "/wms/purchasereturn-request-main/refused?id="+id, + method: "put", + data: {}, + }); +} + +/** + * 采购退货申请 处理 + * @param {*} params + */ +export function purchaseReturnRequestHandle(id) { + return request({ + url: baseApi + "/wms/purchasereturn-request-main/handle?id="+id, + method: "put", + data: {}, + }); +} + + /** * 采购退货申请 提交 * @param {*} params @@ -630,6 +691,8 @@ export function purchaseReturnRequestSubmit(params) { }); } + + /** * 采购退货 记录提交 * @param {*} params diff --git a/common/basic.js b/common/basic.js index 2d38eede..45b24ed5 100644 --- a/common/basic.js +++ b/common/basic.js @@ -875,3 +875,7 @@ export function updateTitle(title) { title: title }) } + +export function clearTirmAndWrap(content) { + return content.replace(/<\/?.+?\/?>|\r|\n|\s*/g,'') +} diff --git a/mycomponents/request/requestListCommonInfo.vue b/mycomponents/request/requestListCommonInfo.vue index e9d490a5..2459a406 100644 --- a/mycomponents/request/requestListCommonInfo.vue +++ b/mycomponents/request/requestListCommonInfo.vue @@ -50,11 +50,11 @@ type:"dateTime" },{ title: '最后更新时间', - content: this.dataContent.lastModificationTime, + content: this.dataContent.updateTime, type:"dateTime" },{ - title: '最后更新者Id', - content: this.dataContent.lastModiferName + title: '最后更新者用户名', + content: this.dataContent.updater }, { title: '并发乐观锁', diff --git a/pages/count/job/countJob.vue b/pages/count/job/countJob.vue index fccafabe..4b196021 100644 --- a/pages/count/job/countJob.vue +++ b/pages/count/job/countJob.vue @@ -278,7 +278,7 @@ }, showMessage(message) { - this.$refs.comMessage.showWaringMessage(message, res => { + this.$refs.comMessage.showErrorMessage(message, res => { if (res) { } diff --git a/pages/purchaseReturn/job/returnJob.vue b/pages/purchaseReturn/job/returnJob.vue index 84289555..1206811c 100644 --- a/pages/purchaseReturn/job/returnJob.vue +++ b/pages/purchaseReturn/job/returnJob.vue @@ -199,8 +199,7 @@ this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?", res => { if (res) { - var id = dataContent.id - this.cancleJob(id); + this.cancleJob(dataContent.id); } }); } diff --git a/pages/purchaseReturn/request/returnRequest.vue b/pages/purchaseReturn/request/returnRequest.vue index 3023abe6..45f1d80e 100644 --- a/pages/purchaseReturn/request/returnRequest.vue +++ b/pages/purchaseReturn/request/returnRequest.vue @@ -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, @@ -81,7 +87,7 @@ this.detailOptions = getDetailOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), - this.detailAndHandleOption = getDetailAndHandleOption() + this.detailAndHandleOption = getDetailAndHandleOption() this.detailAndCloseOption = getDetailAndCloseOption() }, @@ -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.includes("审批通过")) { + 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) + }) + }, + + + } } diff --git a/pages/purchaseReturn/request/returnRequestDetail.vue b/pages/purchaseReturn/request/returnRequestDetail.vue index e0fe32d1..d4b23b4a 100644 --- a/pages/purchaseReturn/request/returnRequestDetail.vue +++ b/pages/purchaseReturn/request/returnRequestDetail.vue @@ -20,6 +20,7 @@