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.

651 lines
25 KiB

3 months ago
3 months ago
3 months ago
1 month ago
3 months ago
4 months ago
3 months ago
3 months ago
3 months ago
5 months ago
3 months ago
3 months ago
4 months ago
5 months ago
5 months ago
5 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
3 months ago
3 months ago
3 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 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 :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 v-else>{{ 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;">
  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 } 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 editRow = ref({})// 编辑回显
  282. const statusList = ref([t('cash.pending'), t('cash.refundSuccess')])
  283. const pagination = ref({
  284. pageNum: 1,
  285. pageSize: 50,
  286. total: 0
  287. })
  288. const market = ref([])
  289. const uploadRef = ref(null)
  290. const searchForm = ref({
  291. jwcode: '',
  292. markets: []
  293. })
  294. const showEdit = ref(false)
  295. const editForm = ref({
  296. jwcode: ''
  297. })
  298. // 查全部
  299. const getRefund = async function () {
  300. try {
  301. const statusesParam = [40, 41] // 默认:看不到进度没到这里的
  302. if (searchForm.value.statuses === t('cash.pending')) {
  303. statusesParam.value = [40]
  304. } else if (searchForm.value.statuses === t('cash.refundSuccess')) {
  305. statusesParam.value = [41]
  306. } else {
  307. statusesParam.value = [40, 41]
  308. }
  309. let goodsName = searchForm.value.goodsName && searchForm.value.goodsName.length > 0
  310. ? [searchForm.value.goodsName] : []
  311. if (searchForm.value.jwcode) {
  312. const isPositiveInteger = /^[1-9]\d*$/.test(searchForm.value.jwcode);
  313. if (!isPositiveInteger) {
  314. ElMessage.error(t('elmessage.checkJwcodeFormat'))
  315. return;
  316. }
  317. }
  318. // 增加精网号长度限制,防止后端400错误
  319. if (searchForm.value.jwcode.length > 8) {
  320. ElMessage.error(t('elmessage.limitJwcodeLength'))
  321. return;
  322. }
  323. const params = {
  324. pageNum: pagination.value.pageNum,
  325. pageSize: pagination.value.pageSize,
  326. cashRecordDTO: {
  327. jwcode: searchForm.value.jwcode,
  328. name: searchForm.value.name,
  329. markets: searchForm.value.markets && searchForm.value.markets.length > 0 ? [searchForm.value.markets[searchForm.value.markets.length - 1]] : [],
  330. goodsNames: goodsName,
  331. statuses: statusesParam.value,//10:地区财务待审核;12:地区财务驳回;
  332. // 20:地区负责人待审核;22:地区负责人驳回;
  333. // 30:总部财务待审核;32:总部财务驳回;
  334. // 40:执行人待处理;41:执行人已处理,退款完成;
  335. paymentCurrency: CurrencyForId(searchForm.value.paymentCurrency),
  336. refundCurrency: searchForm.value.refundCurrency,
  337. sTime: dateRange.value && dateRange.value[0] ? dayjs(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss') : "",
  338. eTime: dateRange.value && dateRange.value[1] ? dayjs(dateRange.value[1]).format('YYYY-MM-DD HH:mm:ss') : "",
  339. adminId: adminData.value.id,
  340. executor: adminData.value.account,
  341. refundChannels: searchForm.value.refundChannels
  342. }
  343. }
  344. const result = await API({
  345. url: '/Money/exSelect',
  346. method: 'POST',
  347. data: params
  348. })
  349. tableData.value = result.data.list || []
  350. pagination.value.total = result.data.total || 0
  351. } catch (error) {
  352. ElMessage.error(error.message || t('elmessage.searchFailed'))
  353. }
  354. }
  355. // 提交
  356. const submitRefund = async function () {
  357. try {
  358. const numberReg = /^[0-9]+(\.[0-9]+)?$/
  359. if (!numberReg.test(editForm.value.refundAmount)) {
  360. ElMessage.error(t('elmessage.checkNumberOrDecimal'))
  361. return
  362. }
  363. const params = {
  364. refundVoucher: editForm.value.imageUrl,
  365. refundTime: editForm.value.refundTime ? dayjs(editForm.value.refundTime).format('YYYY-MM-DD HH:mm:ss') : "",
  366. refundRemark: editForm.value.refundRemark,
  367. id: editRow.value.id,
  368. refundCurrency: editForm.value.refundCurrency,
  369. refundAmount: editForm.value.refundAmount,
  370. refundChannels: editForm.value.refundChannels,
  371. status: 41,
  372. auditId: editRow.value.auditId,
  373. executor: adminData.value.account
  374. }
  375. const result = await API({
  376. url: '/Money/executor',
  377. data: params
  378. })
  379. if (result.code === 200) {
  380. ElMessage.success(t('elmessage.submitSuccess'))
  381. hideEditDialog()
  382. getRefund()
  383. } else {
  384. ElMessage.error(result.msg || t('elmessage.submitFailed'))
  385. }
  386. } catch (error) {
  387. ElMessage.error(error.message || t('elmessage.submitFailed'))
  388. }
  389. }
  390. const getMarket = async function () {
  391. try {
  392. const result = await API({
  393. url: '/market/selectMarket',
  394. })
  395. console.log('看看地区树', result)
  396. const transformTree = (nodes) => {
  397. const allChildren = nodes.flatMap(node => node.children || []);
  398. return allChildren.map(child => {
  399. const grandchildren = child.children && child.children.length
  400. ? transformTree([child])
  401. : null;
  402. return {
  403. value: child.id,
  404. label: child.name,
  405. children: grandchildren
  406. };
  407. });
  408. };
  409. market.value = transformTree(result.data)
  410. console.log('转换后的地区树==============', market.value)
  411. } catch (error) {
  412. console.log('请求失败', error)
  413. }
  414. }
  415. const showEditDialog = (row) => {
  416. editRow.value = row
  417. editForm.value.refundCurrency = ''
  418. editForm.value.refundAmount = ''
  419. editForm.value.channels = []
  420. editForm.value.refundTime = ''
  421. editForm.value.refundRemark = ''
  422. editForm.value.imageUrl = ''
  423. showEdit.value = true
  424. }
  425. const hideEditDialog = () => {
  426. showEdit.value = false
  427. editForm.value = {
  428. jwcode: ''
  429. }
  430. }
  431. // const currencies = ref(['美元(USD)', '港币(HKD)', '新币(SGD)', '马币(MYR)', '泰铢(THB)', '加币(CAD)', '越南盾(VND)', '韩元(KRW)'])
  432. const currencies = ref([
  433. t('cash.currency.usd'), // 美元(USD)
  434. t('cash.currency.hkd'), // 港币(HKD)
  435. t('cash.currency.sgd'), // 新币(SGD)
  436. t('cash.currency.myr'), // 马币(MYR)
  437. t('cash.currency.thb'), // 泰铢(THB)
  438. t('cash.currency.cad'), // 加币(CAD)
  439. t('cash.currency.vnd'), // 越南盾(VND)
  440. t('cash.currency.krw') // 韩元(KRW)
  441. ])
  442. // const channelOptions = ref(["Stripe", "PaymentAsia", "Ipay88", "银行转账", "刷卡", "现金", "支票", "Grabpay", "Nets", "E-Transfer", "Paypal"])
  443. const channelOptions = ref([
  444. t('cash.payMethods.stripe'),
  445. t('cash.payMethods.paymentAsia'),
  446. t('cash.payMethods.ipay88'),
  447. t('cash.payMethods.bankTransfer'),
  448. t('cash.payMethods.card'),
  449. t('cash.payMethods.cash'),
  450. t('cash.payMethods.check'),
  451. t('cash.payMethods.grabpay'),
  452. t('cash.payMethods.nets'),
  453. t('cash.payMethods.transfer'),
  454. t('cash.payMethods.paypal'),
  455. ])
  456. // 预览图片函数
  457. const previewImage = (imageUrl) => {
  458. // 使用 element-plus 的 el-image 组件实现图片预览功能
  459. const imageElement = document.createElement('img');
  460. imageElement.src = imageUrl;
  461. imageElement.style.maxWidth = '80vw';
  462. imageElement.style.maxHeight = '80vh';
  463. const viewer = document.createElement('div');
  464. viewer.style.position = 'fixed';
  465. viewer.style.top = '0';
  466. viewer.style.left = '0';
  467. viewer.style.width = '100vw';
  468. viewer.style.height = '100vh';
  469. viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  470. viewer.style.display = 'flex';
  471. viewer.style.justifyContent = 'center';
  472. viewer.style.alignItems = 'center';
  473. viewer.style.zIndex = '9999';
  474. viewer.style.overflow = 'auto';
  475. viewer.appendChild(imageElement);
  476. document.body.appendChild(viewer);
  477. viewer.addEventListener('click', () => {
  478. document.body.removeChild(viewer);
  479. });
  480. };
  481. const handleImageChange = (file) => {
  482. uploadRef.value.submit()
  483. }
  484. const beforeUpload = (file) => {
  485. const isJPG = file.type === 'image/jpeg'
  486. const isPNG = file.type === 'image/png'
  487. const isLt1 = file.size / 1024 < 2048
  488. if (!isJPG && !isPNG) {
  489. ElMessage.error(t('elmessage.onlyUploadJPGPNG'))
  490. return false
  491. }
  492. if (!isLt1) {
  493. ElMessage.error(t('elmessage.limitImageSize2MB'))
  494. return false
  495. }
  496. return true
  497. }
  498. const customUpload = async (options) => {
  499. try {
  500. const formData = new FormData()
  501. formData.append('file', options.file)
  502. const response = await API({
  503. url: uploadUrl,
  504. method: 'POST',
  505. data: formData,
  506. headers: {
  507. 'Content-Type': 'multipart/form-data'
  508. }
  509. })
  510. if (response.code === 200 && response.data) {
  511. editForm.value.imageUrl = response.data.url
  512. ElMessage.success(response.msg || t('elmessage.uploadSuccess'))
  513. } else {
  514. ElMessage.error(response.msg || t('elmessage.uploadFailed'))
  515. }
  516. } catch (error) {
  517. console.error('上传错误:', error)
  518. ElMessage.error(t('elmessage.uploadFailed') + `: ${error.msg || error.message || t('elmessage.inNetworkError')}`)
  519. }
  520. }
  521. const defaultTime = [
  522. new Date(2000, 1, 1, 0, 0, 0),
  523. new Date(2000, 2, 1, 23, 59, 59),
  524. ]
  525. const disabledDate = (time) => {
  526. const limitDate = new Date(2025, 0, 1);
  527. return time.getTime() < limitDate.getTime();
  528. }
  529. const reset = function () {
  530. searchForm.value = {
  531. jwcode: '',
  532. markets: [],
  533. statuses: []
  534. }
  535. // 重置页码
  536. pagination.value.pageNum = 1
  537. dateRange.value = []
  538. getRefund()
  539. }
  540. const handlePageSizeChange = function (val) {
  541. pagination.value.pageSize = val
  542. getRefund()
  543. }
  544. const handleCurrentChange = function (val) {
  545. pagination.value.pageNum = val
  546. getRefund()
  547. }
  548. onMounted(() => {
  549. console.log('???????????????????', adminData.value)
  550. getRefund()
  551. getMarket()
  552. })
  553. </script>
  554. <style scoped>
  555. :deep(.el-table__header-wrapper),
  556. :deep(.el-table__body-wrapper),
  557. :deep(.el-table__cell),
  558. :deep(.el-table__body td) {
  559. background-color: #F3FAFE !important;
  560. }
  561. :deep(.el-table__header th) {
  562. background-color: #F3FAFE !important;
  563. }
  564. :deep(.el-image-viewer) {
  565. z-index: 3000 !important;
  566. /* 确保高于固定列和对话框的层级 */
  567. }
  568. /* 若固定列仍遮挡,强制提高固定列容器的层级(可选) */
  569. :deep(.el-table__fixed),
  570. :deep(.el-table__fixed-right) {
  571. z-index: 10 !important;
  572. /* 低于预览层的 3000 即可 */
  573. }
  574. .condition1 {
  575. width: 82vw;
  576. display: flex;
  577. align-items: center;
  578. height: 4vh;
  579. .search {
  580. width: 19%;
  581. display: flex;
  582. align-items: center;
  583. margin-bottom: 1vh;
  584. margin-right: 0.5vw;
  585. }
  586. .search2 {
  587. width: 19%;
  588. display: flex;
  589. align-items: center;
  590. margin-right: 0.5vw;
  591. }
  592. }
  593. .edit {
  594. .left {
  595. width: 45%;
  596. height: auto;
  597. padding: 0 2vw;
  598. .dialog-item {
  599. display: flex;
  600. align-items: center;
  601. margin-bottom: 1vh;
  602. }
  603. .image {
  604. width: 4vw !important;
  605. height: 4vw !important;
  606. }
  607. :deep(.el-upload--picture-card) {
  608. width: 4vw !important;
  609. height: 4vw !important;
  610. padding: 0 !important;
  611. }
  612. }
  613. .right {
  614. width: 50%;
  615. .dialog-item {
  616. display: flex;
  617. align-items: center;
  618. margin-bottom: 1vh;
  619. }
  620. }
  621. }
  622. </style>