| | |
| | | </QueryFilterItem> |
| | | </template> |
| | | <template #btn v-if="isSettlement"> |
| | | <BlFileUpload |
| | | <!-- <BlFileUpload |
| | | v-model:file-url="form.settlementUrl" |
| | | ref="uploadRef" |
| | | :showTip="false" |
| | |
| | | accept="xlsx,xls" |
| | | > |
| | | <el-button text type="primary" class="pro-table-operation-btn">导入</el-button> |
| | | </BlFileUpload> |
| | | <el-button type="primary" link @click="handleExport()">导出</el-button> |
| | | </BlFileUpload> --> |
| | | <el-button |
| | | v-if="checkSubModuleItemShow('pageButton', 'exportBtn')" |
| | | type="primary" |
| | | link |
| | | @click="handleExport()" |
| | | >导出</el-button |
| | | > |
| | | </template> |
| | | </ProTableQueryFilterBar> |
| | | <ProTableV2 |
| | | v-bind="proTableProps" |
| | | :columns="SettlementListColumns" |
| | | :columns="column" |
| | | :operationBtns="operationBtns" |
| | | :auto-height="false" |
| | | ref="proTable" |
| | |
| | | " |
| | | class="chuck-add-or-edit-actions" |
| | | type="primary" |
| | | @click="handleSubmit()" |
| | | >结算申请</el-button |
| | | @click="handleSubmit('confirm')" |
| | | >结算确认</el-button |
| | | > |
| | | <el-button |
| | | v-if="isSettlement && form.auditStatus === EnumTaskSettlementAuditStatus.Pass" |
| | | class="chuck-add-or-edit-actions" |
| | | type="primary" |
| | | @click="handleSubmit()" |
| | | @click="handleSubmit('submit')" |
| | | >提交结算</el-button |
| | | > |
| | | </div> |
| | |
| | | </AppScrollContainer> |
| | | <EditAccountInfoDialog v-bind="dialogProps"></EditAccountInfoDialog> |
| | | <SettleDetailDialog v-bind="dialogSettleProps" /> |
| | | <ResettleEditDialog v-bind="dialogResettleProps" /> |
| | | </LoadingLayout> |
| | | </template> |
| | | <script setup lang="ts"> |
| | |
| | | BlFileUpload, |
| | | UploadUserFile, |
| | | } from '@bole-core/components'; |
| | | import { SettlementListColumns } from './constants'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import * as taskServices from '@/services/api/task'; |
| | | import * as taskUserServices from '@/services/api/taskUser'; |
| | | import EditAccountInfoDialog from './components/EditAccountInfoDialog.vue'; |
| | | import SettleDetailDialog from './components/SettleDetailDialog.vue'; |
| | | import ResettleEditDialog from './components/ResettleEditDialog.vue'; |
| | | import { Message } from '@bole-core/core'; |
| | | import { SettlementReceiveStatusText, EnumTaskSettlementAuditStatus } from '@/constants'; |
| | | import { |
| | |
| | | |
| | | const { closeViewPush } = useRouteView(); |
| | | const eventContext = useGlobalEventContext(); |
| | | const operationBtns = defineOperationBtns([ |
| | | { |
| | | data: { |
| | | enCode: 'editBtn', |
| | | name: '编辑', |
| | | }, |
| | | |
| | | const operationBtnMap: Record<string, OperationBtnType> = { |
| | | editBtn: { |
| | | emits: { |
| | | onClick: (role) => openDialog(role), |
| | | }, |
| | | extraProps: { |
| | | hide: () => !isSettlement.value, |
| | | hide: (row: API.GetSettlementTaskUsersQueryResultItem) => |
| | | !( |
| | | (row.settlementReceiveStatus === SettlementReceiveStatus.Refunded && |
| | | form.auditStatus === EnumTaskSettlementAuditStatus.Pass) || |
| | | form.auditStatus === EnumTaskSettlementAuditStatus.Wait |
| | | ), |
| | | }, |
| | | }, |
| | | ]); |
| | | reSettleBtn: { |
| | | emits: { |
| | | onClick: (role) => againSureTaskSettlementOrderRoster(role), |
| | | }, |
| | | extraProps: { |
| | | hide: (row: API.GetSettlementTaskUsersQueryResultItem) => |
| | | row.settlementReceiveStatus !== SettlementReceiveStatus.Refunded, |
| | | }, |
| | | }, |
| | | }; |
| | | const { column, operationBtns, checkSubModuleItemShow } = useAccess({ |
| | | operationBtnMap, |
| | | }); |
| | | |
| | | const route = useRoute(); |
| | | const id = (route.params.id as string) ?? ''; |
| | | const settlement = (route.query.settlement as string) ?? ''; |
| | |
| | | auditStatus: '' as any as EnumTaskSettlementAuditStatus, |
| | | |
| | | timeoutServiceFee: 0, |
| | | |
| | | settlementStatus: '' as any as EnumTaskSettlementStatus, |
| | | }); |
| | | |
| | | const BaseState = { |
| | |
| | | form.settlementAccess = res?.detail?.settlementAccess; |
| | | form.auditStatus = res?.detail?.auditStatus; |
| | | form.timeoutServiceFee = res?.detail?.timeoutServiceFee ?? 0; |
| | | form.settlementStatus = res?.detail?.settlementStatus; |
| | | // form.settlementOrderName = setOssFileName(res?.detail?.settlementOrderName); |
| | | // form.settlementOrderTime = res?.detail?.settlementOrderTime ?? ''; |
| | | } |
| | |
| | | |
| | | function openDialog(row?: API.GetSettlementTaskUsersQueryResultItem) { |
| | | if (row) { |
| | | handleEdit({ |
| | | id: row?.id, |
| | | settlementAmount: row?.settlementAmount ?? null, |
| | | actualSettlementAmount: row?.actualSettlementAmount ?? null, |
| | | receiveAccount: row?.receiveAccount ?? '', |
| | | bank: row?.bank ?? '', |
| | | // totalWorkHours: row?.totalWorkHours ?? null, |
| | | settlementAccess: form.settlementAccess, |
| | | // bankBranch: row?.bankBranch ?? '', |
| | | timeoutServiceFee: form.timeoutServiceFee, |
| | | serviceFee: row?.serviceFee ?? 0, |
| | | timeoutHours: row?.timeoutHours ?? null, |
| | | timeoutFee: row?.timeoutFee ?? null, |
| | | otherFee: row?.otherFee ?? null, |
| | | remark: row?.remark ?? '', |
| | | }); |
| | | if (isSettlement) { |
| | | handleEdit({ |
| | | id: row?.id, |
| | | settlementAmount: row?.settlementAmount ?? null, |
| | | actualSettlementAmount: row?.actualSettlementAmount ?? null, |
| | | receiveAccount: row?.receiveAccount ?? '', |
| | | bank: row?.bank ?? '', |
| | | // totalWorkHours: row?.totalWorkHours ?? null, |
| | | settlementAccess: form.settlementAccess, |
| | | // bankBranch: row?.bankBranch ?? '', |
| | | timeoutServiceFee: form.timeoutServiceFee, |
| | | serviceFee: row?.serviceFee ?? 0, |
| | | timeoutHours: row?.timeoutHours ?? null, |
| | | timeoutFee: row?.timeoutFee ?? null, |
| | | otherFee: row?.otherFee ?? null, |
| | | remark: row?.remark ?? '', |
| | | }); |
| | | } else { |
| | | handleResettleEdit({ |
| | | id: row?.id, |
| | | name: row?.name ?? '', |
| | | bank: row?.bank ?? '', |
| | | bankBranch: row?.bankBranch ?? '', |
| | | receiveAccount: row?.receiveAccount ?? '', |
| | | remark: row?.remark ?? '', |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | function handleSubmit() { |
| | | function handleSubmit(submitStatus: string) { |
| | | let actualList = form.settlementTaskUsers.filter((x) => x.actualSettlementAmount > 0); |
| | | const actualSettlementAmount = actualList.reduce( |
| | | (pre, cur) => pre + cur.actualSettlementAmount, |
| | | 0 |
| | | ); |
| | | const settlementAmount = actualList.reduce((pre, cur) => pre + cur.settlementAmount, 0); |
| | | handleSettleEdit({ |
| | | id: id, |
| | | name: form.name, |
| | | code: form.code, |
| | | settlementUserCount: form.settlementTaskUsers.length, |
| | | actualSettlementAmount: form.actualSettlementAmount, |
| | | settlementAmount: form.settlementAmount, |
| | | submitStatus: submitStatus, |
| | | settlementUserCount: actualList.length, |
| | | actualSettlementAmount: actualSettlementAmount, |
| | | settlementAmount: settlementAmount, |
| | | settlementAccess: form.settlementAccess, |
| | | }); |
| | | } |
| | |
| | | id: '', |
| | | name: '', |
| | | code: '', |
| | | submitStatus: '', |
| | | settlementUserCount: 0, |
| | | settlementAmount: 0, |
| | | actualSettlementAmount: 0, |
| | |
| | | }); |
| | | |
| | | async function handleSettle() { |
| | | sureTaskSettlementOrder(); |
| | | if (settleEditForm.submitStatus === 'confirm') { |
| | | auditTaskSettlement(); |
| | | } |
| | | if (settleEditForm.submitStatus === 'submit') { |
| | | sureTaskSettlementOrder(); |
| | | } |
| | | } |
| | | |
| | | async function auditTaskSettlement() { |
| | | try { |
| | | let params: API.AuditTaskSettlementCommand = { |
| | | id: id, |
| | | auditStatus: EnumTaskSettlementAuditStatus.Pass, |
| | | rosters: form.settlementTaskUsers.map((item) => ({ |
| | | id: item.id, |
| | | serviceFee: item.serviceFee, |
| | | timeoutHours: item.timeoutHours, |
| | | timeoutFee: item.timeoutFee, |
| | | otherFee: item.otherFee, |
| | | remark: item.remark, |
| | | settlementAmount: item.settlementAmount, |
| | | })), |
| | | }; |
| | | let res = await taskServices.auditTaskSettlement(params); |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | // eventContext.emit('sureTaskSettlementOrder'); |
| | | // handleBack(); |
| | | refetch(); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function sureTaskSettlementOrder() { |
| | |
| | | { leading: true, trailing: false } |
| | | ); |
| | | |
| | | const { |
| | | dialogProps: dialogResettleProps, |
| | | handleEdit: handleResettleEdit, |
| | | editForm: resettleEditForm, |
| | | } = useFormDialog({ |
| | | onConfirm: handleResettle, |
| | | defaultFormParams: { |
| | | id: '', |
| | | name: '', |
| | | bank: '', |
| | | bankBranch: '', |
| | | receiveAccount: '', |
| | | remark: '', |
| | | }, |
| | | }); |
| | | |
| | | async function handleResettle() { |
| | | try { |
| | | let params: API.EditTaskSettlementOrderRosterCommand = { |
| | | id: id, |
| | | bank: resettleEditForm.bank, |
| | | bankBranch: resettleEditForm.bankBranch, |
| | | receiveAccount: resettleEditForm.receiveAccount, |
| | | remark: resettleEditForm.remark, |
| | | settlementAmount: 0, |
| | | actualSettlementAmount: 0, |
| | | }; |
| | | let res = await taskServices.editTaskSettlementOrderRoster(params); |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | refetch(); |
| | | getList(paginationState.pageIndex); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function againSureTaskSettlementOrderRoster(row: API.GetSettlementTaskUsersQueryResultItem) { |
| | | try { |
| | | let params: API.AgainSureTaskSettlementOrderRosterCommand = { |
| | | id: row.id, |
| | | }; |
| | | let res = await taskServices.againSureTaskSettlementOrderRoster(params); |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | refetch(); |
| | | getList(paginationState.pageIndex); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | function handleBack() { |
| | | closeViewPush(route, { |
| | | name: 'ServiceChargeManageList', |