From 3bfb1d4a8d82b12537cf2383f631bc17f206cfd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E7=8E=B2?= <8702040+cai-ling@user.noreply.gitee.com> Date: Fri, 15 Nov 2024 15:22:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=B4=A7=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/management/receive-confirm_new.vue | 67 ++++++++++++++++-------- utils/mork2.js | 2 +- utils/request.js | 8 +-- 3 files changed, 51 insertions(+), 26 deletions(-) diff --git a/pages/management/receive-confirm_new.vue b/pages/management/receive-confirm_new.vue index ad1d85b..70a7b4b 100644 --- a/pages/management/receive-confirm_new.vue +++ b/pages/management/receive-confirm_new.vue @@ -99,7 +99,9 @@ {{el.bcshsl}} {{el.zzmc}} {{['否', '是'][Number(el.sfzj)]}} - + + + @@ -148,7 +150,7 @@ import SearchBox from '@/components/SearchBox.vue' import Pagination from '@/components/Pagination.vue' import GridDetail from '@/components/GridDetail.vue' - import {getOrganizationInfo, getWarehouseInfo, receiptPage, receiptBillDetailPage, receiptBillDetailUpdate, receiptBillDetailSetStor, receiptBillConfirm} from '@/utils/getData2.js' + import {getOrganizationInfo, getWarehouseInfo, receiptPage, receiptBillDetailPage, receiptBillDetailUpdate, receiptBillDetailSetStor, receiptBillConfirm} from '@/utils/mork2.js' export default { components: { NavBar, @@ -177,7 +179,9 @@ detailObj: {}, // 详情弹窗 disabled1: false, value2: '', // 收货仓库信息 - range2: [] + range2: [], + raw: '', // 副表格修改前输入框数据 + rawObj: {} // 副表格修改前行数据 } }, onLoad () { @@ -299,9 +303,13 @@ e.subOneChecked = false this._receiptBillDetailPage(e) }, + // 副表格单行收货数量获取焦点 + focusInput (e, el) { + this.raw = el.shsl + }, // 修改副表格单行收货数量 - updateNumkw (e) { - this._receiptBillDetailUpdate(e) + updateNumkw (e, el) { + this._receiptBillDetailUpdate(e, el, 'sl') }, showPop (type, e, obj) { this.popData = [] @@ -315,7 +323,8 @@ this.show = true } else if (type === 2) { // 修改副表格单行收货仓库弹窗 this.show = true - this.popObj = {id: e.djid, iid: obj.id} + this.popObj = e + this.rawObj = obj } }, // 一键设置仓库弹窗->确定 @@ -356,25 +365,41 @@ text = el.text } }) - this.dataList.map(e => { - if (e.djid === this.popObj.id) { - e.subData.map(el => { - if (el.id === this.popObj.iid) { - el.ckbm = this.value2 - el.ckmc = text - } - }) - this.show = false - this._receiptBillDetailUpdate(e) - } - }) + let obj = Object.assign({}, this.rawObj) + obj.ckbm = this.value2 + obj.ckmc = text + this._receiptBillDetailUpdate(this.popObj, obj, 'ck') + this.show = false }, // 副表格单行收货数量和收货仓库接口 - async _receiptBillDetailUpdate (e) { + async _receiptBillDetailUpdate (e, el, type) { try { - let res = await receiptBillDetailUpdate(e.subData) + let res = await receiptBillDetailUpdate(el) if (res.code === 1) { - this._receiptBillDetailPage(e) + this.dataList.map(ele => { + if (e.id === ele.id) { + e.subData.map(elem => { + if (elem.id === el.id) { + if (type === 'ck') { + elem.ckbm = el.ckbm + elem.ckmc = el.ckmc + } + } + }) + } + }) + } else { + this.dataList.map(ele => { + if (e.id === ele.id) { + e.subData.map(elem => { + if (elem.id === el.id) { + if (type === 'sl') { + elem.shsl = this.raw + } + } + }) + } + }) } uni.showToast({ title: res.desc, diff --git a/utils/mork2.js b/utils/mork2.js index e7027d1..0a77004 100644 --- a/utils/mork2.js +++ b/utils/mork2.js @@ -2323,7 +2323,7 @@ export const moveDtlByMoveId = () => { export const receiptBillDetailUpdate = () => { let res = { - code: '1', + code: 1, desc: 'ok' } return res diff --git a/utils/request.js b/utils/request.js index fb1368c..63f762d 100644 --- a/utils/request.js +++ b/utils/request.js @@ -65,10 +65,10 @@ const request = (params) => { content: `${res[1].data.message}`, showCancel: false }) - store.dispatch('delUserInfo', '') - uni.redirectTo({ - url: '/pages/login/login' - }) + // store.dispatch('delUserInfo', '') + // uni.redirectTo({ + // url: '/pages/login/login' + // }) } else if (res[1] && res[1].statusCode === 200) { uni.hideLoading(); let {