diff --git a/src/views/moneyManage/financialAccount/cashFlow.vue b/src/views/moneyManage/financialAccount/cashFlow.vue index 5ad17a5..579099b 100644 --- a/src/views/moneyManage/financialAccount/cashFlow.vue +++ b/src/views/moneyManage/financialAccount/cashFlow.vue @@ -5,23 +5,29 @@ import { ElMessage, ElMessageBox } from 'element-plus' import request from '@/util/http.js' import dayjs from 'dayjs' import { useI18n } from 'vue-i18n' -import { Moneyfunds,refundOnline } from '@/api/cash/financialAccount.js' +import { Moneyfunds, refundOnline } from '@/api/cash/financialAccount.js' +import { useAdminStore } from '@/store/index.js' +import { storeToRefs } from 'pinia' +import _ from 'lodash'; + +const adminStore = useAdminStore() +const { adminData } = storeToRefs(adminStore) const { t } = useI18n() const route = useRoute() const paytypeList = [ - t('cash.payMethods.stripe'), - t('cash.payMethods.paymentAsia'), - t('cash.payMethods.ipay88'), - t('cash.payMethods.bankTransfer'), - t('cash.payMethods.card'), - t('cash.payMethods.cash'), - t('cash.payMethods.check'), - t('cash.payMethods.grabpay'), - t('cash.payMethods.nets'), - t('cash.payMethods.transfer'), - t('cash.payMethods.paypal'), + t('cash.payMethods.stripe'), + t('cash.payMethods.paymentAsia'), + t('cash.payMethods.ipay88'), + t('cash.payMethods.bankTransfer'), + t('cash.payMethods.card'), + t('cash.payMethods.cash'), + t('cash.payMethods.check'), + t('cash.payMethods.grabpay'), + t('cash.payMethods.nets'), + t('cash.payMethods.transfer'), + t('cash.payMethods.paypal'), ] const payPlatformOptions = ref([...paytypeList]) @@ -85,7 +91,7 @@ const fetchData = async () => { const params = { pageNum: queryParams.pageNum, pageSize: queryParams.pageSize, - fundsDTO:{ + fundsDTO: { jwcode: queryParams.jwcode, markets: queryParams.markets, startTime: queryParams.timeRange?.[0] ? dayjs(queryParams.timeRange[0]).format('YYYY-MM-DD HH:mm:ss') : '', @@ -95,7 +101,7 @@ const fetchData = async () => { statuses: queryParams.statuses, } } - + console.log('查询参数:', params) const res = await Moneyfunds(params) if (res.code == 200) { @@ -105,7 +111,7 @@ const fetchData = async () => { } else { ElMessage.error(res.msg || t('elmessage.getDataFailed')) loading.value = false - } + } } catch (error) { console.error(error) loading.value = false @@ -139,18 +145,67 @@ const handleCurrentChange = (val) => { } // 退款操作 -const handleRefund = (row) => { - ElMessageBox.confirm(t('cash.refundConfirmContent', { orderNo: row.systemTradeNo }), t('cash.refundConfirmTitle'), { - confirmButtonText: t('common.confirm'), - cancelButtonText: t('common.cancel'), - type: 'warning' - }).then(() => { - - - ElMessage.success(t('elmessage.refundSubmitSuccess')) - // 刷新列表 - fetchData() - }).catch(() => {}) +const openRefundConfirm = (row) => { + textContent.value = t('common.willRefundOrder') + '?' + refundConfirmDialog.value = true + refundFormData.value = { + ...row, + oldpermanentGold: row.permanentGold,//退款永久金币 + oldfreeGold: row.freeGold,//退款免费金币 + permanentGold: null, + freeGold: null, + } + console.log(row); +} +const openRefundDialog = () => { + refundDialog.value = true + closeConfirmRefund() + +} + +const closeConfirmRefund = () => { + refundConfirmDialog.value = false + textContent.value = '' +} +const refundConfirmDialog = ref(false) +const textContent = ref('') +const refundDialog = ref(false) +const refundFormData = ref({}) + +const handleRefund = async () => { + try { + if (refundFormData.value.refundModel == 1) { + refundFormData.value.permanentGold = refundFormData.value.oldpermanentGold + refundFormData.value.freeGold = refundFormData.value.oldfreeGold + } + let params = { + jwcode: refundFormData.value.jwcode, + name: refundFormData.value.name, + market: refundFormData.value.marketName, + submitterMarket: adminData.value.markets, + remark: refundFormData.value.remark, + originalOrderId: refundFormData.value.id, + refundReason: refundFormData.value.refundReason, + refundModel: refundFormData.value.refundModel, + orderCode: refundFormData.value.orderCode, + submitterId: adminData.value.id, + submitterMarket: adminData.value.markets, + permanentGold: (refundFormData.value.permanentGold) * 100 || 0, + handlingCharge: refundFormData.value.handlingCharge == null ? null : refundFormData.value.handlingCharge * 100, + freeGold: (refundFormData.value.freeGold) * 100 || 0, + } + console.log('这是退款参数:', params); + + const res = await refundOnline(params) + if (res.code == 200) { + refundDialog.value = false + fetchData() + } else { + ElMessage.error(res.msg || '退款失败') + } + } catch (error) { + console.error(error) + } } // ==================== 导出相关逻辑 ==================== @@ -162,10 +217,10 @@ const exportListLoading = ref(false) // 导出Excel const handleExport = async () => { try { - const params = { + const params = { pageNum: queryParams.pageNum, pageSize: queryParams.pageSize, - fundsDTO:{ + fundsDTO: { jwcode: queryParams.jwcode, markets: queryParams.markets, startTime: queryParams.timeRange?.[0] ? dayjs(queryParams.timeRange[0]).format('YYYY-MM-DD HH:mm:ss') : '', @@ -175,15 +230,15 @@ const handleExport = async () => { statuses: queryParams.statuses, } } - + // TODO: 确认导出接口 URL const res = await request({ url: '/export/exportCash', data: params }) - if(res.code == 200){ + if (res.code == 200) { - console.log('导出参数', params) - ElMessage.success(t('elmessage.exportSuccess')) + console.log('导出参数', params) + ElMessage.success(t('elmessage.exportSuccess')) } - + } catch (error) { console.error(error) ElMessage.error(t('elmessage.exportError')) @@ -248,7 +303,9 @@ const getTagText = (state) => { default: return t('elmessage.unknownStatus'); } } - +const throttledsubmitRefund = _.throttle(handleRefund, 5000, { + trailing: false +}) // 递归查找地区ID const findValueByLabel = (options, label) => { for (const option of options) { @@ -348,6 +405,7 @@ onMounted(async () => { + @@ -364,19 +422,19 @@ onMounted(async () => { {{ row.paymentAmount }} {{ row.paymentCurrency }} --> - - + + - - + + - + - + @@ -402,16 +455,9 @@ onMounted(async () => {
- +
@@ -446,21 +492,143 @@ onMounted(async () => { + +
+
+ +
+
+ {{ textContent }} +
+
+ +
+
+ +
+
+ + +
+
+
+ {{ t('common_add.jwcode') }} + +
+
+ {{ t('common_add.customerName') }} + +
+
+ {{ t('common_add.market') }} + +
+
+ {{ t('common_add.activity') }} + +
+
+ {{ t('common_add.productName') }} + +
+
+
+ {{ t('common_add.permanentGold') + }}: + +
+
+ {{ t('common_add.freeGold') }}: + +
+
+
+ {{ t('common_add.payCurrency') }} + +
+
+ {{ t('common_add.payAmount') }} + +
+
+ {{ t('common_add.payMethod') }} + +
+
+ {{ t('common_add.payTime') }} + +
+
+ {{ t('common_add.transferVoucher') }} + + + + + +
+
+ {{ t('common_add.remark') }} + +
+
+
+
+ {{ t('common_add.refundModel') }} + + {{ t('common_add.refundModelAll') }} + {{ t('common_add.refundModelPart') }} + +
+
+
+ {{ t('common_add.permanentGold') + }}: + +
+
+ {{ t('common_add.freeGold') }}: + +
+
+
+ {{ t('common_add.refundReason') }} + +
+
{{ t('common_add.tip') }}
+
+ {{ t('common.reset') }} + {{ t('common.submit') }} +
+
+
+
diff --git a/src/views/moneyManage/financialAccount/performanceAttribution.vue b/src/views/moneyManage/financialAccount/performanceAttribution.vue index 6a5556e..1ae65f0 100644 --- a/src/views/moneyManage/financialAccount/performanceAttribution.vue +++ b/src/views/moneyManage/financialAccount/performanceAttribution.vue @@ -2,11 +2,11 @@ import { ref, reactive, onMounted, toRefs } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import request from '@/util/http.js' -import { storeToRefs } from 'pinia' import dayjs from 'dayjs' import { useI18n } from 'vue-i18n' import { refundOnline,performanceSelect,exportPerformance } from '@/api/cash/financialAccount.js' import {useAdminStore} from '@/store/index.js' +import { storeToRefs } from 'pinia' const adminStore = useAdminStore() const {adminData} = storeToRefs(adminStore) @@ -271,7 +271,7 @@ onMounted(() => { collapse-tags-tooltip :placeholder="t('common.marketPlaceholder')" clearable - style="width: 220px;" + style="width: 8vw;" /> @@ -284,16 +284,14 @@ onMounted(() => { :start-placeholder="t('common.startTime')" :end-placeholder="t('common.endTime')" :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]" - style="width: 350px;" + style="width: 18vw;" /> -
{{ t('common.search') }} {{ t('common.exportExcel') }} {{ t('common.viewExportList') }} {{ t('common.reset') }} -
@@ -409,9 +407,13 @@ onMounted(() => { .label { white-space: nowrap; - margin-right: 10px; - font-weight: bold; - color: #606266; + margin-right: 8px; + min-width: 60px; + text-align: right; + } + + .el-input, .el-select { + width: 8vw; } }