|
|
@@ -1,11 +1,8 @@
|
|
|
-import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo'
|
|
|
import { getUsrId } from '@/services/bus/user'
|
|
|
-import { FinanceReportReq } from "@/services/go/ermcp/report/interface"
|
|
|
-import { getDecimalsNum } from '@/utils/number'
|
|
|
import moment, { Moment } from "moment"
|
|
|
import { ref, SetupContext } from "vue"
|
|
|
import { reportCycleType, reportCyleTimeType } from "./enum"
|
|
|
-import { TypeAndTime, Value } from "./interface"
|
|
|
+import { Value } from "./interface"
|
|
|
|
|
|
export function handleReprotType(context: SetupContext) {
|
|
|
// 选中的周期类型
|
|
|
@@ -83,34 +80,3 @@ export function handleInitTypeAndTime() {
|
|
|
return { getInitTime, getInitType }
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * 获取表格列表数据
|
|
|
- * @param type
|
|
|
- * @returns
|
|
|
- */
|
|
|
-export function queryTableList<T>(fn: Function) {
|
|
|
- // 加载状态
|
|
|
- const loading = ref<boolean>(false);
|
|
|
- // 表格数据
|
|
|
- const tableList = ref<T[]>([]);
|
|
|
- function queryTable(value: TypeAndTime, otherParam?: object) {
|
|
|
- const param: FinanceReportReq = {
|
|
|
- querytype: 1,
|
|
|
- ...value
|
|
|
- }
|
|
|
- if (otherParam) {
|
|
|
- Object.assign(param, otherParam)
|
|
|
- }
|
|
|
- queryResultLoadingAndInfo(fn, loading, param).then(res => {
|
|
|
- const result = res?.map((e: T, i: number) => {
|
|
|
- for (const item in e) {
|
|
|
- // 折中方案:处理浮点失真,如果页面卡顿,则需要服务处理
|
|
|
- e[item] = getDecimalsNum(e[item])
|
|
|
- }
|
|
|
- return { ...e, key: String(i) };
|
|
|
- });
|
|
|
- tableList.value = result ? result : []
|
|
|
- })
|
|
|
- }
|
|
|
- return { loading, tableList, queryTable }
|
|
|
-}
|