Compare commits
3 Commits
92c5071fab
...
master-lzm
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cb913cb0a | |||
| ddc0c7db1e | |||
| 1fbf02a310 |
@@ -13,6 +13,7 @@ export interface EmployeeVO {
|
|||||||
leaveDate?: string
|
leaveDate?: string
|
||||||
employeeStatus: string
|
employeeStatus: string
|
||||||
remark?: string
|
remark?: string
|
||||||
|
officeLeaderFlag?: boolean
|
||||||
sortNo?: number
|
sortNo?: number
|
||||||
enabledFlag?: boolean
|
enabledFlag?: boolean
|
||||||
createTime?: string
|
createTime?: string
|
||||||
@@ -23,6 +24,7 @@ export interface EmployeePageReqVO extends PageParam {
|
|||||||
officeId?: number
|
officeId?: number
|
||||||
employeeStatus?: string
|
employeeStatus?: string
|
||||||
enabledFlag?: boolean
|
enabledFlag?: boolean
|
||||||
|
officeLeaderFlag?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EmployeeSimpleVO {
|
export interface EmployeeSimpleVO {
|
||||||
@@ -33,6 +35,7 @@ export interface EmployeeSimpleVO {
|
|||||||
employeeStatus?: string
|
employeeStatus?: string
|
||||||
registrationType?: string
|
registrationType?: string
|
||||||
jobTitle?: string
|
jobTitle?: string
|
||||||
|
officeLeaderFlag?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getEmployeePage = (params: EmployeePageReqVO) => {
|
export const getEmployeePage = (params: EmployeePageReqVO) => {
|
||||||
@@ -60,6 +63,7 @@ export const getEmployeeSimpleList = (params: {
|
|||||||
officeId?: number
|
officeId?: number
|
||||||
status?: string
|
status?: string
|
||||||
enabledFlag?: boolean
|
enabledFlag?: boolean
|
||||||
|
officeLeaderFlag?: boolean
|
||||||
}) => {
|
}) => {
|
||||||
return request.get({ url: '/tjt/employee/simple-list', params })
|
return request.get({ url: '/tjt/employee/simple-list', params })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,18 @@ export interface EmployeeYearCostBudgetPageReqVO extends PageParam {
|
|||||||
enabledFlag?: boolean
|
enabledFlag?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface EmployeeYearCostBudgetGenerateReqVO {
|
||||||
|
budgetYear: number
|
||||||
|
expectedCostAmount?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface EmployeeYearCostBudgetGenerateRespVO {
|
||||||
|
budgetYear: number
|
||||||
|
totalEnabledEmployeeCount: number
|
||||||
|
createdCount: number
|
||||||
|
skippedCount: number
|
||||||
|
}
|
||||||
|
|
||||||
export const getEmployeeYearCostBudgetPage = (params: EmployeeYearCostBudgetPageReqVO) => {
|
export const getEmployeeYearCostBudgetPage = (params: EmployeeYearCostBudgetPageReqVO) => {
|
||||||
return request.get({ url: '/tjt/employee-year-cost-budget/page', params })
|
return request.get({ url: '/tjt/employee-year-cost-budget/page', params })
|
||||||
}
|
}
|
||||||
@@ -31,6 +43,10 @@ export const createEmployeeYearCostBudget = (data: EmployeeYearCostBudgetVO) =>
|
|||||||
return request.post({ url: '/tjt/employee-year-cost-budget/create', data })
|
return request.post({ url: '/tjt/employee-year-cost-budget/create', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const generateEmployeeYearCostBudget = (data: EmployeeYearCostBudgetGenerateReqVO) => {
|
||||||
|
return request.post({ url: '/tjt/employee-year-cost-budget/generate', data })
|
||||||
|
}
|
||||||
|
|
||||||
export const updateEmployeeYearCostBudget = (data: EmployeeYearCostBudgetVO) => {
|
export const updateEmployeeYearCostBudget = (data: EmployeeYearCostBudgetVO) => {
|
||||||
return request.put({ url: '/tjt/employee-year-cost-budget/update', data })
|
return request.put({ url: '/tjt/employee-year-cost-budget/update', data })
|
||||||
}
|
}
|
||||||
|
|||||||
56
src/api/tjt/employeeYearLeaderOutput/index.ts
Normal file
56
src/api/tjt/employeeYearLeaderOutput/index.ts
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface EmployeeYearLeaderOutputVO {
|
||||||
|
id?: number
|
||||||
|
employeeId: number
|
||||||
|
employeeName?: string
|
||||||
|
outputYear: number
|
||||||
|
leaderOutputAmount: number
|
||||||
|
remark?: string
|
||||||
|
sortNo?: number
|
||||||
|
enabledFlag?: boolean
|
||||||
|
createTime?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface EmployeeYearLeaderOutputPageReqVO extends PageParam {
|
||||||
|
employeeId?: number
|
||||||
|
employeeName?: string
|
||||||
|
outputYear?: number
|
||||||
|
enabledFlag?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface EmployeeYearLeaderOutputGenerateReqVO {
|
||||||
|
outputYear: number
|
||||||
|
leaderOutputAmount?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface EmployeeYearLeaderOutputGenerateRespVO {
|
||||||
|
outputYear: number
|
||||||
|
totalEnabledLeaderCount: number
|
||||||
|
createdCount: number
|
||||||
|
skippedCount: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getEmployeeYearLeaderOutputPage = (params: EmployeeYearLeaderOutputPageReqVO) => {
|
||||||
|
return request.get({ url: '/tjt/employee-year-leader-output/page', params })
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getEmployeeYearLeaderOutput = (id: number) => {
|
||||||
|
return request.get({ url: '/tjt/employee-year-leader-output/get', params: { id } })
|
||||||
|
}
|
||||||
|
|
||||||
|
export const createEmployeeYearLeaderOutput = (data: EmployeeYearLeaderOutputVO) => {
|
||||||
|
return request.post({ url: '/tjt/employee-year-leader-output/create', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
export const generateEmployeeYearLeaderOutput = (data: EmployeeYearLeaderOutputGenerateReqVO) => {
|
||||||
|
return request.post({ url: '/tjt/employee-year-leader-output/generate', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
export const updateEmployeeYearLeaderOutput = (data: EmployeeYearLeaderOutputVO) => {
|
||||||
|
return request.put({ url: '/tjt/employee-year-leader-output/update', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
export const deleteEmployeeYearLeaderOutput = (id: number) => {
|
||||||
|
return request.delete({ url: '/tjt/employee-year-leader-output/delete', params: { id } })
|
||||||
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
|
import type { ProjectPlanningVO } from '@/api/tjt/planning'
|
||||||
|
import type { ProjectPlanningQuarterVO } from '@/api/tjt/planningQuarter'
|
||||||
|
|
||||||
export interface ProjectOutputSplitVO {
|
export interface ProjectOutputSplitVO {
|
||||||
id?: number
|
id?: number
|
||||||
@@ -45,10 +47,20 @@ export type ProjectOutputSplitSaveVO = Pick<
|
|||||||
| 'digitalRatio'
|
| 'digitalRatio'
|
||||||
>
|
>
|
||||||
|
|
||||||
|
export interface ProjectOutputSplitPlanningDetailVO {
|
||||||
|
planning: ProjectPlanningVO
|
||||||
|
outputSplit: ProjectOutputSplitVO
|
||||||
|
quarters: ProjectPlanningQuarterVO[]
|
||||||
|
}
|
||||||
|
|
||||||
export const getProjectOutputSplitByPlanningId = (planningId: number) => {
|
export const getProjectOutputSplitByPlanningId = (planningId: number) => {
|
||||||
return request.get({ url: '/tjt/output-split/get-by-planning', params: { planningId } })
|
return request.get({ url: '/tjt/output-split/get-by-planning', params: { planningId } })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getProjectOutputSplitPlanningDetail = (planningId: number) => {
|
||||||
|
return request.get({ url: '/tjt/output-split/planning-detail', params: { planningId } })
|
||||||
|
}
|
||||||
|
|
||||||
export const saveProjectOutputSplit = (data: ProjectOutputSplitSaveVO) => {
|
export const saveProjectOutputSplit = (data: ProjectOutputSplitSaveVO) => {
|
||||||
return request.put({ url: '/tjt/output-split/save', data })
|
return request.put({ url: '/tjt/output-split/save', data })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
|
import type { ProjectPlanningGuideDetailVO } from '@/api/tjt/planningGuideDetail'
|
||||||
|
|
||||||
export interface ProjectPlanningVO {
|
export interface ProjectPlanningVO {
|
||||||
id?: number
|
id?: number
|
||||||
@@ -71,6 +72,11 @@ export interface ProjectPlanningPageReqVO extends PageParam {
|
|||||||
createTime?: string[]
|
createTime?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ProjectPlanningOutputEditDetailVO {
|
||||||
|
planning: ProjectPlanningVO
|
||||||
|
guideDetails: ProjectPlanningGuideDetailVO[]
|
||||||
|
}
|
||||||
|
|
||||||
export const getProjectPlanningPage = (params: ProjectPlanningPageReqVO) => {
|
export const getProjectPlanningPage = (params: ProjectPlanningPageReqVO) => {
|
||||||
return request.get({ url: '/tjt/planning/page', params })
|
return request.get({ url: '/tjt/planning/page', params })
|
||||||
}
|
}
|
||||||
@@ -79,6 +85,10 @@ export const getProjectPlanning = (id: number) => {
|
|||||||
return request.get({ url: '/tjt/planning/get', params: { id } })
|
return request.get({ url: '/tjt/planning/get', params: { id } })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getProjectPlanningOutputEditDetail = (id: number) => {
|
||||||
|
return request.get({ url: '/tjt/planning/output-edit-detail', params: { id } })
|
||||||
|
}
|
||||||
|
|
||||||
export const getProjectPlanningListByProjectId = (projectId: number) => {
|
export const getProjectPlanningListByProjectId = (projectId: number) => {
|
||||||
return request.get({ url: '/tjt/planning/list-by-project', params: { projectId } })
|
return request.get({ url: '/tjt/planning/list-by-project', params: { projectId } })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
|
import type { ProjectPlanningVO } from '@/api/tjt/planning'
|
||||||
|
|
||||||
export interface ProjectPlanningQuarterVO {
|
export interface ProjectPlanningQuarterVO {
|
||||||
id?: number
|
id?: number
|
||||||
@@ -15,6 +16,11 @@ export type ProjectPlanningQuarterSaveVO = Omit<
|
|||||||
'distributionAmount' | 'createTime'
|
'distributionAmount' | 'createTime'
|
||||||
>
|
>
|
||||||
|
|
||||||
|
export interface ProjectPlanningQuarterPlanningDetailVO {
|
||||||
|
planning: ProjectPlanningVO
|
||||||
|
quarters: ProjectPlanningQuarterVO[]
|
||||||
|
}
|
||||||
|
|
||||||
export const getProjectPlanningQuarter = (id: number) => {
|
export const getProjectPlanningQuarter = (id: number) => {
|
||||||
return request.get({ url: '/tjt/planning-quarter/get', params: { id } })
|
return request.get({ url: '/tjt/planning-quarter/get', params: { id } })
|
||||||
}
|
}
|
||||||
@@ -23,6 +29,13 @@ export const getProjectPlanningQuarterListByPlanningId = (planningId: number) =>
|
|||||||
return request.get({ url: '/tjt/planning-quarter/list-by-planning', params: { planningId } })
|
return request.get({ url: '/tjt/planning-quarter/list-by-planning', params: { planningId } })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getProjectPlanningQuarterPlanningDetail = (planningId: number) => {
|
||||||
|
return request.get({
|
||||||
|
url: '/tjt/planning-quarter/planning-detail',
|
||||||
|
params: { planningId }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export const createProjectPlanningQuarter = (data: ProjectPlanningQuarterSaveVO) => {
|
export const createProjectPlanningQuarter = (data: ProjectPlanningQuarterSaveVO) => {
|
||||||
return request.post({ url: '/tjt/planning-quarter/create', data })
|
return request.post({ url: '/tjt/planning-quarter/create', data })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export interface ProjectProfitVO {
|
|||||||
contractSignedFlag: boolean
|
contractSignedFlag: boolean
|
||||||
contractAmount?: number
|
contractAmount?: number
|
||||||
finalSettlementAmount?: number
|
finalSettlementAmount?: number
|
||||||
|
effectiveSettlementAmount?: number
|
||||||
comprehensivePlanningAmount?: number
|
comprehensivePlanningAmount?: number
|
||||||
subcontractPlanningAmount?: number
|
subcontractPlanningAmount?: number
|
||||||
majorOutputValue?: number
|
majorOutputValue?: number
|
||||||
|
|||||||
@@ -6,6 +6,41 @@ export interface ProjectOverviewExportReqVO {
|
|||||||
sortType?: string
|
sortType?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ProjectOverviewPreviewRespVO {
|
||||||
|
year?: number
|
||||||
|
officeName?: string
|
||||||
|
employeeColumns?: ProjectOverviewEmployeeColumn[]
|
||||||
|
rows?: ProjectOverviewProjectRow[]
|
||||||
|
totalRow?: ProjectOverviewProjectRow
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProjectOverviewEmployeeColumn {
|
||||||
|
employeeId?: number
|
||||||
|
employeeName?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProjectOverviewProjectRow {
|
||||||
|
serialNo?: number
|
||||||
|
totalRow?: boolean
|
||||||
|
projectName?: string
|
||||||
|
progressText?: string
|
||||||
|
workStage?: string
|
||||||
|
totalOutputAmountWan?: number
|
||||||
|
historicalIssuedRatio?: number
|
||||||
|
currentSettlementRatio?: number
|
||||||
|
currentSettlementAmountWan?: number
|
||||||
|
pendingRatio?: number
|
||||||
|
employeeAmountMap?: Record<string, ProjectOverviewEmployeeAmountValue>
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProjectOverviewEmployeeAmountValue {
|
||||||
|
quarterOneAmountWan?: number
|
||||||
|
quarterTwoAmountWan?: number
|
||||||
|
quarterThreeAmountWan?: number
|
||||||
|
quarterFourAmountWan?: number
|
||||||
|
annualTotalAmountWan?: number
|
||||||
|
}
|
||||||
|
|
||||||
export interface EmployeeOutputSummaryExportReqVO {
|
export interface EmployeeOutputSummaryExportReqVO {
|
||||||
year?: number
|
year?: number
|
||||||
officeId?: number
|
officeId?: number
|
||||||
@@ -14,6 +49,31 @@ export interface EmployeeOutputSummaryExportReqVO {
|
|||||||
sortType?: string
|
sortType?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface EmployeeOutputSummaryPreviewRespVO {
|
||||||
|
year?: number
|
||||||
|
kValue?: number
|
||||||
|
rows?: EmployeeOutputSummaryRow[]
|
||||||
|
totalRow?: EmployeeOutputSummaryRow
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface EmployeeOutputSummaryRow {
|
||||||
|
serialNo?: number
|
||||||
|
employeeName?: string
|
||||||
|
officeName?: string
|
||||||
|
quarterOneAmount?: number
|
||||||
|
quarterTwoAmount?: number
|
||||||
|
quarterThreeAmount?: number
|
||||||
|
quarterFourAmount?: number
|
||||||
|
annualTotalAmount?: number
|
||||||
|
officeLeaderOrBimAmount?: number
|
||||||
|
totalAssessmentOutputAmount?: number
|
||||||
|
expectedCostAmount?: number
|
||||||
|
basicAssessmentOutputAmount?: number
|
||||||
|
remainingOutputAmount?: number
|
||||||
|
estimatedYearEndPerformanceAmount?: number
|
||||||
|
totalRow?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export interface ProjectBudgetExportReqVO {
|
export interface ProjectBudgetExportReqVO {
|
||||||
projectId: number
|
projectId: number
|
||||||
year?: number
|
year?: number
|
||||||
@@ -35,6 +95,65 @@ export interface SpecialtyPersonOutputExportReqVO {
|
|||||||
year?: number
|
year?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SpecialtyPersonOutputPreviewReqVO {
|
||||||
|
planningId: number
|
||||||
|
year?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpecialtyPersonOutputPreviewRespVO {
|
||||||
|
planningId: number
|
||||||
|
year: number
|
||||||
|
projectName?: string
|
||||||
|
groups?: SpecialtyPersonOutputPreviewGroupRow[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpecialtyPersonOutputPreviewGroupRow {
|
||||||
|
specialtyCode: string
|
||||||
|
specialtyName?: string
|
||||||
|
exportable?: boolean
|
||||||
|
specialtyAmount?: number
|
||||||
|
roleTotal?: number
|
||||||
|
personCount?: number
|
||||||
|
overRatio?: boolean
|
||||||
|
specialtyQuarterOneAmountWan?: number
|
||||||
|
specialtyQuarterTwoAmountWan?: number
|
||||||
|
specialtyQuarterThreeAmountWan?: number
|
||||||
|
specialtyQuarterFourAmountWan?: number
|
||||||
|
specialtyYearTotalAmountWan?: number
|
||||||
|
rows: SpecialtyPersonOutputPreviewRoleRow[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpecialtyPersonOutputPreviewRoleRow {
|
||||||
|
specialtyCode: string
|
||||||
|
specialtyName?: string
|
||||||
|
roleCode: string
|
||||||
|
roleName?: string
|
||||||
|
roleRatio?: number
|
||||||
|
roleAmount?: number
|
||||||
|
personTotalRatio?: number
|
||||||
|
persons: SpecialtyPersonOutputPreviewPersonRow[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpecialtyPersonOutputPreviewPersonRow {
|
||||||
|
personKey: string
|
||||||
|
employeeId?: number
|
||||||
|
employeeName?: string
|
||||||
|
personRatio?: number
|
||||||
|
personAmount?: number
|
||||||
|
roleNames?: string
|
||||||
|
adjustedPersonRatio?: number
|
||||||
|
quarterOneRatio?: number
|
||||||
|
quarterOneAmountWan?: number
|
||||||
|
quarterTwoRatio?: number
|
||||||
|
quarterTwoAmountWan?: number
|
||||||
|
quarterThreeRatio?: number
|
||||||
|
quarterThreeAmountWan?: number
|
||||||
|
quarterFourRatio?: number
|
||||||
|
quarterFourAmountWan?: number
|
||||||
|
yearTotalRatio?: number
|
||||||
|
yearTotalAmountWan?: number
|
||||||
|
}
|
||||||
|
|
||||||
export const exportProjectBudget = (params: ProjectBudgetExportReqVO) => {
|
export const exportProjectBudget = (params: ProjectBudgetExportReqVO) => {
|
||||||
return request.download({ url: '/tjt/report/project-budget/export-excel', params })
|
return request.download({ url: '/tjt/report/project-budget/export-excel', params })
|
||||||
}
|
}
|
||||||
@@ -57,10 +176,28 @@ export const exportSpecialtyPersonOutput = (params: SpecialtyPersonOutputExportR
|
|||||||
return request.download({ url: '/tjt/report/specialty-person-output/export-excel', params })
|
return request.download({ url: '/tjt/report/specialty-person-output/export-excel', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getSpecialtyPersonOutputPreview = (params: SpecialtyPersonOutputPreviewReqVO) => {
|
||||||
|
return request.get({ url: '/tjt/report/specialty-person-output/preview', params })
|
||||||
|
}
|
||||||
|
|
||||||
export const exportProjectOverview = (params: ProjectOverviewExportReqVO) => {
|
export const exportProjectOverview = (params: ProjectOverviewExportReqVO) => {
|
||||||
return request.download({ url: '/tjt/report/project-overview/export-excel', params })
|
return request.download({ url: '/tjt/report/project-overview/export-excel', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getProjectOverviewPreview = (params: ProjectOverviewExportReqVO) => {
|
||||||
|
return request.get<ProjectOverviewPreviewRespVO>({
|
||||||
|
url: '/tjt/report/project-overview/preview',
|
||||||
|
params: { ...params, _t: Date.now() }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export const exportEmployeeOutputSummary = (params: EmployeeOutputSummaryExportReqVO) => {
|
export const exportEmployeeOutputSummary = (params: EmployeeOutputSummaryExportReqVO) => {
|
||||||
return request.download({ url: '/tjt/report/employee-output-summary/export-excel', params })
|
return request.download({ url: '/tjt/report/employee-output-summary/export-excel', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getEmployeeOutputSummaryPreview = (params: EmployeeOutputSummaryExportReqVO) => {
|
||||||
|
return request.get<EmployeeOutputSummaryPreviewRespVO>({
|
||||||
|
url: '/tjt/report/employee-output-summary/preview',
|
||||||
|
params: { ...params, _t: Date.now() }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export interface SpecialtyRoleSplitSaveItemVO {
|
|||||||
export interface SpecialtyRoleSplitBatchSaveVO {
|
export interface SpecialtyRoleSplitBatchSaveVO {
|
||||||
planningId: number
|
planningId: number
|
||||||
items: SpecialtyRoleSplitSaveItemVO[]
|
items: SpecialtyRoleSplitSaveItemVO[]
|
||||||
|
temporarySave?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getSpecialtyRoleSplitListByPlanningId = (planningId: number) => {
|
export const getSpecialtyRoleSplitListByPlanningId = (planningId: number) => {
|
||||||
|
|||||||
@@ -50,13 +50,22 @@
|
|||||||
<Icon class="mr-5px" icon="ep:plus" />
|
<Icon class="mr-5px" icon="ep:plus" />
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['tjt:employee-year-cost-budget:create']"
|
||||||
|
plain
|
||||||
|
type="success"
|
||||||
|
@click="openGenerateDialog"
|
||||||
|
>
|
||||||
|
<Icon class="mr-5px" icon="ep:document-add" />
|
||||||
|
按年度生成
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column align="center" label="ID" prop="id" width="88" />
|
<el-table-column :index="getRowIndex" align="center" label="序号" type="index" width="88" />
|
||||||
<el-table-column align="center" label="员工姓名" min-width="140" prop="employeeName" />
|
<el-table-column align="center" label="员工姓名" min-width="140" prop="employeeName" />
|
||||||
<el-table-column align="center" label="预算年度" prop="budgetYear" width="120" />
|
<el-table-column align="center" label="预算年度" prop="budgetYear" width="120" />
|
||||||
<el-table-column align="center" label="预计发生成本(元)" width="160">
|
<el-table-column align="center" label="预计发生成本(元)" width="160">
|
||||||
@@ -72,7 +81,13 @@
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="创建时间" prop="createTime" width="180" />
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="创建时间"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
/>
|
||||||
<el-table-column align="center" fixed="right" label="操作" width="160">
|
<el-table-column align="center" fixed="right" label="操作" width="160">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -167,12 +182,48 @@
|
|||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
|
<Dialog v-model="generateDialogVisible" title="按年度生成员工预算记录" width="560">
|
||||||
|
<el-form
|
||||||
|
ref="generateFormRef"
|
||||||
|
v-loading="generateLoading"
|
||||||
|
:model="generateFormData"
|
||||||
|
:rules="generateFormRules"
|
||||||
|
label-width="140px"
|
||||||
|
>
|
||||||
|
<el-form-item label="预算年度" prop="budgetYear">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="generateBudgetYearValue"
|
||||||
|
class="!w-1/1"
|
||||||
|
placeholder="请选择年度"
|
||||||
|
type="year"
|
||||||
|
value-format="YYYY"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="默认预计发生成本" prop="expectedCostAmount">
|
||||||
|
<el-input-number
|
||||||
|
v-model="generateFormData.expectedCostAmount"
|
||||||
|
:min="0"
|
||||||
|
:precision="2"
|
||||||
|
:step="1000"
|
||||||
|
class="!w-1/1"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<el-button :loading="generateLoading" type="primary" @click="submitGenerateForm">确认生成</el-button>
|
||||||
|
<el-button @click="generateDialogVisible = false">取消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { FormRules } from 'element-plus'
|
import type { FormRules } from 'element-plus'
|
||||||
import * as EmployeeApi from '@/api/tjt/employee'
|
import * as EmployeeApi from '@/api/tjt/employee'
|
||||||
import * as EmployeeYearCostBudgetApi from '@/api/tjt/employeeYearCostBudget'
|
import * as EmployeeYearCostBudgetApi from '@/api/tjt/employeeYearCostBudget'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
import { formatAmountText } from '@/views/tjt/shared/planning'
|
import { formatAmountText } from '@/views/tjt/shared/planning'
|
||||||
|
|
||||||
defineOptions({ name: 'TjtEmployeeYearCostBudget' })
|
defineOptions({ name: 'TjtEmployeeYearCostBudget' })
|
||||||
@@ -183,12 +234,15 @@ const { t } = useI18n()
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const formLoading = ref(false)
|
const formLoading = ref(false)
|
||||||
const employeeLoading = ref(false)
|
const employeeLoading = ref(false)
|
||||||
|
const generateLoading = ref(false)
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const list = ref<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO[]>([])
|
const list = ref<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO[]>([])
|
||||||
const employeeOptions = ref<EmployeeApi.EmployeeSimpleVO[]>([])
|
const employeeOptions = ref<EmployeeApi.EmployeeSimpleVO[]>([])
|
||||||
const queryFormRef = ref()
|
const queryFormRef = ref()
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
|
const generateFormRef = ref()
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
|
const generateDialogVisible = ref(false)
|
||||||
const dialogTitle = ref('')
|
const dialogTitle = ref('')
|
||||||
const formType = ref<'create' | 'update'>('create')
|
const formType = ref<'create' | 'update'>('create')
|
||||||
|
|
||||||
@@ -201,6 +255,9 @@ const queryParams = reactive<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetPag
|
|||||||
enabledFlag: undefined
|
enabledFlag: undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const getRowIndex = (index: number) =>
|
||||||
|
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
||||||
|
|
||||||
const createFormData = (): EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO => ({
|
const createFormData = (): EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO => ({
|
||||||
employeeId: undefined as never,
|
employeeId: undefined as never,
|
||||||
employeeName: '',
|
employeeName: '',
|
||||||
@@ -212,6 +269,10 @@ const createFormData = (): EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO =>
|
|||||||
})
|
})
|
||||||
|
|
||||||
const formData = ref<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO>(createFormData())
|
const formData = ref<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO>(createFormData())
|
||||||
|
const generateFormData = reactive<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetGenerateReqVO>({
|
||||||
|
budgetYear: new Date().getFullYear(),
|
||||||
|
expectedCostAmount: 0
|
||||||
|
})
|
||||||
|
|
||||||
const queryBudgetYearValue = computed({
|
const queryBudgetYearValue = computed({
|
||||||
get: () => (queryParams.budgetYear ? String(queryParams.budgetYear) : undefined),
|
get: () => (queryParams.budgetYear ? String(queryParams.budgetYear) : undefined),
|
||||||
@@ -227,12 +288,24 @@ const formBudgetYearValue = computed({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const generateBudgetYearValue = computed({
|
||||||
|
get: () => (generateFormData.budgetYear ? String(generateFormData.budgetYear) : undefined),
|
||||||
|
set: (value?: string) => {
|
||||||
|
generateFormData.budgetYear = value ? Number(value) : new Date().getFullYear()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const formRules = reactive<FormRules>({
|
const formRules = reactive<FormRules>({
|
||||||
employeeId: [{ required: true, message: '员工不能为空', trigger: 'change' }],
|
employeeId: [{ required: true, message: '员工不能为空', trigger: 'change' }],
|
||||||
budgetYear: [{ required: true, message: '预算年度不能为空', trigger: 'change' }],
|
budgetYear: [{ required: true, message: '预算年度不能为空', trigger: 'change' }],
|
||||||
expectedCostAmount: [{ required: true, message: '预计发生成本不能为空', trigger: 'blur' }]
|
expectedCostAmount: [{ required: true, message: '预计发生成本不能为空', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const generateFormRules = reactive<FormRules>({
|
||||||
|
budgetYear: [{ required: true, message: '预算年度不能为空', trigger: 'change' }],
|
||||||
|
expectedCostAmount: [{ required: true, message: '默认预计发生成本不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
|
||||||
const ensureEmployeeOption = () => {
|
const ensureEmployeeOption = () => {
|
||||||
if (!formData.value.employeeId || !formData.value.employeeName) {
|
if (!formData.value.employeeId || !formData.value.employeeName) {
|
||||||
return
|
return
|
||||||
@@ -310,6 +383,13 @@ const openDialog = async (type: 'create' | 'update', id?: number) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const openGenerateDialog = () => {
|
||||||
|
generateFormData.budgetYear = queryParams.budgetYear || new Date().getFullYear()
|
||||||
|
generateFormData.expectedCostAmount = 0
|
||||||
|
generateDialogVisible.value = true
|
||||||
|
generateFormRef.value?.clearValidate()
|
||||||
|
}
|
||||||
|
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
if (!formRef.value) {
|
if (!formRef.value) {
|
||||||
return
|
return
|
||||||
@@ -334,6 +414,33 @@ const submitForm = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const submitGenerateForm = async () => {
|
||||||
|
if (!generateFormRef.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const valid = await generateFormRef.value.validate()
|
||||||
|
if (!valid) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
generateLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = await EmployeeYearCostBudgetApi.generateEmployeeYearCostBudget(generateFormData)
|
||||||
|
if (data.createdCount > 0) {
|
||||||
|
message.success(
|
||||||
|
`成功为 ${data.budgetYear} 年度生成 ${data.createdCount} 名员工的预算记录,已跳过 ${data.skippedCount} 条重复记录。`
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
message.info(`${data.budgetYear} 年度没有需要新增的员工预算记录,已跳过 ${data.skippedCount} 条重复记录。`)
|
||||||
|
}
|
||||||
|
generateDialogVisible.value = false
|
||||||
|
queryParams.budgetYear = data.budgetYear
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
generateLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const handleDelete = async (id: number) => {
|
const handleDelete = async (id: number) => {
|
||||||
try {
|
try {
|
||||||
await message.delConfirm()
|
await message.delConfirm()
|
||||||
@@ -343,11 +450,18 @@ const handleDelete = async (id: number) => {
|
|||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
468
src/views/tjt/employee-year-leader-output/index.vue
Normal file
468
src/views/tjt/employee-year-leader-output/index.vue
Normal file
@@ -0,0 +1,468 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<el-form
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
:model="queryParams"
|
||||||
|
class="-mb-15px"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="员工姓名" prop="employeeName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.employeeName"
|
||||||
|
class="!w-220px"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入员工姓名"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产值年度" prop="outputYear">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryOutputYearValue"
|
||||||
|
class="!w-180px"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择年度"
|
||||||
|
type="year"
|
||||||
|
value-format="YYYY"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否启用" prop="enabledFlag">
|
||||||
|
<el-select v-model="queryParams.enabledFlag" class="!w-180px" clearable placeholder="请选择">
|
||||||
|
<el-option :value="true" label="启用" />
|
||||||
|
<el-option :value="false" label="停用" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery">
|
||||||
|
<Icon class="mr-5px" icon="ep:search" />
|
||||||
|
搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="resetQuery">
|
||||||
|
<Icon class="mr-5px" icon="ep:refresh" />
|
||||||
|
重置
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['tjt:employee-year-leader-output:create']"
|
||||||
|
plain
|
||||||
|
type="primary"
|
||||||
|
@click="openDialog('create')"
|
||||||
|
>
|
||||||
|
<Icon class="mr-5px" icon="ep:plus" />
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['tjt:employee-year-leader-output:create']"
|
||||||
|
plain
|
||||||
|
type="success"
|
||||||
|
@click="openGenerateDialog"
|
||||||
|
>
|
||||||
|
<Icon class="mr-5px" icon="ep:document-add" />
|
||||||
|
按年度生成
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list">
|
||||||
|
<el-table-column :index="getRowIndex" align="center" label="序号" type="index" width="88" />
|
||||||
|
<el-table-column align="center" label="员工姓名" min-width="140" prop="employeeName" />
|
||||||
|
<el-table-column align="center" label="产值年度" prop="outputYear" width="120" />
|
||||||
|
<el-table-column align="center" label="所长考核产值(元)" width="170">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ formatAmountText(scope.row.leaderOutputAmount) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="备注" min-width="240" prop="remark" show-overflow-tooltip />
|
||||||
|
<el-table-column align="center" label="是否启用" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag :type="scope.row.enabledFlag ? 'success' : 'info'">
|
||||||
|
{{ scope.row.enabledFlag ? '启用' : '停用' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="创建时间"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
/>
|
||||||
|
<el-table-column align="center" fixed="right" label="操作" width="160">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['tjt:employee-year-leader-output:update']"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openDialog('update', scope.row.id)"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['tjt:employee-year-leader-output:delete']"
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<Pagination
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
:total="total"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<Dialog v-model="dialogVisible" :title="dialogTitle" width="620">
|
||||||
|
<el-form ref="formRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="120px">
|
||||||
|
<el-form-item label="所长姓名" prop="employeeId">
|
||||||
|
<el-select
|
||||||
|
:model-value="formData.employeeId"
|
||||||
|
class="!w-1/1"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
reserve-keyword
|
||||||
|
placeholder="请输入所长姓名搜索"
|
||||||
|
:remote-method="searchEmployees"
|
||||||
|
:loading="employeeLoading"
|
||||||
|
@change="handleEmployeeChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in employeeOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.officeName ? `${item.employeeName} / ${item.officeName}` : item.employeeName"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产值年度" prop="outputYear">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formOutputYearValue"
|
||||||
|
class="!w-1/1"
|
||||||
|
placeholder="请选择年度"
|
||||||
|
type="year"
|
||||||
|
value-format="YYYY"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所长考核产值" prop="leaderOutputAmount">
|
||||||
|
<el-input-number
|
||||||
|
v-model="formData.leaderOutputAmount"
|
||||||
|
:min="0"
|
||||||
|
:precision="2"
|
||||||
|
:step="1000"
|
||||||
|
class="!w-1/1"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序号" prop="sortNo">
|
||||||
|
<el-input-number v-model="formData.sortNo" :min="0" :precision="0" class="!w-1/1" controls-position="right" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否启用" prop="enabledFlag">
|
||||||
|
<el-switch v-model="formData.enabledFlag" active-text="启用" inactive-text="停用" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.remark"
|
||||||
|
:rows="3"
|
||||||
|
maxlength="255"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
show-word-limit
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<el-button :loading="formLoading" type="primary" @click="submitForm">保存</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
|
<Dialog v-model="generateDialogVisible" title="按年度生成所长考核产值记录" width="560">
|
||||||
|
<el-form
|
||||||
|
ref="generateFormRef"
|
||||||
|
v-loading="generateLoading"
|
||||||
|
:model="generateFormData"
|
||||||
|
:rules="generateFormRules"
|
||||||
|
label-width="140px"
|
||||||
|
>
|
||||||
|
<el-form-item label="产值年度" prop="outputYear">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="generateOutputYearValue"
|
||||||
|
class="!w-1/1"
|
||||||
|
placeholder="请选择年度"
|
||||||
|
type="year"
|
||||||
|
value-format="YYYY"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="默认所长考核产值" prop="leaderOutputAmount">
|
||||||
|
<el-input-number
|
||||||
|
v-model="generateFormData.leaderOutputAmount"
|
||||||
|
:min="0"
|
||||||
|
:precision="2"
|
||||||
|
:step="1000"
|
||||||
|
class="!w-1/1"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<el-button :loading="generateLoading" type="primary" @click="submitGenerateForm">确认生成</el-button>
|
||||||
|
<el-button @click="generateDialogVisible = false">取消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import type { FormRules } from 'element-plus'
|
||||||
|
import * as EmployeeApi from '@/api/tjt/employee'
|
||||||
|
import * as EmployeeYearLeaderOutputApi from '@/api/tjt/employeeYearLeaderOutput'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import { formatAmountText } from '@/views/tjt/shared/planning'
|
||||||
|
|
||||||
|
defineOptions({ name: 'TjtEmployeeYearLeaderOutput' })
|
||||||
|
|
||||||
|
const message = useMessage()
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
|
const loading = ref(false)
|
||||||
|
const formLoading = ref(false)
|
||||||
|
const employeeLoading = ref(false)
|
||||||
|
const generateLoading = ref(false)
|
||||||
|
const total = ref(0)
|
||||||
|
const list = ref<EmployeeYearLeaderOutputApi.EmployeeYearLeaderOutputVO[]>([])
|
||||||
|
const employeeOptions = ref<EmployeeApi.EmployeeSimpleVO[]>([])
|
||||||
|
const queryFormRef = ref()
|
||||||
|
const formRef = ref()
|
||||||
|
const generateFormRef = ref()
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const generateDialogVisible = ref(false)
|
||||||
|
const dialogTitle = ref('')
|
||||||
|
const formType = ref<'create' | 'update'>('create')
|
||||||
|
|
||||||
|
const queryParams = reactive<EmployeeYearLeaderOutputApi.EmployeeYearLeaderOutputPageReqVO>({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
employeeId: undefined,
|
||||||
|
employeeName: undefined,
|
||||||
|
outputYear: undefined,
|
||||||
|
enabledFlag: undefined
|
||||||
|
})
|
||||||
|
|
||||||
|
const getRowIndex = (index: number) =>
|
||||||
|
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
||||||
|
|
||||||
|
const createFormData = (): EmployeeYearLeaderOutputApi.EmployeeYearLeaderOutputVO => ({
|
||||||
|
employeeId: undefined as never,
|
||||||
|
employeeName: '',
|
||||||
|
outputYear: new Date().getFullYear(),
|
||||||
|
leaderOutputAmount: 0,
|
||||||
|
remark: '',
|
||||||
|
sortNo: 0,
|
||||||
|
enabledFlag: true
|
||||||
|
})
|
||||||
|
|
||||||
|
const formData = ref<EmployeeYearLeaderOutputApi.EmployeeYearLeaderOutputVO>(createFormData())
|
||||||
|
const generateFormData = reactive<EmployeeYearLeaderOutputApi.EmployeeYearLeaderOutputGenerateReqVO>({
|
||||||
|
outputYear: new Date().getFullYear(),
|
||||||
|
leaderOutputAmount: 0
|
||||||
|
})
|
||||||
|
|
||||||
|
const queryOutputYearValue = computed({
|
||||||
|
get: () => (queryParams.outputYear ? String(queryParams.outputYear) : undefined),
|
||||||
|
set: (value?: string) => {
|
||||||
|
queryParams.outputYear = value ? Number(value) : undefined
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const formOutputYearValue = computed({
|
||||||
|
get: () => (formData.value.outputYear ? String(formData.value.outputYear) : undefined),
|
||||||
|
set: (value?: string) => {
|
||||||
|
formData.value.outputYear = value ? Number(value) : new Date().getFullYear()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const generateOutputYearValue = computed({
|
||||||
|
get: () => (generateFormData.outputYear ? String(generateFormData.outputYear) : undefined),
|
||||||
|
set: (value?: string) => {
|
||||||
|
generateFormData.outputYear = value ? Number(value) : new Date().getFullYear()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const formRules = reactive<FormRules>({
|
||||||
|
employeeId: [{ required: true, message: '所长不能为空', trigger: 'change' }],
|
||||||
|
outputYear: [{ required: true, message: '产值年度不能为空', trigger: 'change' }],
|
||||||
|
leaderOutputAmount: [{ required: true, message: '所长考核产值不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
const generateFormRules = reactive<FormRules>({
|
||||||
|
outputYear: [{ required: true, message: '产值年度不能为空', trigger: 'change' }],
|
||||||
|
leaderOutputAmount: [{ required: true, message: '默认所长考核产值不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
const ensureEmployeeOption = () => {
|
||||||
|
if (!formData.value.employeeId || !formData.value.employeeName) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (employeeOptions.value.some((item) => item.id === formData.value.employeeId)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
employeeOptions.value.push({
|
||||||
|
id: formData.value.employeeId,
|
||||||
|
employeeName: formData.value.employeeName
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const searchEmployees = async (keyword: string) => {
|
||||||
|
employeeLoading.value = true
|
||||||
|
try {
|
||||||
|
employeeOptions.value = await EmployeeApi.getEmployeeSimpleList({
|
||||||
|
keyword,
|
||||||
|
enabledFlag: true,
|
||||||
|
officeLeaderFlag: true
|
||||||
|
})
|
||||||
|
ensureEmployeeOption()
|
||||||
|
} finally {
|
||||||
|
employeeLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleEmployeeChange = (employeeId?: number) => {
|
||||||
|
const employee = employeeOptions.value.find((item) => item.id === employeeId)
|
||||||
|
formData.value.employeeId = employeeId as never
|
||||||
|
formData.value.employeeName = employee?.employeeName || ''
|
||||||
|
}
|
||||||
|
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await EmployeeYearLeaderOutputApi.getEmployeeYearLeaderOutputPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = createFormData()
|
||||||
|
employeeOptions.value = []
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
|
||||||
|
const openDialog = async (type: 'create' | 'update', id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = type === 'create' ? '新增年度所长考核产值' : '编辑年度所长考核产值'
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
if (!id) {
|
||||||
|
await searchEmployees('')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await EmployeeYearLeaderOutputApi.getEmployeeYearLeaderOutput(id)
|
||||||
|
ensureEmployeeOption()
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const openGenerateDialog = () => {
|
||||||
|
generateFormData.outputYear = queryParams.outputYear || new Date().getFullYear()
|
||||||
|
generateFormData.leaderOutputAmount = 0
|
||||||
|
generateDialogVisible.value = true
|
||||||
|
generateFormRef.value?.clearValidate()
|
||||||
|
}
|
||||||
|
|
||||||
|
const submitForm = async () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const valid = await formRef.value.validate()
|
||||||
|
if (!valid) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await EmployeeYearLeaderOutputApi.createEmployeeYearLeaderOutput(formData.value)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await EmployeeYearLeaderOutputApi.updateEmployeeYearLeaderOutput(formData.value)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const submitGenerateForm = async () => {
|
||||||
|
if (!generateFormRef.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const valid = await generateFormRef.value.validate()
|
||||||
|
if (!valid) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
generateLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = await EmployeeYearLeaderOutputApi.generateEmployeeYearLeaderOutput(generateFormData)
|
||||||
|
if (data.createdCount > 0) {
|
||||||
|
message.success(
|
||||||
|
`成功为 ${data.outputYear} 年度生成 ${data.createdCount} 名所长的考核产值记录,已跳过 ${data.skippedCount} 条重复记录。`
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
message.info(`${data.outputYear} 年度没有需要新增的所长考核产值记录,已跳过 ${data.skippedCount} 条重复记录。`)
|
||||||
|
}
|
||||||
|
generateDialogVisible.value = false
|
||||||
|
queryParams.outputYear = data.outputYear
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
generateLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
await message.delConfirm()
|
||||||
|
await EmployeeYearLeaderOutputApi.deleteEmployeeYearLeaderOutput(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
|
||||||
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -57,6 +57,17 @@
|
|||||||
<el-option :value="false" label="停用" />
|
<el-option :value="false" label="停用" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="是否所长" prop="officeLeaderFlag">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.officeLeaderFlag"
|
||||||
|
class="!w-180px"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择"
|
||||||
|
>
|
||||||
|
<el-option :value="true" label="是" />
|
||||||
|
<el-option :value="false" label="否" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="handleQuery">
|
<el-button @click="handleQuery">
|
||||||
<Icon class="mr-5px" icon="ep:search" />
|
<Icon class="mr-5px" icon="ep:search" />
|
||||||
@@ -76,7 +87,7 @@
|
|||||||
|
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column align="center" label="ID" prop="id" width="88" />
|
<el-table-column :index="getRowIndex" align="center" label="序号" type="index" width="88" />
|
||||||
<el-table-column align="center" label="员工姓名" min-width="120" prop="employeeName" />
|
<el-table-column align="center" label="员工姓名" min-width="120" prop="employeeName" />
|
||||||
<el-table-column align="center" label="性别" prop="gender" width="80" />
|
<el-table-column align="center" label="性别" prop="gender" width="80" />
|
||||||
<el-table-column align="center" label="所属专业所" min-width="140" prop="officeName" />
|
<el-table-column align="center" label="所属专业所" min-width="140" prop="officeName" />
|
||||||
@@ -95,9 +106,28 @@
|
|||||||
prop="registrationSealNo"
|
prop="registrationSealNo"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
/>
|
/>
|
||||||
<el-table-column align="center" label="入职时间" prop="entryDate" width="120" />
|
<el-table-column
|
||||||
<el-table-column align="center" label="离职时间" prop="leaveDate" width="120" />
|
align="center"
|
||||||
|
label="入职时间"
|
||||||
|
prop="entryDate"
|
||||||
|
width="120"
|
||||||
|
:formatter="dateFormatter2"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="离职时间"
|
||||||
|
prop="leaveDate"
|
||||||
|
width="120"
|
||||||
|
:formatter="dateFormatter2"
|
||||||
|
/>
|
||||||
<el-table-column align="center" label="状态" prop="employeeStatus" width="90" />
|
<el-table-column align="center" label="状态" prop="employeeStatus" width="90" />
|
||||||
|
<el-table-column align="center" label="是否所长" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag :type="scope.row.officeLeaderFlag ? 'warning' : 'info'">
|
||||||
|
{{ scope.row.officeLeaderFlag ? '是' : '否' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column align="center" label="是否启用" width="100">
|
<el-table-column align="center" label="是否启用" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag :type="scope.row.enabledFlag ? 'success' : 'info'">
|
<el-tag :type="scope.row.enabledFlag ? 'success' : 'info'">
|
||||||
@@ -105,7 +135,13 @@
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="创建时间" prop="createTime" width="180" />
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="创建时间"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
/>
|
||||||
<el-table-column align="center" fixed="right" label="操作" width="160">
|
<el-table-column align="center" fixed="right" label="操作" width="160">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -262,6 +298,11 @@
|
|||||||
<el-switch v-model="formData.enabledFlag" active-text="启用" inactive-text="停用" />
|
<el-switch v-model="formData.enabledFlag" active-text="启用" inactive-text="停用" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否所长" prop="officeLeaderFlag">
|
||||||
|
<el-switch v-model="formData.officeLeaderFlag" active-text="是" inactive-text="否" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input
|
<el-input
|
||||||
@@ -286,6 +327,7 @@
|
|||||||
import type { FormRules } from 'element-plus'
|
import type { FormRules } from 'element-plus'
|
||||||
import * as EmployeeApi from '@/api/tjt/employee'
|
import * as EmployeeApi from '@/api/tjt/employee'
|
||||||
import * as OfficeApi from '@/api/tjt/office'
|
import * as OfficeApi from '@/api/tjt/office'
|
||||||
|
import { dateFormatter, dateFormatter2, formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
defineOptions({ name: 'TjtEmployee' })
|
defineOptions({ name: 'TjtEmployee' })
|
||||||
|
|
||||||
@@ -327,9 +369,13 @@ const queryParams = reactive<EmployeeApi.EmployeePageReqVO>({
|
|||||||
employeeName: undefined,
|
employeeName: undefined,
|
||||||
officeId: undefined,
|
officeId: undefined,
|
||||||
employeeStatus: undefined,
|
employeeStatus: undefined,
|
||||||
enabledFlag: undefined
|
enabledFlag: undefined,
|
||||||
|
officeLeaderFlag: undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const getRowIndex = (index: number) =>
|
||||||
|
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
||||||
|
|
||||||
const createFormData = (): EmployeeApi.EmployeeVO => ({
|
const createFormData = (): EmployeeApi.EmployeeVO => ({
|
||||||
employeeName: '',
|
employeeName: '',
|
||||||
gender: '男',
|
gender: '男',
|
||||||
@@ -341,12 +387,17 @@ const createFormData = (): EmployeeApi.EmployeeVO => ({
|
|||||||
leaveDate: undefined,
|
leaveDate: undefined,
|
||||||
employeeStatus: '在职',
|
employeeStatus: '在职',
|
||||||
remark: '',
|
remark: '',
|
||||||
|
officeLeaderFlag: false,
|
||||||
sortNo: 0,
|
sortNo: 0,
|
||||||
enabledFlag: true
|
enabledFlag: true
|
||||||
})
|
})
|
||||||
|
|
||||||
const formData = ref<EmployeeApi.EmployeeVO>(createFormData())
|
const formData = ref<EmployeeApi.EmployeeVO>(createFormData())
|
||||||
|
|
||||||
|
const normalizeDateValue = (value?: string | number) => {
|
||||||
|
return value ? formatDate(value as any, 'YYYY-MM-DD') : undefined
|
||||||
|
}
|
||||||
|
|
||||||
const formRules = reactive<FormRules>({
|
const formRules = reactive<FormRules>({
|
||||||
employeeName: [{ required: true, message: '员工姓名不能为空', trigger: 'blur' }],
|
employeeName: [{ required: true, message: '员工姓名不能为空', trigger: 'blur' }],
|
||||||
gender: [{ required: true, message: '性别不能为空', trigger: 'change' }],
|
gender: [{ required: true, message: '性别不能为空', trigger: 'change' }],
|
||||||
@@ -408,7 +459,12 @@ const openDialog = async (type: 'create' | 'update', id?: number) => {
|
|||||||
}
|
}
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
formData.value = await EmployeeApi.getEmployee(id)
|
const data = await EmployeeApi.getEmployee(id)
|
||||||
|
formData.value = {
|
||||||
|
...data,
|
||||||
|
entryDate: normalizeDateValue(data.entryDate as any),
|
||||||
|
leaveDate: normalizeDateValue(data.leaveDate as any)
|
||||||
|
}
|
||||||
await ensureCurrentOfficeOption()
|
await ensureCurrentOfficeOption()
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
@@ -448,12 +504,19 @@ const handleDelete = async (id: number) => {
|
|||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await loadOfficeOptions()
|
await loadOfficeOptions()
|
||||||
await getList()
|
await getList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column align="center" label="ID" prop="id" width="88" />
|
<el-table-column :index="getRowIndex" align="center" label="序号" type="index" width="88" />
|
||||||
<el-table-column align="center" label="专业所名称" min-width="180" prop="officeName" />
|
<el-table-column align="center" label="专业所名称" min-width="180" prop="officeName" />
|
||||||
<el-table-column align="center" label="专业所编码" min-width="140" prop="officeCode" />
|
<el-table-column align="center" label="专业所编码" min-width="140" prop="officeCode" />
|
||||||
<el-table-column align="center" label="排序号" prop="sortNo" width="100" />
|
<el-table-column align="center" label="排序号" prop="sortNo" width="100" />
|
||||||
@@ -58,7 +58,13 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="备注" min-width="220" prop="remark" show-overflow-tooltip />
|
<el-table-column align="center" label="备注" min-width="220" prop="remark" show-overflow-tooltip />
|
||||||
<el-table-column align="center" label="创建时间" prop="createTime" width="180" />
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="创建时间"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
/>
|
||||||
<el-table-column align="center" fixed="right" label="操作" width="160">
|
<el-table-column align="center" fixed="right" label="操作" width="160">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-hasPermi="['tjt:office:update']" link type="primary" @click="openDialog('update', scope.row.id)">
|
<el-button v-hasPermi="['tjt:office:update']" link type="primary" @click="openDialog('update', scope.row.id)">
|
||||||
@@ -114,6 +120,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { FormRules } from 'element-plus'
|
import type { FormRules } from 'element-plus'
|
||||||
import * as OfficeApi from '@/api/tjt/office'
|
import * as OfficeApi from '@/api/tjt/office'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
|
||||||
defineOptions({ name: 'TjtOffice' })
|
defineOptions({ name: 'TjtOffice' })
|
||||||
|
|
||||||
@@ -137,6 +144,9 @@ const queryParams = reactive<OfficeApi.OfficePageReqVO>({
|
|||||||
enabledFlag: undefined
|
enabledFlag: undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const getRowIndex = (index: number) =>
|
||||||
|
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
||||||
|
|
||||||
const createFormData = (): OfficeApi.OfficeVO => ({
|
const createFormData = (): OfficeApi.OfficeVO => ({
|
||||||
officeName: '',
|
officeName: '',
|
||||||
officeCode: '',
|
officeCode: '',
|
||||||
@@ -226,11 +236,18 @@ const handleDelete = async (id: number) => {
|
|||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -103,108 +103,126 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<ContentWrap v-if="currentPlanning && formData">
|
<ContentWrap>
|
||||||
<div class="mb-16px flex items-center justify-between gap-16px">
|
<div v-loading="quarterLoading" class="min-h-320px">
|
||||||
<div>
|
<template v-if="currentPlanning && formData">
|
||||||
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
<div class="mb-16px flex items-center justify-between gap-16px">
|
||||||
<div class="mt-4px text-13px text-[var(--el-text-color-secondary)]">
|
<div>
|
||||||
年度:{{ formData.year || '-' }},考核产值:{{ formatAmountText(formData.assessmentOutputValue) }} 元
|
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
||||||
|
<div class="mt-4px text-13px text-[var(--el-text-color-secondary)]">
|
||||||
|
年度:{{ formData.year || '-' }},考核产值:{{
|
||||||
|
formatAmountText(formData.assessmentOutputValue)
|
||||||
|
}}
|
||||||
|
元
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-12px">
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['tjt:output-split:update']"
|
||||||
|
plain
|
||||||
|
type="primary"
|
||||||
|
@click="openEditDialog"
|
||||||
|
>
|
||||||
|
<Icon class="mr-5px" icon="ep:edit" />
|
||||||
|
编辑比例
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="flex items-center gap-12px">
|
|
||||||
<el-button
|
|
||||||
v-hasPermi="['tjt:output-split:update']"
|
|
||||||
plain
|
|
||||||
type="primary"
|
|
||||||
@click="openEditDialog"
|
|
||||||
>
|
|
||||||
<Icon class="mr-5px" icon="ep:edit" />
|
|
||||||
编辑比例
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-descriptions :column="2" border title="基础信息">
|
<el-descriptions :column="2" border title="基础信息">
|
||||||
<el-descriptions-item label="项目名称">{{ formData.projectName || '-' }}</el-descriptions-item>
|
<el-descriptions-item label="项目名称">{{
|
||||||
<el-descriptions-item label="项目任务包">{{ formData.planningContent || '-' }}</el-descriptions-item>
|
formData.projectName || '-'
|
||||||
<el-descriptions-item label="工程负责人">
|
}}</el-descriptions-item>
|
||||||
{{ getProjectLeadText(formData.projectManagerName, formData.engineeringLeaderName) }}
|
<el-descriptions-item label="项目任务包">{{
|
||||||
</el-descriptions-item>
|
formData.planningContent || '-'
|
||||||
</el-descriptions>
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="工程负责人">
|
||||||
|
{{
|
||||||
|
getProjectLeadText(formData.projectManagerName, formData.engineeringLeaderName)
|
||||||
|
}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
|
||||||
<el-divider content-position="left">项目层结果</el-divider>
|
<el-divider content-position="left">项目层结果</el-divider>
|
||||||
<el-table :data="projectResultRows" border>
|
<el-table :data="projectResultRows" border>
|
||||||
<el-table-column align="center" label="类别" min-width="160" prop="label" />
|
<el-table-column align="center" label="类别" min-width="160" prop="label" />
|
||||||
<el-table-column align="center" label="比例" min-width="120">
|
<el-table-column align="center" label="比例" min-width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.percentText }}
|
{{ scope.row.percentText }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="金额(元)" min-width="140">
|
<el-table-column align="center" label="金额(元)" min-width="140">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatAmountText(scope.row.amount) }}
|
{{ formatAmountText(scope.row.amount) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<el-divider content-position="left">专业层结果</el-divider>
|
<el-divider content-position="left">专业层结果</el-divider>
|
||||||
<el-table :data="specialtyResultRows" border>
|
<el-table :data="specialtyResultRows" border>
|
||||||
<el-table-column align="center" label="专业" min-width="140" prop="label" />
|
<el-table-column align="center" label="专业" min-width="140" prop="label" />
|
||||||
<el-table-column align="center" label="比例" min-width="120">
|
<el-table-column align="center" label="比例" min-width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.percentText }}
|
{{ scope.row.percentText }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="金额(元)" min-width="140">
|
<el-table-column align="center" label="金额(元)" min-width="140">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatAmountText(scope.row.amount) }}
|
{{ formatAmountText(scope.row.amount) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<el-divider content-position="left">年度分配信息</el-divider>
|
<el-divider content-position="left">年度分配信息</el-divider>
|
||||||
<div class="mb-12px">
|
<div class="mb-12px">
|
||||||
<el-radio-group v-model="selectedAnnualCategory" size="small">
|
<el-radio-group v-model="selectedAnnualCategory" size="small">
|
||||||
<el-radio-button
|
<el-radio-button
|
||||||
v-for="item in annualCategoryOptions"
|
v-for="item in annualCategoryOptions"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.value"
|
:label="item.value"
|
||||||
>
|
>
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
|
||||||
<el-row :gutter="16" class="mb-16px">
|
|
||||||
<el-col v-for="item in annualSummaryCards" :key="item.label" :span="8">
|
|
||||||
<div class="rounded-8px bg-[var(--el-fill-color-light)] px-16px py-12px">
|
|
||||||
<div class="text-12px text-[var(--el-text-color-secondary)]">{{ item.label }}</div>
|
|
||||||
<div class="mt-6px text-18px font-600">{{ formatAmountText(item.amount) }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<el-row :gutter="16" class="mb-16px">
|
||||||
</el-row>
|
<el-col v-for="item in annualSummaryCards" :key="item.label" :span="8">
|
||||||
<el-table v-loading="quarterLoading" :data="annualDistributionRows" border>
|
<div class="rounded-8px bg-[var(--el-fill-color-light)] px-16px py-12px">
|
||||||
<el-table-column align="center" label="分配年度" min-width="120" prop="distributionYear" />
|
<div class="text-12px text-[var(--el-text-color-secondary)]">{{
|
||||||
<el-table-column
|
item.label
|
||||||
v-for="quarter in QUARTER_OPTIONS"
|
}}</div>
|
||||||
:key="String(quarter.value)"
|
<div class="mt-6px text-18px font-600">{{ formatAmountText(item.amount) }}</div>
|
||||||
align="center"
|
</div>
|
||||||
:label="quarter.label"
|
</el-col>
|
||||||
min-width="150"
|
</el-row>
|
||||||
>
|
<el-table :data="annualDistributionRows" border>
|
||||||
<template #default="scope">
|
<el-table-column
|
||||||
{{ formatAmountText(scope.row.quarterAmounts[Number(quarter.value)]) }}
|
align="center"
|
||||||
</template>
|
label="分配年度"
|
||||||
</el-table-column>
|
min-width="120"
|
||||||
<el-table-column align="center" label="年度合计(元)" min-width="160">
|
prop="distributionYear"
|
||||||
<template #default="scope">
|
/>
|
||||||
{{ formatAmountText(scope.row.yearTotal) }}
|
<el-table-column
|
||||||
</template>
|
v-for="quarter in QUARTER_OPTIONS"
|
||||||
</el-table-column>
|
:key="String(quarter.value)"
|
||||||
</el-table>
|
align="center"
|
||||||
</ContentWrap>
|
:label="quarter.label"
|
||||||
|
min-width="150"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{ formatAmountText(scope.row.quarterAmounts[Number(quarter.value)]) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="年度合计(元)" min-width="160">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ formatAmountText(scope.row.yearTotal) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
|
|
||||||
<ContentWrap v-else>
|
<el-empty v-else-if="!quarterLoading" description="请选择合约规划后查看分配结果" />
|
||||||
<el-empty description="请选择合约规划后查看分配结果" />
|
</div>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -618,14 +636,12 @@ const loadPlanningRelatedData = async (planning: PlanningApi.ProjectPlanningVO)
|
|||||||
}
|
}
|
||||||
quarterLoading.value = true
|
quarterLoading.value = true
|
||||||
try {
|
try {
|
||||||
const [planningDetail, outputSplit, quarterList] = await Promise.all([
|
const detail = await OutputSplitApi.getProjectOutputSplitPlanningDetail(planning.id)
|
||||||
PlanningApi.getProjectPlanning(planning.id),
|
currentPlanning.value = detail?.planning
|
||||||
OutputSplitApi.getProjectOutputSplitByPlanningId(planning.id),
|
formData.value = detail?.outputSplit
|
||||||
PlanningQuarterApi.getProjectPlanningQuarterListByPlanningId(planning.id)
|
quarterRows.value = detail?.planning
|
||||||
])
|
? buildQuarterRows(detail.planning, detail.quarters || [])
|
||||||
currentPlanning.value = planningDetail
|
: []
|
||||||
formData.value = outputSplit
|
|
||||||
quarterRows.value = buildQuarterRows(planningDetail, quarterList)
|
|
||||||
} finally {
|
} finally {
|
||||||
quarterLoading.value = false
|
quarterLoading.value = false
|
||||||
}
|
}
|
||||||
@@ -723,11 +739,18 @@ const handleSave = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -228,7 +228,7 @@
|
|||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="formData.drawingSetFactor"
|
v-model="formData.drawingSetFactor"
|
||||||
:min="0"
|
:min="0"
|
||||||
:precision="4"
|
:precision="2"
|
||||||
:step="0.01"
|
:step="0.01"
|
||||||
class="!w-1/1"
|
class="!w-1/1"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
@@ -240,7 +240,7 @@
|
|||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="formData.scaleFactor"
|
v-model="formData.scaleFactor"
|
||||||
:min="0"
|
:min="0"
|
||||||
:precision="4"
|
:precision="2"
|
||||||
:step="0.01"
|
:step="0.01"
|
||||||
class="!w-1/1"
|
class="!w-1/1"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
@@ -254,7 +254,7 @@
|
|||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="formData.modificationFactor"
|
v-model="formData.modificationFactor"
|
||||||
:min="0"
|
:min="0"
|
||||||
:precision="4"
|
:precision="2"
|
||||||
:step="0.01"
|
:step="0.01"
|
||||||
class="!w-1/1"
|
class="!w-1/1"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
@@ -312,31 +312,49 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="建筑类型" min-width="140" fixed="left">
|
<el-table-column align="center" label="建筑类型" min-width="140" fixed="left">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input v-model="row.buildingType" maxlength="100" placeholder="建筑类型" />
|
<el-tooltip
|
||||||
|
:content="row.buildingType"
|
||||||
|
:disabled="!hasValue(row.buildingType)"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
|
<el-input v-model="row.buildingType" maxlength="100" placeholder="建筑类型" />
|
||||||
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<!-- 2. 取消 controls 的核心数值列 -->
|
<!-- 2. 取消 controls 的核心数值列 -->
|
||||||
<el-table-column align="center" label="指导单价(元)" min-width="110">
|
<el-table-column align="center" label="指导单价(元)" min-width="110">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input-number
|
<el-tooltip
|
||||||
v-model="row.internalGuidanceUnitPrice"
|
:content="formatAmountText(row.internalGuidanceUnitPrice)"
|
||||||
:min="0"
|
:disabled="!hasValue(row.internalGuidanceUnitPrice)"
|
||||||
:precision="2"
|
placement="top"
|
||||||
:controls="false"
|
>
|
||||||
class="!w-1/1"
|
<el-input-number
|
||||||
/>
|
v-model="row.internalGuidanceUnitPrice"
|
||||||
|
:min="0"
|
||||||
|
:precision="2"
|
||||||
|
:controls="false"
|
||||||
|
class="!w-1/1"
|
||||||
|
/>
|
||||||
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="设计面积(m²)" min-width="110">
|
<el-table-column align="center" label="设计面积(m²)" min-width="110">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input-number
|
<el-tooltip
|
||||||
v-model="row.designArea"
|
:content="formatAmountText(row.designArea)"
|
||||||
:min="0"
|
:disabled="!hasValue(row.designArea)"
|
||||||
:precision="2"
|
placement="top"
|
||||||
:controls="false"
|
>
|
||||||
class="!w-1/1"
|
<el-input-number
|
||||||
/>
|
v-model="row.designArea"
|
||||||
|
:min="0"
|
||||||
|
:precision="2"
|
||||||
|
:controls="false"
|
||||||
|
class="!w-1/1"
|
||||||
|
/>
|
||||||
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="楼栋/户型数" min-width="100">
|
<el-table-column align="center" label="楼栋/户型数" min-width="100">
|
||||||
@@ -355,17 +373,17 @@
|
|||||||
<el-table-column label="调整系数配置" align="center">
|
<el-table-column label="调整系数配置" align="center">
|
||||||
<el-table-column align="center" label="套图" min-width="85">
|
<el-table-column align="center" label="套图" min-width="85">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input-number v-model="row.drawingSetFactor" :min="0" :precision="4" :controls="false" class="!w-1/1" />
|
<el-input-number v-model="row.drawingSetFactor" :min="0" :precision="2" :controls="false" class="!w-1/1" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="规模" min-width="85">
|
<el-table-column align="center" label="规模" min-width="85">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input-number v-model="row.scaleFactor" :min="0" :precision="4" :controls="false" class="!w-1/1" />
|
<el-input-number v-model="row.scaleFactor" :min="0" :precision="2" :controls="false" class="!w-1/1" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="修改" min-width="85">
|
<el-table-column align="center" label="修改" min-width="85">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input-number v-model="row.modificationFactor" :min="0" :precision="4" :controls="false" class="!w-1/1" />
|
<el-input-number v-model="row.modificationFactor" :min="0" :precision="2" :controls="false" class="!w-1/1" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="复杂(%)" min-width="90">
|
<el-table-column align="center" label="复杂(%)" min-width="90">
|
||||||
@@ -412,9 +430,34 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column align="center" label="备注" min-width="130">
|
<el-table-column align="left" label="备注" min-width="260">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input v-model="row.remark" maxlength="500" placeholder="备注信息" />
|
<div class="remark-cell">
|
||||||
|
<el-tooltip
|
||||||
|
:disabled="!hasGuideDetailRemark(row.remark)"
|
||||||
|
effect="dark"
|
||||||
|
placement="top-start"
|
||||||
|
popper-class="guide-remark-tooltip"
|
||||||
|
>
|
||||||
|
<template #content>
|
||||||
|
<div class="remark-tooltip-content">{{ row.remark }}</div>
|
||||||
|
</template>
|
||||||
|
<div
|
||||||
|
class="remark-preview"
|
||||||
|
:class="{ 'is-empty': !hasGuideDetailRemark(row.remark) }"
|
||||||
|
>
|
||||||
|
{{ formatGuideDetailRemarkPreview(row.remark) }}
|
||||||
|
</div>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-button
|
||||||
|
class="remark-edit-button !h-auto !p-0"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openGuideDetailRemarkDialog(row)"
|
||||||
|
>
|
||||||
|
{{ hasGuideDetailRemark(row.remark) ? '编辑' : '填写' }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" fixed="right" label="操作" width="70">
|
<el-table-column align="center" fixed="right" label="操作" width="70">
|
||||||
@@ -526,6 +569,35 @@
|
|||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
|
<Dialog v-model="remarkDialogVisible" title="指导价法明细备注" width="720">
|
||||||
|
<el-descriptions v-if="activeRemarkRow" :column="2" border class="mb-16px">
|
||||||
|
<el-descriptions-item label="序号">
|
||||||
|
{{ activeRemarkRow.sortNo || '-' }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="设计部位">
|
||||||
|
{{ activeRemarkRow.designPart || '-' }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="建筑类型">
|
||||||
|
{{ activeRemarkRow.buildingType || '-' }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="考核产值(元)">
|
||||||
|
{{ formatAmountText(getGuideDetailAssessmentOutputValue(activeRemarkRow)) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<el-input
|
||||||
|
v-model="remarkDraft"
|
||||||
|
:autosize="{ minRows: 8, maxRows: 14 }"
|
||||||
|
maxlength="500"
|
||||||
|
placeholder="请输入备注,例如计价说明、图纸版本说明、附加系数说明等"
|
||||||
|
show-word-limit
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
|
<template #footer>
|
||||||
|
<el-button type="primary" @click="saveGuideDetailRemark">确定</el-button>
|
||||||
|
<el-button @click="remarkDialogVisible = false">取消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -619,6 +691,9 @@ const createFormData = (): PlanningApi.ProjectPlanningVO => ({
|
|||||||
|
|
||||||
const formData = ref<PlanningApi.ProjectPlanningVO>(createFormData())
|
const formData = ref<PlanningApi.ProjectPlanningVO>(createFormData())
|
||||||
const guideDetails = ref<GuideDetailRow[]>([])
|
const guideDetails = ref<GuideDetailRow[]>([])
|
||||||
|
const remarkDialogVisible = ref(false)
|
||||||
|
const activeRemarkRow = ref<GuideDetailRow>()
|
||||||
|
const remarkDraft = ref('')
|
||||||
|
|
||||||
const planningStartYearValue = computed({
|
const planningStartYearValue = computed({
|
||||||
get: () => (formData.value.planningStartYear ? String(formData.value.planningStartYear) : undefined),
|
get: () => (formData.value.planningStartYear ? String(formData.value.planningStartYear) : undefined),
|
||||||
@@ -743,6 +818,28 @@ const resetGuideDetailSortNo = () => {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hasGuideDetailRemark = (remark?: string) => Boolean(remark && remark.trim())
|
||||||
|
|
||||||
|
const formatGuideDetailRemarkPreview = (remark?: string) => {
|
||||||
|
if (!hasGuideDetailRemark(remark)) {
|
||||||
|
return '暂无备注'
|
||||||
|
}
|
||||||
|
return remark!.trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
const openGuideDetailRemarkDialog = (row: GuideDetailRow) => {
|
||||||
|
activeRemarkRow.value = row
|
||||||
|
remarkDraft.value = row.remark || ''
|
||||||
|
remarkDialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const saveGuideDetailRemark = () => {
|
||||||
|
if (activeRemarkRow.value) {
|
||||||
|
activeRemarkRow.value.remark = remarkDraft.value
|
||||||
|
}
|
||||||
|
remarkDialogVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
const getGuideDetailTotalAdjustmentFactor = (row: GuideDetailRow) => {
|
const getGuideDetailTotalAdjustmentFactor = (row: GuideDetailRow) => {
|
||||||
if (
|
if (
|
||||||
row.drawingSetFactor === undefined ||
|
row.drawingSetFactor === undefined ||
|
||||||
@@ -1095,12 +1192,17 @@ const open = async (id: number) => {
|
|||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await PlanningApi.getProjectPlanning(id)
|
const detail = await PlanningApi.getProjectPlanningOutputEditDetail(id)
|
||||||
formData.value = normalizeFormData(data)
|
if (!detail?.planning) {
|
||||||
|
formData.value = createFormData()
|
||||||
|
guideDetails.value = []
|
||||||
|
dialogVisible.value = false
|
||||||
|
message.warning('合约规划不存在或已被删除')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
formData.value = normalizeFormData(detail.planning)
|
||||||
guideDetails.value = showGuideDetailSection.value
|
guideDetails.value = showGuideDetailSection.value
|
||||||
? normalizeGuideDetailList(
|
? normalizeGuideDetailList(detail.guideDetails)
|
||||||
await PlanningGuideDetailApi.getProjectPlanningGuideDetailListByPlanningId(id)
|
|
||||||
)
|
|
||||||
: []
|
: []
|
||||||
applyCalculationRatioDefault()
|
applyCalculationRatioDefault()
|
||||||
if (formData.value.reviewOutsourceRatio === undefined || formData.value.reviewOutsourceRatio === null) {
|
if (formData.value.reviewOutsourceRatio === undefined || formData.value.reviewOutsourceRatio === null) {
|
||||||
@@ -1157,4 +1259,45 @@ const submitForm = async () => {
|
|||||||
:deep(.text-primary) {
|
:deep(.text-primary) {
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.remark-cell {
|
||||||
|
display: flex;
|
||||||
|
min-height: 32px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remark-preview {
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
flex: 1;
|
||||||
|
color: var(--el-text-color-regular);
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 20px;
|
||||||
|
text-align: left;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remark-preview.is-empty {
|
||||||
|
color: var(--el-text-color-placeholder);
|
||||||
|
}
|
||||||
|
|
||||||
|
.remark-edit-button {
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.guide-remark-tooltip) {
|
||||||
|
max-width: 640px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.guide-remark-tooltip .remark-tooltip-content) {
|
||||||
|
max-height: 260px;
|
||||||
|
overflow-y: auto;
|
||||||
|
line-height: 22px;
|
||||||
|
white-space: pre-line;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog v-model="dialogVisible" title="季度分配编辑" width="1280">
|
<Dialog v-model="dialogVisible" title="季度分配编辑" width="1280">
|
||||||
<div class="mb-16px rounded-8px bg-[var(--el-fill-color-light)] px-16px py-12px text-13px leading-22px text-[var(--el-text-color-secondary)]">
|
|
||||||
在这里维护合约规划的分配总控信息和季度分配明细。新增年度默认各季度为 0%,没有比例或比例为 0 的季度不会落库。
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
@@ -208,7 +205,24 @@ const open = async (id: number) => {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
deletedQuarterIds.value = []
|
deletedQuarterIds.value = []
|
||||||
try {
|
try {
|
||||||
const planning = await PlanningApi.getProjectPlanning(id)
|
const detail = await PlanningQuarterApi.getProjectPlanningQuarterPlanningDetail(id)
|
||||||
|
if (!detail?.planning) {
|
||||||
|
planningId.value = undefined
|
||||||
|
formData.value = {
|
||||||
|
projectId: 0,
|
||||||
|
ownershipType: '',
|
||||||
|
calculationMethod: '',
|
||||||
|
planningContent: '',
|
||||||
|
totalDistributionAmount: 1,
|
||||||
|
progressRemark: ''
|
||||||
|
}
|
||||||
|
quarterRows.value = []
|
||||||
|
deletedQuarterIds.value = []
|
||||||
|
dialogVisible.value = false
|
||||||
|
message.warning('合约规划不存在或已被删除')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const planning = detail.planning
|
||||||
formData.value = {
|
formData.value = {
|
||||||
...planning,
|
...planning,
|
||||||
contractValueQuantity: planning.contractValueQuantity ?? 1,
|
contractValueQuantity: planning.contractValueQuantity ?? 1,
|
||||||
@@ -217,8 +231,7 @@ const open = async (id: number) => {
|
|||||||
totalDistributionAmount: planning.totalDistributionAmount ?? 1,
|
totalDistributionAmount: planning.totalDistributionAmount ?? 1,
|
||||||
progressRemark: planning.progressRemark ?? ''
|
progressRemark: planning.progressRemark ?? ''
|
||||||
}
|
}
|
||||||
const quarterList = await PlanningQuarterApi.getProjectPlanningQuarterListByPlanningId(id)
|
quarterRows.value = buildQuarterRows(formData.value, detail.quarters || [])
|
||||||
quarterRows.value = buildQuarterRows(formData.value, quarterList)
|
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,9 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="15">
|
<el-col :span="15">
|
||||||
<ContentWrap v-if="currentPlanning">
|
<div v-loading="quarterLoading" class="min-h-320px">
|
||||||
|
<template v-if="currentPlanning">
|
||||||
|
<ContentWrap>
|
||||||
<div class="mb-16px flex items-center justify-between gap-16px">
|
<div class="mb-16px flex items-center justify-between gap-16px">
|
||||||
<div>
|
<div>
|
||||||
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
||||||
@@ -298,13 +300,10 @@
|
|||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<ContentWrap v-if="currentPlanning">
|
<ContentWrap>
|
||||||
<div class="mb-16px flex items-center justify-between gap-16px">
|
<div class="mb-16px flex items-center justify-between gap-16px">
|
||||||
<div>
|
<div>
|
||||||
<div class="text-14px font-600">季度分配</div>
|
<div class="text-14px font-600">季度分配</div>
|
||||||
<div class="mt-4px text-12px text-[var(--el-text-color-secondary)]">
|
|
||||||
总分配、已分配、待分配和提取进度备注属于合约规划的总体分配控制;季度分配表只展示年度、季度和分配比例明细。
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['tjt:planning:update', 'tjt:planning-quarter:update', 'tjt:planning-quarter:create']"
|
v-hasPermi="['tjt:planning:update', 'tjt:planning-quarter:update', 'tjt:planning-quarter:create']"
|
||||||
@@ -351,7 +350,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="quarterLoading" :data="quarterRows" border>
|
<el-table :data="quarterRows" border>
|
||||||
<el-table-column align="center" label="分配年度" width="150" prop="distributionYear" />
|
<el-table-column align="center" label="分配年度" width="150" prop="distributionYear" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="quarter in QUARTER_OPTIONS"
|
v-for="quarter in QUARTER_OPTIONS"
|
||||||
@@ -369,10 +368,12 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
</template>
|
||||||
|
|
||||||
<ContentWrap v-else>
|
<ContentWrap v-else-if="!quarterLoading">
|
||||||
<el-empty description="请选择合约规划后查看测算结果和季度分配" />
|
<el-empty description="请选择合约规划后查看测算结果和季度分配" />
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
@@ -584,12 +585,11 @@ const getPlanningList = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const loadPlanningDetail = async (planningId: number) => {
|
const loadPlanningDetail = async (planningId: number) => {
|
||||||
const planning = await PlanningApi.getProjectPlanning(planningId)
|
|
||||||
currentPlanning.value = planning
|
|
||||||
quarterLoading.value = true
|
quarterLoading.value = true
|
||||||
try {
|
try {
|
||||||
const quarterList = await PlanningQuarterApi.getProjectPlanningQuarterListByPlanningId(planningId)
|
const detail = await PlanningQuarterApi.getProjectPlanningQuarterPlanningDetail(planningId)
|
||||||
quarterRows.value = buildQuarterRows(planning, quarterList)
|
currentPlanning.value = detail?.planning
|
||||||
|
quarterRows.value = detail?.planning ? buildQuarterRows(detail.planning, detail.quarters || []) : []
|
||||||
} finally {
|
} finally {
|
||||||
quarterLoading.value = false
|
quarterLoading.value = false
|
||||||
}
|
}
|
||||||
@@ -646,11 +646,18 @@ const handlePlanningOutputFormSuccess = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -88,6 +88,18 @@
|
|||||||
{{ formatAmountText(scope.row.finalSettlementAmount) }}
|
{{ formatAmountText(scope.row.finalSettlementAmount) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="测算采用金额(元)" width="140">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tooltip
|
||||||
|
v-if="isUsingContractAmount(scope.row)"
|
||||||
|
content="最终结算金额未填写,当前暂按合同产值测算"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
|
<span>{{ formatAmountText(scope.row.effectiveSettlementAmount) }}</span>
|
||||||
|
</el-tooltip>
|
||||||
|
<span v-else>{{ formatAmountText(scope.row.effectiveSettlementAmount) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column align="center" label="综合所协作金额(元)" width="150">
|
<el-table-column align="center" label="综合所协作金额(元)" width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatAmountText(scope.row.comprehensivePlanningAmount) }}
|
{{ formatAmountText(scope.row.comprehensivePlanningAmount) }}
|
||||||
@@ -147,61 +159,73 @@
|
|||||||
/>
|
/>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<ContentWrap v-if="currentProfit">
|
<ContentWrap>
|
||||||
<div class="mb-16px flex items-center justify-between gap-16px">
|
<div v-loading="detailLoading" class="min-h-220px">
|
||||||
<div class="text-16px font-600">{{ currentProfit.projectName }}</div>
|
<template v-if="currentProfit">
|
||||||
<el-button plain type="primary" @click="openProfitEditDialog">
|
<div class="mb-16px flex items-center justify-between gap-16px">
|
||||||
<Icon class="mr-5px" icon="ep:edit" />
|
<div class="text-16px font-600">{{ currentProfit.projectName }}</div>
|
||||||
编辑盈亏参数
|
<el-button plain type="primary" @click="openProfitEditDialog">
|
||||||
</el-button>
|
<Icon class="mr-5px" icon="ep:edit" />
|
||||||
|
编辑盈亏参数
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-descriptions :column="3" border>
|
||||||
|
<el-descriptions-item label="合同产值(元)">
|
||||||
|
{{ formatAmountText(currentProfit.contractAmount) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="最终结算金额(元)">
|
||||||
|
{{ formatAmountText(currentProfit.finalSettlementAmount) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="测算采用金额(元)">
|
||||||
|
<el-tooltip
|
||||||
|
v-if="isUsingContractAmount(currentProfit)"
|
||||||
|
content="最终结算金额未填写,当前暂按合同产值测算"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
|
<span>{{ formatAmountText(currentProfit.effectiveSettlementAmount) }}</span>
|
||||||
|
</el-tooltip>
|
||||||
|
<span v-else>{{ formatAmountText(currentProfit.effectiveSettlementAmount) }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="项目开始年度">
|
||||||
|
{{ currentProfit.projectStartYear || '-' }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="综合所协作金额(元)">
|
||||||
|
{{ formatAmountText(currentProfit.comprehensivePlanningAmount) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="专业分包金额(元)">
|
||||||
|
{{ formatAmountText(currentProfit.subcontractPlanningAmount) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="专业所产值(元)">
|
||||||
|
{{ formatAmountText(currentProfit.majorOutputValue) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="专业所预计绩效(元)">
|
||||||
|
{{ formatAmountText(currentProfit.majorExpectedPerformance) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="科创产值比例">
|
||||||
|
{{ formatPercentText(currentProfit.innovationOutputRate) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="科创产值(元)">
|
||||||
|
{{ formatAmountText(currentProfit.innovationOutputValue) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="其他成本(元)">
|
||||||
|
{{ formatAmountText(currentProfit.otherCost) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="盈亏值(元)">
|
||||||
|
<span :class="profitLossClass(currentProfit.profitLossValue)">
|
||||||
|
{{ formatAmountText(currentProfit.profitLossValue) }}
|
||||||
|
</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="盈亏百分比">
|
||||||
|
<span :class="profitLossClass(currentProfit.profitLossValue)">
|
||||||
|
{{ formatPercentText(currentProfit.profitLossRate) }}
|
||||||
|
</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-empty v-else-if="!detailLoading" description="请选择项目后查看盈亏详情" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-descriptions :column="3" border>
|
|
||||||
<el-descriptions-item label="合同产值(元)">
|
|
||||||
{{ formatAmountText(currentProfit.contractAmount) }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="最终结算金额(元)">
|
|
||||||
{{ formatAmountText(currentProfit.finalSettlementAmount) }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="项目开始年度">
|
|
||||||
{{ currentProfit.projectStartYear || '-' }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="综合所协作金额(元)">
|
|
||||||
{{ formatAmountText(currentProfit.comprehensivePlanningAmount) }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="专业分包金额(元)">
|
|
||||||
{{ formatAmountText(currentProfit.subcontractPlanningAmount) }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="专业所产值(元)">
|
|
||||||
{{ formatAmountText(currentProfit.majorOutputValue) }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="专业所预计绩效(元)">
|
|
||||||
{{ formatAmountText(currentProfit.majorExpectedPerformance) }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="科创产值比例">
|
|
||||||
{{ formatPercentText(currentProfit.innovationOutputRate) }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="科创产值(元)">
|
|
||||||
{{ formatAmountText(currentProfit.innovationOutputValue) }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="其他成本(元)">
|
|
||||||
{{ formatAmountText(currentProfit.otherCost) }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="盈亏值(元)">
|
|
||||||
<span :class="profitLossClass(currentProfit.profitLossValue)">
|
|
||||||
{{ formatAmountText(currentProfit.profitLossValue) }}
|
|
||||||
</span>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="盈亏百分比">
|
|
||||||
<span :class="profitLossClass(currentProfit.profitLossValue)">
|
|
||||||
{{ formatPercentText(currentProfit.profitLossRate) }}
|
|
||||||
</span>
|
|
||||||
</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
|
||||||
</ContentWrap>
|
|
||||||
|
|
||||||
<ContentWrap v-else>
|
|
||||||
<el-empty description="请选择项目后查看盈亏详情" />
|
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<Dialog v-model="dialogVisible" title="编辑盈亏参数" width="520">
|
<Dialog v-model="dialogVisible" title="编辑盈亏参数" width="520">
|
||||||
@@ -264,6 +288,7 @@ const message = useMessage()
|
|||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
const detailLoading = ref(false)
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const list = ref<ProfitApi.ProjectProfitVO[]>([])
|
const list = ref<ProfitApi.ProjectProfitVO[]>([])
|
||||||
const currentProfit = ref<ProfitApi.ProjectProfitVO>()
|
const currentProfit = ref<ProfitApi.ProjectProfitVO>()
|
||||||
@@ -315,21 +340,24 @@ const queryProjectStartYearValue = computed({
|
|||||||
|
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
let targetProfit: ProfitApi.ProjectProfitVO | undefined
|
||||||
try {
|
try {
|
||||||
const data = await ProfitApi.getProjectProfitPage(queryParams)
|
const data = await ProfitApi.getProjectProfitPage(queryParams)
|
||||||
list.value = data.list
|
list.value = data.list
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
if (!list.value.length) {
|
if (!list.value.length) {
|
||||||
currentProfit.value = undefined
|
currentProfit.value = undefined
|
||||||
return
|
} else {
|
||||||
|
const targetProjectId = currentProfit.value?.projectId || list.value[0].projectId
|
||||||
|
targetProfit = list.value.find((item) => item.projectId === targetProjectId) || list.value[0]
|
||||||
}
|
}
|
||||||
const targetProjectId = currentProfit.value?.projectId || list.value[0].projectId
|
|
||||||
const targetProfit = list.value.find((item) => item.projectId === targetProjectId) || list.value[0]
|
|
||||||
await nextTick()
|
|
||||||
profitTableRef.value?.setCurrentRow(targetProfit)
|
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
if (targetProfit) {
|
||||||
|
await nextTick()
|
||||||
|
profitTableRef.value?.setCurrentRow(targetProfit)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
@@ -347,14 +375,24 @@ const handleCurrentProfitChange = async (row?: ProfitApi.ProjectProfitVO) => {
|
|||||||
currentProfit.value = undefined
|
currentProfit.value = undefined
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
currentProfit.value = await ProfitApi.getProjectProfit(row.projectId)
|
detailLoading.value = true
|
||||||
|
try {
|
||||||
|
currentProfit.value = await ProfitApi.getProjectProfit(row.projectId)
|
||||||
|
} finally {
|
||||||
|
detailLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const refreshCurrentProfit = async () => {
|
const refreshCurrentProfit = async () => {
|
||||||
if (!currentProfit.value?.projectId) {
|
if (!currentProfit.value?.projectId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
currentProfit.value = await ProfitApi.getProjectProfit(currentProfit.value.projectId)
|
detailLoading.value = true
|
||||||
|
try {
|
||||||
|
currentProfit.value = await ProfitApi.getProjectProfit(currentProfit.value.projectId)
|
||||||
|
} finally {
|
||||||
|
detailLoading.value = false
|
||||||
|
}
|
||||||
await getList()
|
await getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,19 +445,29 @@ const submitProfitForm = async () => {
|
|||||||
|
|
||||||
const profitLossClass = (value?: number) => {
|
const profitLossClass = (value?: number) => {
|
||||||
if ((value || 0) > 0) {
|
if ((value || 0) > 0) {
|
||||||
return 'text-[var(--el-color-success)] font-600'
|
return 'text-[var(--el-color-danger)] font-600'
|
||||||
}
|
}
|
||||||
if ((value || 0) < 0) {
|
if ((value || 0) < 0) {
|
||||||
return 'text-[var(--el-color-danger)] font-600'
|
return 'text-[var(--el-color-success)] font-600'
|
||||||
}
|
}
|
||||||
return 'text-[var(--el-text-color-primary)]'
|
return 'text-[var(--el-text-color-primary)]'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isUsingContractAmount = (row?: ProfitApi.ProjectProfitVO) =>
|
||||||
|
!!row && Number(row.finalSettlementAmount || 0) <= 0 && Number(row.contractAmount || 0) > 0
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -526,11 +526,18 @@ const handlePlanningFormSuccess = async () => {
|
|||||||
await getPlanningList()
|
await getPlanningList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -384,11 +384,18 @@ const submitProjectBudgetExport = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -103,7 +103,9 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<ContentWrap v-if="currentPlanning && formData">
|
<ContentWrap>
|
||||||
|
<div v-loading="quarterLoading" class="min-h-320px">
|
||||||
|
<template v-if="currentPlanning && formData">
|
||||||
<div class="mb-16px flex items-center justify-between gap-16px">
|
<div class="mb-16px flex items-center justify-between gap-16px">
|
||||||
<div>
|
<div>
|
||||||
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
||||||
@@ -193,7 +195,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table v-loading="quarterLoading" :data="annualDistributionRows" border>
|
<el-table :data="annualDistributionRows" border>
|
||||||
<el-table-column align="center" label="分配年度" min-width="120" prop="distributionYear" />
|
<el-table-column align="center" label="分配年度" min-width="120" prop="distributionYear" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="quarter in QUARTER_OPTIONS"
|
v-for="quarter in QUARTER_OPTIONS"
|
||||||
@@ -212,10 +214,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</ContentWrap>
|
</template>
|
||||||
|
|
||||||
<ContentWrap v-else>
|
<el-empty v-else-if="!quarterLoading" description="请选择合约规划后查看导出预览" />
|
||||||
<el-empty description="请选择合约规划后查看导出预览" />
|
</div>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -566,14 +568,12 @@ const loadPlanningRelatedData = async (planning: PlanningApi.ProjectPlanningVO)
|
|||||||
}
|
}
|
||||||
quarterLoading.value = true
|
quarterLoading.value = true
|
||||||
try {
|
try {
|
||||||
const [planningDetail, outputSplit, quarterList] = await Promise.all([
|
const detail = await OutputSplitApi.getProjectOutputSplitPlanningDetail(planning.id)
|
||||||
PlanningApi.getProjectPlanning(planning.id),
|
currentPlanning.value = detail?.planning
|
||||||
OutputSplitApi.getProjectOutputSplitByPlanningId(planning.id),
|
formData.value = detail?.outputSplit
|
||||||
PlanningQuarterApi.getProjectPlanningQuarterListByPlanningId(planning.id)
|
quarterRows.value = detail?.planning
|
||||||
])
|
? buildQuarterRows(detail.planning, detail.quarters || [])
|
||||||
currentPlanning.value = planningDetail
|
: []
|
||||||
formData.value = outputSplit
|
|
||||||
quarterRows.value = buildQuarterRows(planningDetail, quarterList)
|
|
||||||
} finally {
|
} finally {
|
||||||
quarterLoading.value = false
|
quarterLoading.value = false
|
||||||
}
|
}
|
||||||
@@ -684,11 +684,18 @@ const submitProjectLeadQuarterExport = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -105,22 +105,37 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<ContentWrap v-if="currentPlanning && currentGroup">
|
<ContentWrap>
|
||||||
|
<div v-loading="previewLoading" class="min-h-320px">
|
||||||
|
<template v-if="currentPlanning && currentGroup">
|
||||||
<div class="mb-16px flex items-center justify-between gap-12px">
|
<div class="mb-16px flex items-center justify-between gap-12px">
|
||||||
<div>
|
<div>
|
||||||
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
||||||
|
<div class="mt-6px text-12px text-[var(--el-text-color-secondary)]">
|
||||||
|
按当前年度和专业预览专业内人员计取结果
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-10px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="selectedYearValue"
|
||||||
|
class="!w-150px"
|
||||||
|
clearable
|
||||||
|
placeholder="计取年度"
|
||||||
|
type="year"
|
||||||
|
value-format="YYYY"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['tjt:report-specialty-person:export']"
|
||||||
|
:disabled="!canExportCurrentGroup || !selectedYear"
|
||||||
|
:loading="exportSpecialtyLoading"
|
||||||
|
plain
|
||||||
|
type="success"
|
||||||
|
@click="handleExportSpecialtyPerson"
|
||||||
|
>
|
||||||
|
<Icon class="mr-5px" icon="ep:download" />
|
||||||
|
导出专业内人员计取表
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
|
||||||
v-hasPermi="['tjt:report-specialty-person:export']"
|
|
||||||
:disabled="!canExportCurrentGroup"
|
|
||||||
:loading="exportSpecialtyLoading"
|
|
||||||
plain
|
|
||||||
type="success"
|
|
||||||
@click="handleExportSpecialtyPerson"
|
|
||||||
>
|
|
||||||
<Icon class="mr-5px" icon="ep:download" />
|
|
||||||
导出专业内人员计取表
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-16px">
|
<div class="mb-16px">
|
||||||
@@ -140,7 +155,17 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table :data="currentGroup.rows" border>
|
<div class="mb-10px flex items-center justify-between gap-12px">
|
||||||
|
<div class="text-14px font-600">专业内人员工作量与年度 / 季度计取预览</div>
|
||||||
|
<div class="text-12px text-[var(--el-text-color-secondary)]">季度金额单位:万元</div>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
v-loading="previewLoading"
|
||||||
|
:data="currentGroupDisplayRows"
|
||||||
|
border
|
||||||
|
empty-text="当前年度暂无可预览的专业人员计取数据"
|
||||||
|
:span-method="spanRoleColumns"
|
||||||
|
>
|
||||||
<el-table-column align="center" label="角色" min-width="110" prop="roleName" />
|
<el-table-column align="center" label="角色" min-width="110" prop="roleName" />
|
||||||
<el-table-column align="center" label="角色比例" min-width="120">
|
<el-table-column align="center" label="角色比例" min-width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
@@ -154,95 +179,115 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="人员合计" min-width="120">
|
<el-table-column align="center" label="人员合计" min-width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatPercentText(getPersonTotalRatio(scope.row)) }}
|
{{ formatPercentText(scope.row.personTotalRatio) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="人员信息" min-width="360">
|
<el-table-column align="center" label="人员明细">
|
||||||
<template #default="scope">
|
<el-table-column align="center" label="人员基本分配">
|
||||||
<div v-if="scope.row.persons?.length" class="person-display-list">
|
<el-table-column align="center" label="姓名" min-width="110">
|
||||||
<div
|
<template #default="scope">
|
||||||
v-for="(person, index) in scope.row.persons"
|
<span class="person-display-name">{{ scope.row.employeeName || '暂无人员' }}</span>
|
||||||
:key="`${scope.row.specialtyCode}-${scope.row.roleCode}-display-${index}`"
|
</template>
|
||||||
class="person-display-row"
|
</el-table-column>
|
||||||
>
|
<el-table-column align="center" label="工作量比例" min-width="110">
|
||||||
<span class="person-display-name">{{ person.employeeName || '-' }}</span>
|
<template #default="scope">
|
||||||
<span>{{ formatPercentText(person.personRatio) }}</span>
|
{{ scope.row.employeeName ? formatPercentText(scope.row.personRatio) : '' }}
|
||||||
<span>{{ formatAmountText(person.personAmount) }} 元</span>
|
</template>
|
||||||
</div>
|
</el-table-column>
|
||||||
</div>
|
<el-table-column align="center" label="人员金额(元)" min-width="120">
|
||||||
<div v-else class="person-empty">暂无人员</div>
|
<template #default="scope">
|
||||||
</template>
|
{{ scope.row.employeeName ? formatAmountText(scope.row.personAmount) : '' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="占专业比例" min-width="110">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.employeeName ? formatPercentText(scope.row.adjustedPersonRatio) : '' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="季度计取明细(年度预览:比例 / 金额 万元)">
|
||||||
|
<el-table-column align="center" label="一季度" min-width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
{{
|
||||||
|
scope.row.employeeName
|
||||||
|
? formatRatioAmountText(scope.row.quarterOneRatio, scope.row.quarterOneAmountWan)
|
||||||
|
: ''
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="二季度" min-width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
{{
|
||||||
|
scope.row.employeeName
|
||||||
|
? formatRatioAmountText(scope.row.quarterTwoRatio, scope.row.quarterTwoAmountWan)
|
||||||
|
: ''
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="三季度" min-width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
{{
|
||||||
|
scope.row.employeeName
|
||||||
|
? formatRatioAmountText(scope.row.quarterThreeRatio, scope.row.quarterThreeAmountWan)
|
||||||
|
: ''
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="四季度" min-width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
{{
|
||||||
|
scope.row.employeeName
|
||||||
|
? formatRatioAmountText(scope.row.quarterFourRatio, scope.row.quarterFourAmountWan)
|
||||||
|
: ''
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="本年度小计" min-width="170">
|
||||||
|
<template #default="scope">
|
||||||
|
{{
|
||||||
|
scope.row.employeeName
|
||||||
|
? formatRatioAmountText(scope.row.yearTotalRatio, scope.row.yearTotalAmountWan)
|
||||||
|
: ''
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</ContentWrap>
|
</template>
|
||||||
|
|
||||||
<ContentWrap v-else>
|
<el-empty v-else-if="!previewLoading" description="请选择合约规划后查看导出预览" />
|
||||||
<el-empty description="请选择合约规划后查看导出预览" />
|
</div>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<Dialog v-model="exportDialogVisible" title="导出专业内人员计取表" width="420">
|
|
||||||
<el-form label-width="88px">
|
|
||||||
<el-form-item label="年度">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="exportYearValue"
|
|
||||||
class="!w-220px"
|
|
||||||
clearable
|
|
||||||
placeholder="请选择年度"
|
|
||||||
type="year"
|
|
||||||
value-format="YYYY"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<template #footer>
|
|
||||||
<el-button @click="exportDialogVisible = false">取消</el-button>
|
|
||||||
<el-button :loading="exportSpecialtyLoading" type="primary" @click="submitSpecialtyExport">
|
|
||||||
确定导出
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</Dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as PlanningApi from '@/api/tjt/planning'
|
import * as PlanningApi from '@/api/tjt/planning'
|
||||||
import * as ProjectApi from '@/api/tjt/project'
|
import * as ProjectApi from '@/api/tjt/project'
|
||||||
import * as ReportApi from '@/api/tjt/report'
|
import * as ReportApi from '@/api/tjt/report'
|
||||||
import * as SpecialtyRoleSplitApi from '@/api/tjt/specialtyRoleSplit'
|
|
||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import { formatAmountText, formatPercentText, getOwnershipTypeLabel } from '@/views/tjt/shared/planning'
|
import { formatAmountText, formatPercentText, getOwnershipTypeLabel } from '@/views/tjt/shared/planning'
|
||||||
|
|
||||||
defineOptions({ name: 'TjtReportSpecialtyPerson' })
|
defineOptions({ name: 'TjtReportSpecialtyPerson' })
|
||||||
|
|
||||||
const PROJECT_LEAD_GROUP_CODE = 'project_lead'
|
const PROJECT_LEAD_GROUP_CODE = 'project_lead'
|
||||||
const EPSILON = 0.0001
|
|
||||||
|
|
||||||
type SpecialtyRoleSplitVO = SpecialtyRoleSplitApi.SpecialtyRoleSplitVO
|
|
||||||
|
|
||||||
interface SpecialtyGroup {
|
|
||||||
specialtyCode: string
|
|
||||||
specialtyName: string
|
|
||||||
specialtyAmount: number
|
|
||||||
rows: SpecialtyRoleSplitVO[]
|
|
||||||
roleTotal: number
|
|
||||||
personCount: number
|
|
||||||
}
|
|
||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
const currentYear = new Date().getFullYear()
|
const currentYear = new Date().getFullYear()
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const planningLoading = ref(false)
|
const planningLoading = ref(false)
|
||||||
|
const previewLoading = ref(false)
|
||||||
const exportSpecialtyLoading = ref(false)
|
const exportSpecialtyLoading = ref(false)
|
||||||
const exportDialogVisible = ref(false)
|
const selectedYear = ref<number | undefined>(currentYear)
|
||||||
const exportYear = ref<number>()
|
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const projectList = ref<ProjectApi.ProjectVO[]>([])
|
const projectList = ref<ProjectApi.ProjectVO[]>([])
|
||||||
const planningList = ref<PlanningApi.ProjectPlanningVO[]>([])
|
const planningList = ref<PlanningApi.ProjectPlanningVO[]>([])
|
||||||
const currentProject = ref<ProjectApi.ProjectVO>()
|
const currentProject = ref<ProjectApi.ProjectVO>()
|
||||||
const currentPlanning = ref<PlanningApi.ProjectPlanningVO>()
|
const currentPlanning = ref<PlanningApi.ProjectPlanningVO>()
|
||||||
const roleList = ref<SpecialtyRoleSplitVO[]>([])
|
const previewData = ref<ReportApi.SpecialtyPersonOutputPreviewRespVO>()
|
||||||
const selectedGroupCode = ref('')
|
const selectedGroupCode = ref('')
|
||||||
const queryFormRef = ref()
|
const queryFormRef = ref()
|
||||||
const projectTableRef = ref()
|
const projectTableRef = ref()
|
||||||
@@ -256,7 +301,7 @@ const queryParams = reactive<ProjectApi.ProjectPageReqVO>({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const getProjectRowIndex = (index: number) =>
|
const getProjectRowIndex = (index: number) =>
|
||||||
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
((queryParams.pageNo || 1) - 1) * (queryParams.pageSize || 10) + index + 1
|
||||||
|
|
||||||
const queryProjectStartYearValue = computed({
|
const queryProjectStartYearValue = computed({
|
||||||
get: () => (queryParams.projectStartYear ? String(queryParams.projectStartYear) : undefined),
|
get: () => (queryParams.projectStartYear ? String(queryParams.projectStartYear) : undefined),
|
||||||
@@ -265,49 +310,24 @@ const queryProjectStartYearValue = computed({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const exportYearValue = computed({
|
const selectedYearValue = computed({
|
||||||
get: () => (exportYear.value ? String(exportYear.value) : undefined),
|
get: () => (selectedYear.value ? String(selectedYear.value) : undefined),
|
||||||
set: (value?: string) => {
|
set: (value?: string) => {
|
||||||
exportYear.value = value ? Number(value) : undefined
|
selectedYear.value = value ? Number(value) : undefined
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const roundRatio = (value?: number | string | null) => {
|
const formatWanAmountText = (value?: number | string | null) => formatAmountText(value)
|
||||||
const numericValue = Number(value || 0)
|
const formatRatioAmountText = (
|
||||||
return Number.isNaN(numericValue) ? 0 : Number(numericValue.toFixed(4))
|
ratio?: number | string | null,
|
||||||
}
|
amount?: number | string | null
|
||||||
|
) => `${formatPercentText(ratio)} / ${formatWanAmountText(amount)}`
|
||||||
|
|
||||||
const countConfiguredPersons = (persons?: SpecialtyRoleSplitApi.SpecialtyRolePersonVO[]) =>
|
const groups = computed(() =>
|
||||||
(persons || []).filter(
|
(previewData.value?.groups || []).filter(
|
||||||
(person) =>
|
(item) => item.specialtyCode !== PROJECT_LEAD_GROUP_CODE && item.exportable !== false
|
||||||
(person.employeeName && person.employeeName.trim()) ||
|
)
|
||||||
(person.personRatio !== undefined && person.personRatio !== null)
|
)
|
||||||
).length
|
|
||||||
|
|
||||||
const getPersonTotalRatio = (row: SpecialtyRoleSplitVO) =>
|
|
||||||
roundRatio((row.persons || []).reduce((sum, person) => sum + Number(person?.personRatio || 0), 0))
|
|
||||||
|
|
||||||
const buildGroups = (source: SpecialtyRoleSplitVO[]): SpecialtyGroup[] => {
|
|
||||||
const map = new Map<string, SpecialtyRoleSplitVO[]>()
|
|
||||||
source.forEach((item) => {
|
|
||||||
const list = map.get(item.specialtyCode) || []
|
|
||||||
list.push(item)
|
|
||||||
map.set(item.specialtyCode, list)
|
|
||||||
})
|
|
||||||
return Array.from(map.entries()).map(([specialtyCode, rows]) => {
|
|
||||||
const sortedRows = [...rows].sort((a, b) => Number(a.sortNo || 0) - Number(b.sortNo || 0))
|
|
||||||
return {
|
|
||||||
specialtyCode,
|
|
||||||
specialtyName: sortedRows[0]?.specialtyName || specialtyCode,
|
|
||||||
specialtyAmount: Number(Number(sortedRows[0]?.specialtyAmount || 0).toFixed(2)),
|
|
||||||
rows: sortedRows,
|
|
||||||
roleTotal: roundRatio(sortedRows.reduce((sum, item) => sum + Number(item.roleRatio || 0), 0)),
|
|
||||||
personCount: sortedRows.reduce((sum, row) => sum + countConfiguredPersons(row.persons), 0)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const groups = computed(() => buildGroups(roleList.value))
|
|
||||||
const groupTabOptions = computed(() =>
|
const groupTabOptions = computed(() =>
|
||||||
groups.value.map((item) => ({
|
groups.value.map((item) => ({
|
||||||
label: item.specialtyName,
|
label: item.specialtyName,
|
||||||
@@ -318,12 +338,62 @@ const currentGroup = computed(
|
|||||||
() => groups.value.find((item) => item.specialtyCode === selectedGroupCode.value) || groups.value[0]
|
() => groups.value.find((item) => item.specialtyCode === selectedGroupCode.value) || groups.value[0]
|
||||||
)
|
)
|
||||||
const canExportCurrentGroup = computed(
|
const canExportCurrentGroup = computed(
|
||||||
() =>
|
() => !!currentGroup.value?.specialtyCode && currentGroup.value.exportable !== false
|
||||||
!!currentGroup.value?.specialtyCode &&
|
|
||||||
currentGroup.value.specialtyCode !== PROJECT_LEAD_GROUP_CODE
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const buildSummaryCards = (group?: SpecialtyGroup) => {
|
type SpecialtyPersonDisplayRow = ReportApi.SpecialtyPersonOutputPreviewPersonRow &
|
||||||
|
Pick<
|
||||||
|
ReportApi.SpecialtyPersonOutputPreviewRoleRow,
|
||||||
|
'specialtyCode' | 'specialtyName' | 'roleCode' | 'roleName' | 'roleRatio' | 'roleAmount' | 'personTotalRatio'
|
||||||
|
> & {
|
||||||
|
roleRowSpan: number
|
||||||
|
}
|
||||||
|
|
||||||
|
const currentGroupDisplayRows = computed(() => {
|
||||||
|
const displayRows: SpecialtyPersonDisplayRow[] = []
|
||||||
|
const rows = currentGroup.value?.rows || []
|
||||||
|
rows.forEach((roleRow) => {
|
||||||
|
if (!roleRow.persons?.length) {
|
||||||
|
displayRows.push({
|
||||||
|
specialtyCode: roleRow.specialtyCode,
|
||||||
|
specialtyName: roleRow.specialtyName,
|
||||||
|
roleCode: roleRow.roleCode,
|
||||||
|
roleName: roleRow.roleName,
|
||||||
|
roleRatio: roleRow.roleRatio,
|
||||||
|
roleAmount: roleRow.roleAmount,
|
||||||
|
personTotalRatio: roleRow.personTotalRatio,
|
||||||
|
personKey: `${roleRow.specialtyCode}-${roleRow.roleCode}-empty`,
|
||||||
|
roleRowSpan: 1
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
roleRow.persons.forEach((person, index) => {
|
||||||
|
displayRows.push({
|
||||||
|
...person,
|
||||||
|
specialtyCode: roleRow.specialtyCode,
|
||||||
|
specialtyName: roleRow.specialtyName,
|
||||||
|
roleCode: roleRow.roleCode,
|
||||||
|
roleName: roleRow.roleName,
|
||||||
|
roleRatio: roleRow.roleRatio,
|
||||||
|
roleAmount: roleRow.roleAmount,
|
||||||
|
personTotalRatio: roleRow.personTotalRatio,
|
||||||
|
roleRowSpan: index === 0 ? roleRow.persons.length : 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return displayRows
|
||||||
|
})
|
||||||
|
|
||||||
|
const spanRoleColumns = ({ row, columnIndex }: { row: SpecialtyPersonDisplayRow; columnIndex: number }) => {
|
||||||
|
if (columnIndex > 3) {
|
||||||
|
return { rowspan: 1, colspan: 1 }
|
||||||
|
}
|
||||||
|
return row.roleRowSpan > 0
|
||||||
|
? { rowspan: row.roleRowSpan, colspan: 1 }
|
||||||
|
: { rowspan: 0, colspan: 0 }
|
||||||
|
}
|
||||||
|
|
||||||
|
const buildSummaryCards = (group?: ReportApi.SpecialtyPersonOutputPreviewGroupRow) => {
|
||||||
if (!group) {
|
if (!group) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
@@ -331,7 +401,7 @@ const buildSummaryCards = (group?: SpecialtyGroup) => {
|
|||||||
{ label: '分组金额', value: `${formatAmountText(group.specialtyAmount)} 元` },
|
{ label: '分组金额', value: `${formatAmountText(group.specialtyAmount)} 元` },
|
||||||
{ label: '角色合计', value: formatPercentText(group.roleTotal) },
|
{ label: '角色合计', value: formatPercentText(group.roleTotal) },
|
||||||
{ label: '已配置人数', value: `${group.personCount} 人` },
|
{ label: '已配置人数', value: `${group.personCount} 人` },
|
||||||
{ label: '超额提醒', value: group.roleTotal > 1 + EPSILON ? '存在' : '无' }
|
{ label: '超额提醒', value: group.overRatio ? '存在' : '无' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,9 +413,8 @@ watch(
|
|||||||
selectedGroupCode.value = ''
|
selectedGroupCode.value = ''
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const preferredCode = codes.find((code) => code !== PROJECT_LEAD_GROUP_CODE) || codes[0]
|
if (!codes.includes(selectedGroupCode.value)) {
|
||||||
if (!codes.includes(selectedGroupCode.value) || selectedGroupCode.value === PROJECT_LEAD_GROUP_CODE) {
|
selectedGroupCode.value = codes[0]
|
||||||
selectedGroupCode.value = preferredCode
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
@@ -361,7 +430,7 @@ const getProjectList = async () => {
|
|||||||
currentProject.value = undefined
|
currentProject.value = undefined
|
||||||
planningList.value = []
|
planningList.value = []
|
||||||
currentPlanning.value = undefined
|
currentPlanning.value = undefined
|
||||||
roleList.value = []
|
previewData.value = undefined
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const targetProjectId = currentProject.value?.id || projectList.value[0].id
|
const targetProjectId = currentProject.value?.id || projectList.value[0].id
|
||||||
@@ -378,7 +447,7 @@ const getPlanningList = async () => {
|
|||||||
if (!currentProject.value?.id) {
|
if (!currentProject.value?.id) {
|
||||||
planningList.value = []
|
planningList.value = []
|
||||||
currentPlanning.value = undefined
|
currentPlanning.value = undefined
|
||||||
roleList.value = []
|
previewData.value = undefined
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
planningLoading.value = true
|
planningLoading.value = true
|
||||||
@@ -387,7 +456,7 @@ const getPlanningList = async () => {
|
|||||||
planningList.value = list
|
planningList.value = list
|
||||||
if (!planningList.value.length) {
|
if (!planningList.value.length) {
|
||||||
currentPlanning.value = undefined
|
currentPlanning.value = undefined
|
||||||
roleList.value = []
|
previewData.value = undefined
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const targetPlanningId = currentPlanning.value?.id || planningList.value[0].id
|
const targetPlanningId = currentPlanning.value?.id || planningList.value[0].id
|
||||||
@@ -400,8 +469,20 @@ const getPlanningList = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadRoleList = async (planningId: number) => {
|
const loadSpecialtyPersonPreview = async () => {
|
||||||
roleList.value = await SpecialtyRoleSplitApi.getSpecialtyRoleSplitListByPlanningId(planningId)
|
if (!currentPlanning.value?.id || !selectedYear.value) {
|
||||||
|
previewData.value = undefined
|
||||||
|
return
|
||||||
|
}
|
||||||
|
previewLoading.value = true
|
||||||
|
try {
|
||||||
|
previewData.value = await ReportApi.getSpecialtyPersonOutputPreview({
|
||||||
|
planningId: currentPlanning.value.id,
|
||||||
|
year: selectedYear.value
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
previewLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
@@ -422,10 +503,11 @@ const handleCurrentProjectChange = async (row?: ProjectApi.ProjectVO) => {
|
|||||||
const handleCurrentPlanningChange = async (row?: PlanningApi.ProjectPlanningVO) => {
|
const handleCurrentPlanningChange = async (row?: PlanningApi.ProjectPlanningVO) => {
|
||||||
currentPlanning.value = row || undefined
|
currentPlanning.value = row || undefined
|
||||||
if (!row?.id) {
|
if (!row?.id) {
|
||||||
roleList.value = []
|
previewData.value = undefined
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
await loadRoleList(row.id)
|
selectedYear.value = row.planningStartYear || currentYear
|
||||||
|
previewData.value = undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleExportSpecialtyPerson = async () => {
|
const handleExportSpecialtyPerson = async () => {
|
||||||
@@ -437,20 +519,7 @@ const handleExportSpecialtyPerson = async () => {
|
|||||||
message.warning('请选择具体专业后再导出')
|
message.warning('请选择具体专业后再导出')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
exportYear.value = currentPlanning.value.planningStartYear || currentYear
|
if (!selectedYear.value) {
|
||||||
exportDialogVisible.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
const submitSpecialtyExport = async () => {
|
|
||||||
if (!currentPlanning.value?.id) {
|
|
||||||
message.warning('请先选择合约规划')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!canExportCurrentGroup.value || !currentGroup.value?.specialtyCode) {
|
|
||||||
message.warning('请选择具体专业后再导出')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!exportYear.value) {
|
|
||||||
message.warning('请选择年度')
|
message.warning('请选择年度')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -460,47 +529,41 @@ const submitSpecialtyExport = async () => {
|
|||||||
const data = await ReportApi.exportSpecialtyPersonOutput({
|
const data = await ReportApi.exportSpecialtyPersonOutput({
|
||||||
planningId: currentPlanning.value.id,
|
planningId: currentPlanning.value.id,
|
||||||
specialtyCode: currentGroup.value.specialtyCode,
|
specialtyCode: currentGroup.value.specialtyCode,
|
||||||
year: exportYear.value
|
year: selectedYear.value
|
||||||
})
|
})
|
||||||
download.excel(
|
download.excel(
|
||||||
data,
|
data,
|
||||||
`${currentProject.value?.projectName || '项目'}_${exportYear.value}_${currentGroup.value.specialtyName || '专业'}内人员年度季度计取表.xlsx`
|
`${currentProject.value?.projectName || '项目'}_${selectedYear.value}_${currentGroup.value.specialtyName || '专业'}内人员年度季度计取表.xlsx`
|
||||||
)
|
)
|
||||||
exportDialogVisible.value = false
|
|
||||||
} finally {
|
} finally {
|
||||||
exportSpecialtyLoading.value = false
|
exportSpecialtyLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
[() => currentPlanning.value?.id, selectedYear],
|
||||||
|
() => {
|
||||||
|
loadSpecialtyPersonPreview()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.person-empty {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--el-text-color-secondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.person-display-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.person-display-row {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: minmax(120px, 1fr) 100px 120px;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.person-display-name {
|
.person-display-name {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-tabs v-model="activeTab">
|
<el-tabs v-model="activeTab">
|
||||||
<el-tab-pane label="员工产值汇总" name="employeeSummary">
|
<el-tab-pane label="员工个人考核产值汇总表" name="employeeSummary">
|
||||||
<el-form :inline="true" :model="employeeSummaryForm" label-width="88px">
|
<el-form :inline="true" :model="employeeSummaryForm" label-width="88px">
|
||||||
<el-form-item label="年度">
|
<el-form-item label="年度">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -13,13 +13,11 @@
|
|||||||
value-format="YYYY"
|
value-format="YYYY"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="getEmployeeBudgetList">
|
<el-button :loading="employeeSummaryPreviewLoading" @click="getEmployeeSummaryPreview">
|
||||||
<Icon class="mr-5px" icon="ep:refresh" />
|
<Icon class="mr-5px" icon="ep:refresh" />
|
||||||
刷新预览
|
刷新预览
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item> -->
|
|
||||||
<el-form-item>
|
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['tjt:report-summary:export']"
|
v-hasPermi="['tjt:report-summary:export']"
|
||||||
:loading="employeeSummaryExportLoading"
|
:loading="employeeSummaryExportLoading"
|
||||||
@@ -34,29 +32,61 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="employeeBudgetLoading"
|
v-loading="employeeSummaryPreviewLoading"
|
||||||
:data="employeeBudgetList"
|
:data="employeeSummaryRows"
|
||||||
class="mt-12px"
|
:empty-text="employeeSummaryForm.year ? '暂无员工个人考核产值汇总数据' : '请先选择年度'"
|
||||||
:empty-text="employeeSummaryForm.year ? '暂无年度成本预算数据' : '请先选择年度'"
|
:row-class-name="getRowClassName"
|
||||||
|
border
|
||||||
|
class="summary-table"
|
||||||
|
max-height="640"
|
||||||
>
|
>
|
||||||
<el-table-column align="center" label="序号" type="index" width="70" />
|
<el-table-column align="center" fixed="left" label="序号" width="70">
|
||||||
<el-table-column align="center" label="员工姓名" min-width="160" prop="employeeName" />
|
|
||||||
<el-table-column align="center" label="预计年度" prop="budgetYear" width="120" />
|
|
||||||
<el-table-column align="center" label="预计发生成本" min-width="160">
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatAmount(scope.row.expectedCostAmount) }}
|
{{ scope.row.totalRow ? '' : scope.row.serialNo }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" fixed="left" label="姓名" min-width="120" prop="employeeName" />
|
||||||
|
<el-table-column align="center" label="第一季度" min-width="110">
|
||||||
|
<template #default="scope">{{ formatAmount(scope.row.quarterOneAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="第二季度" min-width="110">
|
||||||
|
<template #default="scope">{{ formatAmount(scope.row.quarterTwoAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="第三季度" min-width="110">
|
||||||
|
<template #default="scope">{{ formatAmount(scope.row.quarterThreeAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="第四季度" min-width="110">
|
||||||
|
<template #default="scope">{{ formatAmount(scope.row.quarterFourAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="年度合计" min-width="110">
|
||||||
|
<template #default="scope">{{ formatAmount(scope.row.annualTotalAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="所长 / BIM 考核产值" min-width="150">
|
||||||
|
<template #default="scope">{{ formatAmount(scope.row.officeLeaderOrBimAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="年度考核产值合计" min-width="150">
|
||||||
|
<template #default="scope">{{ formatAmount(scope.row.totalAssessmentOutputAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="1~12 月份预计发生成本(含预计精神文明奖)"
|
||||||
|
min-width="220"
|
||||||
|
>
|
||||||
|
<template #default="scope">{{ formatAmount(scope.row.expectedCostAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="基本考核产值" min-width="130">
|
||||||
|
<template #default="scope">{{ formatAmount(scope.row.basicAssessmentOutputAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="剩余产值" min-width="120">
|
||||||
|
<template #default="scope">{{ formatAmount(scope.row.remainingOutputAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="预估年底绩效" min-width="130">
|
||||||
|
<template #default="scope">{{ formatAmount(scope.row.estimatedYearEndPerformanceAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<Pagination
|
|
||||||
v-model:limit="employeeBudgetQuery.pageSize"
|
|
||||||
v-model:page="employeeBudgetQuery.pageNo"
|
|
||||||
:total="employeeBudgetTotal"
|
|
||||||
@pagination="getEmployeeBudgetList"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane label="项目产值总览" name="projectOverview">
|
<el-tab-pane label="项目总览表" name="projectOverview">
|
||||||
<el-form :inline="true" :model="projectOverviewForm" label-width="88px">
|
<el-form :inline="true" :model="projectOverviewForm" label-width="88px">
|
||||||
<el-form-item label="专业所">
|
<el-form-item label="专业所">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -73,13 +103,21 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item>
|
<el-form-item label="年度">
|
||||||
<el-button @click="getProjectEmployeeList">
|
<el-date-picker
|
||||||
|
v-model="projectOverviewYearValue"
|
||||||
|
class="!w-180px"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择年度"
|
||||||
|
type="year"
|
||||||
|
value-format="YYYY"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button :loading="projectOverviewPreviewLoading" @click="getProjectOverviewPreview">
|
||||||
<Icon class="mr-5px" icon="ep:refresh" />
|
<Icon class="mr-5px" icon="ep:refresh" />
|
||||||
刷新预览
|
刷新预览
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item> -->
|
|
||||||
<el-form-item>
|
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['tjt:report-summary:export']"
|
v-hasPermi="['tjt:report-summary:export']"
|
||||||
:loading="projectOverviewExportLoading"
|
:loading="projectOverviewExportLoading"
|
||||||
@@ -94,22 +132,99 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="projectEmployeeLoading"
|
v-loading="projectOverviewPreviewLoading"
|
||||||
:data="projectEmployeeList"
|
:data="projectOverviewRows"
|
||||||
class="mt-12px"
|
:empty-text="projectOverviewEmptyText"
|
||||||
:empty-text="projectOverviewForm.officeId ? '该专业所下暂无员工' : '请先选择专业所'"
|
:row-class-name="getRowClassName"
|
||||||
|
border
|
||||||
|
class="summary-table"
|
||||||
|
max-height="640"
|
||||||
>
|
>
|
||||||
<el-table-column align="center" label="序号" type="index" width="70" />
|
<el-table-column align="center" fixed="left" label="序号" width="70">
|
||||||
<el-table-column align="center" label="员工姓名" min-width="160" prop="employeeName" />
|
<template #default="scope">
|
||||||
<el-table-column align="center" label="性别" prop="gender" width="100" />
|
{{ scope.row.totalRow ? '' : scope.row.serialNo }}
|
||||||
<el-table-column align="center" label="所属所" min-width="180" prop="officeName" />
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
fixed="left"
|
||||||
|
label="项目名称"
|
||||||
|
min-width="220"
|
||||||
|
prop="projectName"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="工程进度情况及其它说明"
|
||||||
|
min-width="240"
|
||||||
|
prop="progressText"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="工作阶段"
|
||||||
|
min-width="180"
|
||||||
|
prop="workStage"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column align="center" label="本专业 + 项目总核算总产值" min-width="170">
|
||||||
|
<template #default="scope">{{ formatAmountBlank(scope.row.totalOutputAmountWan) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="往期已发放百分比" min-width="140">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.totalRow ? '' : formatPercent(scope.row.historicalIssuedRatio) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="本期结算">
|
||||||
|
<el-table-column align="center" label="占比" min-width="110">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.totalRow ? '' : formatPercent(scope.row.currentSettlementRatio) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="考核产值" min-width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ formatAmountBlank(scope.row.currentSettlementAmountWan) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="未结算比例" min-width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.totalRow ? '' : formatPercent(scope.row.pendingRatio) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
v-for="employee in projectOverviewEmployeeColumns"
|
||||||
|
:key="employee.employeeId"
|
||||||
|
align="center"
|
||||||
|
:label="employee.employeeName || '-'"
|
||||||
|
>
|
||||||
|
<el-table-column align="center" label="一季度" min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ formatAmountBlank(getEmployeeAmount(scope.row, employee.employeeId).quarterOneAmountWan) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="二季度" min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ formatAmountBlank(getEmployeeAmount(scope.row, employee.employeeId).quarterTwoAmountWan) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="三季度" min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ formatAmountBlank(getEmployeeAmount(scope.row, employee.employeeId).quarterThreeAmountWan) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="四季度" min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ formatAmountBlank(getEmployeeAmount(scope.row, employee.employeeId).quarterFourAmountWan) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="本年度小计" min-width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ formatAmountBlank(getEmployeeAmount(scope.row, employee.employeeId).annualTotalAmountWan) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<Pagination
|
|
||||||
v-model:limit="projectEmployeeQuery.pageSize"
|
|
||||||
v-model:page="projectEmployeeQuery.pageNo"
|
|
||||||
:total="projectEmployeeTotal"
|
|
||||||
@pagination="getProjectEmployeeList"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
@@ -141,14 +256,7 @@
|
|||||||
<span>{{ currentOfficeName || '-' }}</span>
|
<span>{{ currentOfficeName || '-' }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="年度">
|
<el-form-item label="年度">
|
||||||
<el-date-picker
|
<span>{{ projectOverviewForm.year || '-' }}</span>
|
||||||
v-model="projectOverviewYearValue"
|
|
||||||
class="!w-220px"
|
|
||||||
clearable
|
|
||||||
placeholder="请选择年度"
|
|
||||||
type="year"
|
|
||||||
value-format="YYYY"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="导出排序">
|
<el-form-item label="导出排序">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -177,8 +285,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as EmployeeApi from '@/api/tjt/employee'
|
|
||||||
import * as EmployeeYearCostBudgetApi from '@/api/tjt/employeeYearCostBudget'
|
|
||||||
import * as OfficeApi from '@/api/tjt/office'
|
import * as OfficeApi from '@/api/tjt/office'
|
||||||
import * as ReportApi from '@/api/tjt/report'
|
import * as ReportApi from '@/api/tjt/report'
|
||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
@@ -192,6 +298,10 @@ type SelectOption = {
|
|||||||
|
|
||||||
type ExportDialogType = 'employeeSummary' | 'projectOverview'
|
type ExportDialogType = 'employeeSummary' | 'projectOverview'
|
||||||
|
|
||||||
|
type SummaryTableRow = {
|
||||||
|
totalRow?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
const PROJECT_OVERVIEW_SORT_OPTIONS: SelectOption[] = [
|
const PROJECT_OVERVIEW_SORT_OPTIONS: SelectOption[] = [
|
||||||
{ label: '产值从高到低', value: 'output_desc' },
|
{ label: '产值从高到低', value: 'output_desc' },
|
||||||
{ label: '产值从低到高', value: 'output_asc' },
|
{ label: '产值从低到高', value: 'output_asc' },
|
||||||
@@ -211,13 +321,11 @@ const exportDialogVisible = ref(false)
|
|||||||
const exportDialogType = ref<ExportDialogType>('employeeSummary')
|
const exportDialogType = ref<ExportDialogType>('employeeSummary')
|
||||||
const projectOverviewExportLoading = ref(false)
|
const projectOverviewExportLoading = ref(false)
|
||||||
const employeeSummaryExportLoading = ref(false)
|
const employeeSummaryExportLoading = ref(false)
|
||||||
const employeeBudgetLoading = ref(false)
|
const employeeSummaryPreviewLoading = ref(false)
|
||||||
const projectEmployeeLoading = ref(false)
|
const projectOverviewPreviewLoading = ref(false)
|
||||||
const officeOptions = ref<OfficeApi.OfficeSimpleVO[]>([])
|
const officeOptions = ref<OfficeApi.OfficeSimpleVO[]>([])
|
||||||
const employeeBudgetList = ref<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO[]>([])
|
const employeeSummaryPreview = ref<ReportApi.EmployeeOutputSummaryPreviewRespVO>()
|
||||||
const projectEmployeeList = ref<EmployeeApi.EmployeeVO[]>([])
|
const projectOverviewPreview = ref<ReportApi.ProjectOverviewPreviewRespVO>()
|
||||||
const employeeBudgetTotal = ref(0)
|
|
||||||
const projectEmployeeTotal = ref(0)
|
|
||||||
const currentYear = new Date().getFullYear()
|
const currentYear = new Date().getFullYear()
|
||||||
|
|
||||||
const projectOverviewForm = reactive<ReportApi.ProjectOverviewExportReqVO>({
|
const projectOverviewForm = reactive<ReportApi.ProjectOverviewExportReqVO>({
|
||||||
@@ -234,26 +342,30 @@ const employeeSummaryForm = reactive<ReportApi.EmployeeOutputSummaryExportReqVO>
|
|||||||
sortType: 'annual_total_desc'
|
sortType: 'annual_total_desc'
|
||||||
})
|
})
|
||||||
|
|
||||||
const employeeBudgetQuery = reactive<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetPageReqVO>({
|
const employeeSummaryRows = computed<ReportApi.EmployeeOutputSummaryRow[]>(() => {
|
||||||
pageNo: 1,
|
const rows = employeeSummaryPreview.value?.rows || []
|
||||||
pageSize: 10,
|
const totalRow = employeeSummaryPreview.value?.totalRow
|
||||||
employeeId: undefined,
|
if (!totalRow) {
|
||||||
employeeName: undefined,
|
return rows
|
||||||
budgetYear: currentYear,
|
}
|
||||||
enabledFlag: true
|
return [...rows, { ...totalRow, totalRow: true }]
|
||||||
})
|
})
|
||||||
|
|
||||||
const projectEmployeeQuery = reactive<EmployeeApi.EmployeePageReqVO>({
|
const projectOverviewEmployeeColumns = computed(
|
||||||
pageNo: 1,
|
() => projectOverviewPreview.value?.employeeColumns || []
|
||||||
pageSize: 10,
|
)
|
||||||
employeeName: undefined,
|
|
||||||
officeId: undefined,
|
const projectOverviewRows = computed<ReportApi.ProjectOverviewProjectRow[]>(() => {
|
||||||
employeeStatus: undefined,
|
const rows = projectOverviewPreview.value?.rows || []
|
||||||
enabledFlag: true
|
const totalRow = projectOverviewPreview.value?.totalRow
|
||||||
|
if (!totalRow) {
|
||||||
|
return rows
|
||||||
|
}
|
||||||
|
return [...rows, { ...totalRow, totalRow: true }]
|
||||||
})
|
})
|
||||||
|
|
||||||
const exportDialogTitle = computed(() =>
|
const exportDialogTitle = computed(() =>
|
||||||
exportDialogType.value === 'employeeSummary' ? '导出员工产值汇总' : '导出项目产值总览'
|
exportDialogType.value === 'employeeSummary' ? '导出员工个人考核产值汇总表' : '导出项目总览表'
|
||||||
)
|
)
|
||||||
|
|
||||||
const currentExportLoading = computed(() =>
|
const currentExportLoading = computed(() =>
|
||||||
@@ -266,6 +378,16 @@ const currentOfficeName = computed(() => {
|
|||||||
return officeOptions.value.find((item) => item.id === projectOverviewForm.officeId)?.officeName || ''
|
return officeOptions.value.find((item) => item.id === projectOverviewForm.officeId)?.officeName || ''
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const projectOverviewEmptyText = computed(() => {
|
||||||
|
if (!projectOverviewForm.officeId) {
|
||||||
|
return '请先选择专业所'
|
||||||
|
}
|
||||||
|
if (!projectOverviewForm.year) {
|
||||||
|
return '请先选择年度'
|
||||||
|
}
|
||||||
|
return '暂无项目总览数据'
|
||||||
|
})
|
||||||
|
|
||||||
const projectOverviewYearValue = computed({
|
const projectOverviewYearValue = computed({
|
||||||
get: () => (projectOverviewForm.year ? String(projectOverviewForm.year) : undefined),
|
get: () => (projectOverviewForm.year ? String(projectOverviewForm.year) : undefined),
|
||||||
set: (value?: string) => {
|
set: (value?: string) => {
|
||||||
@@ -287,39 +409,61 @@ const formatAmount = (value?: number) => {
|
|||||||
return Number(value).toFixed(2)
|
return Number(value).toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formatAmountBlank = (value?: number) => {
|
||||||
|
if (value === undefined || value === null || Number(value) === 0) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
return Number(value).toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatPercent = (value?: number) => {
|
||||||
|
if (value === undefined || value === null || Number(value) === 0) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
return `${(Number(value) * 100).toFixed(2)}%`
|
||||||
|
}
|
||||||
|
|
||||||
|
const getEmployeeAmount = (
|
||||||
|
row: ReportApi.ProjectOverviewProjectRow,
|
||||||
|
employeeId?: number
|
||||||
|
): ReportApi.ProjectOverviewEmployeeAmountValue => {
|
||||||
|
if (!employeeId || !row.employeeAmountMap) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
return row.employeeAmountMap[String(employeeId)] || {}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getRowClassName = ({ row }: { row: SummaryTableRow }) => {
|
||||||
|
return row?.totalRow ? 'summary-total-row' : ''
|
||||||
|
}
|
||||||
|
|
||||||
const getOfficeList = async () => {
|
const getOfficeList = async () => {
|
||||||
officeOptions.value = await OfficeApi.getOfficeSimpleList()
|
officeOptions.value = await OfficeApi.getOfficeSimpleList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const getEmployeeBudgetList = async () => {
|
const getEmployeeSummaryPreview = async () => {
|
||||||
if (!employeeBudgetQuery.budgetYear) {
|
if (!employeeSummaryForm.year) {
|
||||||
employeeBudgetList.value = []
|
employeeSummaryPreview.value = undefined
|
||||||
employeeBudgetTotal.value = 0
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
employeeBudgetLoading.value = true
|
employeeSummaryPreviewLoading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await EmployeeYearCostBudgetApi.getEmployeeYearCostBudgetPage(employeeBudgetQuery)
|
employeeSummaryPreview.value = await ReportApi.getEmployeeOutputSummaryPreview(employeeSummaryForm)
|
||||||
employeeBudgetList.value = data.list
|
|
||||||
employeeBudgetTotal.value = data.total
|
|
||||||
} finally {
|
} finally {
|
||||||
employeeBudgetLoading.value = false
|
employeeSummaryPreviewLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getProjectEmployeeList = async () => {
|
const getProjectOverviewPreview = async () => {
|
||||||
if (!projectEmployeeQuery.officeId) {
|
if (!projectOverviewForm.officeId || !projectOverviewForm.year) {
|
||||||
projectEmployeeList.value = []
|
projectOverviewPreview.value = undefined
|
||||||
projectEmployeeTotal.value = 0
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
projectEmployeeLoading.value = true
|
projectOverviewPreviewLoading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await EmployeeApi.getEmployeePage(projectEmployeeQuery)
|
projectOverviewPreview.value = await ReportApi.getProjectOverviewPreview(projectOverviewForm)
|
||||||
projectEmployeeList.value = data.list
|
|
||||||
projectEmployeeTotal.value = data.total
|
|
||||||
} finally {
|
} finally {
|
||||||
projectEmployeeLoading.value = false
|
projectOverviewPreviewLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,7 +482,8 @@ const openProjectOverviewExportDialog = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!projectOverviewForm.year) {
|
if (!projectOverviewForm.year) {
|
||||||
projectOverviewForm.year = currentYear
|
message.warning('请选择年度')
|
||||||
|
return
|
||||||
}
|
}
|
||||||
exportDialogType.value = 'projectOverview'
|
exportDialogType.value = 'projectOverview'
|
||||||
exportDialogVisible.value = true
|
exportDialogVisible.value = true
|
||||||
@@ -389,27 +534,56 @@ const handleExportEmployeeSummary = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const refreshCurrentPreview = () => {
|
||||||
|
if (activeTab.value === 'projectOverview') {
|
||||||
|
getProjectOverviewPreview()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getEmployeeSummaryPreview()
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => employeeSummaryForm.year,
|
() => [employeeSummaryForm.year, employeeSummaryForm.sortType],
|
||||||
(year) => {
|
() => {
|
||||||
employeeBudgetQuery.pageNo = 1
|
getEmployeeSummaryPreview()
|
||||||
employeeBudgetQuery.budgetYear = year
|
|
||||||
getEmployeeBudgetList()
|
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => projectOverviewForm.officeId,
|
() => [projectOverviewForm.officeId, projectOverviewForm.year, projectOverviewForm.sortType],
|
||||||
(officeId) => {
|
() => {
|
||||||
projectEmployeeQuery.pageNo = 1
|
getProjectOverviewPreview()
|
||||||
projectEmployeeQuery.officeId = officeId
|
|
||||||
getProjectEmployeeList()
|
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => activeTab.value,
|
||||||
|
() => {
|
||||||
|
refreshCurrentPreview()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
|
onActivated(() => {
|
||||||
|
// immediate watch 已经负责首次预览加载,跳过 KeepAlive 首轮激活避免重复请求。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
refreshCurrentPreview()
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getOfficeList()
|
await getOfficeList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.summary-table :deep(.summary-total-row) {
|
||||||
|
background: var(--el-fill-color-light);
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -105,7 +105,9 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<ContentWrap v-if="currentPlanning && currentGroup">
|
<ContentWrap>
|
||||||
|
<div v-loading="roleLoading" class="min-h-320px">
|
||||||
|
<template v-if="currentPlanning && currentGroup">
|
||||||
<div class="mb-16px flex items-center justify-between gap-12px">
|
<div class="mb-16px flex items-center justify-between gap-12px">
|
||||||
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
||||||
<div class="flex items-center gap-12px">
|
<div class="flex items-center gap-12px">
|
||||||
@@ -172,10 +174,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</ContentWrap>
|
</template>
|
||||||
|
|
||||||
<ContentWrap v-else>
|
<el-empty v-else-if="!roleLoading" description="请选择合约规划后查看人员分配" />
|
||||||
<el-empty description="请选择合约规划后查看人员分配" />
|
</div>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -306,7 +308,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button :loading="saveLoading" type="primary" @click="handleSave">保存</el-button>
|
<el-button :loading="saveLoading" @click="handleTemporarySave">临时保存</el-button>
|
||||||
|
<el-button :loading="saveLoading" type="primary" @click="handleSave">校验保存</el-button>
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
@@ -349,6 +352,7 @@ const message = useMessage()
|
|||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const planningLoading = ref(false)
|
const planningLoading = ref(false)
|
||||||
|
const roleLoading = ref(false)
|
||||||
const saveLoading = ref(false)
|
const saveLoading = ref(false)
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const projectList = ref<ProjectApi.ProjectVO[]>([])
|
const projectList = ref<ProjectApi.ProjectVO[]>([])
|
||||||
@@ -374,7 +378,7 @@ const queryParams = reactive<ProjectApi.ProjectPageReqVO>({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const getProjectRowIndex = (index: number) =>
|
const getProjectRowIndex = (index: number) =>
|
||||||
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
(Number(queryParams.pageNo || 1) - 1) * Number(queryParams.pageSize || 10) + index + 1
|
||||||
|
|
||||||
const queryProjectStartYearValue = computed({
|
const queryProjectStartYearValue = computed({
|
||||||
get: () => (queryParams.projectStartYear ? String(queryParams.projectStartYear) : undefined),
|
get: () => (queryParams.projectStartYear ? String(queryParams.projectStartYear) : undefined),
|
||||||
@@ -681,7 +685,8 @@ const updateRoleRatio = (row: SpecialtyRoleSplitVO, value?: number) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const buildSavePersons = (
|
const buildSavePersons = (
|
||||||
row: SpecialtyRoleSplitVO
|
row: SpecialtyRoleSplitVO,
|
||||||
|
validate: boolean
|
||||||
):
|
):
|
||||||
| { persons: SpecialtyRolePersonVO[]; error?: never }
|
| { persons: SpecialtyRolePersonVO[]; error?: never }
|
||||||
| { persons?: never; error: string } => {
|
| { persons?: never; error: string } => {
|
||||||
@@ -693,35 +698,39 @@ const buildSavePersons = (
|
|||||||
if (!hasEmployeeId && !hasRatio) {
|
if (!hasEmployeeId && !hasRatio) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (!hasEmployeeId || !hasRatio) {
|
if (!validate && !hasEmployeeId) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (validate && (!hasEmployeeId || !hasRatio)) {
|
||||||
return { error: `${row.roleName} 的员工和比例必须同时填写` }
|
return { error: `${row.roleName} 的员工和比例必须同时填写` }
|
||||||
}
|
}
|
||||||
persons.push({
|
persons.push({
|
||||||
employeeId: person.employeeId,
|
employeeId: person.employeeId,
|
||||||
employeeName: employeeName || undefined,
|
employeeName: employeeName || undefined,
|
||||||
personRatio: roundRatio(person.personRatio)
|
personRatio: roundRatio(hasRatio ? person.personRatio : 0)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return { persons }
|
return { persons }
|
||||||
}
|
}
|
||||||
|
|
||||||
const validateAndBuildSaveItems = () => {
|
const buildSaveItems = (validate: boolean) => {
|
||||||
const items: SpecialtyRoleSplitApi.SpecialtyRoleSplitSaveItemVO[] = []
|
const items: SpecialtyRoleSplitApi.SpecialtyRoleSplitSaveItemVO[] = []
|
||||||
for (const group of editGroups.value) {
|
for (const group of editGroups.value) {
|
||||||
let roleTotal = 0
|
let roleTotal = 0
|
||||||
for (const row of group.rows) {
|
for (const row of group.rows) {
|
||||||
const result = buildSavePersons(row)
|
const result = buildSavePersons(row, validate)
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
message.warning(result.error)
|
message.warning(result.error)
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
const persons = result.persons || []
|
const persons = result.persons || []
|
||||||
const personTotalRatio = sumPersonRatios(persons)
|
const personTotalRatio = sumPersonRatios(persons)
|
||||||
if (personTotalRatio > 1 + EPSILON) {
|
if (validate && personTotalRatio > 1 + EPSILON) {
|
||||||
message.warning(`${group.specialtyName}-${row.roleName} 的人员比例合计不能大于 100%`)
|
message.warning(`${group.specialtyName}-${row.roleName} 的人员比例合计不能大于 100%`)
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
|
validate &&
|
||||||
row.roleCode === DESIGN_ROLE_CODE &&
|
row.roleCode === DESIGN_ROLE_CODE &&
|
||||||
Number(row.roleAmount || 0) > EPSILON &&
|
Number(row.roleAmount || 0) > EPSILON &&
|
||||||
persons.length === 0
|
persons.length === 0
|
||||||
@@ -737,7 +746,7 @@ const validateAndBuildSaveItems = () => {
|
|||||||
persons: isProjectLeadRow(row) ? [] : persons
|
persons: isProjectLeadRow(row) ? [] : persons
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (Math.abs(roleTotal - 1) > EPSILON) {
|
if (validate && Math.abs(roleTotal - 1) > EPSILON) {
|
||||||
message.warning(`${group.specialtyName} 的角色比例合计必须等于 100%`)
|
message.warning(`${group.specialtyName} 的角色比例合计必须等于 100%`)
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
@@ -798,10 +807,15 @@ const getPlanningList = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const loadRoleList = async (planningId: number) => {
|
const loadRoleList = async (planningId: number) => {
|
||||||
const data = await SpecialtyRoleSplitApi.getSpecialtyRoleSplitListByPlanningId(planningId)
|
roleLoading.value = true
|
||||||
roleList.value = cloneRoleRows(data)
|
try {
|
||||||
roleList.value.forEach((row) => syncRoleRatiosForGroup(roleList.value, row.specialtyCode))
|
const data = await SpecialtyRoleSplitApi.getSpecialtyRoleSplitListByPlanningId(planningId)
|
||||||
syncAllDerivedValues(roleList.value)
|
roleList.value = cloneRoleRows(data)
|
||||||
|
roleList.value.forEach((row) => syncRoleRatiosForGroup(roleList.value, row.specialtyCode))
|
||||||
|
syncAllDerivedValues(roleList.value)
|
||||||
|
} finally {
|
||||||
|
roleLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
@@ -841,11 +855,11 @@ const openEditDialog = () => {
|
|||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSave = async () => {
|
const saveRoleSplit = async (temporarySave: boolean) => {
|
||||||
if (!currentPlanning.value?.id) {
|
if (!currentPlanning.value?.id) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const items = validateAndBuildSaveItems()
|
const items = buildSaveItems(!temporarySave)
|
||||||
if (!items) {
|
if (!items) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -853,21 +867,35 @@ const handleSave = async () => {
|
|||||||
try {
|
try {
|
||||||
await SpecialtyRoleSplitApi.saveSpecialtyRoleSplitBatch({
|
await SpecialtyRoleSplitApi.saveSpecialtyRoleSplitBatch({
|
||||||
planningId: currentPlanning.value.id,
|
planningId: currentPlanning.value.id,
|
||||||
items
|
items,
|
||||||
|
temporarySave
|
||||||
})
|
})
|
||||||
message.success('保存成功')
|
message.success(temporarySave ? '临时保存成功' : '保存成功')
|
||||||
dialogVisible.value = false
|
if (!temporarySave) {
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
await loadRoleList(currentPlanning.value.id)
|
await loadRoleList(currentPlanning.value.id)
|
||||||
} finally {
|
} finally {
|
||||||
saveLoading.value = false
|
saveLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleTemporarySave = () => saveRoleSplit(true)
|
||||||
|
|
||||||
|
const handleSave = () => saveRoleSplit(false)
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getProjectList()
|
getProjectList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column align="center" label="ID" prop="id" width="88" />
|
<el-table-column :index="getRowIndex" align="center" label="序号" type="index" width="88" />
|
||||||
<el-table-column align="center" label="年度" prop="kYear" width="120" />
|
<el-table-column align="center" label="年度" prop="kYear" width="120" />
|
||||||
<el-table-column align="center" label="K值" width="120">
|
<el-table-column align="center" label="K值" width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
@@ -67,7 +67,13 @@
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="创建时间" prop="createTime" width="180" />
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="创建时间"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
/>
|
||||||
<el-table-column align="center" fixed="right" label="操作" width="160">
|
<el-table-column align="center" fixed="right" label="操作" width="160">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -144,6 +150,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { FormRules } from 'element-plus'
|
import type { FormRules } from 'element-plus'
|
||||||
import * as YearKValueApi from '@/api/tjt/yearKValue'
|
import * as YearKValueApi from '@/api/tjt/yearKValue'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
import { formatPercentText, fromPercentValue, toPercentValue } from '@/views/tjt/shared/planning'
|
import { formatPercentText, fromPercentValue, toPercentValue } from '@/views/tjt/shared/planning'
|
||||||
|
|
||||||
defineOptions({ name: 'TjtYearKValue' })
|
defineOptions({ name: 'TjtYearKValue' })
|
||||||
@@ -168,6 +175,9 @@ const queryParams = reactive<YearKValueApi.YearKValuePageReqVO>({
|
|||||||
enabledFlag: undefined
|
enabledFlag: undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const getRowIndex = (index: number) =>
|
||||||
|
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
||||||
|
|
||||||
const createFormData = (): YearKValueApi.YearKValueVO => ({
|
const createFormData = (): YearKValueApi.YearKValueVO => ({
|
||||||
kYear: new Date().getFullYear(),
|
kYear: new Date().getFullYear(),
|
||||||
kValue: 0.4,
|
kValue: 0.4,
|
||||||
@@ -289,11 +299,18 @@ const handleDelete = async (id: number) => {
|
|||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let activatedOnce = false
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
|
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||||
|
if (!activatedOnce) {
|
||||||
|
activatedOnce = true
|
||||||
|
return
|
||||||
|
}
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user