Browse Source

🎈 perf: 金币充值明细、金币消耗明细

zhangrenyuan/feature-20251104133449-现金管理二期
zhangrenyuan 4 weeks ago
parent
commit
58ee708037
  1. 21
      src/views/consume/gold/coinConsumeDetail.vue
  2. 23
      src/views/recharge/gold/coinRechargeDetail.vue

21
src/views/consume/gold/coinConsumeDetail.vue

@ -1,13 +1,24 @@
<script setup> <script setup>
import { computed, onMounted, ref } from 'vue'
import { computed, onMounted, ref, watch } from 'vue'
import { dayjs, ElMessage } from 'element-plus' import { dayjs, ElMessage } from 'element-plus'
import request from '@/util/http.js' import request from '@/util/http.js'
import API from '@/util/http.js' import API from '@/util/http.js'
import moment from 'moment' import moment from 'moment'
import { reverseMarketMapping } from "@/utils/marketMap.js"; import { reverseMarketMapping } from "@/utils/marketMap.js";
import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js"; import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js";
import { storeToRefs } from 'pinia'
import { useAdminStore } from '@/store/index.js'
const adminStore = useAdminStore()
const { flag } = storeToRefs(adminStore)
// //
// flag
watch(flag, (newFlag, oldFlag) => {
if(newFlag !== oldFlag) {
ConsumeSelectBy()
}
})
/* /*
====================工具方法============================== ====================工具方法==============================
*/ */
@ -226,7 +237,7 @@ const ConsumeSelectBy = async function (val) {
...consumeUser.value, ...consumeUser.value,
sortField: sortField.value, sortField: sortField.value,
sortOrder: sortOrder.value, sortOrder: sortOrder.value,
flag: showEmployeeData.value ? 0 : 1 // flag
flag: flag.value // flag
} }
} }
}) })
@ -235,7 +246,7 @@ const ConsumeSelectBy = async function (val) {
// //
// detail.value // detail.value
const detailWithoutSort = { ...consumeUser.value, flag: showEmployeeData.value ? 0 : 1 }
const detailWithoutSort = { ...consumeUser.value, flag: flag.value }
delete detailWithoutSort.sortField delete detailWithoutSort.sortField
delete detailWithoutSort.sortOrder delete detailWithoutSort.sortOrder
@ -247,7 +258,7 @@ const ConsumeSelectBy = async function (val) {
totalGoldSearch.value.market = consumeUser.value.market totalGoldSearch.value.market = consumeUser.value.market
totalGoldSearch.value.goodsName = consumeUser.value.goodsName totalGoldSearch.value.goodsName = consumeUser.value.goodsName
totalGoldSearch.value.jwcode = consumeUser.value.jwcode totalGoldSearch.value.jwcode = consumeUser.value.jwcode
totalGoldSearch.value.flag = showEmployeeData.value ? 0 : 1 // flag
totalGoldSearch.value.flag = flag.value // flag
// //
const resultTotalGold = await request({ const resultTotalGold = await request({
// url: '/consume/statsGold', // url: '/consume/statsGold',
@ -446,7 +457,7 @@ const exportExcel = async function () {
goodsName: consumeUser.value.goodsName || '', goodsName: consumeUser.value.goodsName || '',
sortField: sortField.value || '', sortField: sortField.value || '',
sortOrder: sortOrder.value || '', sortOrder: sortOrder.value || '',
flag: showEmployeeData.value ? 0 : 1 // flag
flag: flag.value // flag
} }
} }

23
src/views/recharge/gold/coinRechargeDetail.vue

@ -1,13 +1,24 @@
<script setup> <script setup>
import { onMounted, ref } from 'vue'
import { onMounted, ref, watch } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import moment from 'moment' import moment from 'moment'
import API from '@/util/http.js' import API from '@/util/http.js'
import { reverseMarketMapping } from '@/utils/marketMap.js'; import { reverseMarketMapping } from '@/utils/marketMap.js';
import dayjs from "dayjs"; import dayjs from "dayjs";
import { storeToRefs } from 'pinia'
import { useAdminStore } from '@/store/index.js'
const adminStore = useAdminStore()
const { flag } = storeToRefs(adminStore)
// //
const showEmployeeData = ref(false)
// const showEmployeeData = ref(false)
// flag
watch(flag, (newFlag, oldFlag) => {
if(newFlag !== oldFlag) {
get()
}
})
const trimJwCode = () => { const trimJwCode = () => {
if (rechargeUser.value.jwcode) { if (rechargeUser.value.jwcode) {
@ -334,7 +345,7 @@ const get = async function (val) {
url: '/recharge/selectBy', url: '/recharge/selectBy',
data: { data: {
...getObj.value, ...getObj.value,
rechargeUser: { ...rechargeUser.value, flag: showEmployeeData.value ? 0 : 1 }//flag
rechargeUser: { ...rechargeUser.value, flag: flag.value }//flag
} }
}) })
// rechargeUser.value // rechargeUser.value
@ -342,7 +353,7 @@ const get = async function (val) {
...rechargeUser.value, ...rechargeUser.value,
sortField: undefined, sortField: undefined,
sortOrder: undefined, sortOrder: undefined,
flag: showEmployeeData.value ? 0 : 1 // flag
flag: flag.value // flag
}) })
const resultTotalGold = await API({ const resultTotalGold = await API({
url: '/recharge/statsGold', url: '/recharge/statsGold',
@ -488,7 +499,7 @@ const exportExcel = async function () {
const params = { const params = {
rechargeUser: { rechargeUser: {
...rechargeUser.value, ...rechargeUser.value,
flag: showEmployeeData.value ? 0 : 1
flag: flag.value
}, },
page: getObj.value.pageNum, page: getObj.value.pageNum,
size: total.value size: total.value
@ -608,7 +619,7 @@ const getTagText = (state) => {
<el-option v-for="item in platform" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in platform" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
</div> </div>
<el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox>
<!-- <el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox> -->
</div> </div>
</el-col> </el-col>
<el-col> <el-col>

Loading…
Cancel
Save