From dd420cfd53f1ea6b65caf3bebf322f22da55bbe3 Mon Sep 17 00:00:00 2001 From: FrancisHu <2756004617@qq.com> Date: Thu, 18 Jul 2024 10:30:47 +0800 Subject: [PATCH] =?UTF-8?q?7.18=E5=AE=81=E5=A4=8F=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=80=80=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/http.js | 4 +- pages.json | 6 +- .../backMaterialReceive.vue | 3 +- .../backMaterialReceiveDetail.vue | 99 +++++++++++++++++-- .../fetchMaterialOutStoreDetail.vue | 75 +++++++------- 5 files changed, 139 insertions(+), 48 deletions(-) diff --git a/apis/http.js b/apis/http.js index a9c97b8..03504e9 100644 --- a/apis/http.js +++ b/apis/http.js @@ -10,7 +10,7 @@ class HttpConfig { // baseUrl = "http://10.40.92.8:8080" // baseUrl = "http://10.40.92.52:28080" // baseUrl = "http://10.40.92.78:28080" - // baseUrl = "http://192.168.2.248:28080" + // baseUrl = "http://192.168.2.167:28080" // baseUrl = "https://z.csgmall.com.cn/gl" // baseUrl = "http://10.40.92.141:28080" // #endif @@ -115,7 +115,7 @@ class HttpConfig { }, backMaterialReceive: { backMaterialReceiveList: '/backReceive/getbackReceiveList', // 获取退料接收列表 - backMaterialReceiveDetail: '/backReceive/receiveView', + backMaterialReceiveDetail: '/backReceive/receiveViewWeb', backMaterialSetNumBack: '/backReceive/setNumBack', backMaterialQrcodeQuery:'/backReceive/qrcodeQuery', backMaterialSetCodeBack:'/backReceive/setCodeBack', diff --git a/pages.json b/pages.json index e118abb..b5c1807 100644 --- a/pages.json +++ b/pages.json @@ -286,8 +286,8 @@ }, { "path": "pages/backMaterialReceiveDetail/backMaterialReceiveDetail", "style": { - "navigationBarTitleText": "退料接收明细", - "app-plus": { + "navigationBarTitleText": "退料接收明细" + /* "app-plus": { "titleNView": { "buttons": [ { @@ -298,7 +298,7 @@ } ] } - } + } */ } }, { diff --git a/pages/backMaterialReceive/backMaterialReceive.vue b/pages/backMaterialReceive/backMaterialReceive.vue index 8317d0b..ba17fcb 100644 --- a/pages/backMaterialReceive/backMaterialReceive.vue +++ b/pages/backMaterialReceive/backMaterialReceive.vue @@ -277,7 +277,8 @@ import { basePath } from '../../public' } }, onShow() { - this.getList('') + this.fetchMaterialList = [] + this.searchKeyword(this.exitIpt) }, onReachBottom() { if (this.fetchMaterialList.length >= this.pageTotal) return; diff --git a/pages/backMaterialReceiveDetail/backMaterialReceiveDetail.vue b/pages/backMaterialReceiveDetail/backMaterialReceiveDetail.vue index 1a96db2..a3a68d8 100644 --- a/pages/backMaterialReceiveDetail/backMaterialReceiveDetail.vue +++ b/pages/backMaterialReceiveDetail/backMaterialReceiveDetail.vue @@ -9,6 +9,7 @@ @@ -40,6 +41,12 @@ 全选 + + 完成退料 + @@ -111,6 +118,9 @@ export default { data() { return { + pageNum: 1, + pageSize: 10, + pageTotal: 0, allChecked: false, fetchList: [ @@ -326,17 +336,21 @@ let that = this console.log(that.detailsId); that.$api.backMaterialReceive.backMaterialReceiveDetail({ - id: that.detailsId + id: that.detailsId, + taskId: that.taskId, + pageNum: that.pageNum, + pageSize: that.pageSize }).then(res => { console.log(res); if (res.data.code == 200) { - res.data.data.forEach(item => { - item.checked = false + that.pageTotal = res.data.data.total + res.data.data.rows.forEach(item => { + if (item.backStatus == '0') item.checked = false }) - /* for (let i = 0; i < res.data.data.length; i++) { - res.data.data[i].num = res.data.data[i].num.split('.')[0] - } */ - that.fetchList = res.data.data + /* res.data.data.forEach(item => { + item.checked = false + }) */ + that.fetchList = [...that.fetchList, ...res.data.data.rows] console.log(that.fetchList); } }).catch(err => { @@ -394,6 +408,61 @@ }, 0); console.log("numaccumulator", sum) return sum + }, + endBackMaFn (obj) { + let that = this + console.log(obj); + // 完成退料 + that.$api.backMaterialReceive.backReceiveEndBack(obj).then(res => { + console.log(res) + if (res.data.code == 200) { + uni.showToast({ + icon: 'none', + title: res.data.msg + }) + uni.navigateBack() + } else { + uni.showToast({ + icon: 'none', + title: res.data.msg + }) + } + }).catch(err=>{ + console.log(err); + }) + }, + totalBack () { + let that = this + let submitList = that.fetchList.filter(item => item.checked == true && Number(item.num) == 0) + if (submitList.length != 0) { + console.log(submitList); + let typeIdStr + let typeIdArr = [] + submitList.forEach(item => { + typeIdArr.push(item.modelId) + }) + typeIdStr = typeIdArr.join(',') + console.log(typeIdStr); + uni.showModal({ + title: '完成退料', + content: '确认完成退料吗?', + success: (res) => { + if (res.confirm) { + that.endBackMaFn({ + createBy: uni.getStorageSync('userInfo').userid, + parentId: submitList[0].id, + taskId: submitList[0].taskId, + typeId: typeIdStr + }) + } + } + }) + } else { + uni.showToast({ + icon: 'none', + title: '未选中完成退料项!' + }) + } } }, onLoad(params) { @@ -403,6 +472,7 @@ this.taskStatus = params.taskStatus }, onShow() { + this.fetchList = [] this.initListData() }, onNavigationBarButtonTap(ev) { @@ -426,6 +496,11 @@ title: '未选中完成退料项!' }) } + }, + onReachBottom() { + if (this.fetchList.length >= this.pageTotal) return; + this.pageNum++ + this.initListData() } } @@ -510,12 +585,20 @@ padding: 15rpx 30rpx; background-color: #fff; display: flex; - justify-content: left; + justify-content: space-between; align-items: center; .checked{ display: flex; align-items: center; } + .exam{ + box-sizing: border-box; + padding: 10rpx 50rpx; + border-radius: 30rpx; + background-color: #3788FF; + font-size: 14px; + color: #fff; + } } .popup1 { diff --git a/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail.vue b/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail.vue index a8adc03..83071f1 100644 --- a/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail.vue +++ b/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail.vue @@ -329,41 +329,48 @@ }, finishOut () { let that = this - uni.showModal({ - title: '完成出库', - content: '确定将此种机具完成出库吗?', - confirmText: '出库', - success: (res) => { - if (res.confirm) { - that.showLoading = true - console.log(that.infoList); - that.$api.fetchMaterialOutStore.directOutStore({ - id: that.infoList.parentId, - typeId: that.infoList.typeId - }).then(res => { - console.log(res); - if (res.data.code == 200) { - that.showLoading = false - uni.showToast({ - icon: 'none', - title: res.data.msg, - success: () => { - uni.navigateBack() - } - }) - } else { - that.showLoading = false - uni.showToast({ - icon: 'none', - title: res.data.msg - }) - } - }).catch(err => { - console.log(err); - }) + if (that.infoList.outNum > 0) { + uni.showToast({ + icon: 'none', + title: '该设备待出库数量不为0!' + }) + } else { + uni.showModal({ + title: '完成出库', + content: '确定将此种机具完成出库吗?', + confirmText: '出库', + success: (res) => { + if (res.confirm) { + that.showLoading = true + console.log(that.infoList); + that.$api.fetchMaterialOutStore.directOutStore({ + id: that.infoList.parentId, + typeId: that.infoList.typeId + }).then(res => { + console.log(res); + if (res.data.code == 200) { + that.showLoading = false + uni.showToast({ + icon: 'none', + title: res.data.msg, + success: () => { + uni.navigateBack() + } + }) + } else { + that.showLoading = false + uni.showToast({ + icon: 'none', + title: res.data.msg + }) + } + }).catch(err => { + console.log(err); + }) + } } - } - }) + }) + } } }, onLoad(params) {