Browse Source

Merge branch 'refs/heads/milestone-20251104-现金二期' into lihui/feature-20251104165712-现金二期

# Conflicts:
#	src/views/consume/gold/coinConsumeDetail.vue
zhangrenyuan/feature-20251104133449-现金管理二期
lihui 3 weeks ago
parent
commit
5a856b473f
  1. 36
      src/views/consume/gold/coinConsumeDetail.vue
  2. 23
      src/views/recharge/gold/coinRechargeDetail.vue

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

@ -1,12 +1,24 @@
<script setup>
import { computed, onMounted, ref } from 'vue'
import { computed, onMounted, ref, watch } from 'vue'
import { dayjs, ElMessage } from 'element-plus'
import request from '@/util/http.js'
import API from '@/util/http.js'
import moment from 'moment'
import { reverseMarketMapping } from "@/utils/marketMap.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()
}
})
/*
====================工具方法==============================
*/
@ -141,6 +153,14 @@ const totalGoldSearch = ref({
goodsName: ""
})
const selectPermission = ref(false)
//
const initPermissions = async() => {
if (!menuTree.value || !menuTree.value.length) return;
selectPermission.value = hasMenuPermission(menuTree.value, permissionMapping.gold_coin_consumption_details);
};
/*
====================方法=================================
@ -163,6 +183,11 @@ const getAdminData = async function () {
const ConsumeSelectBy = async function (val) {
if (!selectPermission) {
ElMessage.error('暂无权限')
return
}
try {
//
@ -212,7 +237,7 @@ const ConsumeSelectBy = async function (val) {
...consumeUser.value,
sortField: sortField.value,
sortOrder: sortOrder.value,
flag: showEmployeeData.value ? 0 : 1 // flag
flag: flag.value // flag
}
}
})
@ -221,7 +246,7 @@ const ConsumeSelectBy = async function (val) {
//
// detail.value
const detailWithoutSort = { ...consumeUser.value, flag: showEmployeeData.value ? 0 : 1 }
const detailWithoutSort = { ...consumeUser.value, flag: flag.value }
delete detailWithoutSort.sortField
delete detailWithoutSort.sortOrder
@ -233,7 +258,7 @@ const ConsumeSelectBy = async function (val) {
totalGoldSearch.value.market = consumeUser.value.market
totalGoldSearch.value.goodsName = consumeUser.value.goodsName
totalGoldSearch.value.jwcode = consumeUser.value.jwcode
totalGoldSearch.value.flag = showEmployeeData.value ? 0 : 1 // flag
totalGoldSearch.value.flag = flag.value // flag
//
const resultTotalGold = await request({
// url: '/consume/statsGold',
@ -412,6 +437,7 @@ const handleCurrentChange = function (val) {
//
const sumGold = computed(() => permanentGolds.value + freeGolds.value + taskGolds.value)
onMounted(async function () {
await initPermissions()
await getAdminData()
await ConsumeSelectBy()
// getActivity();
@ -432,7 +458,7 @@ const exportExcel = async function () {
goodsName: consumeUser.value.goodsName || '',
sortField: sortField.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>
import { onMounted, ref } from 'vue'
import { onMounted, ref, watch } from 'vue'
import { ElMessage } from 'element-plus'
import moment from 'moment'
import API from '@/util/http.js'
import { reverseMarketMapping } from '@/utils/marketMap.js';
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 = () => {
if (rechargeUser.value.jwcode) {
@ -334,7 +345,7 @@ const get = async function (val) {
url: '/recharge/selectBy',
data: {
...getObj.value,
rechargeUser: { ...rechargeUser.value, flag: showEmployeeData.value ? 0 : 1 }//flag
rechargeUser: { ...rechargeUser.value, flag: flag.value }//flag
}
})
// rechargeUser.value
@ -342,7 +353,7 @@ const get = async function (val) {
...rechargeUser.value,
sortField: undefined,
sortOrder: undefined,
flag: showEmployeeData.value ? 0 : 1 // flag
flag: flag.value // flag
})
const resultTotalGold = await API({
url: '/recharge/statsGold',
@ -488,7 +499,7 @@ const exportExcel = async function () {
const params = {
rechargeUser: {
...rechargeUser.value,
flag: showEmployeeData.value ? 0 : 1
flag: flag.value
},
page: getObj.value.pageNum,
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-select>
</div>
<el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox>
<!-- <el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox> -->
</div>
</el-col>
<el-col>

Loading…
Cancel
Save