|
@@ -2,16 +2,17 @@
|
|
|
<template>
|
|
<template>
|
|
|
<app-view>
|
|
<app-view>
|
|
|
<template #header>
|
|
<template #header>
|
|
|
- <el-form ref="formRef" class="el-form--filter" :model="queryParams" :rules="formRules" :show-message="false">
|
|
|
|
|
|
|
+ <el-form ref="formRef" class="el-form--filter" :model="queryParams" :rules="formRules"
|
|
|
|
|
+ :show-message="false">
|
|
|
<el-form-item label="报表类型" prop="cycletype">
|
|
<el-form-item label="报表类型" prop="cycletype">
|
|
|
- <el-select v-model="queryParams.cycletype">
|
|
|
|
|
|
|
+ <el-select v-model="queryParams.cycletype" @change="onTypeChange">
|
|
|
<el-option v-for="item in getReportTypeList()" :key="item.value" :label="item.label"
|
|
<el-option v-for="item in getReportTypeList()" :key="item.value" :label="item.label"
|
|
|
:value="item.value" />
|
|
:value="item.value" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="日期" prop="cycletime">
|
|
|
|
|
- <el-date-picker :type="dateType" v-model="queryParams.cycletime" :format="dateFormat"
|
|
|
|
|
- :value-format="dateFormat" placeholder="请选择日期" @change="onTypeChange" />
|
|
|
|
|
|
|
+ <el-form-item label="日期" prop="tradedate">
|
|
|
|
|
+ <el-date-picker :type="dateType" v-model="queryParams.tradedate" :format="dateFormat"
|
|
|
|
|
+ :value-format="dateFormat" placeholder="请选择日期" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="季度" prop="quarter" v-if="queryParams.cycletype === ReportType.Quarter">
|
|
<el-form-item label="季度" prop="quarter" v-if="queryParams.cycletype === ReportType.Quarter">
|
|
|
<el-select v-model="queryParams.quarter">
|
|
<el-select v-model="queryParams.quarter">
|
|
@@ -20,11 +21,11 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="是否包含子机构" prop="isson">
|
|
<el-form-item label="是否包含子机构" prop="isson">
|
|
|
- <el-checkbox v-model="isson" size="small" />
|
|
|
|
|
|
|
+ <el-switch v-model="queryParams.isson" active-value="1" inactive-value="0" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="onSearch">查询</el-button>
|
|
|
|
|
- <el-button type="primary" @click="onSearch(false)">重置</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="onSearch(false)">查询</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="onSearch(true)">重置</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</template>
|
|
</template>
|
|
@@ -46,25 +47,23 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, computed, ref } from 'vue'
|
|
import { shallowRef, computed, ref } from 'vue'
|
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
|
|
+import { useEnum } from '@/hooks/enum'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { formatDate } from '@/filters'
|
|
import { formatDate } from '@/filters'
|
|
|
import { shareAmountQuery } from '@/services/api/report'
|
|
import { shareAmountQuery } from '@/services/api/report'
|
|
|
import { useOperation } from '@/hooks/operation'
|
|
import { useOperation } from '@/hooks/operation'
|
|
|
-import { useUserStore } from '@/stores'
|
|
|
|
|
import { getReportTypeList, ReportType, getQuarterList } from '@/constants/report'
|
|
import { getReportTypeList, ReportType, getQuarterList } from '@/constants/report'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
|
import AppOperation from '@pc/components/base/operation/index.vue'
|
|
import AppOperation from '@pc/components/base/operation/index.vue'
|
|
|
|
|
|
|
|
|
|
+const roleTypeEnum = useEnum('roleType') // 角色
|
|
|
|
|
+
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
-const userStore = useUserStore()
|
|
|
|
|
-const isson = ref(true)
|
|
|
|
|
|
|
|
|
|
const queryParams = ref<Partial<Model.ShareAmountQueryReq>>({
|
|
const queryParams = ref<Partial<Model.ShareAmountQueryReq>>({
|
|
|
- orgztypes: userStore.userInfo.orgztypes,
|
|
|
|
|
cycletype: 0,
|
|
cycletype: 0,
|
|
|
- cycletime: '',
|
|
|
|
|
- isson: isson.value ? 1 : 0
|
|
|
|
|
|
|
+ isson: 0
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.ShareAmountQueryRsp>({
|
|
const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.ShareAmountQueryRsp>({
|
|
@@ -76,8 +75,6 @@ const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(shareA
|
|
|
params: {
|
|
params: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 20,
|
|
pageSize: 20,
|
|
|
- isson: isson.value ? 1 : 0,
|
|
|
|
|
- orgztypes: userStore.userInfo.orgztypes
|
|
|
|
|
},
|
|
},
|
|
|
onError: (err) => {
|
|
onError: (err) => {
|
|
|
ElMessage.error(err)
|
|
ElMessage.error(err)
|
|
@@ -104,34 +101,34 @@ const dateType = computed(() => {
|
|
|
const dateFormat = computed(() => {
|
|
const dateFormat = computed(() => {
|
|
|
switch (queryParams.value.cycletype) {
|
|
switch (queryParams.value.cycletype) {
|
|
|
case ReportType.Month:
|
|
case ReportType.Month:
|
|
|
- return 'YYYY-MM'
|
|
|
|
|
|
|
+ return 'YYYYMM'
|
|
|
case ReportType.Quarter:
|
|
case ReportType.Quarter:
|
|
|
case ReportType.Year:
|
|
case ReportType.Year:
|
|
|
return 'YYYY'
|
|
return 'YYYY'
|
|
|
default:
|
|
default:
|
|
|
- return 'YYYY-MM-DD'
|
|
|
|
|
|
|
+ return 'YYYYMMDD'
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const onTypeChange = (value: ReportType) => {
|
|
const onTypeChange = (value: ReportType) => {
|
|
|
- const dateValue = queryParams.value.cycletime
|
|
|
|
|
|
|
+ const dateValue = queryParams.value.tradedate
|
|
|
if (dateValue) {
|
|
if (dateValue) {
|
|
|
switch (value) {
|
|
switch (value) {
|
|
|
case ReportType.Month:
|
|
case ReportType.Month:
|
|
|
- queryParams.value.cycletime = formatDate(dateValue, 'YYYY-MM')
|
|
|
|
|
|
|
+ queryParams.value.tradedate = formatDate(dateValue, 'YYYYMM')
|
|
|
break
|
|
break
|
|
|
case ReportType.Quarter:
|
|
case ReportType.Quarter:
|
|
|
case ReportType.Year:
|
|
case ReportType.Year:
|
|
|
- queryParams.value.cycletime = formatDate(dateValue, 'YYYY')
|
|
|
|
|
|
|
+ queryParams.value.tradedate = formatDate(dateValue, 'YYYY')
|
|
|
break
|
|
break
|
|
|
default:
|
|
default:
|
|
|
- queryParams.value.cycletime = formatDate(dateValue, 'YYYY-MM-DD')
|
|
|
|
|
|
|
+ queryParams.value.tradedate = formatDate(dateValue, 'YYYYMMDD')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
- { field: 'areatype', label: '角色' },
|
|
|
|
|
|
|
+ { field: 'areatype', label: '角色', formatValue: (val) => roleTypeEnum.getEnumTypeName(val) },
|
|
|
{ field: 'areaaccountid', label: '结算资金账户' },
|
|
{ field: 'areaaccountid', label: '结算资金账户' },
|
|
|
{ field: 'goodsname', label: '商品/市场' },
|
|
{ field: 'goodsname', label: '商品/市场' },
|
|
|
{ field: 'searchtype', label: '费用类型' },
|
|
{ field: 'searchtype', label: '费用类型' },
|
|
@@ -142,19 +139,17 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
|
|
|
|
|
// 表单验证规则
|
|
// 表单验证规则
|
|
|
const formRules: FormRules = {
|
|
const formRules: FormRules = {
|
|
|
- cycletime: [{ required: true }],
|
|
|
|
|
|
|
+ tradedate: [{ required: true }],
|
|
|
|
|
+ quarter: [{ required: true }],
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const onSearch = (clear = false) => {
|
|
const onSearch = (clear = false) => {
|
|
|
- if (!clear) {
|
|
|
|
|
|
|
+ if (clear) {
|
|
|
queryParams.value = {
|
|
queryParams.value = {
|
|
|
cycletype: 0,
|
|
cycletype: 0,
|
|
|
- cycletime: '',
|
|
|
|
|
- isson: isson.value ? 1 : 0,
|
|
|
|
|
- orgztypes: userStore.userInfo.orgztypes
|
|
|
|
|
|
|
+ isson: 0
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- queryParams.value.isson = isson.value ? 1 : 0
|
|
|
|
|
formRef.value?.validate((valid) => {
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
run(queryParams.value)
|
|
run(queryParams.value)
|
|
@@ -164,14 +159,6 @@ const onSearch = (clear = false) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const openComponentOnClick = (code: string) => {
|
|
const openComponentOnClick = (code: string) => {
|
|
|
- processRequiredParams(() => openComponent(code))
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 处理请求参数
|
|
|
|
|
-const processRequiredParams = (callback: (params: Model.ShareAmountQueryReq) => void, clear = false) => {
|
|
|
|
|
- queryParams.value.type = isson.value ? 1 : 0
|
|
|
|
|
- queryParams.value.orgztypes = userStore.userInfo.orgztypes
|
|
|
|
|
- onSearch(!clear)
|
|
|
|
|
|
|
+ openComponent(code)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
</script>
|
|
</script>
|