| | |
| | | </ProFormItemV2> |
| | | </ProFormColItem> |
| | | </ProFormCol> |
| | | <ProFormCol> |
| | | <!-- <ProFormCol> |
| | | <ProFormColItem :span="8"> |
| | | <ProFormItemV2 label="结算单名称:" prop="settlementOrderName"> |
| | | <ProFormText v-model="form.settlementOrderName"> </ProFormText> |
| | |
| | | ></ProFormDatePicker> |
| | | </ProFormItemV2> |
| | | </ProFormColItem> |
| | | </ProFormCol> |
| | | </ProFormCol> --> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="8"> |
| | | <ProFormItemV2 label="结算金额:" prop="settlementAmount"> |
| | |
| | | </el-steps> |
| | | </div> |
| | | </ChunkCell> --> |
| | | <ChunkCell title="结算名单" style="flex: 1"> |
| | | <ChunkCell title="结算名单" style="flex: 1" class="settlement-user-list-chunk"> |
| | | <ProTableQueryFilterBar @on-reset="reset"> |
| | | <template #query> |
| | | <QueryFilterItem> |
| | |
| | | </SearchInput> |
| | | </QueryFilterItem> |
| | | </template> |
| | | <template #btn> |
| | | <BlFileUpload |
| | | v-model:file-url="form.settlementUrl" |
| | | ref="uploadRef" |
| | | :showTip="false" |
| | | :show-file-list="false" |
| | | class="pro-table-operation-btn upload-style-btn" |
| | | :on-success="(event) => handleUploadSuccess(event)" |
| | | :limitFileSize="null" |
| | | :limit="1" |
| | | accept="xlsx,xls" |
| | | > |
| | | <el-button text type="primary" class="pro-table-operation-btn">上传</el-button> |
| | | </BlFileUpload> |
| | | <el-button type="primary" link @click="handleAdd()">导出</el-button> |
| | | </template> |
| | | </ProTableQueryFilterBar> |
| | | <ProTableV2 |
| | | v-bind="proTableProps" |
| | |
| | | :auto-height="false" |
| | | ref="proTable" |
| | | :tableProps="{ |
| | | maxHeight: '400px', |
| | | maxHeight: '250px', |
| | | }" |
| | | > |
| | | </ProTableV2> |
| | | <div class="chuck-add-or-edit-actions"> |
| | | <el-button class="chuck-add-or-edit-actions" @click="handleBack">取消</el-button> |
| | | <el-button |
| | | v-if="!isDetail" |
| | | v-if="isSettlement" |
| | | class="chuck-add-or-edit-actions" |
| | | type="primary" |
| | | @click="handleSubmit" |
| | | >确认</el-button |
| | | >结算</el-button |
| | | > |
| | | </div> |
| | | </ChunkCell> |
| | |
| | | import { |
| | | LoadingLayout, |
| | | AppContainer, |
| | | AppScrollContainer, |
| | | ChunkCell, |
| | | ProForm, |
| | | ProFormItemV2, |
| | |
| | | QueryFilterItem, |
| | | ProTableQueryFilterBar, |
| | | useFormDialog, |
| | | XLSXUtils, |
| | | BlFileUpload, |
| | | UploadUserFile, |
| | | } from '@bole-core/components'; |
| | | import { SettlementListColumns } from './constants'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | |
| | | const route = useRoute(); |
| | | const id = (route.params.id as string) ?? ''; |
| | | const url = (route.query.url as string) ?? ''; |
| | | const settlement = (route.query.settlement as string) ?? ''; |
| | | |
| | | const isDetail = computed(() => !url); |
| | | const isSettlement = computed(() => !!url || !!settlement); |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | |
| | | code: '', |
| | | settlementOrderName: '', |
| | | settlementOrderTime: '', |
| | | settlementTaskUsers: [] as API.GetSettlementTaskUsersQueryResultItem[], |
| | | |
| | | settlementUrl: [] as UploadUserFile[], |
| | | }); |
| | | |
| | | const BaseState = { |
| | | loading: true, |
| | | }; |
| | | |
| | | const state = reactive({ ...BaseState }); |
| | | |
| | | const { isLoading } = useQuery({ |
| | | queryKey: ['taskServices/getSettlementTask', id], |
| | | queryKey: ['taskUserServices/getSettlementTaskUsers', id, url], |
| | | queryFn: async () => { |
| | | return await taskServices.getSettlementTask( |
| | | { id: id }, |
| | | return await taskUserServices.getSettlementTaskUsers( |
| | | { taskInfoId: id, settlementOrderUrl: url }, |
| | | { |
| | | showLoading: false, |
| | | } |
| | | ); |
| | | }, |
| | | placeholderData: () => ({} as API.GetSettlementTaskQueryResult), |
| | | onSuccess(data) { |
| | | form.name = data.name; |
| | | form.settlementAmount = data.settlementAmount ?? 0; |
| | | form.actualSettlementAmount = data.actualSettlementAmount ?? 0; |
| | | form.code = data.code; |
| | | form.settlementOrderName = setOssFileName(data.settlementOrderName); |
| | | form.settlementOrderTime = data.settlementOrderTime ?? ''; |
| | | placeholderData: () => ({} as API.GetSettlementTaskUsersQueryResult), |
| | | onSuccess(res) { |
| | | form.settlementTaskUsers = res?.data ?? []; |
| | | if (res?.detail) { |
| | | form.name = res?.detail?.name; |
| | | form.settlementAmount = res?.detail?.settlementAmount ?? 0; |
| | | form.actualSettlementAmount = res?.detail?.actualSettlementAmount ?? 0; |
| | | form.code = res?.detail?.code; |
| | | form.settlementOrderName = setOssFileName(res?.detail?.settlementOrderName); |
| | | form.settlementOrderTime = res?.detail?.settlementOrderTime ?? ''; |
| | | } |
| | | if (res?.errors?.length > 0) { |
| | | Message.tipMessage('存在导入错误的数据,是否导出?').then(() => { |
| | | XLSXUtils.exportToXLSX({ |
| | | workbookDataList: res.errors, |
| | | fileName: '结算导入-错误数据', |
| | | workbookHeaderMap: { |
| | | name: '姓名', |
| | | identity: '身份证号', |
| | | taskName: '任务名称', |
| | | settlementAmount: '结算金额', |
| | | actualSettlementAmount: '实发金额', |
| | | receiveAccount: '收款账户', |
| | | bank: '所属银行', |
| | | bankBranch: '开户支行名称', |
| | | errorMessage: '错误信息', |
| | | }, |
| | | }); |
| | | }); |
| | | } |
| | | getList(); |
| | | }, |
| | | enabled: !!id, |
| | | }); |
| | |
| | | } = useTable( |
| | | async ({ pageIndex, pageSize }, extraParamState) => { |
| | | try { |
| | | let params: API.APIgetSettlementTaskUsersParams = { |
| | | taskInfoId: id, |
| | | settlementOrderUrl: url, |
| | | }; |
| | | let res = await taskUserServices.getSettlementTaskUsers(params); |
| | | let list = [...form.settlementTaskUsers]; |
| | | if (extraParamState.keywords) { |
| | | res.data = res.data?.filter((item) => { |
| | | list = list?.filter((item) => { |
| | | return ( |
| | | item.name.includes(extraParamState.keywords) || |
| | | item.contactPhoneNumber.includes(extraParamState.keywords) || |
| | |
| | | ); |
| | | }); |
| | | } |
| | | |
| | | return Promise.resolve({ |
| | | pageModel: { |
| | | rows: pageSize, |
| | | page: pageIndex, |
| | | totalCount: res.data.length, |
| | | totalCount: list.length, |
| | | }, |
| | | data: paginateList(res.data, pageIndex, pageSize), |
| | | data: paginateList(list, pageIndex, pageSize), |
| | | }); |
| | | } catch (error) { |
| | | console.log('error: ', error); |
| | |
| | | } catch (error) {} |
| | | } |
| | | |
| | | function handleUploadSuccess(response: UploadUserFile & { file: File & { uid: number } }) { |
| | | if (response.path) { |
| | | // |
| | | } |
| | | } |
| | | |
| | | function handleBack() { |
| | | closeViewPush(route, { |
| | | name: 'ServiceChargeManageList', |
| | | }); |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | margin: 0 auto; |
| | | padding: 24px 0; |
| | | } |
| | | |
| | | .settlement-user-list-chunk { |
| | | :deep() { |
| | | .no-data img { |
| | | width: 280px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="scss"> |
| | | .text-over-tooltip-content { |