<template>
|
<LoadingLayout :loading="state.loading">
|
<AppContainer>
|
<ProTableQueryFilterBar @on-reset="reset">
|
<template #query>
|
<QueryFilterItem tip-content="结算单状态">
|
<FieldRadio
|
v-model="extraParamState.flexEnterpriseSettingStatus"
|
:value-enum="[
|
{ label: '已安排', value: 1 },
|
{ label: '待安排', value: 0 },
|
]"
|
buttonStyle
|
showAllBtn
|
@change="getList()"
|
/>
|
</QueryFilterItem>
|
<QueryFilterItem tip-content="结算状态">
|
<FieldRadio
|
v-model="extraParamState.flexEnterpriseSettingStatus"
|
:value-enum="[
|
{ label: '已安排', value: 1 },
|
{ label: '待安排', value: 0 },
|
]"
|
buttonStyle
|
showAllBtn
|
@change="getList()"
|
/>
|
</QueryFilterItem>
|
<QueryFilterItem>
|
<FieldDatePicker
|
v-model="extraParamState.flexEnterpriseSettingStatus"
|
type="daterange"
|
range-separator="~"
|
start-placeholder="起始日期"
|
end-placeholder="截止日期"
|
clearable
|
@change="getList()"
|
tooltipContent="创建时间"
|
></FieldDatePicker>
|
</QueryFilterItem>
|
<QueryFilterItem>
|
<SearchInput
|
v-model="extraParamState.searchWord"
|
style="width: 250px"
|
placeholder="任务名称"
|
@on-click-search="getList"
|
@keyup.enter="getList()"
|
>
|
</SearchInput>
|
</QueryFilterItem>
|
</template>
|
<template #btn>
|
<el-button type="primary" link @click="handleDownloadTemplate()">结算单模板</el-button>
|
<el-button type="primary" @click="handleDownloadTemplate()">上传结算单</el-button>
|
<el-button type="primary" @click="handleDownloadTemplate()">导出</el-button>
|
</template>
|
</ProTableQueryFilterBar>
|
<ProTableV2
|
v-bind="proTableProps"
|
:columns="ServiceChargeManageColumns"
|
:operationBtns="operationBtns"
|
>
|
<template #operationBtn-uploadBtn="{ data, row }">
|
<BlFileUpload
|
v-model:file-url="row.fileUrl"
|
:limitFileSize="2"
|
:limit="1"
|
accept="doc,docx"
|
ref="uploadRef"
|
:showTip="false"
|
:on-success="(response) => handleUpload(response, row)"
|
:show-file-list="false"
|
class="pro-table-operation-btn upload-style-btn"
|
>
|
<el-button link type="primary">上传</el-button>
|
</BlFileUpload>
|
</template>
|
</ProTableV2>
|
</AppContainer>
|
</LoadingLayout>
|
</template>
|
|
<script setup lang="ts">
|
import {
|
ProTableQueryFilterBar,
|
ProTableV2,
|
SearchInput,
|
LoadingLayout,
|
AppContainer,
|
QueryFilterItem,
|
useTable,
|
FieldDatePicker,
|
FieldRadio,
|
defineOperationBtns,
|
BlFileUpload,
|
} from '@bole-core/components';
|
import { ServiceChargeManageColumns } from './constants';
|
import { FlexEnterpriseSettingStatus, Gender } from '@/constants';
|
import { OrderInputType } from '@bole-core/core';
|
import { downloadFileByUrl } from '@/utils';
|
|
defineOptions({
|
name: 'ServiceChargeManage',
|
});
|
|
const operationBtns = defineOperationBtns([
|
{
|
data: {
|
enCode: 'uploadBtn',
|
name: '上传',
|
},
|
},
|
{
|
data: {
|
enCode: 'settleBtn',
|
name: '结算',
|
},
|
emits: {
|
onClick: (role) => goSettle(role),
|
},
|
},
|
{
|
data: {
|
enCode: 'detailBtn',
|
name: '详情',
|
},
|
emits: {
|
onClick: (role) => goDetail(role),
|
},
|
},
|
{
|
data: {
|
enCode: 'exportBtn',
|
name: '导出',
|
},
|
emits: {
|
onClick: (role) => handleExport(role),
|
},
|
},
|
]);
|
|
const router = useRouter();
|
|
const BaseState = {
|
loading: true,
|
};
|
|
const state = reactive({ ...BaseState });
|
|
onMounted(async () => {
|
await getList();
|
state.loading = false;
|
});
|
|
const {
|
getDataSource: getList,
|
proTableProps,
|
paginationState,
|
extraParamState,
|
reset,
|
} = useTable(
|
async ({ pageIndex, pageSize }, extraParamState) => {
|
try {
|
let params: API.GetFlexEnterpriseInput = {
|
pageModel: {
|
rows: pageSize,
|
page: pageIndex,
|
orderInput: extraParamState.orderInput,
|
},
|
flexEnterpriseSettingStatus: extraParamState.flexEnterpriseSettingStatus,
|
searchWord: extraParamState.searchWord,
|
};
|
|
let res = await flexEnterpriseServices.getFlexEnterpriseList(params, {
|
showLoading: !state.loading,
|
});
|
return res;
|
} catch (error) {
|
console.log('error: ', error);
|
}
|
},
|
{
|
defaultExtraParams: {
|
searchWord: '',
|
orderInput: [{ property: 'id', order: OrderInputType.Desc }],
|
flexEnterpriseSettingStatus: '' as any as FlexEnterpriseSettingStatus,
|
},
|
queryKey: ['flexEnterpriseServices/getFlexEnterpriseList'],
|
columnsRenderProps: {},
|
}
|
);
|
|
function goSettle(row) {
|
router.push({
|
name: 'ServiceChargeSettle',
|
query: {
|
id: row.id,
|
},
|
});
|
}
|
|
function goDetail(row) {
|
router.push({
|
name: 'ServiceChargeDetail',
|
query: {
|
id: row.id,
|
},
|
});
|
}
|
|
function handleUpload(val, row) {
|
console.log('val: ', val);
|
}
|
|
function handleExport(val) {
|
console.log('val: ', val);
|
}
|
|
function handleDownloadTemplate() {
|
downloadFileByUrl('', '结算单模板');
|
}
|
</script>
|