|
|
@ -1,5 +1,6 @@ |
|
|
<script setup> |
|
|
<script setup> |
|
|
import { ref, reactive, onMounted } from 'vue' |
|
|
import { ref, reactive, onMounted } from 'vue' |
|
|
|
|
|
import { useRoute } from 'vue-router' |
|
|
import { ElMessage, ElMessageBox } from 'element-plus' |
|
|
import { ElMessage, ElMessageBox } from 'element-plus' |
|
|
import request from '@/util/http.js' |
|
|
import request from '@/util/http.js' |
|
|
import dayjs from 'dayjs' |
|
|
import dayjs from 'dayjs' |
|
|
@ -7,6 +8,7 @@ import { useI18n } from 'vue-i18n' |
|
|
import { Moneyfunds,refundOnline } from '@/api/cash/financialAccount.js' |
|
|
import { Moneyfunds,refundOnline } from '@/api/cash/financialAccount.js' |
|
|
|
|
|
|
|
|
const { t } = useI18n() |
|
|
const { t } = useI18n() |
|
|
|
|
|
const route = useRoute() |
|
|
|
|
|
|
|
|
const paytypeList = [ |
|
|
const paytypeList = [ |
|
|
t('cash.payMethods.stripe'), |
|
|
t('cash.payMethods.stripe'), |
|
|
@ -247,8 +249,34 @@ const getTagText = (state) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
|
getMarket() |
|
|
|
|
|
|
|
|
// 递归查找地区ID |
|
|
|
|
|
const findValueByLabel = (options, label) => { |
|
|
|
|
|
for (const option of options) { |
|
|
|
|
|
// 简单匹配名称,防止空格等问题,可以trim一下 |
|
|
|
|
|
if (option.label === label || option.label?.trim() === label?.trim()) { |
|
|
|
|
|
return option.value |
|
|
|
|
|
} |
|
|
|
|
|
if (option.children && option.children.length) { |
|
|
|
|
|
const found = findValueByLabel(option.children, label) |
|
|
|
|
|
if (found) return found |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return null |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
|
|
await getMarket() |
|
|
|
|
|
|
|
|
|
|
|
// 处理从工作台跳转过来的地区参数 |
|
|
|
|
|
const regionName = route.query.region |
|
|
|
|
|
if (regionName && marketOptions.value.length) { |
|
|
|
|
|
const matchedId = findValueByLabel(marketOptions.value, regionName) |
|
|
|
|
|
if (matchedId) { |
|
|
|
|
|
// el-cascader 绑定的 markets 是数组 |
|
|
|
|
|
queryParams.markets = [matchedId] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
fetchData() |
|
|
fetchData() |
|
|
}) |
|
|
}) |
|
|
</script> |
|
|
</script> |
|
|
|