From fe2554a393fcaa16447d5d11b2d9de096f87a1cd Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Fri, 1 Mar 2024 09:20:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/home.vue | 10 +- pages/login/login.vue | 7 +- pages/management/in-storage.vue | 154 ++++++++++++++++++++----------- pages/management/out-storage.vue | 154 ++++++++++++++++++++----------- utils/getData2.js | 69 ++++++++++++-- 5 files changed, 269 insertions(+), 125 deletions(-) diff --git a/pages/home/home.vue b/pages/home/home.vue index 9f4ff2e..b5fb81a 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -41,8 +41,14 @@ methods: { async _getBillsCount () { let res = await getBillsCount() - this.menuList = [...res] - + if (res.code === 1) { + this.menuList = [...res.result] + } else { + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } }, toPage (e) { let url = '' diff --git a/pages/login/login.vue b/pages/login/login.vue index 14eaf47..200b985 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -112,9 +112,9 @@ this._tabChange(0) }, async toLogin() { - uni.redirectTo({ - url: '/pages/home/home' - }) + // uni.redirectTo({ + // url: '/pages/home/home' + // }) this.disabled = true if (this.loginname === '') { uni.showToast({ @@ -195,6 +195,7 @@ margin-bottom 15px _bis(,'../../static/images/login_tabs_bg.png', 100%, 100%,bottom) .login_tab_item + cursor pointer _font(50rpx,66rpx,#99B1DD,,center) font-family: YouSheBiaoTiHei; padding 0 50rpx 0 10rpx diff --git a/pages/management/in-storage.vue b/pages/management/in-storage.vue index ad56c21..72982d7 100644 --- a/pages/management/in-storage.vue +++ b/pages/management/in-storage.vue @@ -192,25 +192,39 @@ }, async _easOutInBillPage () { let res = await easOutInBillPage(this.val1, this.id, this.queryParams1.pageNum + '', this.queryParams1.pageSize + '') - this.checkArr1 = [] - res.result.map(el => { - this.$set(el, 'checked', false) - }) - this.dataList1 = [...res.result] - this.totalCount1 = Number(res.totalElements) - this.queryParams1.pageSize = Number(res.pageSize) - this.queryParams1.pageNum = Number(res.pageNum) + if (res.code === 1) { + this.checkArr1 = [] + res.result.map(el => { + this.$set(el, 'checked', false) + }) + this.dataList1 = [...res.result] + this.totalCount1 = Number(res.totalElements) + this.queryParams1.pageSize = Number(res.pageSize) + this.queryParams1.pageNum = Number(res.pageNum) + } else { + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } }, async _easOutInBillDetailPage () { let res = await easOutInBillDetailPage(this.code, this.queryParams2.pageNum + '', this.queryParams2.pageSize + '') - this.checkArr2 = [] - res.result.map(el => { - this.$set(el, 'checked', false) - }) - this.dataList2 = [...res.result] - this.totalCount2 = Number(res.totalElements) - this.queryParams2.pageSize = Number(res.pageSize) - this.queryParams2.pageNum = Number(res.pageNum) + if (res.code === 1) { + this.checkArr2 = [] + res.result.map(el => { + this.$set(el, 'checked', false) + }) + this.dataList2 = [...res.result] + this.totalCount2 = Number(res.totalElements) + this.queryParams2.pageSize = Number(res.pageSize) + this.queryParams2.pageNum = Number(res.pageNum) + } else { + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } }, handlePageChange1(page) { this.queryParams1.pageNum = page @@ -247,14 +261,22 @@ return } try { - let res = await easOutInBillUpdate(this.checkArr1) - this.disabled1 = false - this.checkArr1 = [] - this.toSearch() - uni.showToast({ - title: res.desc, - icon: 'none' - }) + let res = await easOutInBillUpdate(this.checkArr1) + if (res.code === 1) { + this.disabled1 = false + this.checkArr1 = [] + this.toSearch() + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } else { + this.disabled1 = false + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } } catch (e) { this.disabled1 = false } @@ -270,34 +292,48 @@ return } try { - let res = await easOutInBillDetailUpdate(this.checkArr2) - this.disabled2 = false - this.checkArr2 = [] - this.queryParams2 = { - pageSize: 10, - pageNum: 1 + let res = await easOutInBillDetailUpdate(this.checkArr2) + if (res.code === 1) { + this.disabled2 = false + this.checkArr2 = [] + this.queryParams2 = { + pageSize: 10, + pageNum: 1 + } + this.currentPage2 = 1 + this._easOutInBillDetailPage() + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } else { + this.disabled2 = false + uni.showToast({ + title: res.desc, + icon: 'none' + }) } - this.currentPage2 = 1 - this._easOutInBillDetailPage() - uni.showToast({ - title: res.desc, - icon: 'none' - }) } catch (e) { this.disabled2 = false } }, async _queryInventoryInfo () { let res = await queryInventoryInfo(this.checkArr2) - res.result.map(el => { - this.$set(el, 'checked', false) - this.$set(el, 'yqty', el.qty) - }) - this.dataList3 = [...res.result] - this.show = true + if (res.code ===1) { + res.result.map(el => { + this.$set(el, 'checked', false) + this.$set(el, 'yqty', el.qty) + }) + this.dataList3 = [...res.result] + this.show = true + } else { + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } }, handleBlur (ele) { - console.log(this.dataList3) ele.checked = true let index = '' let obj = {} @@ -317,19 +353,27 @@ return } try { - let res = await easOutInBillDetailUpdate(this.dataList3) - this.disabled3 = false - this.show = false - this.queryParams2 = { - pageSize: 10, - pageNum: 1 + let res = await easOutInBillDetailUpdate(this.dataList3) + if (res.code === 1) { + this.disabled3 = false + this.show = false + this.queryParams2 = { + pageSize: 10, + pageNum: 1 + } + this.currentPage2 = 1 + this._easOutInBillDetailPage() + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } else { + this.disabled3 = false + uni.showToast({ + title: res.desc, + icon: 'none' + }) } - this.currentPage2 = 1 - this._easOutInBillDetailPage() - uni.showToast({ - title: res.desc, - icon: 'none' - }) } catch (e) { this.disabled3 = false } diff --git a/pages/management/out-storage.vue b/pages/management/out-storage.vue index 046a496..099825d 100644 --- a/pages/management/out-storage.vue +++ b/pages/management/out-storage.vue @@ -192,25 +192,39 @@ }, async _easOutInBillPage () { let res = await easOutInBillPage(this.val1, this.id, this.queryParams1.pageNum + '', this.queryParams1.pageSize + '') - this.checkArr1 = [] - res.result.map(el => { - this.$set(el, 'checked', false) - }) - this.dataList1 = [...res.result] - this.totalCount1 = Number(res.totalElements) - this.queryParams1.pageSize = Number(res.pageSize) - this.queryParams1.pageNum = Number(res.pageNum) + if (res.code === 1) { + this.checkArr1 = [] + res.result.map(el => { + this.$set(el, 'checked', false) + }) + this.dataList1 = [...res.result] + this.totalCount1 = Number(res.totalElements) + this.queryParams1.pageSize = Number(res.pageSize) + this.queryParams1.pageNum = Number(res.pageNum) + } else { + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } }, async _easOutInBillDetailPage () { let res = await easOutInBillDetailPage(this.code, this.queryParams2.pageNum + '', this.queryParams2.pageSize + '') - this.checkArr2 = [] - res.result.map(el => { - this.$set(el, 'checked', false) - }) - this.dataList2 = [...res.result] - this.totalCount2 = Number(res.totalElements) - this.queryParams2.pageSize = Number(res.pageSize) - this.queryParams2.pageNum = Number(res.pageNum) + if (res.code === 1) { + this.checkArr2 = [] + res.result.map(el => { + this.$set(el, 'checked', false) + }) + this.dataList2 = [...res.result] + this.totalCount2 = Number(res.totalElements) + this.queryParams2.pageSize = Number(res.pageSize) + this.queryParams2.pageNum = Number(res.pageNum) + } else { + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } }, handlePageChange1(page) { this.queryParams1.pageNum = page @@ -247,14 +261,22 @@ return } try { - let res = await easOutInBillUpdate(this.checkArr1) - this.disabled1 = false - this.checkArr1 = [] - this.toSearch() - uni.showToast({ - title: res.desc, - icon: 'none' - }) + let res = await easOutInBillUpdate(this.checkArr1) + if (res.code === 1) { + this.disabled1 = false + this.checkArr1 = [] + this.toSearch() + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } else { + this.disabled1 = false + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } } catch (e) { this.disabled1 = false } @@ -270,34 +292,48 @@ return } try { - let res = await easOutInBillDetailUpdate(this.checkArr2) - this.disabled2 = false - this.checkArr2 = [] - this.queryParams2 = { - pageSize: 10, - pageNum: 1 + let res = await easOutInBillDetailUpdate(this.checkArr2) + if (res.code === 1) { + this.disabled2 = false + this.checkArr2 = [] + this.queryParams2 = { + pageSize: 10, + pageNum: 1 + } + this.currentPage2 = 1 + this._easOutInBillDetailPage() + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } else { + this.disabled2 = false + uni.showToast({ + title: res.desc, + icon: 'none' + }) } - this.currentPage2 = 1 - this._easOutInBillDetailPage() - uni.showToast({ - title: res.desc, - icon: 'none' - }) } catch (e) { this.disabled2 = false } }, async _queryInventoryInfo () { let res = await queryInventoryInfo(this.checkArr2) - res.result.map(el => { - this.$set(el, 'checked', false) - this.$set(el, 'yqty', el.qty) - }) - this.dataList3 = [...res.result] - this.show = true + if (res.code ===1) { + res.result.map(el => { + this.$set(el, 'checked', false) + this.$set(el, 'yqty', el.qty) + }) + this.dataList3 = [...res.result] + this.show = true + } else { + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } }, handleBlur (ele) { - console.log(this.dataList3) ele.checked = true let index = '' let obj = {} @@ -317,19 +353,27 @@ return } try { - let res = await easOutInBillDetailUpdate(this.dataList3) - this.disabled3 = false - this.show = false - this.queryParams2 = { - pageSize: 10, - pageNum: 1 + let res = await easOutInBillDetailUpdate(this.dataList3) + if (res.code === 1) { + this.disabled3 = false + this.show = false + this.queryParams2 = { + pageSize: 10, + pageNum: 1 + } + this.currentPage2 = 1 + this._easOutInBillDetailPage() + uni.showToast({ + title: res.desc, + icon: 'none' + }) + } else { + this.disabled3 = false + uni.showToast({ + title: res.desc, + icon: 'none' + }) } - this.currentPage2 = 1 - this._easOutInBillDetailPage() - uni.showToast({ - title: res.desc, - icon: 'none' - }) } catch (e) { this.disabled3 = false } diff --git a/utils/getData2.js b/utils/getData2.js index 1b08339..c5564bc 100644 --- a/utils/getData2.js +++ b/utils/getData2.js @@ -69,17 +69,66 @@ export const easOutInBillDetailUpdate = (arr) => request({ // return res // } // export const getBillsCount = (area) => { -// let res = [ -// {name: '销售出库', djlx: 'XSCKD', ywlx: 'OUT', counts: '1'}, -// {name: '采购退货出库', djlx: 'CGTHD', ywlx: 'OUT', counts: '1'}, -// {name: '调拨出库', djlx: 'DBCKD', ywlx: 'OUT', counts: '1'}, -// {name: '委外出库', djlx: 'WWFLD', ywlx: 'OUT', counts: '1'}, -// {name: '生产出库', djlx: 'LLCKD', ywlx: 'OUT', counts: '1'}, -// {name: '采购入库', djlx: 'CGRKD', ywlx: 'IN', counts: '1'}, -// {name: '生产退料入库', djlx: 'LLTHD', ywlx: 'IN', counts: '1'}, -// {name: '调拨入库', djlx: 'DBRKD', ywlx: 'IN', counts: '1'}, -// {name: '委外入库', djlx: 'WWRKD', ywlx: 'IN', counts: '1'} +// let res = { +// "code": 1, +// "desc": "操作成功", +// "result": [ +// { +// "djlx": "CGRKD", +// "ywlx": "IN", +// "name": "采购入库", +// "counts": "1" +// }, +// { +// "djlx": "CGTHD", +// "ywlx": "OUT", +// "name": "采购退货出库", +// "counts": "0" +// }, +// { +// "djlx": "DBCKD", +// "ywlx": "OUT", +// "name": "调拨出库", +// "counts": "0" +// }, +// { +// "djlx": "DBRKD", +// "ywlx": "IN", +// "name": "调拨入库", +// "counts": "0" +// }, +// { +// "djlx": "LLCKD", +// "ywlx": "OUT", +// "name": "生产出库", +// "counts": "0" +// }, +// { +// "djlx": "LLTHD", +// "ywlx": "IN", +// "name": "生产退料入库", +// "counts": "0" +// }, +// { +// "djlx": "WWFLD", +// "ywlx": "OUT", +// "name": "委外出库", +// "counts": "0" +// }, +// { +// "djlx": "WWRKD", +// "ywlx": "IN", +// "name": "委外入库", +// "counts": "0" +// }, +// { +// "djlx": "XSCKD", +// "ywlx": "OUT", +// "name": "销售出库", +// "counts": "0" +// } // ] +// } // return res // } // export const easOutInBillPage = (size, page, fuzzy, djlx) => {