From aeb0cc88aae92c89736574c0ac846bd150e2d002 Mon Sep 17 00:00:00 2001 From: lhl Date: Fri, 21 Nov 2025 16:06:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=94=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../moneyManage/receiveDetail/receiveFinance.vue | 48 +++++++++++++++++-- .../moneyManage/receiveDetail/receiveHead.vue | 55 +++++++++++++++++++--- .../moneyManage/receiveDetail/receiveManage.vue | 48 +++++++++++++++++-- .../moneyManage/receiveDetail/receiveService.vue | 54 +++++++++++++++++---- 4 files changed, 183 insertions(+), 22 deletions(-) diff --git a/src/views/moneyManage/receiveDetail/receiveFinance.vue b/src/views/moneyManage/receiveDetail/receiveFinance.vue index 1d844ed..0e10eab 100644 --- a/src/views/moneyManage/receiveDetail/receiveFinance.vue +++ b/src/views/moneyManage/receiveDetail/receiveFinance.vue @@ -15,9 +15,8 @@
所属地区 - - - +
@@ -637,6 +636,9 @@ const tableData = ref([]); const total = ref(0); const pageInfo = ref({ pageSize: 10, pageNum: 1 }); +// 筛选地区树 +const market = ref([]) + // 搜索条件 const searchData = ref({}); const defaultTime = [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]; @@ -873,6 +875,13 @@ const getlist = async () => { else if (activeTab.value === 'done') searchData.value.status = 46; else if (activeTab.value === 'reject') searchData.value.status = 2; + // 地区处理 + const markets = ref(null) + if(searchData.value.markets) { + markets.value = searchData.value.markets[searchData.value.markets.length - 1] + console.log('地区转换', markets.value) + } + const result = await request({ url: '/cashCollection/selectCollection', data: { @@ -885,7 +894,8 @@ const getlist = async () => { paymentCurrency: payCurrencySelect, submitterMarket: receivedMarket, goodsName: goodsName, - market: MarketNameForId(searchData.value.market) + // market: MarketNameForId(searchData.value.market) + market:markets.value } } }); @@ -1260,6 +1270,7 @@ onMounted(async () => { //背景预加载 const bgImg = new Image(); bgImg.src = '/src/assets/receive-recall.png'; + getMarket() }); // 2.10 未使用函数占位(避免报错) @@ -1271,6 +1282,35 @@ const customUpload = () => { }; const handleDatePickerChange = () => { }; const disabledDate = () => false; const handleSortChange = () => { }; +const getMarket = async function () { + try { + const result = await API({ + + url: '/market/selectMarket', + }) + console.log('看看地区树', result) + + const transformTree = (nodes) => { + const allChildren = nodes.flatMap(node => node.children || []); + + return allChildren.map(child => { + const grandchildren = child.children && child.children.length + ? transformTree([child]) + : null; + + return { + value: child.id, + label: child.name, + children: grandchildren + }; + }); + }; + market.value = transformTree(result.data) + console.log('转换后的地区树==============', market.value) + } catch (error) { + console.log('请求失败', error) + } +} const handlePagination = (type, val) => { if (type === 'size') pageInfo.value.pageSize = val; else pageInfo.value.pageNum = val; diff --git a/src/views/moneyManage/receiveDetail/receiveHead.vue b/src/views/moneyManage/receiveDetail/receiveHead.vue index a1dff3f..7529bdf 100644 --- a/src/views/moneyManage/receiveDetail/receiveHead.vue +++ b/src/views/moneyManage/receiveDetail/receiveHead.vue @@ -15,9 +15,11 @@
所属地区 - - - + +
@@ -455,7 +457,7 @@
- + @@ -502,6 +504,9 @@ import _ from 'lodash'; import { Plus } from '@element-plus/icons-vue'; import { startsWith } from './utils/util.js' +// 筛选地区树 +const market = ref([]) + // 总部财务专属组件 import CurrencySelect from '@/components/MoneyManage/CurrencySelect.vue'; @@ -632,7 +637,7 @@ const exportExcel = async function () { const openExportList = () => { getExportList() console.log('daoshiu'); - + exportListVisible.value = true } //获取导出列表 @@ -753,6 +758,13 @@ const getlist = async () => { if (activeTab.value === 'pass') searchData.value.status = 13; else if (activeTab.value === 'done') searchData.value.status = 46; + // 地区处理 + const markets = ref(null) + if (searchData.value.markets) { + markets.value = searchData.value.markets[searchData.value.markets.length - 1] + console.log('地区转换', markets.value) + } + const result = await request({ url: '/cashCollection/selectCollection', data: { @@ -765,7 +777,8 @@ const getlist = async () => { paymentCurrency: payCurrencySelect, submitterMarket: receivedMarket, goodsName: goodsName, - market: MarketNameForId(searchData.value.market) + //market: MarketNameForId(searchData.value.market) + market: markets.value } } }); @@ -1062,6 +1075,7 @@ onMounted(async () => { //背景预加载 const bgImg = new Image(); bgImg.src = '/src/assets/receive-recall.png'; + getMarket() }); // 2.10 未使用函数占位(避免报错) @@ -1072,6 +1086,35 @@ const customUpload = () => { }; const handleDatePickerChange = () => { }; const disabledDate = () => false; const handleSortChange = () => { }; +const getMarket = async function () { + try { + const result = await API({ + + url: '/market/selectMarket', + }) + console.log('看看地区树', result) + + const transformTree = (nodes) => { + const allChildren = nodes.flatMap(node => node.children || []); + + return allChildren.map(child => { + const grandchildren = child.children && child.children.length + ? transformTree([child]) + : null; + + return { + value: child.id, + label: child.name, + children: grandchildren + }; + }); + }; + market.value = transformTree(result.data) + console.log('转换后的地区树==============', market.value) + } catch (error) { + console.log('请求失败', error) + } +} const handlePagination = (type, val) => { if (type === 'size') pageInfo.value.pageSize = val; else pageInfo.value.pageNum = val; diff --git a/src/views/moneyManage/receiveDetail/receiveManage.vue b/src/views/moneyManage/receiveDetail/receiveManage.vue index 1d844ed..1513fc0 100644 --- a/src/views/moneyManage/receiveDetail/receiveManage.vue +++ b/src/views/moneyManage/receiveDetail/receiveManage.vue @@ -15,9 +15,8 @@
所属地区 - - - +
@@ -613,6 +612,9 @@ import _ from 'lodash'; import { Plus } from '@element-plus/icons-vue'; import { startsWith } from './utils/util.js' +// 筛选地区树 +const market = ref([]) + // 地区财务专属组件 import CurrencySelect from '@/components/MoneyManage/CurrencySelect.vue'; @@ -873,6 +875,13 @@ const getlist = async () => { else if (activeTab.value === 'done') searchData.value.status = 46; else if (activeTab.value === 'reject') searchData.value.status = 2; + // 地区处理 + const markets = ref(null) + if (searchData.value.markets) { + markets.value = searchData.value.markets[searchData.value.markets.length - 1] + console.log('地区转换', markets.value) + } + const result = await request({ url: '/cashCollection/selectCollection', data: { @@ -885,7 +894,8 @@ const getlist = async () => { paymentCurrency: payCurrencySelect, submitterMarket: receivedMarket, goodsName: goodsName, - market: MarketNameForId(searchData.value.market) + //market: MarketNameForId(searchData.value.market) + market: markets.value } } }); @@ -1260,6 +1270,7 @@ onMounted(async () => { //背景预加载 const bgImg = new Image(); bgImg.src = '/src/assets/receive-recall.png'; + getMarket() }); // 2.10 未使用函数占位(避免报错) @@ -1271,6 +1282,35 @@ const customUpload = () => { }; const handleDatePickerChange = () => { }; const disabledDate = () => false; const handleSortChange = () => { }; +const getMarket = async function () { + try { + const result = await API({ + + url: '/market/selectMarket', + }) + console.log('看看地区树', result) + + const transformTree = (nodes) => { + const allChildren = nodes.flatMap(node => node.children || []); + + return allChildren.map(child => { + const grandchildren = child.children && child.children.length + ? transformTree([child]) + : null; + + return { + value: child.id, + label: child.name, + children: grandchildren + }; + }); + }; + market.value = transformTree(result.data) + console.log('转换后的地区树==============', market.value) + } catch (error) { + console.log('请求失败', error) + } +} const handlePagination = (type, val) => { if (type === 'size') pageInfo.value.pageSize = val; else pageInfo.value.pageNum = val; diff --git a/src/views/moneyManage/receiveDetail/receiveService.vue b/src/views/moneyManage/receiveDetail/receiveService.vue index 02c130b..78c511e 100644 --- a/src/views/moneyManage/receiveDetail/receiveService.vue +++ b/src/views/moneyManage/receiveDetail/receiveService.vue @@ -16,9 +16,8 @@
所属地区 - - - +
订单状态 @@ -428,6 +427,9 @@ const total = ref(0) // 总条数 const pageInfo = ref({ pageSize: 10, pageNum: 1 }) // 分页信息 const numUnitList = ref(['年', '月']) +// 筛选地区树 +const market = ref([]) + //防止重复点击状态管理 const ifAddDone = ref(false) const ifReAddDone = ref(false) @@ -501,6 +503,13 @@ const getlist = async () => { const cashRoleId = '0' const receivedMarket = '' + // 地区处理 + if (searchData.value.markets) { + searchData.value.market = searchData.value.markets[searchData.value.markets.length - 1] + } else { + searchData.value.market = '' + } + const result = await request({ url: '/cashCollection/selectCollection', data: { @@ -686,7 +695,7 @@ const handleAddForm = async () => { } } - if(addFormData.value.numUnit == ''){ + if (addFormData.value.numUnit == '') { ElMessage.error('请选择产品数量单位'); return; } @@ -730,9 +739,9 @@ const handleEditForm = async () => { ElMessage.error(testGold().message); return; } - if(typeof addFormData.value.activity == 'string'){ + if (typeof addFormData.value.activity == 'string') { console.log('转换前:', addFormData.value.activity); - + addFormData.value.activity = activityList.value.find(item => item.activityName === addFormData.value.activity).id } //单独校验产品数量 @@ -747,7 +756,7 @@ const handleEditForm = async () => { return; } } - if(addFormData.value.numUnit == ''){ + if (addFormData.value.numUnit == '') { ElMessage.error('请选择产品数量单位'); return; } @@ -970,7 +979,7 @@ const submitRefund = async () => { freeGold: (refundFormData.value.freeGold) * 100 || 0, partRefundGold: (refundFormData.value.partRefundGold) * 100 || 0, partRefundFree: (refundFormData.value.partRefundFree) * 100 || 0, - handlingCharge:(refundFormData.value.handlingCharge) * 100 || 0, + handlingCharge: (refundFormData.value.handlingCharge) * 100 || 0, } }) if (result.code == 200) { @@ -1019,13 +1028,42 @@ const getAdminData = async () => { // 支付方式列表(表格筛选用) const paytypeList = ["Stripe-链接收款", "PaymentAsia-链接收款", "Ipay88-链接收款", "银行转账", "刷卡", "现金", "支票", "Grabpay", "Nets", "E-Transfer", "Paypal"] +const getMarket = async function () { + try { + const result = await API({ + url: '/market/selectMarket', + }) + console.log('看看地区树', result) + + const transformTree = (nodes) => { + const allChildren = nodes.flatMap(node => node.children || []); + + return allChildren.map(child => { + const grandchildren = child.children && child.children.length + ? transformTree([child]) + : null; + + return { + value: child.id, + label: child.name, + children: grandchildren + }; + }); + }; + market.value = transformTree(result.data) + console.log('转换后的地区树==============', market.value) + } catch (error) { + console.log('请求失败', error) + } +} // 初始化 onMounted(async () => { await getAdminData() await getActivitys() // 客服角色默认加载列表 getlist() + await getMarket() })