|
@@ -21,17 +21,20 @@
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :sm="6" :xs="24">
|
|
<a-col :sm="6" :xs="24">
|
|
|
- <a-form-item label="日期" field="pay_date">
|
|
|
|
|
|
|
+ <a-form-item label="日期" field="pay_time">
|
|
|
<a-range-picker
|
|
<a-range-picker
|
|
|
- v-model="searchForm.pay_date"
|
|
|
|
|
|
|
+ v-model="searchForm.pay_time"
|
|
|
type="date"
|
|
type="date"
|
|
|
format="YYYY-MM-DD"
|
|
format="YYYY-MM-DD"
|
|
|
allow-clear
|
|
allow-clear
|
|
|
- :max-date="new Date()"
|
|
|
|
|
- :min-date="new Date('2025-01-01')"
|
|
|
|
|
:allow-clear="false" />
|
|
:allow-clear="false" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
|
|
+ <a-col :sm="6" :xs="24">
|
|
|
|
|
+ <a-form-item label="负责人" field="auth_id">
|
|
|
|
|
+ <auth-select v-model="searchForm.auth_id" multiple />
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<!-- Table 自定义渲染 -->
|
|
<!-- Table 自定义渲染 -->
|
|
@@ -45,6 +48,7 @@ import api from '../../../api/customer/reconciliation'
|
|
|
import commonApi from '../../../api/common'
|
|
import commonApi from '../../../api/common'
|
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
|
import GameSelect from '@/components/game-select/index.vue'
|
|
import GameSelect from '@/components/game-select/index.vue'
|
|
|
|
|
+import AuthSelect from '@/components/auth-select/index.vue'
|
|
|
import { nextTick } from 'vue'
|
|
import { nextTick } from 'vue'
|
|
|
|
|
|
|
|
// 引用定义
|
|
// 引用定义
|
|
@@ -56,19 +60,23 @@ const payChannelOptions = ref([])
|
|
|
// 搜索表单
|
|
// 搜索表单
|
|
|
const searchForm = ref({
|
|
const searchForm = ref({
|
|
|
game_id: '',
|
|
game_id: '',
|
|
|
- pay_channel_id: '',
|
|
|
|
|
- pay_date: [dayjs().subtract(7, 'day').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
|
|
|
|
|
|
|
+ pay_channel_id: [],
|
|
|
|
|
+ pay_time: [dayjs().subtract(7, 'day').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// SaTable 基础配置
|
|
// SaTable 基础配置
|
|
|
const options = reactive({
|
|
const options = reactive({
|
|
|
- singleLine: true,
|
|
|
|
|
api: api.getPageList,
|
|
api: api.getPageList,
|
|
|
pk: 'id',
|
|
pk: 'id',
|
|
|
showSummary: true,
|
|
showSummary: true,
|
|
|
operationColumn: false,
|
|
operationColumn: false,
|
|
|
showSort: false,
|
|
showSort: false,
|
|
|
- summary: [],
|
|
|
|
|
|
|
+ summary: reactive([
|
|
|
|
|
+ {
|
|
|
|
|
+ action: 'totalRow',
|
|
|
|
|
+ dataIndex: 'game_id',
|
|
|
|
|
+ },
|
|
|
|
|
+ ]),
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// SaTable 列配置
|
|
// SaTable 列配置
|
|
@@ -86,24 +94,26 @@ const getPayChannelOptions = async () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const handleRequestData = () => {
|
|
const handleRequestData = () => {
|
|
|
- // 使用 nextTick 确保在 DOM 更新后再获取数据
|
|
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
const res = crudRef.value.getResponseData()
|
|
const res = crudRef.value.getResponseData()
|
|
|
|
|
|
|
|
- // 重新添加动态列,并为每一列添加合计配置
|
|
|
|
|
- if (res && res.columns && Array.isArray(res.columns)) {
|
|
|
|
|
- console.log(res.columns)
|
|
|
|
|
|
|
+ // 重新添加动态列
|
|
|
|
|
+ if (res?.columns && Array.isArray(res.columns)) {
|
|
|
columns.value = res.columns
|
|
columns.value = res.columns
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 处理合计行数据
|
|
|
|
|
+ if (res.totalRow) {
|
|
|
|
|
+ // 先清空数组
|
|
|
|
|
+ options.summary.length = 0
|
|
|
|
|
|
|
|
- // 动态生成 summary 配置,dataIndex 与 columns 保持一致
|
|
|
|
|
- if (Array.isArray(res.columns)) {
|
|
|
|
|
- // 只对数值类型的列添加合计
|
|
|
|
|
- const numericColumns = res.columns.filter((col) => {
|
|
|
|
|
- // 排除日期、文本等非数值列
|
|
|
|
|
- const excludeFields = ['reg_date', 'date', 'time', 'name', 'title', 'description', 'game_id', 'game_name']
|
|
|
|
|
- return !excludeFields.includes(col.dataIndex)
|
|
|
|
|
|
|
+ // 遍历 totalRow 的 key,设置 dataIndex 为 key
|
|
|
|
|
+ Object.keys(res.totalRow).forEach((key) => {
|
|
|
|
|
+ options.summary.push({
|
|
|
|
|
+ action: 'totalRow',
|
|
|
|
|
+ dataIndex: key,
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|