| | |
| | | @change="getList()" |
| | | /> |
| | | </QueryFilterItem> |
| | | <QueryFilterItem> |
| | | <!-- <QueryFilterItem> |
| | | <FieldDatePicker |
| | | v-model="extraParamState.time" |
| | | type="daterange" |
| | |
| | | @change="getList()" |
| | | tooltipContent="创建时间" |
| | | ></FieldDatePicker> |
| | | </QueryFilterItem> |
| | | </QueryFilterItem> --> |
| | | <QueryFilterItem> |
| | | <SearchInput |
| | | v-model="extraParamState.keywords" |
| | |
| | | </template> |
| | | <template #btn> |
| | | <el-button type="primary" link @click="handleDownloadTemplate()">结算单模板</el-button> |
| | | <el-button type="primary" @click="openDialog()">上传结算单</el-button> |
| | | <el-button type="primary" @click="handleDownloadTemplate()">导出</el-button> |
| | | <el-button type="primary" @click="handleAdd()">上传结算单</el-button> |
| | | <!-- <el-button type="primary" @click="handleDownloadTemplate()">导出</el-button> --> |
| | | </template> |
| | | </ProTableQueryFilterBar> |
| | | <ProTableV2 |
| | |
| | | :columns="ServiceChargeManageColumns" |
| | | :operationBtns="operationBtns" |
| | | > |
| | | <template #operationBtn-uploadBtn="{ data, row }"> |
| | | <template #operationBtn-uploadBtn="{ row }"> |
| | | <BlFileUpload |
| | | v-model:file-url="row.listFiles" |
| | | multiple |
| | | v-model:file-url="editForm.settlementUrl" |
| | | ref="uploadRef" |
| | | :showTip="false" |
| | | :show-file-list="false" |
| | | class="pro-table-operation-btn upload-style-btn" |
| | | :on-success="(event) => handleUploadSuccess(event, row)" |
| | | :limitFileSize="null" |
| | | :limit="1" |
| | | accept="xlsx,xls" |
| | | > |
| | | <el-button text type="primary" class="pro-table-operation-btn">上传</el-button> |
| | | </BlFileUpload> |
| | | </template> |
| | | <template #operationBtn-reUploadBtn="{ data, row }"> |
| | | <BlFileUpload |
| | | v-model:file-url="editForm.settlementUrl" |
| | | ref="uploadRef" |
| | | :showTip="false" |
| | | :show-file-list="false" |
| | | class="pro-table-operation-btn upload-style-btn" |
| | | :on-success="(event) => handleUploadSuccess(event, row)" |
| | | :limitFileSize="null" |
| | | :limit="1" |
| | | accept="xlsx,xls" |
| | | > |
| | | <el-button text type="primary" class="pro-table-operation-btn">重新上传</el-button> |
| | | </BlFileUpload> |
| | | </template> |
| | | </ProTableV2> |
| | |
| | | BlFileUpload, |
| | | } from '@bole-core/components'; |
| | | import { ServiceChargeManageColumns } from './constants'; |
| | | import { EnumTaskSettlementStatusText, EnumTaskSettlementOrderStatusText } from '@/constants'; |
| | | import { downloadFileByUrl } from '@/utils'; |
| | | import { |
| | | EnumTaskSettlementStatusText, |
| | | EnumTaskSettlementOrderStatusText, |
| | | EnumTaskSettlementOrderStatus, |
| | | EnumTaskSettlementStatus, |
| | | } from '@/constants'; |
| | | import { downloadFileByUrl, setOssFileName } from '@/utils'; |
| | | import * as taskServices from '@/services/api/task'; |
| | | import { ModelValueType } from 'element-plus'; |
| | | import UploadStatementDialog from './components/UploadStatementDialog.vue'; |
| | |
| | | }); |
| | | |
| | | const operationBtns = defineOperationBtns([ |
| | | // { |
| | | // data: { |
| | | // enCode: 'uploadBtn', |
| | | // name: '上传', |
| | | // }, |
| | | // emits: { |
| | | // onClick: (role) => openDialog(role), |
| | | // }, |
| | | // extraProps: { |
| | | // hide: () => false, |
| | | // }, |
| | | // }, |
| | | // { |
| | | // data: { |
| | | // enCode: 'reUploadBtn', |
| | | // name: '重新上传', |
| | | // }, |
| | | // emits: { |
| | | // onClick: (role) => openDialog(role), |
| | | // }, |
| | | // extraProps: { |
| | | // hide: () => false, |
| | | // }, |
| | | // }, |
| | | { |
| | | data: { |
| | | enCode: 'uploadBtn', |
| | | name: '上传', |
| | | }, |
| | | extraProps: { |
| | | hide: (row: API.GetSettlementTasksQueryResultItem) => |
| | | row.settlementOrderStatus !== EnumTaskSettlementOrderStatus.Wait, |
| | | }, |
| | | }, |
| | | { |
| | | data: { |
| | | enCode: 'reUploadBtn', |
| | | name: '重新上传', |
| | | }, |
| | | extraProps: { |
| | | hide: (row: API.GetSettlementTasksQueryResultItem) => |
| | | !( |
| | | row.settlementOrderStatus === EnumTaskSettlementOrderStatus.Completed && |
| | | row.settlementStatus === EnumTaskSettlementStatus.Wait |
| | | ), |
| | | }, |
| | | }, |
| | | { |
| | | data: { |
| | | enCode: 'settleBtn', |
| | | name: '结算', |
| | | }, |
| | | emits: { |
| | | onClick: (role) => openSettleDialog(role), |
| | | onClick: (role: API.GetSettlementTasksQueryResultItem) => openSettleDialog(role), |
| | | }, |
| | | extraProps: { |
| | | hide: () => false, |
| | | hide: (role: API.GetSettlementTasksQueryResultItem) => |
| | | !( |
| | | role.settlementOrderStatus === EnumTaskSettlementOrderStatus.Completed && |
| | | role.settlementStatus === EnumTaskSettlementStatus.Wait |
| | | ), |
| | | }, |
| | | }, |
| | | { |
| | |
| | | name: '详情', |
| | | }, |
| | | emits: { |
| | | onClick: (role) => goDetail(role), |
| | | onClick: (role: API.GetSettlementTasksQueryResultItem) => goDetail(role.id), |
| | | }, |
| | | extraProps: { |
| | | hide: (role: API.GetSettlementTasksQueryResultItem) => |
| | | role.settlementOrderStatus === EnumTaskSettlementOrderStatus.Wait, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | settlementAmount: { type: 'money' }, |
| | | settlementTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' }, |
| | | settlementOrderTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' }, |
| | | settlementOrderName: { |
| | | formatter: (row: API.GetSettlementTasksQueryResultItem) => |
| | | row.settlementOrderName && setOssFileName(row.settlementOrderName), |
| | | }, |
| | | }, |
| | | } |
| | | ); |
| | | |
| | | const { dialogProps, handleAdd, handleEdit, editForm } = useFormDialog({ |
| | | const { dialogProps, handleAdd, editForm } = useFormDialog({ |
| | | onConfirm: handleAddOrEdit, |
| | | defaultFormParams: { |
| | | code: '', |
| | | id: '', |
| | | name: '', |
| | | settlementUrl: [] as UploadUserFile[], |
| | | }, |
| | | }); |
| | | |
| | | function openDialog(row?: API.GetSettlementTasksQueryResultItem) { |
| | | if (row) { |
| | | handleEdit({ |
| | | id: row?.id, |
| | | name: row?.name, |
| | | settlementUrl: [] as UploadUserFile[], |
| | | }); |
| | | } else { |
| | | handleAdd(); |
| | | } |
| | | async function handleAddOrEdit() { |
| | | console.log('editForm: ', editForm); |
| | | goDetail(editForm.id, editForm.settlementUrl[0]?.path); |
| | | } |
| | | |
| | | async function handleAddOrEdit() {} |
| | | |
| | | const { |
| | | dialogProps: dialogSettleProps, |
| | |
| | | name: '', |
| | | code: '', |
| | | settlementUserCount: 0, |
| | | settlementAmount: 0, |
| | | actualSettlementAmount: 0, |
| | | }, |
| | | }); |
| | | |
| | |
| | | id: row.id, |
| | | name: row.name, |
| | | code: row.code, |
| | | settlementUserCount: row.settlementUserCount, |
| | | settlementAmount: row.settlementAmount, |
| | | settlementUserCount: row.settlementUserCount ?? 0, |
| | | actualSettlementAmount: row.actualSettlementAmount ?? 0, |
| | | }); |
| | | } |
| | | |
| | | async function handleRecall(row: API.GetSettlementTasksQueryResultItem) { |
| | | try { |
| | | Message.tipMessage('确认要撤回吗?'); |
| | | await Message.tipMessage('确认要撤回吗?'); |
| | | let params: API.RevokeTaskSettlementOrderCommand = { |
| | | taskInfoId: row.id, |
| | | }; |
| | |
| | | response: UploadUserFile & { file: File & { uid: number } }, |
| | | row: API.GetSettlementTasksQueryResultItem |
| | | ) { |
| | | if (response.url) { |
| | | goDetail(row, response.url); |
| | | if (response.path) { |
| | | goDetail(row.id, response.path); |
| | | } |
| | | } |
| | | |
| | | function goDetail(row: API.GetSettlementTasksQueryResultItem, url?: string) { |
| | | router.push({ |
| | | async function goDetail(id: string, url?: string) { |
| | | await router.push({ |
| | | name: 'ServiceChargeDetail', |
| | | params: { |
| | | id: id, |
| | | }, |
| | | query: { |
| | | id: row.id, |
| | | url: url ? url : '', |
| | | }, |
| | | }); |
| | | editForm.settlementUrl = [] as UploadUserFile[]; |
| | | } |
| | | |
| | | function handleExport(val) { |
| | |
| | | } |
| | | |
| | | function handleDownloadTemplate() { |
| | | downloadFileByUrl('', '结算单模板'); |
| | | downloadFileByUrl( |
| | | 'https://parkmanagement.oss-cn-hangzhou.aliyuncs.com/FlexJob/temp/%E7%BB%93%E7%AE%97%E5%8D%95%E6%A8%A1%E6%9D%BF.xlsx', |
| | | '结算单模板' |
| | | ); |
| | | } |
| | | </script> |