| | |
| | | <template> |
| | | <LoadingLayout :loading="isLoading"> |
| | | <AppScrollContainer> |
| | | <ChunkCell title="结算单详情"> </ChunkCell> |
| | | <ChunkCell title="结算流程"> </ChunkCell> |
| | | <ChunkCell title="结算名单"> </ChunkCell> |
| | | </AppScrollContainer> |
| | | <AppContainer> |
| | | <ChunkCell title="结算单详情"> |
| | | <ProForm :model="form" ref="formRef" label-width="120px" :is-read="true"> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="8"> |
| | | <ProFormItemV2 label="所属任务:" prop="name"> |
| | | <ProFormText v-model="form.name"> </ProFormText> |
| | | </ProFormItemV2> |
| | | </ProFormColItem> |
| | | <ProFormColItem :span="8"> |
| | | <ProFormItemV2 label="任务编号:" prop="code"> |
| | | <ProFormText v-model="form.code"> </ProFormText> |
| | | </ProFormItemV2> |
| | | </ProFormColItem> |
| | | </ProFormCol> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="8"> |
| | | <ProFormItemV2 label="结算单名称:" prop="settlementOrderName"> |
| | | <ProFormText v-model="form.settlementOrderName"> </ProFormText> |
| | | </ProFormItemV2> |
| | | </ProFormColItem> |
| | | <ProFormColItem :span="8"> |
| | | <ProFormItemV2 label="上传时间:" prop="settlementOrderTime"> |
| | | <ProFormDatePicker |
| | | v-model="form.settlementOrderTime" |
| | | type="date" |
| | | format="YYYY-MM-DD HH:mm" |
| | | ></ProFormDatePicker> |
| | | </ProFormItemV2> |
| | | </ProFormColItem> |
| | | </ProFormCol> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="8"> |
| | | <ProFormItemV2 label="结算金额:" prop="settlementAmount"> |
| | | <ProFormInputNumber v-model="form.settlementAmount" format-value="money"> |
| | | </ProFormInputNumber> |
| | | </ProFormItemV2> |
| | | </ProFormColItem> |
| | | <ProFormColItem :span="8"> |
| | | <ProFormItemV2 label="实发金额:" prop="actualSettlementAmount"> |
| | | <ProFormInputNumber v-model="form.actualSettlementAmount" format-value="money"> |
| | | </ProFormInputNumber> |
| | | </ProFormItemV2> |
| | | </ProFormColItem> |
| | | </ProFormCol> |
| | | </ProForm> |
| | | </ChunkCell> |
| | | <!-- <ChunkCell title="结算流程"> |
| | | <div class="step-wrapper"> |
| | | <el-steps :active="1" align-center finish-status="process"> |
| | | <el-step title="结算单上传" :icon="Edit"> |
| | | <template #description> |
| | | <div>创建人:{{ form.name }}</div> |
| | | <div>时间:{{ form.name }}</div> |
| | | <TextOverTooltip>备注:{{ form.name }}</TextOverTooltip> |
| | | </template> |
| | | </el-step> |
| | | <el-step title="结算付款" :icon="Upload"> |
| | | <template #description> |
| | | <div>创建人:{{ form.name }}</div> |
| | | <div>时间:{{ form.name }}</div> |
| | | <TextOverTooltip |
| | | >备注:{{ 'form.nameform.nameform.eform.nameform.nameform.name' }}</TextOverTooltip |
| | | > |
| | | </template> |
| | | </el-step> |
| | | </el-steps> |
| | | </div> |
| | | </ChunkCell> --> |
| | | <ChunkCell title="结算名单" style="flex: 1"> |
| | | <ProTableQueryFilterBar @on-reset="reset"> |
| | | <template #query> |
| | | <QueryFilterItem> |
| | | <SearchInput |
| | | v-model="extraParamState.keywords" |
| | | style="width: 300px" |
| | | placeholder="姓名/手机/身份证号/客户" |
| | | @on-click-search="getList" |
| | | > |
| | | </SearchInput> |
| | | </QueryFilterItem> |
| | | </template> |
| | | </ProTableQueryFilterBar> |
| | | <ProTableV2 |
| | | v-bind="proTableProps" |
| | | :columns="SettlementListColumns" |
| | | :show-operation-column="false" |
| | | :auto-height="false" |
| | | ref="proTable" |
| | | :tableProps="{ |
| | | maxHeight: '400px', |
| | | }" |
| | | > |
| | | </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" |
| | | class="chuck-add-or-edit-actions" |
| | | type="primary" |
| | | @click="handleSubmit" |
| | | >确认</el-button |
| | | > |
| | | </div> |
| | | </ChunkCell> |
| | | </AppContainer> |
| | | <EditAccountInfoDialog v-bind="dialogProps"></EditAccountInfoDialog> |
| | | </LoadingLayout> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { LoadingLayout, AppScrollContainer, ChunkCell } from '@bole-core/components'; |
| | | import { |
| | | LoadingLayout, |
| | | AppContainer, |
| | | AppScrollContainer, |
| | | ChunkCell, |
| | | ProForm, |
| | | ProFormItemV2, |
| | | ProFormText, |
| | | ProFormCol, |
| | | ProFormColItem, |
| | | ProFormDatePicker, |
| | | ProFormInputNumber, |
| | | useTable, |
| | | ProTableV2, |
| | | defineOperationBtns, |
| | | SearchInput, |
| | | QueryFilterItem, |
| | | ProTableQueryFilterBar, |
| | | useFormDialog, |
| | | } 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 { Message } from '@bole-core/core'; |
| | | import { paginateList, setOssFileName, toThousand } from '@/utils'; |
| | | |
| | | defineOptions({ |
| | | name: 'ServiceChargeDetail', |
| | | }); |
| | | |
| | | const { closeViewPush } = useRouteView(); |
| | | const eventContext = useGlobalEventContext(); |
| | | const operationBtns = defineOperationBtns([ |
| | | { |
| | | data: { |
| | | enCode: 'editBtn', |
| | | name: '编辑', |
| | | }, |
| | | emits: { |
| | | onClick: (role) => openDialog(role), |
| | | }, |
| | | }, |
| | | ]); |
| | | |
| | | const route = useRoute(); |
| | | const id = (route.params.id as string) ?? ''; |
| | | const url = (route.query.url as string) ?? ''; |
| | | |
| | | const state = reactive({ |
| | | loading: true, |
| | | const isDetail = computed(() => !url); |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | settlementAmount: 0, |
| | | actualSettlementAmount: 0, |
| | | code: '', |
| | | settlementOrderName: '', |
| | | settlementOrderTime: '', |
| | | }); |
| | | |
| | | const { isLoading } = useQuery({ |
| | | queryKey: ['flexTaskServices/getFlexTaskDetail', id], |
| | | queryKey: ['taskServices/getSettlementTask', id], |
| | | queryFn: async () => { |
| | | return await flexTaskServices.getFlexTaskDetail( |
| | | return await taskServices.getSettlementTask( |
| | | { id: id }, |
| | | { |
| | | showLoading: false, |
| | | } |
| | | ); |
| | | }, |
| | | onSuccess(data) {}, |
| | | 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 ?? ''; |
| | | }, |
| | | enabled: !!id, |
| | | }); |
| | | |
| | | onMounted(() => {}); |
| | | const { |
| | | getDataSource: getList, |
| | | proTableProps, |
| | | paginationState, |
| | | extraParamState, |
| | | reset, |
| | | } = useTable( |
| | | async ({ pageIndex, pageSize }, extraParamState) => { |
| | | try { |
| | | let params: API.APIgetSettlementTaskUsersParams = { |
| | | taskInfoId: id, |
| | | settlementOrderUrl: url, |
| | | }; |
| | | let res = await taskUserServices.getSettlementTaskUsers(params); |
| | | if (extraParamState.keywords) { |
| | | res.data = res.data?.filter((item) => { |
| | | return ( |
| | | item.name.includes(extraParamState.keywords) || |
| | | item.contactPhoneNumber.includes(extraParamState.keywords) || |
| | | item.identity.includes(extraParamState.keywords) |
| | | ); |
| | | }); |
| | | } |
| | | return Promise.resolve({ |
| | | pageModel: { |
| | | rows: pageSize, |
| | | page: pageIndex, |
| | | totalCount: res.data.length, |
| | | }, |
| | | data: paginateList(res.data, pageIndex, pageSize), |
| | | }); |
| | | } catch (error) { |
| | | console.log('error: ', error); |
| | | } |
| | | }, |
| | | { |
| | | defaultExtraParams: { |
| | | keywords: '', |
| | | orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }], |
| | | }, |
| | | queryKey: ['taskUserServices/getSettlementTaskUsers'], |
| | | columnsRenderProps: { |
| | | settlementTime: { type: 'date' }, |
| | | settlementAmount: { type: 'money' }, |
| | | actualSettlementAmount: { type: 'money' }, |
| | | }, |
| | | } |
| | | ); |
| | | |
| | | const { dialogProps, handleAdd, handleEdit, editForm } = useFormDialog({ |
| | | onConfirm: handleAddOrEdit, |
| | | defaultFormParams: { |
| | | id: '', |
| | | name: '', |
| | | }, |
| | | }); |
| | | |
| | | function openDialog(row?) { |
| | | if (row) { |
| | | handleEdit({ |
| | | id: row?.id, |
| | | name: row?.name, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | async function handleAddOrEdit() {} |
| | | |
| | | async function handleSubmit() { |
| | | try { |
| | | let params: API.SureTaskSettlementOrderCommand = { |
| | | taskInfoId: id, |
| | | settlementOrderUrl: url, |
| | | taskInfoUsers: |
| | | proTableProps.value.tableData?.length > 0 |
| | | ? proTableProps.value.tableData.map( |
| | | (x) => ({ ...x } as API.SureTaskSettlementOrderCommandUser) |
| | | ) |
| | | : [], |
| | | }; |
| | | let res = await taskServices.sureTaskSettlementOrder(params); |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | eventContext.emit('sureTaskSettlementOrder'); |
| | | handleBack(); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | function handleBack() { |
| | | closeViewPush(route, { |
| | | name: 'ServiceChargeManageList', |
| | | }); |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @use '@/style/common.scss' as *; |
| | | |
| | | .step-wrapper { |
| | | margin: 0 auto; |
| | | padding: 24px 0; |
| | | } |
| | | </style> |
| | | <style lang="scss"> |
| | | .text-over-tooltip-content { |
| | | max-width: 600px; |
| | | word-break: break-all; |
| | | } |
| | | </style> |