|
|
|
@ -4,15 +4,23 @@ import { useAdminStore } from "@/store/index.js" |
|
|
|
import { storeToRefs } from "pinia" |
|
|
|
import { findMenuById, permissionMapping } from "@/utils/menuTreePermission.js" |
|
|
|
const adminStore = useAdminStore() |
|
|
|
const { adminData, menuTree } = storeToRefs(adminStore) |
|
|
|
import { onMounted, ref } from 'vue' |
|
|
|
const { adminData, menuTree, flag } = storeToRefs(adminStore) |
|
|
|
// 监听全局flag状态变化(员工数据的) |
|
|
|
watch(flag, (newFlag, oldFlag) => { |
|
|
|
// 当flag状态改变时,重新发送请求 |
|
|
|
if (newFlag !== oldFlag) { |
|
|
|
console.log('员工数据flag状态改变,重新加载数据', newFlag) |
|
|
|
get() |
|
|
|
} |
|
|
|
}) |
|
|
|
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"; |
|
|
|
|
|
|
|
//新增员工数据复选框 |
|
|
|
const showEmployeeData = ref(false) |
|
|
|
// const showEmployeeData = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
// 变量 |
|
|
|
@ -102,7 +110,7 @@ const get = async function (val) { |
|
|
|
const result = await API({ |
|
|
|
url: '/goldDetail/getGold', |
|
|
|
method: 'post', |
|
|
|
data: { ...getObj.value, user: { ...user.value, flag: showEmployeeData.value ? 0 : 1 } } |
|
|
|
data: { ...getObj.value, user: { ...user.value, flag: flag.value } } |
|
|
|
}) |
|
|
|
console.log('响应数据', result) |
|
|
|
tableData.value = result.data.list |
|
|
|
@ -115,7 +123,7 @@ const get = async function (val) { |
|
|
|
data: { |
|
|
|
jwcode: user.value.jwcode, |
|
|
|
markets: user.value.markets, |
|
|
|
flag: showEmployeeData.value ? 0 : 1 |
|
|
|
flag: flag.value |
|
|
|
} |
|
|
|
}) |
|
|
|
// 判断精网号是否存在,假设精网号不存在时 result.data.list 为空数组 |
|
|
|
@ -242,7 +250,7 @@ const exportExcel = async function () { |
|
|
|
user: { |
|
|
|
jwcode: user.value.jwcode || '', |
|
|
|
markets: user.value.markets || [], |
|
|
|
flag: showEmployeeData.value ? 0 : 1 |
|
|
|
flag: flag.value |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
@ -394,7 +402,7 @@ const format3 = (num) => { |
|
|
|
@change="handleMarketChange" /> |
|
|
|
</div> |
|
|
|
<div class="head-card-element"> |
|
|
|
<el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox> |
|
|
|
<!-- <el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox> --> |
|
|
|
</div> |
|
|
|
<el-button type="primary" @click="search()">查询</el-button> |
|
|
|
<el-button type="primary" @click="exportExcel()">导出Excel</el-button> |
|
|
|
|