From 179438917a7470c674ed1d62a29835504b7658f1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-369JRHT\\12997" <9> Date: Fri, 27 Oct 2023 18:06:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E8=B4=A7=20=E9=80=80=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/convenienceStore/purchase.js | 8 + fuintAdmin/src/router/index.js | 31 ++- .../convenienceStore/purchase/details.vue | 89 ++++-- .../views/convenienceStore/purchase/index.vue | 101 ++++--- .../views/oilConfig/oilInventory/order.vue | 10 + .../oilConfig/oilPurchase/purchaseOrder.vue | 14 +- .../controller/MtPurchaseController.java | 57 +++- .../MtPurchaseDetailsController.java | 2 +- .../controller/MtReturnsController.java | 118 ++++++++ .../MtReturnsDetailsController.java | 114 ++++++++ .../convenienceSore/dto/MtPurchaseDto.java | 11 + .../convenienceSore/dto/MtReturnsDto.java | 10 + .../convenienceSore/entity/MtPurchase.java | 1 + .../convenienceSore/entity/MtReturns.java | 57 ++++ .../entity/MtReturnsDetails.java | 52 ++++ .../mapper/MtPurchaseMapper.java | 10 + .../mapper/MtReturnsDetailsMapper.java | 93 +++++++ .../mapper/MtReturnsMapper.java | 91 ++++++ .../mapper/xml/MtPurchaseDetailsMapper.xml | 2 +- .../mapper/xml/MtPurchaseMapper.xml | 53 +++- .../mapper/xml/MtReturnsDetailsMapper.xml | 260 ++++++++++++++++++ .../mapper/xml/MtReturnsMapper.xml | 243 ++++++++++++++++ .../service/MtPurchaseService.java | 8 + .../service/MtReturnsDetailsService.java | 64 +++++ .../service/MtReturnsService.java | 62 +++++ .../impl/MtPurchaseDetailsServiceImpl.java | 38 ++- .../service/impl/MtPurchaseServiceImpl.java | 125 +++++++++ .../impl/MtReturnsDetailsServiceImpl.java | 133 +++++++++ .../service/impl/MtReturnsServiceImpl.java | 142 ++++++++++ .../convenienceSore/vo/MtPurchaseVO.java | 13 + .../vo/MtReturnsDetailsVO.java | 13 + .../convenienceSore/vo/MtReturnsVO.java | 13 + 32 files changed, 1945 insertions(+), 93 deletions(-) create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/controller/MtReturnsController.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/controller/MtReturnsDetailsController.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/dto/MtPurchaseDto.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/dto/MtReturnsDto.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtReturns.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtReturnsDetails.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/MtReturnsDetailsMapper.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/MtReturnsMapper.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/MtReturnsDetailsMapper.xml create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/MtReturnsMapper.xml create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/MtReturnsDetailsService.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/MtReturnsService.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtReturnsDetailsServiceImpl.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtReturnsServiceImpl.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/MtPurchaseVO.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/MtReturnsDetailsVO.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/MtReturnsVO.java diff --git a/fuintAdmin/src/api/convenienceStore/purchase.js b/fuintAdmin/src/api/convenienceStore/purchase.js index b8421e9fb..d28fdc039 100644 --- a/fuintAdmin/src/api/convenienceStore/purchase.js +++ b/fuintAdmin/src/api/convenienceStore/purchase.js @@ -4,6 +4,14 @@ import request from '@/utils/request' /** * 订单 */ + +export function getPurchasePageApi(query) { + return request({ + url: '/business/convenience/mtPurchase/getListByPage', + method: 'get', + params: query + }) +} // 新增 export function addPurchaseApi(data) { return request({ diff --git a/fuintAdmin/src/router/index.js b/fuintAdmin/src/router/index.js index c50060370..b0c071dee 100644 --- a/fuintAdmin/src/router/index.js +++ b/fuintAdmin/src/router/index.js @@ -119,6 +119,14 @@ export const constantRoutes = [ ] }, + // { + // path: '/purchase/details/:PpurchaseId/:PorderDate/:PapprovalStatus', + // component: () => import('@/views/convenienceStore/purchase/details'), + // name: 'purchase-details', + // props: true, // 启用路由参数作为组件的props + // meta: { title: '', icon: 'user' } + // } + { path: '/purchase', component: Layout, @@ -126,10 +134,27 @@ export const constantRoutes = [ redirect: 'noredirect', children: [ { - path: 'details', + path: '/purchase/details/:PpurchaseId/:PorderDate/:PapprovalStatus/:orderNumber', component: () => import('@/views/convenienceStore/purchase/details'), - name: 'Profile', - meta: { title: '盘点详情', icon: 'user' } + name: 'purchase-details', + props: true, // 启用路由参数作为组件的props + meta: { title: '进货详情', icon: 'user' } + }, + ] + }, + + { + path: '/returns', + component: Layout, + hidden: true, + redirect: 'noredirect', + children: [ + { + path: '/returns/details/:PreturnsId/:PorderDate/:PapprovalStatus/:orderNumber', + component: () => import('@/views/convenienceStore/returns/details'), + name: 'returns-details', + props: true, // 启用路由参数作为组件的props + meta: { title: '退货详情', icon: 'user' } }, ] }, diff --git a/fuintAdmin/src/views/convenienceStore/purchase/details.vue b/fuintAdmin/src/views/convenienceStore/purchase/details.vue index e76e63a59..443bf9be2 100644 --- a/fuintAdmin/src/views/convenienceStore/purchase/details.vue +++ b/fuintAdmin/src/views/convenienceStore/purchase/details.vue @@ -89,17 +89,17 @@ - + - + - + @@ -228,7 +228,12 @@ import { export default { name: "details", - + props:[ + 'PpurchaseId', + 'PorderNumber', + 'PorderDate', + 'PapprovalStatus' + ], data() { return { detailsList: [], @@ -245,9 +250,9 @@ export default { isRecovery:0, }, purchaseForm: { - orderNumber: "", + orderNumber: null, approvalStatus: "", - orderDate: "", + orderDate: null, totalAmount: 0, //总金额 productQuantity: 0, //商品数量 quantityPurchased: 0 //进货数量 @@ -299,9 +304,32 @@ export default { async created() { + this.purchaseForm.purchaseId = this.$props.PpurchaseId + this.purchaseId = this.$props.PpurchaseId + this.purchaseForm.orderNumber = this.$props.PorderNumber + this.purchaseForm.orderDate = this.$props.PorderDate + this.purchaseForm.approvalStatus = this.$props.PapprovalStatus + this.state = this.$props.PapprovalStatus + + console.log("this.purchaseForm",this.purchaseForm) + + if ( this.state == null) { + this.state = 'await' + } + + if (this.state=='await') { + this.numberInput = false + }else { + this.numberInput = true + } + + if (this.purchaseForm.orderNumber == null) { this.refresh(); } + if (this.purchaseForm.orderDate == null) { + this.purchaseForm.orderDate =new Date() + } this.getDetailsList(); this.getQueryList(); @@ -312,13 +340,14 @@ export default { getPurchaseDetailsPageApi().then(res=>{ this_.detailsList = res.data.records; this.total = res.data.total; - + this.sumMethod(res.data.records); }) }, getCommodityList() { let this_ = this listLJGoods(this_.commodityForm).then(res=>{ this_.commodityList = res.data.records; + this_.sumMethod(res.data.records); // this.total = response.data.total; }) }, @@ -355,12 +384,10 @@ export default { if (flag == 3) { data.unitPrice = subtotalAmount.dividedBy(quantityPurchased); - } - // this.sumMethod(this.detailsList); - - // this.sumMethod(this.orderList) + this.sumMethod(this.detailsList); + console.log("this.detailsList",this.detailsList) // 进行保存 // this.detailsList = data // this.edit() @@ -368,27 +395,26 @@ export default { // 计算header数据 sumMethod(data) { - console.log("sumMethod",data) let this_ = this this_.purchaseForm.totalAmount = data.length - this_.purchaseForm.productQuantity = new BigNumber(0), + this_.purchaseForm.productQuantity = data.length, + this_.purchaseForm.totalAmount = new BigNumber(0), this_.purchaseForm.quantityPurchased = new BigNumber(0), + data.forEach(da => { if (da.unitPrice != null) { - this_.purchaseForm.productQuantity= this_.purchaseForm.productQuantity.plus(da.unitPrice) + this_.purchaseForm.quantityPurchased= this_.purchaseForm.quantityPurchased.plus(da.quantityPurchased) } if (da.subtotalAmount != null) { - this_.purchaseForm.quantityPurchased= this_.purchaseForm.quantityPurchased.plus(da.subtotalAmount) + this_.purchaseForm.totalAmount= this_.purchaseForm.totalAmount.plus(da.subtotalAmount) } }) }, addCommodity () { let this_ = this - - console.log("this.multipleSelection",this.multipleSelection) this.multipleSelection.forEach(mul=>{ let now = { goodsId: mul.id, @@ -404,10 +430,8 @@ export default { this_.detailsList.push(now) }) this_.open = false - console.log("this.multipleSelection",this.multipleSelection) this_.sumMethod(this_.detailsList); - }, // 查询搜索列表信息 @@ -470,12 +494,24 @@ export default { async save(){ let this_ = this + // 保存之前进行判断 + if (this_.purchaseForm.orderNumber == null) { + this.$modal.msgError("进货单号不能为空"); + return -1; + }else if (this_.purchaseForm.orderDate == null) { + this.$modal.msgError("进货时间不能为空"); + return -1; + }else if(this_.detailsList.length<=0) { + this.$modal.msgError("进货单不能为空"); + return -1; + } if (this_.purchaseId == null) { // 新增 await addPurchaseApi(this_.purchaseForm).then(res=>{ this_.purchaseId = res.data.id }).catch(res=>{ + this.$modal.msgError("保存失败"); return; }) }else { @@ -483,23 +519,28 @@ export default { this_.purchaseForm.id = this_.purchaseId await editPurchaseApi(this_.purchaseForm).then(res=> { }).catch(res=>{ + this.$modal.msgError("保存失败"); return; }) } // 批量保存订单 - console.log("::::::::::",this_.detailsList) - this_.detailsList.fill(this_.purchaseId) - console.log("**********",this_.detailsList) + + this_.detailsList.forEach(data=>{ + data.purchaseId = this_.purchaseId + }) await batchProcessingApi(this_.detailsList).then(res=>{ this.$modal.msgSuccess("保存成功"); - }).catch() + this.goToAbout(); + }).catch(res=>{ + this.$modal.msgError("保存失败"); + }) }, // 保存并审核 audit(){ // 保存 - let number = this.saveInventory(); + let number = this.save(); if (number != -1) { // 审核 let fil ={ diff --git a/fuintAdmin/src/views/convenienceStore/purchase/index.vue b/fuintAdmin/src/views/convenienceStore/purchase/index.vue index 8dd802d72..04f574e74 100644 --- a/fuintAdmin/src/views/convenienceStore/purchase/index.vue +++ b/fuintAdmin/src/views/convenienceStore/purchase/index.vue @@ -5,27 +5,27 @@ - - - - - - - - + + + - - - - - - - + + - + 搜索 @@ -58,22 +58,22 @@ v-loading="loading" :data="purchaseList" :default-sort="defaultSort"> - - - - + + + + - 待审核 - 已审核入库 - 已作废 - 已审核 + 待审核 + 已审核入库 + 已作废 + 已审核 - + {{ parseTime(scope.row.orderDate) }} @@ -108,6 +108,8 @@