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.

688 lines
22 KiB

4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
6 months ago
4 months ago
4 months ago
6 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
6 months ago
4 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
6 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
6 months ago
4 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
2 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 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
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 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
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. <script setup>
  2. import { computed, onMounted, reactive, ref, watch } from 'vue'
  3. import { ElMessage, ElMessageBox } from 'element-plus'
  4. import API from '@/util/http.js'
  5. import { useAdminStore } from "@/store/index.js";
  6. import { storeToRefs } from "pinia";
  7. import { findMenuById, permissionMapping } from "@/utils/menuTreePermission.js"
  8. import { e } from 'mathjs';
  9. const adminStore = useAdminStore();
  10. const { adminData, menuTree } = storeToRefs(adminStore);
  11. // 国际化
  12. import { useI18n } from 'vue-i18n'
  13. const { t } = useI18n()
  14. const tableData = ref([])
  15. const pagination = ref({
  16. pageNum: 1,
  17. pageSize: 10,
  18. total: 0
  19. })
  20. // 精网号去空格
  21. const trimJwCode = () => {
  22. if (addRefund.value.jwcode) {
  23. addRefund.value.jwcode = addRefund.value.jwcode.replace(/\s/g, '');
  24. }
  25. }
  26. // 这是添加退款信息的表单
  27. const addRefund = ref({
  28. jwcode: '',
  29. goodsName: '',
  30. refundType: '',
  31. refundModel: 0, // 0:全部退款, 1:部分退款
  32. permanentGold: '',
  33. freeGold: '',
  34. taskGold: '',
  35. sumGold: 0,
  36. remark: '',
  37. price: '',
  38. linkId: '',
  39. adminId: adminData.value.id,
  40. adminName: adminData.value.name,
  41. orderCode: '',
  42. type: 0
  43. })
  44. // 取消按钮
  45. const cancel = function () {
  46. addRefund.value = {
  47. jwcode: '',
  48. goodsName: '',
  49. refundType: '',
  50. refundModel: 0,
  51. permanentGold: '',
  52. freeGold: '',
  53. taskGold: '',
  54. sumGold: 0,
  55. remark: '',
  56. price: '',
  57. linkId: '',
  58. adminId: adminData.value.id,
  59. orderCode: '',
  60. }
  61. }
  62. const getRefund = async function () {
  63. if (!addRefund.value.jwcode) {
  64. ElMessage.error(t('elmessage.checkJwcode'))
  65. return
  66. }
  67. addRefund.value.orderCode = ''
  68. addRefund.value.goodsName = ''
  69. addRefund.value.permanentGold = ''
  70. addRefund.value.freeGold = ''
  71. addRefund.value.taskGold = ''
  72. addRefund.value.price = ''
  73. addRefund.value.linkId = ''
  74. let type = null
  75. if (addRefund.value.refundType === '商品退款') {
  76. type = 1
  77. } else {
  78. type = 0
  79. }
  80. const params = {
  81. pageNum: pagination.value.pageNum,
  82. pageSize: pagination.value.pageSize,
  83. goldDetail: {
  84. jwcode: addRefund.value.jwcode,
  85. flag: 0,
  86. type: type,
  87. markets:[]
  88. }
  89. }
  90. try {
  91. const res = await API({
  92. url: '/goldDetail/getGoldDetail',
  93. data: {
  94. ...params
  95. }
  96. })
  97. tableData.value = res.data.list
  98. pagination.value.total = res.data.total
  99. if (Array.isArray(res.data.list) && res.data.list.length > 0) {
  100. orderCodes.value = res.data.list.map(item => ({
  101. label: item.orderCode,
  102. value: item.orderCode
  103. }))
  104. console.log("看看订单号们", orderCodes.value)
  105. } else {
  106. ElMessage.info(t('elmessage.noOrder'))
  107. }
  108. } catch (error) {
  109. console.log('goldDetail有错误', error)
  110. ElMessage.error(t('elmessage.requestFailed'))
  111. tableData.value = []
  112. pagination.value.total = 0
  113. }
  114. }
  115. // 这是添加退款信息的接口
  116. const add = async function () {
  117. // 检查是否有添加权限
  118. if (!canAdd.value) {
  119. ElMessage.error(t('elmessage.noPermission'))
  120. return
  121. }
  122. try {
  123. if (addRefund.value.refundType === '商品退款') {
  124. addRefund.value.type = 1
  125. } else {
  126. addRefund.value.type = 0
  127. }
  128. // 对提交的金币数乘以 100
  129. const processedRefund = {
  130. ...addRefund.value,
  131. permanentGold: addRefund.value.permanentGold * 100,
  132. freeGold: addRefund.value.freeGold * 100,
  133. taskGold: addRefund.value.taskGold * 100,
  134. sumGold: addRefund.value.sumGold * 100,
  135. price: addRefund.value.price * 100,
  136. linkId: addRefund.value.linkId
  137. }
  138. console.log('提交的退款信息', processedRefund)
  139. addDisabled.value = true
  140. // 发送POST请求
  141. const result = await API({
  142. url: '/refund/add',
  143. data: processedRefund
  144. })
  145. addDisabled.value = false
  146. if (result.code === 0) {
  147. ElMessage.error(result.msg)
  148. return
  149. }
  150. console.log('请求成功', result)
  151. ElMessage.success(t('elmessage.addSuccess'))
  152. // 重置表单
  153. cancel()
  154. } catch (error) {
  155. console.log('请求失败', error)
  156. ElMessage.error('请求失败,请重试')
  157. addDisabled.value = false
  158. }
  159. }
  160. // 提交禁止重复点击
  161. const addDisabled = ref(false)
  162. // 提交退款信息前的表单验证
  163. const addBefore = () => {
  164. Ref.value.validate(async (valid) => {
  165. if (valid) {
  166. ElMessageBox.confirm(t('elmessage.confirmRefund'))
  167. .then(() => {
  168. add()
  169. })
  170. .catch(() => {
  171. console.log('取消退款')
  172. })
  173. } else {
  174. // 提示
  175. ElMessage({
  176. type: 'error',
  177. message: t('elmessage.checkInputContent')
  178. })
  179. }
  180. })
  181. }
  182. // 表单验证
  183. const Ref = ref(null)
  184. const validateJwCode = (rule, value, callback) => {
  185. if (!value) {
  186. callback(new Error(t('elmessage.noEmptyJwcode')));
  187. return;
  188. }
  189. if (/[^0-9]/.test(value)) {
  190. callback(new Error(t('elmessage.limitDigitJwcode')));
  191. return;
  192. }
  193. callback();
  194. };
  195. const rules = reactive({
  196. jwcode: [{ required: true, validator: validateJwCode, trigger: 'blur' }],
  197. refundType: [{ required: true, message: t('elmessage.checkRefundType'), trigger: 'blur' }],
  198. goodsName: [{ required: false, message: t('elmessage.checkRefundGoods'), trigger: 'blur' }],
  199. // 订单号
  200. orderCode: [{ required: true, message: t('elmessage.checkOrderNo'), trigger: 'blur' }],
  201. taskGold: [{ required: true, message: t('elmessage.checkTaskGold'), trigger: 'blur' }],
  202. freeGold: [{ required: true, message: t('elmessage.checkFreeGold'), trigger: 'blur' }],
  203. permanentGold: [
  204. { required: true, message: t('elmessage.checkPermanentGold'), trigger: 'blur' }
  205. ],
  206. sumGold: [
  207. { required: true, message: t('elmessage.checkPayModel'), trigger: 'blur' },
  208. {
  209. validator: (rule, value) => {
  210. if (addRefund.value.refundModel === 1 && value === 0) {
  211. return Promise.reject(new Error(t('elmessage.noTotalGoldZero')))
  212. }
  213. return Promise.resolve()
  214. },
  215. trigger: 'blur'
  216. }
  217. ]
  218. })
  219. // 查找客户信息的方法
  220. const user = ref({
  221. firstRechargeTime: ''
  222. })
  223. const getUser = async function (jwcode) {
  224. trimJwCode();
  225. // 验证精网号
  226. if (!jwcode) {
  227. ElMessage.warning(t('elmessage.noEmptyJwcode'));
  228. return;
  229. }
  230. // 验证精网号是否为数字
  231. if (!/^\d{1,9}$/.test(jwcode)) {
  232. cancel()
  233. return;
  234. }
  235. try {
  236. // 发送POST请求
  237. const result = await API({
  238. url: '/user/selectUser',
  239. data: {
  240. jwcode: addRefund.value.jwcode
  241. }
  242. })
  243. console.log('请求成功', result)
  244. // 重置订单信息
  245. restGoods()
  246. //在此处错误逻辑的提示做了注释,在后续商品查询接口返回错误时,提示信息会显示在弹窗中
  247. if (result.code === 0) {
  248. ElMessage.error(result.msg);
  249. } else if (result.data === null) {
  250. ElMessage.error(t('elmessage.noUser'));
  251. } else {
  252. // 对传过来的金币数除以 100
  253. const processedData = {
  254. ...result.data,
  255. historySumGold: (Number(result.data.historySumGold) || 0),
  256. nowSumGold: (Number(result.data.nowSumGold) || 0),
  257. nowPermanentGold: (Number(result.data.nowPermanentGold) || 0),
  258. nowFreeGold: (Number(result.data.nowFreeGold) || 0),
  259. nowTaskGold: (Number(result.data.nowTaskGold) || 0)
  260. }
  261. user.value = processedData;
  262. console.log("用户信息", user.value);
  263. tableData.value = []
  264. addRefund.value.refundType = ''
  265. }
  266. } catch (error) {
  267. console.log("请求失败", error);
  268. ElMessage.error(t('elmessage.jwcodeError'));
  269. }
  270. }
  271. // 退款类型,写死为商品退款
  272. const refundType = ref([
  273. { value: '商品退款', label: t('refund.refundTypeOptions.商品退款') },
  274. { value: '金币退款', label: t('refund.refundTypeOptions.金币退款') }
  275. ])
  276. // 存储所有商品信息和订单号下拉数据
  277. const goodsName = ref([])
  278. const orderCodes = ref([])
  279. // 根据订单号自动带出商品名和金币信息
  280. const handleOrderChange = (orderCode) => {
  281. addRefund.value.refundModel = 0
  282. addRefund.value.goodsName = ''
  283. addRefund.value.permanentGold = ''
  284. addRefund.value.freeGold = ''
  285. addRefund.value.taskGold = ''
  286. const order = tableData.value.find(item => item.orderCode === orderCode)
  287. if (order) {
  288. addRefund.value.goodsName = order.goodsName
  289. addRefund.value.price = Number(order.price || 0) / 100
  290. addRefund.value.linkId = order.linkId || ''
  291. if (addRefund.value.refundType === '金币退款') {
  292. selectedGoodsGold.value = {
  293. permanentGold: Number(order.permanentGold) || 0,
  294. freeGold: Number(order.freeGold) || 0,
  295. taskGold: Number(order.taskGold) || 0
  296. }
  297. console.log('看看金币退款参数', selectedGoodsGold.value)
  298. } else {
  299. selectedGoodsGold.value = {
  300. permanentGold: -Number(order.permanentGold) || 0,
  301. freeGold: -Number(order.freeGold) || 0,
  302. taskGold: -Number(order.taskGold) || 0
  303. }
  304. console.log('看看商品退款参数', selectedGoodsGold.value)
  305. }
  306. // 全部退款的填充
  307. if (addRefund.value.refundModel === 0) {
  308. addRefund.value.permanentGold = selectedGoodsGold.value.permanentGold.toString()
  309. addRefund.value.freeGold = selectedGoodsGold.value.freeGold.toString()
  310. addRefund.value.taskGold = selectedGoodsGold.value.taskGold.toString()
  311. }
  312. } else {
  313. addRefund.value.goodsName = ''
  314. addRefund.value.price = ''
  315. addRefund.value.linkId = ''
  316. selectedGoodsGold.value = {
  317. permanentGold: 0,
  318. freeGold: 0,
  319. taskGold: 0
  320. }
  321. }
  322. }
  323. // 存储选中商品的金币花费信息
  324. const selectedGoodsGold = ref({
  325. permanentGold: 0,
  326. freeGold: 0,
  327. taskGold: 0
  328. })
  329. // 重置订单信息
  330. const restGoods = () => {
  331. addRefund.value.orderCode = ''
  332. addRefund.value.goodsName = ''
  333. addRefund.value.permanentGold = ''
  334. addRefund.value.freeGold = ''
  335. addRefund.value.taskGold = ''
  336. addRefund.value.price = ''
  337. addRefund.value.linkId = ''
  338. }
  339. // 处理退款方式切换
  340. const handleRefundModelChange = () => {
  341. // 全部退款的自动填充 上面有
  342. if (addRefund.value.refundModel === 0) {
  343. addRefund.value.permanentGold = selectedGoodsGold.value.permanentGold.toString();
  344. addRefund.value.freeGold = selectedGoodsGold.value.freeGold.toString();
  345. addRefund.value.taskGold = selectedGoodsGold.value.taskGold.toString();
  346. }
  347. if (Ref.value) {
  348. Ref.value.clearValidate('sumGold')
  349. }
  350. }
  351. // 统一的输入处理函数
  352. const handleGoldInput = (type, value) => {
  353. // 1. 过滤非法字符(只允许数字和小数点)
  354. let filtered = value.replace(/[^\d.]/g, '');
  355. // 2. 防止多个小数点
  356. const dotCount = (filtered.match(/\./g) || []).length;
  357. if (dotCount > 1) {
  358. // 保留第一个小数点,移除后续的小数点
  359. const parts = filtered.split('.');
  360. filtered = parts[0] + '.' + parts.slice(1).join('');
  361. }
  362. // 3. 限制小数点后两位
  363. if (filtered.includes('.')) {
  364. const [integer, decimal] = filtered.split('.');
  365. if (decimal.length > 2) {
  366. filtered = `${integer}.${decimal.slice(0, 2)}`;
  367. }
  368. }
  369. // 4. 检查是否以小数点开头,如果是,在前面添加0
  370. if (filtered.startsWith('.')) {
  371. filtered = '0' + filtered;
  372. }
  373. // 5. 更新值
  374. addRefund.value[type] = filtered;
  375. // 6. 验证逻辑(这里直接应用修正后的值)
  376. const maxValue = selectedGoodsGold.value[type];
  377. const inputValue = Number(filtered || 0);
  378. if (isNaN(inputValue)) {
  379. return;
  380. }
  381. if (inputValue > maxValue) {
  382. // 修正为最大值并设置回输入框
  383. const correctedValue = maxValue.toFixed(2);
  384. addRefund.value[type] = correctedValue;
  385. ElMessage.warning(t('elmessage.limitBalance'));
  386. }
  387. if (inputValue < 0) {
  388. // 修正为0并设置回输入框
  389. addRefund.value[type] = '0';
  390. ElMessage.warning(t('elmessage.noNegativeNumber'));
  391. }
  392. }
  393. // 使用示例
  394. const handlePermanentGoldInput = (value) => handleGoldInput('permanentGold', value);
  395. const handleFreeGoldInput = (value) => handleGoldInput('freeGold', value);
  396. const handleTaskGoldInput = (value) => handleGoldInput('taskGold', value);
  397. // 计算总金币
  398. const calculatedRechargeGoods = computed(() => {
  399. const permanentGold = addRefund.value.permanentGold === '' ? 0 : +addRefund.value.permanentGold;
  400. const freeGold = addRefund.value.freeGold === '' ? 0 : +addRefund.value.freeGold;
  401. const taskGold = addRefund.value.taskGold === '' ? 0 : +addRefund.value.taskGold;
  402. return Number((permanentGold + freeGold + taskGold).toFixed(2));
  403. })
  404. const canAdd = ref(findMenuById(menuTree.value,permissionMapping.add_gold_coin_refund))
  405. watch(calculatedRechargeGoods, (newVal) => {
  406. addRefund.value.sumGold = newVal
  407. })
  408. const handlePageSizeChange = function (val) {
  409. pagination.value.pageSize = val
  410. getRefund()
  411. }
  412. const handleCurrentChange = function (val) {
  413. pagination.value.pageNum = val
  414. getRefund()
  415. }
  416. onMounted(() =>{
  417. console.log(adminData.value)
  418. })
  419. </script>
  420. <template>
  421. <div class="father">
  422. <div class="userAndForm">
  423. <div class="left">
  424. <el-form :model="addRefund" ref="Ref" :rules="rules" label-width="auto" label-position="right"
  425. style="min-width: 500px" class="add-form">
  426. <el-form-item prop="jwcode" :label="$t('common_add.jwcode')">
  427. <el-input v-model="addRefund.jwcode" style="width: 220px" />
  428. <el-button type="primary" @click="getUser(addRefund.jwcode)" style="margin-left: 20px">{{ $t('common.search') }}
  429. </el-button>
  430. </el-form-item>
  431. <el-form-item prop="refundType" :label="$t('common_add.refundType')">
  432. <el-select v-model="addRefund.refundType" :placeholder="$t('common_add.refundTypePlaceholder')" style="width: 220px"
  433. @change="getRefund(addRefund.jwcode)">
  434. <el-option v-for="item in refundType" :key="item.value" :label="item.label" :value="item.value" />
  435. </el-select>
  436. </el-form-item>
  437. <el-form-item prop="orderCode" :label="$t('common_add.orderNo')">
  438. <el-select v-model="addRefund.orderCode" :placeholder="$t('common_add.orderNoPlaceholder')" style="width: 220px;" clearable filterable
  439. @change="handleOrderChange">
  440. <el-option v-for="(item, index) in orderCodes" :key="index" :label="item.label" :value="item.value" />
  441. </el-select>
  442. </el-form-item>
  443. <el-form-item prop="goodsName" :label="$t('common_add.goodsName')">
  444. <el-input v-model="addRefund.goodsName" style="width: 220px" disabled />
  445. </el-form-item>
  446. <el-form-item prop="refundModel" :label="$t('common_add.refundModel')">
  447. <el-radio-group v-model="addRefund.refundModel" @change="handleRefundModelChange">
  448. <el-radio :value="0">{{ $t('refund.refundMethods.allRefund') }}</el-radio>
  449. <el-radio :value="1">{{ $t('refund.refundMethods.partialRefund') }}</el-radio>
  450. </el-radio-group>
  451. </el-form-item>
  452. <el-form-item prop="permanentGold" :label="$t('common_add.permanentGold')">
  453. <el-input v-model="addRefund.permanentGold" style="width: 220px" :disabled="addRefund.refundModel === 0"
  454. @input="handlePermanentGoldInput($event)" type="number">
  455. </el-input>&nbsp;&nbsp;{{ $t('common.') }}
  456. <template>
  457. </template>
  458. </el-form-item>
  459. <el-form-item prop="freeGold" :label="$t('common_add.freeGold')">
  460. <el-input v-model="addRefund.freeGold" style="float: left; width: 220px"
  461. :disabled="addRefund.refundModel === 0" @input="handleFreeGoldInput($event)" type="number" />
  462. &nbsp;&nbsp;{{ $t('common.个') }}
  463. </el-form-item>
  464. <div>
  465. <el-form-item prop="taskGold" :label="$t('common_add.taskGold')">
  466. <el-input v-model="addRefund.taskGold" style="float: left; width: 220px"
  467. :disabled="addRefund.refundModel === 0" @input="handleTaskGoldInput($event)" type="number" />
  468. &nbsp;&nbsp;{{ $t('common.个') }}
  469. </el-form-item>
  470. </div>
  471. <div>
  472. <el-form-item prop="sumGold" :label="$t('common_add.refundGoldCoin')">
  473. <el-input disabled v-model="addRefund.sumGold" style="width: 220px">
  474. </el-input>
  475. </el-form-item>
  476. </div>
  477. <div>
  478. <el-form-item prop="remark" :label="$t('common_add.remark')">
  479. <el-input v-model="addRefund.remark" style="width: 220px" :rows="3" maxlength="100" show-word-limit
  480. type="textarea" />
  481. </el-form-item>
  482. </div>
  483. <el-button type="success" @click="cancel()" style="margin-left: 200px">{{ $t('common.reset') }}</el-button>
  484. <el-button type="primary" :disabled="addDisabled" @click="addBefore" v-if="canAdd"> {{ $t('common.submit') }}</el-button>
  485. </el-form>
  486. </div>
  487. </div>
  488. <div class="right">
  489. <div class="right-up">
  490. <!-- 客户信息栏 -->
  491. <el-card v-if="user.jwcode" class="customer-info">
  492. <el-form :model="user" label-width="auto" label-position="left">
  493. <span style="margin-left: 30%;font-size: larger;">{{ $t('common_add_user.customerInfo') }}</span>
  494. <el-row style="margin-top: 1vh;">
  495. <div class="line">
  496. <span style="width:5vw;">{{ $t('common_add_user.name') }}</span>
  497. <span style="width:10vw;">{{ user.name }}</span>
  498. <span style="width:10vw;">{{ $t('common_add_user.currentGoldCoinTotal') }}</span>
  499. <span style="color: #2fa1ff;width: 25vw;" v-if="user.nowSumGold !== undefined">{{
  500. user.nowSumGold
  501. }}</span>
  502. </div>
  503. </el-row>
  504. <el-row style="height: 3vh;width: 100%;">
  505. <span style="height:3vh;color: #b1b1b1;font-size: small;margin-left:50%;"
  506. v-if="user.nowPermanentGold !== undefined">({{ $t('common_add_user.permanentGold') }}:{{
  507. user.nowPermanentGold
  508. }};
  509. {{ $t('common_add_user.freeGold') }}:{{ user.nowFreeGold }};
  510. {{ $t('common_add_user.taskGold') }}:{{ user.nowTaskGold }})</span>
  511. </el-row>
  512. <el-row>
  513. <!-- 第二行精网号 + 消费次数 -->
  514. <div class="line">
  515. <span style="width:5vw;">{{ $t('common_add_user.jwcode') }}</span>
  516. <span style="width: 10vw;">{{ user.jwcode }}</span>
  517. <span style="width:10vw;">{{ $t('common_add_user.consumptionTimes') }}</span>
  518. <span style="width: 10vw;color: #2fa1ff;">{{ user.consumeNum }}</span>
  519. </div>
  520. </el-row>
  521. <el-row>
  522. <span style="height:3vh;color: #b1b1b1;font-size: small;margin-left:50%;">({{ $t('common_add_user.onlyStatisticsDataAfter20250101') }}2025-01-01)</span>
  523. </el-row>
  524. <!-- 第四行所属门店 -->
  525. <el-row>
  526. <div class="line">
  527. <span style="width:5vw;">{{ $t('common_add_user.store') }}</span>
  528. <span style="width: 10vw;">{{ user.market }}</span>
  529. </div>
  530. </el-row>
  531. </el-form>
  532. </el-card>
  533. </div>
  534. <div>
  535. <el-card class="card" v-if="tableData.length > 0">
  536. <el-table :data="tableData" style="height:43vh;width:50vw">
  537. <el-table-column type="index" :label="$t('refund.id')" width="80">
  538. <template #default="scope">
  539. <span>{{
  540. scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize
  541. }}</span>
  542. </template>
  543. </el-table-column>
  544. <el-table-column prop="type" :label="$t('refund.type')" width="100">
  545. <template #default="{ row }">
  546. {{ row.type === 0 ? $t('refund.recharge') : $t('refund.consume') }}
  547. </template>
  548. </el-table-column>
  549. <el-table-column prop="goodsName" :label="$t('refund.productName')" width="120" show-overflow-tooltip />
  550. <el-table-column prop="orderCode" :label="$t('refund.orderCode')" width="200px" show-overflow-tooltip />
  551. <el-table-column prop="permanentGold" :label="$t('refund.permanentGold')" width="120">
  552. <template #default="{ row }">
  553. {{ row.permanentGold }}
  554. </template>
  555. </el-table-column>
  556. <el-table-column prop="freeGold" :label="$t('refund.freeGold')" width="120">
  557. <template #default="{ row }">
  558. {{ row.freeGold }}
  559. </template>
  560. </el-table-column>
  561. <el-table-column prop="taskGold" :label="$t('refund.taskGold')" width="120">
  562. <template #default="{ row }">
  563. {{ row.taskGold }}
  564. </template>
  565. </el-table-column>
  566. <el-table-column prop="isRefund" :label="$t('refund.isRefund')" width="120">
  567. <template #default="{ row }">
  568. {{ row.isRefund === 1 ? $t('refund.no') : $t('refund.yes') }}
  569. </template>
  570. </el-table-column>
  571. </el-table>
  572. <el-pagination class="pagination" v-model:current-page="pagination.pageNum"
  573. v-model:page-size="pagination.pageSize" layout="total, sizes, prev, pager, next, jumper"
  574. :total="pagination.total" @size-change="handlePageSizeChange"
  575. @current-change="handleCurrentChange"></el-pagination>
  576. </el-card>
  577. </div>
  578. </div>
  579. </div>
  580. </template>
  581. <style scoped lang="scss">
  582. p {
  583. margin: 0px;
  584. }
  585. .father {
  586. width: 75vw;
  587. height: 70vh;
  588. display: flex;
  589. }
  590. .userAndForm {
  591. width: 25vw;
  592. height: 100%;
  593. display: flex;
  594. }
  595. .left {
  596. width: 35vw;
  597. display: flex;
  598. .add-form {
  599. width: 100%;
  600. margin-top: 30px;
  601. }
  602. }
  603. .right-up {
  604. width: 52vw;
  605. height: 20vh;
  606. display: flex;
  607. justify-content: center;
  608. align-items: center;
  609. margin-left: 2vw;
  610. .customer-info {
  611. height: 21vh;
  612. padding-left: 5%;
  613. display: flex;
  614. align-items: center;
  615. .line {
  616. display: flex;
  617. height: 3vh;
  618. }
  619. }
  620. }
  621. .card {
  622. width: 52vw;
  623. height: 50vh;
  624. margin-left: 2vw;
  625. margin-top: 1vh;
  626. }
  627. .pagination {
  628. display: flex;
  629. margin-top: 0.5vh;
  630. }
  631. </style>