You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

759 lines
28 KiB

5 months ago
5 months ago
5 months ago
3 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
7 months ago
5 months ago
5 months ago
6 months ago
7 months ago
7 months ago
7 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <el-card style="margin-bottom: 0.5vh;background-color: rgb(243,250,254);">
  3. <div class="condition1">
  4. <div class="search">
  5. <el-text size="large" style="width:7vw;">{{ t('common.name') }}</el-text>
  6. <el-input v-model="searchForm.name" :placeholder="t('common.pleaseInputName')" style="width:9vw;" clearable />
  7. </div>
  8. <div class="search">
  9. <el-text size="large" style="width:7vw;">{{ t('common.jwcode') }}</el-text>
  10. <el-input v-model="searchForm.jwcode" :placeholder="t('common.jwcodePlaceholder')" style="width:9vw;"
  11. clearable />
  12. </div>
  13. <div class="search">
  14. <el-text size="large" style="width:7vw;">{{ t('common.productName') }}</el-text>
  15. <el-cascader v-model="searchForm.goodsName" :props="{ multiple: false, emitPath: false }" :show-all-levels="false" collapse-tags collapse-tags-tooltip :options="productList" style="width: 10vw;" :placeholder="t('common.productNamePlaceholder')" clearable />
  16. </div>
  17. <div class="search" v-if="adminData.markets === t('common.markets.headquarter')">
  18. <el-text size="large" style="width:7vw;">{{ t('common.market') }}</el-text>
  19. <el-cascader style="width: 9vw;" v-model="searchForm.markets" :options="market"
  20. :placeholder="t('common.marketPlaceholder')" clearable />
  21. </div>
  22. <div class="search">
  23. <el-text size="large" style="width:9vw;">{{ t('common.refundCurrency') }}</el-text>
  24. <el-select v-model="searchForm.refundCurrency" style="width:9vw;" clearable>
  25. <el-option v-for="item in currencies" :key="item" :label="item" :value="item" />
  26. </el-select>
  27. </div>
  28. </div>
  29. <div class="condition1">
  30. <div class="search2">
  31. <el-text size="large" style="width:7vw;">{{ t('common.refundMethod') }}</el-text>
  32. <el-select v-model="searchForm.refundChannels" style="width:9vw;" clearable>
  33. <el-option v-for="item in channelOptions" :key="item" :label="item" :value="item" />
  34. </el-select>
  35. </div>
  36. <div class="search2">
  37. <el-text size="large" style="width:7vw;">{{ t('common.orderStatus') }}</el-text>
  38. <el-select v-model="searchForm.statuses" style="width:9vw;" clearable>
  39. <el-option v-for="item in statusList" :label="item" :value="item" :key="item" />
  40. </el-select>
  41. </div>
  42. <div class="search2" style="width: 27.5vw;">
  43. <el-text size="large" style="width:6.5vw;">{{ t('common.refundTime') }}</el-text>
  44. <el-date-picker v-model="dateRange" type="datetimerange" :range-separator="t('common.to')"
  45. :start-placeholder="t('common.startTime')" :end-placeholder="t('common.endTime')" style="width:18vw;"
  46. clearable :disabled-date="disabledDate" :default-time="defaultTime" />
  47. </div>
  48. <div>
  49. <el-button type="primary" size="medium" @click="getRefund">{{ t('common.search') }}</el-button>
  50. <el-button type="success" size="medium" @click="reset">{{ t('common.reset') }}</el-button>
  51. </div>
  52. </div>
  53. </el-card>
  54. <el-card style="background-color: rgb(231,244,253);height:80vh;">
  55. <el-table ref="tableRef" :data="tableData" style="height:70vh;width:82vw;">
  56. <el-table-column type="index" :label="t('common_list.id')" width="60" fixed="left">
  57. <template #default="scope">
  58. {{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }}
  59. </template>
  60. </el-table-column>
  61. <el-table-column prop="jwcode" label="Homily ID" width="120" fixed="left" />
  62. <el-table-column prop="name" :label="t('common_list.name')" width="120" fixed="left" show-overflow-tooltip />
  63. <el-table-column prop="marketName" :label="t('common_list.market')" width="120" />
  64. <el-table-column prop="goodsName" :label="t('common_list.productName')" width="120" />
  65. <el-table-column prop="goodsNum" :label="t('common_list.productNum')" width="130px">
  66. <template #default="scope">
  67. <!-- <span v-if="scope.row.goodsName == t('common_list.goldRecharge')">{{
  68. scope.row.permanentGold }} {{ t('cash.unit') }}</span> -->
  69. <span>{{ scope.row.goodsNum }} {{ scope.row.numUnit }}</span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column prop="refundModel" :label="t('common_list.refundModel')" width="140">
  73. <template #default="scope">
  74. {{ scope.row.refundModel === 1 ? t('common_list.refundModelPart') : t('common_list.refundModelAll') }}
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="refundCurrency" :label="t('common_list.refundCurrency')" width="120">
  78. <template #default="scope">
  79. <div v-if="!scope.row.refundCurrency">
  80. <text style="color: #FA5A1E;">{{ t('common_list.toSupply') }}</text>
  81. </div>
  82. </template>
  83. </el-table-column>
  84. <el-table-column prop="refundAmount" :label="t('common_list.refundAmount')" width="120">
  85. <template #default="scope">
  86. <div v-if="!scope.row.refundAmount">
  87. <text style="color: #FA5A1E;">{{ t('common_list.toSupply') }}</text>
  88. </div>
  89. </template>
  90. </el-table-column>
  91. <el-table-column prop="refundChannels" :label="t('common_list.refundChannels')" width="120">
  92. <template #default="scope">
  93. <div v-if="!scope.row.refundChannels">
  94. <text style="color: #FA5A1E;">{{ t('common_list.toSupply') }}</text>
  95. </div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column prop="refundVoucher" :label="t('common_list.refundVoucher')" width="120">
  99. <template #default="scope">
  100. <el-image v-if="scope.row.refundVoucher" :src="scope.row.refundVoucher"
  101. @click="previewImage(scope.row.refundVoucher)"
  102. style="width: 40px; height: 40px; cursor: pointer;z-index: 99999;" fit="cover" />
  103. <span v-else style="color: #FA5A1E;">{{ t('common_list.toSupply') }}</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column prop="refundTime" :label="t('common_list.refundTime')" width="180">
  107. <template #default="scope">
  108. <div v-if="!scope.row.refundTime">
  109. <text style="color: #FA5A1E;">{{ t('common_list.toSupply') }}</text>
  110. </div>
  111. </template>
  112. </el-table-column>
  113. <el-table-column prop="status" :label="t('common_list.orderStatus')" width="130">
  114. <template #default="scope">
  115. {{ scope.row.status === 41 ? t('common_list.refundSuccess') : t('common_list.pending') }}
  116. </template>
  117. </el-table-column>
  118. <el-table-column prop="operation" :label="t('common_list.operation')" fixed="right" width="100px">
  119. <template #default="scope">
  120. <div class="operation">
  121. <el-button v-if="scope.row.status === 40" type="primary" text @click="showEditDialog(scope.row)">
  122. {{ t('common.submit') }}
  123. </el-button>
  124. <el-button v-else type="primary" text @click="showEditDialog(scope.row)">
  125. {{ t('common.edit') }}
  126. </el-button>
  127. </div>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. <el-pagination v-model:current-page="pagination.pageNum" v-model:page-size="pagination.pageSize"
  132. @size-change="handlePageSizeChange" @current-change="handleCurrentChange"
  133. layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" style="margin-top: 1vh;" />
  134. </el-card>
  135. <el-dialog v-model="showEdit" class="edit" overflow draggable
  136. style="width: 40vw; background-color: #F3FAFE !important;">
  137. <div style="display: flex;">
  138. <div class="left">
  139. <div class="dialog-item">
  140. <el-text style="width:4vw;">{{ t('common_add.jwcode') }}</el-text>
  141. <el-input v-model="editRow.jwcode" style="width:10vw;" disabled />
  142. </div>
  143. <div class="dialog-item">
  144. <el-text style="width:4vw;">{{ t('common_add.customerName') }}</el-text>
  145. <el-input v-model="editRow.name" style="width:10vw;" disabled />
  146. </div>
  147. <div class="dialog-item">
  148. <el-text style="width:4vw;">{{ t('common_add.market') }}</el-text>
  149. <el-input v-model="editRow.marketName" style="width:10vw;" disabled />
  150. </div>
  151. <div class="dialog-item">
  152. <el-text style="width:4vw;">{{ t('common_add.productName') }}</el-text>
  153. <el-input v-model="editRow.goodsName" style="width:10vw;" disabled />
  154. </div>
  155. <div class="dialog-item">
  156. <el-text style="width:4vw;">{{ t('common_add.refundModel') }}</el-text>
  157. <el-select v-model="editRow.refundModel" style="width:10vw;" disabled>
  158. <el-option :label="t('common_add.refundModelAll')" :value="0"></el-option>
  159. <el-option :label="t('common_add.refundModelPart')" :value="1"></el-option>
  160. </el-select>
  161. </div>
  162. <div class="dialog-item" v-if="editRow.goodsName === '金币充值'">
  163. <el-text style="width:4vw;">{{ t('common_add.permanentGold') }}</el-text>
  164. <el-input v-model="editRow.permanentGold" style="width:10vw;" disabled />
  165. </div>
  166. <div class="dialog-item" v-if="editRow.goodsName === '金币充值'">
  167. <el-text style="width:4vw;">{{ t('common_add.freeGold') }}</el-text>
  168. <el-input v-model="editRow.freeGold" style="width:10vw;" disabled />
  169. </div>
  170. <div class="dialog-item">
  171. <el-text style="width:4vw;">{{ t('common_add.payCurrency') }}</el-text>
  172. <el-input v-model="editRow.paymentCurrency" style="width:10vw;" disabled />
  173. </div>
  174. <div class="dialog-item">
  175. <el-text style="width:4vw;">{{ t('common_add.payAmount') }}</el-text>
  176. <el-input v-model="editRow.paymentAmount" style="width:10vw;" disabled />
  177. </div>
  178. <div class="dialog-item">
  179. <el-text style="width:4vw;">{{ t('common_add.payMethod') }}</el-text>
  180. <el-input v-model="editRow.payType" style="width:10vw;" disabled />
  181. </div>
  182. <div class="dialog-item">
  183. <el-text style="width:4vw;">{{ t('common_add.payTime') }}</el-text>
  184. <el-input v-model="editRow.payTime" style="width:10vw;" disabled />
  185. </div>
  186. <div class="dialog-item">
  187. <el-text style="width:4vw;">{{ t('common_add.submitter') }}</el-text>
  188. <el-input v-model="editRow.submitter" style="width:10vw;" disabled />
  189. </div>
  190. <div class="dialog-item">
  191. <el-text style="width:4vw;">{{ t('common_add.transferVoucher') }}</el-text>
  192. <img v-if="editRow.payVoucher" :src="editRow.payVoucher"
  193. style="width: 80px; height: 80px; object-fit: cover; cursor: zoom-in;" @click="openVoucherViewer(editRow.payVoucher)">
  194. <div v-else>
  195. {{ t('common_add.noTransferVoucher') }}
  196. </div>
  197. </div>
  198. <div class="dialog-item">
  199. <el-text style="width:4vw;">{{ t('common_add.remark') }}</el-text>
  200. <el-input v-model="editRow.payRemark" style="width:10vw;" :row="3" disabled maxlength="100" type="textarea"
  201. show-word-limit clearable />
  202. </div>
  203. <div class="dialog-item">
  204. <el-text style="width:4vw;">{{ t('common_add.refundReason') }}</el-text>
  205. <el-input v-model="editRow.refundReason" style="width:10vw;" :row="3" disabled maxlength="100" type="textarea"
  206. show-word-limit clearable />
  207. </div>
  208. </div>
  209. <div class="right">
  210. <div class="dialog-item">
  211. <el-text style="width:4vw;">{{ t('common_add.refundCurrency') }}</el-text>
  212. <el-select v-model="editForm.refundCurrency" :placeholder="t('common_add.refundCurrencyPlaceholder')"
  213. style="width:10vw;">
  214. <el-option v-for="item in currencies" :key="item" :label="item" :value="item" />
  215. </el-select>
  216. </div>
  217. <div class="dialog-item">
  218. <el-text style="width:4vw;">{{ t('common_add.refundAmount') }}</el-text>
  219. <el-input v-model="editForm.refundAmount" :placeholder="t('common_add.refundAmountPlaceholder')"
  220. style="width:10vw;" clearable />
  221. </div>
  222. <div class="dialog-item">
  223. <el-text style="width:4vw;">{{ t('common_add.refundChannels') }}</el-text>
  224. <el-select v-model="editForm.refundChannels" :placeholder="t('common_add.refundChannelsPlaceholder')"
  225. style="width:10vw;">
  226. <el-option v-for="item in channelOptions" :key="item" :label="item" :value="item" />
  227. </el-select>
  228. </div>
  229. <div class="dialog-item">
  230. <el-text style="width:4vw;">{{ t('common_add.refundTime') }}</el-text>
  231. <el-date-picker v-model="editForm.refundTime" type="datetime"
  232. :placeholder="t('common_add.refundTimePlaceholder')" style="width:10vw;" clearable />
  233. </div>
  234. <div class="dialog-item">
  235. <el-text style="width:4vw;">{{ t('common_add.refundVoucher') }}</el-text>
  236. <el-upload ref="uploadRef" :http-request="customUpload" list-type="picture-card" :auto-upload="false"
  237. :on-change="handleImageChange" :before-upload="beforeUpload" :show-file-list="false">
  238. <template #default>
  239. <img v-if="editForm.imageUrl" :src="editForm.imageUrl"
  240. style="width: 80px; height: 80px; object-fit: cover;">
  241. <el-icon v-else>
  242. <Plus />
  243. </el-icon>
  244. </template>
  245. </el-upload>
  246. </div>
  247. <div class="dialog-item">
  248. <el-text style="width:4vw;">{{ t('common_add.remark') }}</el-text>
  249. <el-input v-model="editForm.refundRemark" :placeholder="t('common_add.remarkPlaceholder')" style="width:10vw;"
  250. :rows="3" maxlength="100" show-word-limit type="textarea" clearable />
  251. </div>
  252. <div style="display:flex;justify-content: center;margin-top: 5vh;">
  253. <el-button type="default" @click="hideEditDialog" style="margin-right: 2vw;">{{ t('common.cancel')
  254. }}</el-button>
  255. <el-button type="primary" @click="submitRefund">{{ t('common.submit') }}</el-button>
  256. </div>
  257. </div>
  258. </div>
  259. </el-dialog>
  260. </template>
  261. <script setup>
  262. import { ref, onMounted, nextTick } from 'vue'
  263. import { ElMessage } from 'element-plus'
  264. import API from '@/util/http.js'
  265. import dayjs from 'dayjs'
  266. import { useAdminStore } from "@/store/index.js"
  267. import { storeToRefs } from "pinia"
  268. import { Delete, Download, Plus, ZoomIn } from '@element-plus/icons-vue'
  269. import { productList, CurrencyForId } from '@/views/moneyManage/receiveDetail/utils/staticData.js'
  270. const adminStore = useAdminStore()
  271. const { adminData, menuTree } = storeToRefs(adminStore)
  272. import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js"
  273. import moment from 'moment'
  274. import { isNumber } from 'lodash'
  275. // 国际化
  276. import { useI18n } from 'vue-i18n'
  277. const { t } = useI18n()
  278. const uploadUrl = 'https://api.homilychart.com/hljw/api/aws/upload'
  279. const dateRange = ref([])
  280. const tableData = ref([])
  281. const tableRef = ref(null)
  282. const scrollTableTop = () => {
  283. tableRef.value?.setScrollTop?.(0)
  284. }
  285. const editRow = ref({})// 编辑回显
  286. const statusList = ref([t('cash.pending'), t('cash.refundSuccess')])
  287. const pagination = ref({
  288. pageNum: 1,
  289. pageSize: 50,
  290. total: 0
  291. })
  292. const market = ref([])
  293. const uploadRef = ref(null)
  294. const searchForm = ref({
  295. jwcode: '',
  296. markets: []
  297. })
  298. const showEdit = ref(false)
  299. const editForm = ref({
  300. jwcode: ''
  301. })
  302. // 图片预览(支持滚轮缩放)
  303. const openVoucherViewer = (url) => {
  304. if (!url) return
  305. const container = document.createElement('div')
  306. container.style.position = 'fixed'
  307. container.style.left = '0'
  308. container.style.top = '0'
  309. container.style.width = '100vw'
  310. container.style.height = '100vh'
  311. container.style.backgroundColor = 'rgba(0,0,0,0.7)'
  312. container.style.display = 'flex'
  313. container.style.alignItems = 'center'
  314. container.style.justifyContent = 'center'
  315. container.style.zIndex = '9999'
  316. container.style.cursor = 'zoom-in'
  317. const img = document.createElement('img')
  318. img.src = url
  319. img.style.maxWidth = '90%'
  320. img.style.maxHeight = '90%'
  321. img.style.transformOrigin = 'center center'
  322. img.style.transition = 'transform 0.05s linear'
  323. let scale = 1
  324. const onWheel = (e) => {
  325. e.preventDefault()
  326. const factor = e.deltaY > 0 ? 0.9 : 1.1
  327. scale = Math.min(5, Math.max(0.2, scale * factor))
  328. img.style.transform = `scale(${scale})`
  329. }
  330. const onKey = (e) => { if (e.key === 'Escape') close() }
  331. const close = () => {
  332. container.removeEventListener('wheel', onWheel)
  333. document.body.removeEventListener('keydown', onKey)
  334. document.body.contains(container) && document.body.removeChild(container)
  335. }
  336. container.addEventListener('wheel', onWheel, { passive: false })
  337. container.addEventListener('click', (e) => { if (e.target === container) close() })
  338. document.body.addEventListener('keydown', onKey)
  339. container.appendChild(img)
  340. document.body.appendChild(container)
  341. }
  342. // 查全部
  343. const getRefund = async function () {
  344. try {
  345. const statusesParam = [40, 41] // 默认:看不到进度没到这里的
  346. if (searchForm.value.statuses === t('cash.pending')) {
  347. statusesParam.value = [40]
  348. } else if (searchForm.value.statuses === t('cash.refundSuccess')) {
  349. statusesParam.value = [41]
  350. } else {
  351. statusesParam.value = [40, 41]
  352. }
  353. let goodsName = searchForm.value.goodsName && searchForm.value.goodsName.length > 0
  354. ? [searchForm.value.goodsName] : []
  355. if (searchForm.value.jwcode) {
  356. const isPositiveInteger = /^[1-9]\d*$/.test(searchForm.value.jwcode);
  357. if (!isPositiveInteger) {
  358. ElMessage.error(t('elmessage.checkJwcodeFormat'))
  359. return;
  360. }
  361. }
  362. // 增加精网号长度限制,防止后端400错误
  363. if (searchForm.value.jwcode.length > 8) {
  364. ElMessage.error(t('elmessage.limitJwcodeLength'))
  365. return;
  366. }
  367. const params = {
  368. pageNum: pagination.value.pageNum,
  369. pageSize: pagination.value.pageSize,
  370. cashRecordDTO: {
  371. jwcode: searchForm.value.jwcode,
  372. name: searchForm.value.name,
  373. markets: searchForm.value.markets && searchForm.value.markets.length > 0 ? [searchForm.value.markets[searchForm.value.markets.length - 1]] : [],
  374. goodsNames: goodsName,
  375. statuses: statusesParam.value,//10:地区财务待审核;12:地区财务驳回;
  376. // 20:地区负责人待审核;22:地区负责人驳回;
  377. // 30:总部财务待审核;32:总部财务驳回;
  378. // 40:执行人待处理;41:执行人已处理,退款完成;
  379. paymentCurrency: CurrencyForId(searchForm.value.paymentCurrency),
  380. refundCurrency: searchForm.value.refundCurrency,
  381. sTime: dateRange.value && dateRange.value[0] ? dayjs(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss') : "",
  382. eTime: dateRange.value && dateRange.value[1] ? dayjs(dateRange.value[1]).format('YYYY-MM-DD HH:mm:ss') : "",
  383. adminId: adminData.value.id,
  384. executor: adminData.value.account,
  385. refundChannels: searchForm.value.refundChannels
  386. }
  387. }
  388. const result = await API({
  389. url: '/Money/exSelect',
  390. method: 'POST',
  391. data: params
  392. })
  393. tableData.value = result.data.list || []
  394. await nextTick()
  395. scrollTableTop()
  396. pagination.value.total = result.data.total || 0
  397. } catch (error) {
  398. ElMessage.error(error.message || t('elmessage.searchFailed'))
  399. }
  400. }
  401. // 提交
  402. const submitRefund = async function () {
  403. try {
  404. const numberReg = /^[0-9]+(\.[0-9]+)?$/
  405. if (!numberReg.test(editForm.value.refundAmount)) {
  406. ElMessage.error(t('elmessage.checkNumberOrDecimal'))
  407. return
  408. }
  409. const params = {
  410. refundVoucher: editForm.value.imageUrl,
  411. refundTime: editForm.value.refundTime ? dayjs(editForm.value.refundTime).format('YYYY-MM-DD HH:mm:ss') : "",
  412. refundRemark: editForm.value.refundRemark,
  413. id: editRow.value.id,
  414. refundCurrency: editForm.value.refundCurrency,
  415. refundAmount: editForm.value.refundAmount,
  416. refundChannels: editForm.value.refundChannels,
  417. status: 41,
  418. auditId: editRow.value.auditId,
  419. executor: adminData.value.account
  420. }
  421. const result = await API({
  422. url: '/Money/executor',
  423. data: params
  424. })
  425. if (result.code === 200) {
  426. ElMessage.success(t('elmessage.submitSuccess'))
  427. hideEditDialog()
  428. getRefund()
  429. } else {
  430. ElMessage.error(result.msg || t('elmessage.submitFailed'))
  431. }
  432. } catch (error) {
  433. ElMessage.error(error.message || t('elmessage.submitFailed'))
  434. }
  435. }
  436. const getMarket = async function () {
  437. try {
  438. const result = await API({
  439. url: '/market/selectMarket',
  440. })
  441. console.log('看看地区树', result)
  442. const transformTree = (nodes) => {
  443. const allChildren = nodes.flatMap(node => node.children || []);
  444. return allChildren.map(child => {
  445. const grandchildren = child.children && child.children.length
  446. ? transformTree([child])
  447. : null;
  448. return {
  449. value: child.id,
  450. label: child.name,
  451. children: grandchildren
  452. };
  453. });
  454. };
  455. market.value = transformTree(result.data)
  456. console.log('转换后的地区树==============', market.value)
  457. } catch (error) {
  458. console.log('请求失败', error)
  459. }
  460. }
  461. const showEditDialog = (row) => {
  462. editRow.value = row
  463. editForm.value.refundCurrency = ''
  464. editForm.value.refundAmount = ''
  465. editForm.value.channels = []
  466. editForm.value.refundTime = ''
  467. editForm.value.refundRemark = ''
  468. editForm.value.imageUrl = ''
  469. showEdit.value = true
  470. }
  471. const hideEditDialog = () => {
  472. showEdit.value = false
  473. editForm.value = {
  474. jwcode: ''
  475. }
  476. }
  477. // const currencies = ref(['美元(USD)', '港币(HKD)', '新币(SGD)', '马币(MYR)', '泰铢(THB)', '加币(CAD)', '越南盾(VND)', '韩元(KRW)'])
  478. const currencies = ref([
  479. t('cash.currency.usd'), // 美元(USD)
  480. t('cash.currency.hkd'), // 港币(HKD)
  481. t('cash.currency.sgd'), // 新币(SGD)
  482. t('cash.currency.myr'), // 马币(MYR)
  483. t('cash.currency.thb'), // 泰铢(THB)
  484. t('cash.currency.cad'), // 加币(CAD)
  485. t('cash.currency.vnd'), // 越南盾(VND)
  486. t('cash.currency.krw') // 韩元(KRW)
  487. ])
  488. // const channelOptions = ref(["Stripe", "PaymentAsia", "Ipay88", "银行转账", "刷卡", "现金", "支票", "Grabpay", "Nets", "E-Transfer", "Paypal"])
  489. const channelOptions = ref([
  490. t('cash.payMethods.stripe'),
  491. t('cash.payMethods.paymentAsia'),
  492. t('cash.payMethods.ipay88'),
  493. t('cash.payMethods.bankTransfer'),
  494. t('cash.payMethods.card'),
  495. t('cash.payMethods.cash'),
  496. t('cash.payMethods.check'),
  497. t('cash.payMethods.grabpay'),
  498. t('cash.payMethods.nets'),
  499. t('cash.payMethods.transfer'),
  500. t('cash.payMethods.iotPay'),
  501. t('cash.payMethods.stripe3'),
  502. t('cash.payMethods.stripe2'),
  503. t('cash.payMethods.paypal'),
  504. ])
  505. // 预览图片函数
  506. // const previewImage = (imageUrl) => {
  507. // // 使用 element-plus 的 el-image 组件实现图片预览功能
  508. // const imageElement = document.createElement('img');
  509. // imageElement.src = imageUrl;
  510. // imageElement.style.maxWidth = '80vw';
  511. // imageElement.style.maxHeight = '80vh';
  512. // const viewer = document.createElement('div');
  513. // viewer.style.position = 'fixed';
  514. // viewer.style.top = '0';
  515. // viewer.style.left = '0';
  516. // viewer.style.width = '100vw';
  517. // viewer.style.height = '100vh';
  518. // viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  519. // viewer.style.display = 'flex';
  520. // viewer.style.justifyContent = 'center';
  521. // viewer.style.alignItems = 'center';
  522. // viewer.style.zIndex = '9999';
  523. // viewer.style.overflow = 'auto';
  524. // viewer.appendChild(imageElement);
  525. // document.body.appendChild(viewer);
  526. // viewer.addEventListener('click', () => {
  527. // document.body.removeChild(viewer);
  528. // });
  529. // };
  530. const previewImage = (imageUrl) => {
  531. if (!imageUrl) return;
  532. const imageElement = document.createElement('img');
  533. imageElement.src = imageUrl;
  534. imageElement.style.maxWidth = '90vw';
  535. imageElement.style.maxHeight = '90vh';
  536. imageElement.style.display = 'block';
  537. imageElement.style.transition = 'transform 0.2s ease-out';
  538. imageElement.style.cursor = 'zoom-in';
  539. imageElement.style.transformOrigin = 'center center'; // 缩放中心点
  540. const viewer = document.createElement('div');
  541. viewer.style.position = 'fixed';
  542. viewer.style.top = '0';
  543. viewer.style.left = '0';
  544. viewer.style.width = '100vw';
  545. viewer.style.height = '100vh';
  546. viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  547. viewer.style.display = 'flex';
  548. viewer.style.justifyContent = 'center';
  549. viewer.style.alignItems = 'center';
  550. viewer.style.overflow = 'hidden';
  551. viewer.style.zIndex = '999999';
  552. viewer.appendChild(imageElement);
  553. let currentScale = 1;
  554. const scaleStep = 0.2;
  555. const handleWheel = (e) => {
  556. e.preventDefault();
  557. if (e.deltaY > 0) {
  558. currentScale -= scaleStep;
  559. } else {
  560. currentScale += scaleStep;
  561. }
  562. if (currentScale < 0.5) currentScale = 0.5;
  563. imageElement.style.transform = `scale(${currentScale})`;
  564. imageElement.style.cursor = currentScale > 1 ? 'zoom-out' : 'zoom-in';
  565. };
  566. viewer.addEventListener('wheel', handleWheel, { passive: false });
  567. viewer.addEventListener('click', (e) => {
  568. if (e.target === viewer) {
  569. document.body.removeChild(viewer);
  570. viewer.removeEventListener('wheel', handleWheel);
  571. }
  572. });
  573. document.body.appendChild(viewer);
  574. };
  575. const handleImageChange = (file) => {
  576. uploadRef.value.submit()
  577. }
  578. const beforeUpload = (file) => {
  579. const isJPG = file.type === 'image/jpeg'
  580. const isPNG = file.type === 'image/png'
  581. const isLt1 = file.size / 1024 < 2048
  582. if (!isJPG && !isPNG) {
  583. ElMessage.error(t('elmessage.onlyUploadJPGPNG'))
  584. return false
  585. }
  586. if (!isLt1) {
  587. ElMessage.error(t('elmessage.limitImageSize2MB'))
  588. return false
  589. }
  590. return true
  591. }
  592. const customUpload = async (options) => {
  593. try {
  594. const formData = new FormData()
  595. formData.append('file', options.file)
  596. const response = await API({
  597. url: uploadUrl,
  598. method: 'POST',
  599. data: formData,
  600. headers: {
  601. 'Content-Type': 'multipart/form-data'
  602. }
  603. })
  604. if (response.code === 200 && response.data) {
  605. editForm.value.imageUrl = response.data.url
  606. ElMessage.success(response.msg || t('elmessage.uploadSuccess'))
  607. } else {
  608. ElMessage.error(response.msg || t('elmessage.uploadFailed'))
  609. }
  610. } catch (error) {
  611. console.error('上传错误:', error)
  612. ElMessage.error(t('elmessage.uploadFailed') + `: ${error.msg || error.message || t('elmessage.inNetworkError')}`)
  613. }
  614. }
  615. const defaultTime = [
  616. new Date(2000, 1, 1, 0, 0, 0),
  617. new Date(2000, 2, 1, 23, 59, 59),
  618. ]
  619. const disabledDate = (time) => {
  620. const limitDate = new Date(2025, 0, 1);
  621. return time.getTime() < limitDate.getTime();
  622. }
  623. const reset = function () {
  624. searchForm.value = {
  625. jwcode: '',
  626. markets: [],
  627. statuses: []
  628. }
  629. // 重置页码
  630. pagination.value.pageNum = 1
  631. dateRange.value = []
  632. getRefund()
  633. }
  634. const handlePageSizeChange = function (val) {
  635. pagination.value.pageSize = val
  636. getRefund()
  637. }
  638. const handleCurrentChange = function (val) {
  639. pagination.value.pageNum = val
  640. getRefund()
  641. }
  642. onMounted(() => {
  643. console.log('???????????????????', adminData.value)
  644. getRefund()
  645. getMarket()
  646. })
  647. </script>
  648. <style scoped>
  649. :deep(.el-table__header-wrapper),
  650. :deep(.el-table__body-wrapper),
  651. :deep(.el-table__cell),
  652. :deep(.el-table__body td) {
  653. background-color: #F3FAFE !important;
  654. }
  655. :deep(.el-table__header th) {
  656. background-color: #F3FAFE !important;
  657. }
  658. :deep(.el-image-viewer) {
  659. z-index: 3000 !important;
  660. /* 确保高于固定列和对话框的层级 */
  661. }
  662. /* 若固定列仍遮挡,强制提高固定列容器的层级(可选) */
  663. :deep(.el-table__fixed),
  664. :deep(.el-table__fixed-right) {
  665. z-index: 10 !important;
  666. /* 低于预览层的 3000 即可 */
  667. }
  668. .condition1 {
  669. width: 82vw;
  670. display: flex;
  671. align-items: center;
  672. height: 4vh;
  673. .search {
  674. width: 19%;
  675. display: flex;
  676. align-items: center;
  677. margin-bottom: 1vh;
  678. margin-right: 0.5vw;
  679. }
  680. .search2 {
  681. width: 19%;
  682. display: flex;
  683. align-items: center;
  684. margin-right: 0.5vw;
  685. }
  686. }
  687. .edit {
  688. .left {
  689. width: 45%;
  690. height: auto;
  691. padding: 0 2vw;
  692. .dialog-item {
  693. display: flex;
  694. align-items: center;
  695. margin-bottom: 1vh;
  696. }
  697. .image {
  698. width: 4vw !important;
  699. height: 4vw !important;
  700. }
  701. :deep(.el-upload--picture-card) {
  702. width: 4vw !important;
  703. height: 4vw !important;
  704. padding: 0 !important;
  705. }
  706. }
  707. .right {
  708. width: 50%;
  709. .dialog-item {
  710. display: flex;
  711. align-items: center;
  712. margin-bottom: 1vh;
  713. }
  714. }
  715. }
  716. </style>