|
|
@ -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 参数 |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|