Compare commits
3 Commits
92c5071fab
...
master-lzm
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cb913cb0a | |||
| ddc0c7db1e | |||
| 1fbf02a310 |
@@ -13,6 +13,7 @@ export interface EmployeeVO {
|
||||
leaveDate?: string
|
||||
employeeStatus: string
|
||||
remark?: string
|
||||
officeLeaderFlag?: boolean
|
||||
sortNo?: number
|
||||
enabledFlag?: boolean
|
||||
createTime?: string
|
||||
@@ -23,6 +24,7 @@ export interface EmployeePageReqVO extends PageParam {
|
||||
officeId?: number
|
||||
employeeStatus?: string
|
||||
enabledFlag?: boolean
|
||||
officeLeaderFlag?: boolean
|
||||
}
|
||||
|
||||
export interface EmployeeSimpleVO {
|
||||
@@ -33,6 +35,7 @@ export interface EmployeeSimpleVO {
|
||||
employeeStatus?: string
|
||||
registrationType?: string
|
||||
jobTitle?: string
|
||||
officeLeaderFlag?: boolean
|
||||
}
|
||||
|
||||
export const getEmployeePage = (params: EmployeePageReqVO) => {
|
||||
@@ -60,6 +63,7 @@ export const getEmployeeSimpleList = (params: {
|
||||
officeId?: number
|
||||
status?: string
|
||||
enabledFlag?: boolean
|
||||
officeLeaderFlag?: boolean
|
||||
}) => {
|
||||
return request.get({ url: '/tjt/employee/simple-list', params })
|
||||
}
|
||||
|
||||
@@ -19,6 +19,18 @@ export interface EmployeeYearCostBudgetPageReqVO extends PageParam {
|
||||
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) => {
|
||||
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 })
|
||||
}
|
||||
|
||||
export const generateEmployeeYearCostBudget = (data: EmployeeYearCostBudgetGenerateReqVO) => {
|
||||
return request.post({ url: '/tjt/employee-year-cost-budget/generate', data })
|
||||
}
|
||||
|
||||
export const updateEmployeeYearCostBudget = (data: EmployeeYearCostBudgetVO) => {
|
||||
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 type { ProjectPlanningVO } from '@/api/tjt/planning'
|
||||
import type { ProjectPlanningQuarterVO } from '@/api/tjt/planningQuarter'
|
||||
|
||||
export interface ProjectOutputSplitVO {
|
||||
id?: number
|
||||
@@ -45,10 +47,20 @@ export type ProjectOutputSplitSaveVO = Pick<
|
||||
| 'digitalRatio'
|
||||
>
|
||||
|
||||
export interface ProjectOutputSplitPlanningDetailVO {
|
||||
planning: ProjectPlanningVO
|
||||
outputSplit: ProjectOutputSplitVO
|
||||
quarters: ProjectPlanningQuarterVO[]
|
||||
}
|
||||
|
||||
export const getProjectOutputSplitByPlanningId = (planningId: number) => {
|
||||
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) => {
|
||||
return request.put({ url: '/tjt/output-split/save', data })
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import request from '@/config/axios'
|
||||
import type { ProjectPlanningGuideDetailVO } from '@/api/tjt/planningGuideDetail'
|
||||
|
||||
export interface ProjectPlanningVO {
|
||||
id?: number
|
||||
@@ -71,6 +72,11 @@ export interface ProjectPlanningPageReqVO extends PageParam {
|
||||
createTime?: string[]
|
||||
}
|
||||
|
||||
export interface ProjectPlanningOutputEditDetailVO {
|
||||
planning: ProjectPlanningVO
|
||||
guideDetails: ProjectPlanningGuideDetailVO[]
|
||||
}
|
||||
|
||||
export const getProjectPlanningPage = (params: ProjectPlanningPageReqVO) => {
|
||||
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 } })
|
||||
}
|
||||
|
||||
export const getProjectPlanningOutputEditDetail = (id: number) => {
|
||||
return request.get({ url: '/tjt/planning/output-edit-detail', params: { id } })
|
||||
}
|
||||
|
||||
export const getProjectPlanningListByProjectId = (projectId: number) => {
|
||||
return request.get({ url: '/tjt/planning/list-by-project', params: { projectId } })
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import request from '@/config/axios'
|
||||
import type { ProjectPlanningVO } from '@/api/tjt/planning'
|
||||
|
||||
export interface ProjectPlanningQuarterVO {
|
||||
id?: number
|
||||
@@ -15,6 +16,11 @@ export type ProjectPlanningQuarterSaveVO = Omit<
|
||||
'distributionAmount' | 'createTime'
|
||||
>
|
||||
|
||||
export interface ProjectPlanningQuarterPlanningDetailVO {
|
||||
planning: ProjectPlanningVO
|
||||
quarters: ProjectPlanningQuarterVO[]
|
||||
}
|
||||
|
||||
export const getProjectPlanningQuarter = (id: number) => {
|
||||
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 } })
|
||||
}
|
||||
|
||||
export const getProjectPlanningQuarterPlanningDetail = (planningId: number) => {
|
||||
return request.get({
|
||||
url: '/tjt/planning-quarter/planning-detail',
|
||||
params: { planningId }
|
||||
})
|
||||
}
|
||||
|
||||
export const createProjectPlanningQuarter = (data: ProjectPlanningQuarterSaveVO) => {
|
||||
return request.post({ url: '/tjt/planning-quarter/create', data })
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface ProjectProfitVO {
|
||||
contractSignedFlag: boolean
|
||||
contractAmount?: number
|
||||
finalSettlementAmount?: number
|
||||
effectiveSettlementAmount?: number
|
||||
comprehensivePlanningAmount?: number
|
||||
subcontractPlanningAmount?: number
|
||||
majorOutputValue?: number
|
||||
|
||||
@@ -6,6 +6,41 @@ export interface ProjectOverviewExportReqVO {
|
||||
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 {
|
||||
year?: number
|
||||
officeId?: number
|
||||
@@ -14,6 +49,31 @@ export interface EmployeeOutputSummaryExportReqVO {
|
||||
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 {
|
||||
projectId: number
|
||||
year?: number
|
||||
@@ -35,6 +95,65 @@ export interface SpecialtyPersonOutputExportReqVO {
|
||||
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) => {
|
||||
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 })
|
||||
}
|
||||
|
||||
export const getSpecialtyPersonOutputPreview = (params: SpecialtyPersonOutputPreviewReqVO) => {
|
||||
return request.get({ url: '/tjt/report/specialty-person-output/preview', params })
|
||||
}
|
||||
|
||||
export const exportProjectOverview = (params: ProjectOverviewExportReqVO) => {
|
||||
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) => {
|
||||
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 {
|
||||
planningId: number
|
||||
items: SpecialtyRoleSplitSaveItemVO[]
|
||||
temporarySave?: boolean
|
||||
}
|
||||
|
||||
export const getSpecialtyRoleSplitListByPlanningId = (planningId: number) => {
|
||||
|
||||
@@ -50,13 +50,22 @@
|
||||
<Icon class="mr-5px" icon="ep:plus" />
|
||||
新增
|
||||
</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>
|
||||
</ContentWrap>
|
||||
|
||||
<ContentWrap>
|
||||
<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="预算年度" prop="budgetYear" width="120" />
|
||||
<el-table-column align="center" label="预计发生成本(元)" width="160">
|
||||
@@ -72,7 +81,13 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</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">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -167,12 +182,48 @@
|
||||
<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="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>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { FormRules } from 'element-plus'
|
||||
import * as EmployeeApi from '@/api/tjt/employee'
|
||||
import * as EmployeeYearCostBudgetApi from '@/api/tjt/employeeYearCostBudget'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { formatAmountText } from '@/views/tjt/shared/planning'
|
||||
|
||||
defineOptions({ name: 'TjtEmployeeYearCostBudget' })
|
||||
@@ -183,12 +234,15 @@ 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<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO[]>([])
|
||||
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')
|
||||
|
||||
@@ -201,6 +255,9 @@ const queryParams = reactive<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetPag
|
||||
enabledFlag: undefined
|
||||
})
|
||||
|
||||
const getRowIndex = (index: number) =>
|
||||
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
||||
|
||||
const createFormData = (): EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO => ({
|
||||
employeeId: undefined as never,
|
||||
employeeName: '',
|
||||
@@ -212,6 +269,10 @@ const createFormData = (): EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO =>
|
||||
})
|
||||
|
||||
const formData = ref<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO>(createFormData())
|
||||
const generateFormData = reactive<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetGenerateReqVO>({
|
||||
budgetYear: new Date().getFullYear(),
|
||||
expectedCostAmount: 0
|
||||
})
|
||||
|
||||
const queryBudgetYearValue = computed({
|
||||
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>({
|
||||
employeeId: [{ required: true, message: '员工不能为空', trigger: 'change' }],
|
||||
budgetYear: [{ required: true, message: '预算年度不能为空', trigger: 'change' }],
|
||||
expectedCostAmount: [{ required: true, message: '预计发生成本不能为空', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
const generateFormRules = reactive<FormRules>({
|
||||
budgetYear: [{ required: true, message: '预算年度不能为空', trigger: 'change' }],
|
||||
expectedCostAmount: [{ required: true, message: '默认预计发生成本不能为空', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
const ensureEmployeeOption = () => {
|
||||
if (!formData.value.employeeId || !formData.value.employeeName) {
|
||||
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 () => {
|
||||
if (!formRef.value) {
|
||||
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) => {
|
||||
try {
|
||||
await message.delConfirm()
|
||||
@@ -343,11 +450,18 @@ const handleDelete = async (id: number) => {
|
||||
} catch {}
|
||||
}
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getList()
|
||||
})
|
||||
</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-select>
|
||||
</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-button @click="handleQuery">
|
||||
<Icon class="mr-5px" icon="ep:search" />
|
||||
@@ -76,7 +87,7 @@
|
||||
|
||||
<ContentWrap>
|
||||
<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="性别" prop="gender" width="80" />
|
||||
<el-table-column align="center" label="所属专业所" min-width="140" prop="officeName" />
|
||||
@@ -95,9 +106,28 @@
|
||||
prop="registrationSealNo"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column align="center" label="入职时间" prop="entryDate" width="120" />
|
||||
<el-table-column align="center" label="离职时间" prop="leaveDate" width="120" />
|
||||
<el-table-column
|
||||
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="是否所长" 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">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.enabledFlag ? 'success' : 'info'">
|
||||
@@ -105,7 +135,13 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</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">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -262,6 +298,11 @@
|
||||
<el-switch v-model="formData.enabledFlag" active-text="启用" inactive-text="停用" />
|
||||
</el-form-item>
|
||||
</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-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
@@ -286,6 +327,7 @@
|
||||
import type { FormRules } from 'element-plus'
|
||||
import * as EmployeeApi from '@/api/tjt/employee'
|
||||
import * as OfficeApi from '@/api/tjt/office'
|
||||
import { dateFormatter, dateFormatter2, formatDate } from '@/utils/formatTime'
|
||||
|
||||
defineOptions({ name: 'TjtEmployee' })
|
||||
|
||||
@@ -327,9 +369,13 @@ const queryParams = reactive<EmployeeApi.EmployeePageReqVO>({
|
||||
employeeName: undefined,
|
||||
officeId: undefined,
|
||||
employeeStatus: undefined,
|
||||
enabledFlag: undefined
|
||||
enabledFlag: undefined,
|
||||
officeLeaderFlag: undefined
|
||||
})
|
||||
|
||||
const getRowIndex = (index: number) =>
|
||||
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
||||
|
||||
const createFormData = (): EmployeeApi.EmployeeVO => ({
|
||||
employeeName: '',
|
||||
gender: '男',
|
||||
@@ -341,12 +387,17 @@ const createFormData = (): EmployeeApi.EmployeeVO => ({
|
||||
leaveDate: undefined,
|
||||
employeeStatus: '在职',
|
||||
remark: '',
|
||||
officeLeaderFlag: false,
|
||||
sortNo: 0,
|
||||
enabledFlag: true
|
||||
})
|
||||
|
||||
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>({
|
||||
employeeName: [{ required: true, message: '员工姓名不能为空', trigger: 'blur' }],
|
||||
gender: [{ required: true, message: '性别不能为空', trigger: 'change' }],
|
||||
@@ -408,7 +459,12 @@ const openDialog = async (type: 'create' | 'update', id?: number) => {
|
||||
}
|
||||
formLoading.value = true
|
||||
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()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
@@ -448,12 +504,19 @@ const handleDelete = async (id: number) => {
|
||||
} catch {}
|
||||
}
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(async () => {
|
||||
await loadOfficeOptions()
|
||||
await getList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
<ContentWrap>
|
||||
<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="140" prop="officeCode" />
|
||||
<el-table-column align="center" label="排序号" prop="sortNo" width="100" />
|
||||
@@ -58,7 +58,13 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<template #default="scope">
|
||||
<el-button v-hasPermi="['tjt:office:update']" link type="primary" @click="openDialog('update', scope.row.id)">
|
||||
@@ -114,6 +120,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { FormRules } from 'element-plus'
|
||||
import * as OfficeApi from '@/api/tjt/office'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
defineOptions({ name: 'TjtOffice' })
|
||||
|
||||
@@ -137,6 +144,9 @@ const queryParams = reactive<OfficeApi.OfficePageReqVO>({
|
||||
enabledFlag: undefined
|
||||
})
|
||||
|
||||
const getRowIndex = (index: number) =>
|
||||
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
||||
|
||||
const createFormData = (): OfficeApi.OfficeVO => ({
|
||||
officeName: '',
|
||||
officeCode: '',
|
||||
@@ -226,11 +236,18 @@ const handleDelete = async (id: number) => {
|
||||
} catch {}
|
||||
}
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -103,12 +103,17 @@
|
||||
</el-col>
|
||||
|
||||
<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>
|
||||
<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) }} 元
|
||||
年度:{{ formData.year || '-' }},考核产值:{{
|
||||
formatAmountText(formData.assessmentOutputValue)
|
||||
}}
|
||||
元
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-12px">
|
||||
@@ -125,10 +130,16 @@
|
||||
</div>
|
||||
|
||||
<el-descriptions :column="2" border title="基础信息">
|
||||
<el-descriptions-item label="项目名称">{{ formData.projectName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目任务包">{{ formData.planningContent || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目名称">{{
|
||||
formData.projectName || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目任务包">{{
|
||||
formData.planningContent || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工程负责人">
|
||||
{{ getProjectLeadText(formData.projectManagerName, formData.engineeringLeaderName) }}
|
||||
{{
|
||||
getProjectLeadText(formData.projectManagerName, formData.engineeringLeaderName)
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
@@ -177,13 +188,20 @@
|
||||
<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="text-12px text-[var(--el-text-color-secondary)]">{{
|
||||
item.label
|
||||
}}</div>
|
||||
<div class="mt-6px text-18px font-600">{{ formatAmountText(item.amount) }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table v-loading="quarterLoading" :data="annualDistributionRows" border>
|
||||
<el-table-column align="center" label="分配年度" min-width="120" prop="distributionYear" />
|
||||
<el-table :data="annualDistributionRows" border>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="分配年度"
|
||||
min-width="120"
|
||||
prop="distributionYear"
|
||||
/>
|
||||
<el-table-column
|
||||
v-for="quarter in QUARTER_OPTIONS"
|
||||
:key="String(quarter.value)"
|
||||
@@ -201,10 +219,10 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
<ContentWrap v-else>
|
||||
<el-empty description="请选择合约规划后查看分配结果" />
|
||||
<el-empty v-else-if="!quarterLoading" description="请选择合约规划后查看分配结果" />
|
||||
</div>
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -618,14 +636,12 @@ const loadPlanningRelatedData = async (planning: PlanningApi.ProjectPlanningVO)
|
||||
}
|
||||
quarterLoading.value = true
|
||||
try {
|
||||
const [planningDetail, outputSplit, quarterList] = await Promise.all([
|
||||
PlanningApi.getProjectPlanning(planning.id),
|
||||
OutputSplitApi.getProjectOutputSplitByPlanningId(planning.id),
|
||||
PlanningQuarterApi.getProjectPlanningQuarterListByPlanningId(planning.id)
|
||||
])
|
||||
currentPlanning.value = planningDetail
|
||||
formData.value = outputSplit
|
||||
quarterRows.value = buildQuarterRows(planningDetail, quarterList)
|
||||
const detail = await OutputSplitApi.getProjectOutputSplitPlanningDetail(planning.id)
|
||||
currentPlanning.value = detail?.planning
|
||||
formData.value = detail?.outputSplit
|
||||
quarterRows.value = detail?.planning
|
||||
? buildQuarterRows(detail.planning, detail.quarters || [])
|
||||
: []
|
||||
} finally {
|
||||
quarterLoading.value = false
|
||||
}
|
||||
@@ -723,11 +739,18 @@ const handleSave = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(() => {
|
||||
getProjectList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getProjectList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
<el-input-number
|
||||
v-model="formData.drawingSetFactor"
|
||||
:min="0"
|
||||
:precision="4"
|
||||
:precision="2"
|
||||
:step="0.01"
|
||||
class="!w-1/1"
|
||||
controls-position="right"
|
||||
@@ -240,7 +240,7 @@
|
||||
<el-input-number
|
||||
v-model="formData.scaleFactor"
|
||||
:min="0"
|
||||
:precision="4"
|
||||
:precision="2"
|
||||
:step="0.01"
|
||||
class="!w-1/1"
|
||||
controls-position="right"
|
||||
@@ -254,7 +254,7 @@
|
||||
<el-input-number
|
||||
v-model="formData.modificationFactor"
|
||||
:min="0"
|
||||
:precision="4"
|
||||
:precision="2"
|
||||
:step="0.01"
|
||||
class="!w-1/1"
|
||||
controls-position="right"
|
||||
@@ -312,13 +312,24 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="建筑类型" min-width="140" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<el-tooltip
|
||||
:content="row.buildingType"
|
||||
:disabled="!hasValue(row.buildingType)"
|
||||
placement="top"
|
||||
>
|
||||
<el-input v-model="row.buildingType" maxlength="100" placeholder="建筑类型" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 2. 取消 controls 的核心数值列 -->
|
||||
<el-table-column align="center" label="指导单价(元)" min-width="110">
|
||||
<template #default="{ row }">
|
||||
<el-tooltip
|
||||
:content="formatAmountText(row.internalGuidanceUnitPrice)"
|
||||
:disabled="!hasValue(row.internalGuidanceUnitPrice)"
|
||||
placement="top"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="row.internalGuidanceUnitPrice"
|
||||
:min="0"
|
||||
@@ -326,10 +337,16 @@
|
||||
:controls="false"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="设计面积(m²)" min-width="110">
|
||||
<template #default="{ row }">
|
||||
<el-tooltip
|
||||
:content="formatAmountText(row.designArea)"
|
||||
:disabled="!hasValue(row.designArea)"
|
||||
placement="top"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="row.designArea"
|
||||
:min="0"
|
||||
@@ -337,6 +354,7 @@
|
||||
:controls="false"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="楼栋/户型数" min-width="100">
|
||||
@@ -355,17 +373,17 @@
|
||||
<el-table-column label="调整系数配置" align="center">
|
||||
<el-table-column align="center" label="套图" min-width="85">
|
||||
<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>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="规模" min-width="85">
|
||||
<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>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="修改" min-width="85">
|
||||
<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>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="复杂(%)" min-width="90">
|
||||
@@ -412,9 +430,34 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="备注" min-width="130">
|
||||
<el-table-column align="left" label="备注" min-width="260">
|
||||
<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>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="70">
|
||||
@@ -526,6 +569,35 @@
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
</template>
|
||||
</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>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@@ -619,6 +691,9 @@ const createFormData = (): PlanningApi.ProjectPlanningVO => ({
|
||||
|
||||
const formData = ref<PlanningApi.ProjectPlanningVO>(createFormData())
|
||||
const guideDetails = ref<GuideDetailRow[]>([])
|
||||
const remarkDialogVisible = ref(false)
|
||||
const activeRemarkRow = ref<GuideDetailRow>()
|
||||
const remarkDraft = ref('')
|
||||
|
||||
const planningStartYearValue = computed({
|
||||
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) => {
|
||||
if (
|
||||
row.drawingSetFactor === undefined ||
|
||||
@@ -1095,12 +1192,17 @@ const open = async (id: number) => {
|
||||
dialogVisible.value = true
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = await PlanningApi.getProjectPlanning(id)
|
||||
formData.value = normalizeFormData(data)
|
||||
const detail = await PlanningApi.getProjectPlanningOutputEditDetail(id)
|
||||
if (!detail?.planning) {
|
||||
formData.value = createFormData()
|
||||
guideDetails.value = []
|
||||
dialogVisible.value = false
|
||||
message.warning('合约规划不存在或已被删除')
|
||||
return
|
||||
}
|
||||
formData.value = normalizeFormData(detail.planning)
|
||||
guideDetails.value = showGuideDetailSection.value
|
||||
? normalizeGuideDetailList(
|
||||
await PlanningGuideDetailApi.getProjectPlanningGuideDetailListByPlanningId(id)
|
||||
)
|
||||
? normalizeGuideDetailList(detail.guideDetails)
|
||||
: []
|
||||
applyCalculationRatioDefault()
|
||||
if (formData.value.reviewOutsourceRatio === undefined || formData.value.reviewOutsourceRatio === null) {
|
||||
@@ -1157,4 +1259,45 @@ const submitForm = async () => {
|
||||
:deep(.text-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>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<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
|
||||
ref="formRef"
|
||||
@@ -208,7 +205,24 @@ const open = async (id: number) => {
|
||||
loading.value = true
|
||||
deletedQuarterIds.value = []
|
||||
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 = {
|
||||
...planning,
|
||||
contractValueQuantity: planning.contractValueQuantity ?? 1,
|
||||
@@ -217,8 +231,7 @@ const open = async (id: number) => {
|
||||
totalDistributionAmount: planning.totalDistributionAmount ?? 1,
|
||||
progressRemark: planning.progressRemark ?? ''
|
||||
}
|
||||
const quarterList = await PlanningQuarterApi.getProjectPlanningQuarterListByPlanningId(id)
|
||||
quarterRows.value = buildQuarterRows(formData.value, quarterList)
|
||||
quarterRows.value = buildQuarterRows(formData.value, detail.quarters || [])
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
@@ -166,7 +166,9 @@
|
||||
</el-col>
|
||||
|
||||
<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>
|
||||
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
||||
@@ -298,13 +300,10 @@
|
||||
</el-descriptions>
|
||||
</ContentWrap>
|
||||
|
||||
<ContentWrap v-if="currentPlanning">
|
||||
<ContentWrap>
|
||||
<div class="mb-16px flex items-center justify-between gap-16px">
|
||||
<div>
|
||||
<div class="text-14px font-600">季度分配</div>
|
||||
<div class="mt-4px text-12px text-[var(--el-text-color-secondary)]">
|
||||
总分配、已分配、待分配和提取进度备注属于合约规划的总体分配控制;季度分配表只展示年度、季度和分配比例明细。
|
||||
</div>
|
||||
</div>
|
||||
<el-button
|
||||
v-hasPermi="['tjt:planning:update', 'tjt:planning-quarter:update', 'tjt:planning-quarter:create']"
|
||||
@@ -351,7 +350,7 @@
|
||||
</el-col>
|
||||
</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
|
||||
v-for="quarter in QUARTER_OPTIONS"
|
||||
@@ -369,10 +368,12 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
<ContentWrap v-else>
|
||||
<ContentWrap v-else-if="!quarterLoading">
|
||||
<el-empty description="请选择合约规划后查看测算结果和季度分配" />
|
||||
</ContentWrap>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -584,12 +585,11 @@ const getPlanningList = async () => {
|
||||
}
|
||||
|
||||
const loadPlanningDetail = async (planningId: number) => {
|
||||
const planning = await PlanningApi.getProjectPlanning(planningId)
|
||||
currentPlanning.value = planning
|
||||
quarterLoading.value = true
|
||||
try {
|
||||
const quarterList = await PlanningQuarterApi.getProjectPlanningQuarterListByPlanningId(planningId)
|
||||
quarterRows.value = buildQuarterRows(planning, quarterList)
|
||||
const detail = await PlanningQuarterApi.getProjectPlanningQuarterPlanningDetail(planningId)
|
||||
currentPlanning.value = detail?.planning
|
||||
quarterRows.value = detail?.planning ? buildQuarterRows(detail.planning, detail.quarters || []) : []
|
||||
} finally {
|
||||
quarterLoading.value = false
|
||||
}
|
||||
@@ -646,11 +646,18 @@ const handlePlanningOutputFormSuccess = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(() => {
|
||||
getProjectList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getProjectList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -88,6 +88,18 @@
|
||||
{{ formatAmountText(scope.row.finalSettlementAmount) }}
|
||||
</template>
|
||||
</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">
|
||||
<template #default="scope">
|
||||
{{ formatAmountText(scope.row.comprehensivePlanningAmount) }}
|
||||
@@ -147,7 +159,9 @@
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<ContentWrap v-if="currentProfit">
|
||||
<ContentWrap>
|
||||
<div v-loading="detailLoading" class="min-h-220px">
|
||||
<template v-if="currentProfit">
|
||||
<div class="mb-16px flex items-center justify-between gap-16px">
|
||||
<div class="text-16px font-600">{{ currentProfit.projectName }}</div>
|
||||
<el-button plain type="primary" @click="openProfitEditDialog">
|
||||
@@ -163,6 +177,16 @@
|
||||
<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>
|
||||
@@ -198,10 +222,10 @@
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
<ContentWrap v-else>
|
||||
<el-empty description="请选择项目后查看盈亏详情" />
|
||||
<el-empty v-else-if="!detailLoading" description="请选择项目后查看盈亏详情" />
|
||||
</div>
|
||||
</ContentWrap>
|
||||
|
||||
<Dialog v-model="dialogVisible" title="编辑盈亏参数" width="520">
|
||||
@@ -264,6 +288,7 @@ const message = useMessage()
|
||||
const { t } = useI18n()
|
||||
|
||||
const loading = ref(false)
|
||||
const detailLoading = ref(false)
|
||||
const total = ref(0)
|
||||
const list = ref<ProfitApi.ProjectProfitVO[]>([])
|
||||
const currentProfit = ref<ProfitApi.ProjectProfitVO>()
|
||||
@@ -315,21 +340,24 @@ const queryProjectStartYearValue = computed({
|
||||
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
let targetProfit: ProfitApi.ProjectProfitVO | undefined
|
||||
try {
|
||||
const data = await ProfitApi.getProjectProfitPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
if (!list.value.length) {
|
||||
currentProfit.value = undefined
|
||||
return
|
||||
}
|
||||
} else {
|
||||
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)
|
||||
targetProfit = list.value.find((item) => item.projectId === targetProjectId) || list.value[0]
|
||||
}
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
if (targetProfit) {
|
||||
await nextTick()
|
||||
profitTableRef.value?.setCurrentRow(targetProfit)
|
||||
}
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
@@ -347,14 +375,24 @@ const handleCurrentProfitChange = async (row?: ProfitApi.ProjectProfitVO) => {
|
||||
currentProfit.value = undefined
|
||||
return
|
||||
}
|
||||
detailLoading.value = true
|
||||
try {
|
||||
currentProfit.value = await ProfitApi.getProjectProfit(row.projectId)
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const refreshCurrentProfit = async () => {
|
||||
if (!currentProfit.value?.projectId) {
|
||||
return
|
||||
}
|
||||
detailLoading.value = true
|
||||
try {
|
||||
currentProfit.value = await ProfitApi.getProjectProfit(currentProfit.value.projectId)
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
await getList()
|
||||
}
|
||||
|
||||
@@ -407,19 +445,29 @@ const submitProfitForm = async () => {
|
||||
|
||||
const profitLossClass = (value?: number) => {
|
||||
if ((value || 0) > 0) {
|
||||
return 'text-[var(--el-color-success)] font-600'
|
||||
return 'text-[var(--el-color-danger)] font-600'
|
||||
}
|
||||
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)]'
|
||||
}
|
||||
|
||||
const isUsingContractAmount = (row?: ProfitApi.ProjectProfitVO) =>
|
||||
!!row && Number(row.finalSettlementAmount || 0) <= 0 && Number(row.contractAmount || 0) > 0
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -526,11 +526,18 @@ const handlePlanningFormSuccess = async () => {
|
||||
await getPlanningList()
|
||||
}
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -384,11 +384,18 @@ const submitProjectBudgetExport = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(() => {
|
||||
getProjectList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getProjectList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -103,7 +103,9 @@
|
||||
</el-col>
|
||||
|
||||
<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>
|
||||
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
||||
@@ -193,7 +195,7 @@
|
||||
</div>
|
||||
</el-col>
|
||||
</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
|
||||
v-for="quarter in QUARTER_OPTIONS"
|
||||
@@ -212,10 +214,10 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
<ContentWrap v-else>
|
||||
<el-empty description="请选择合约规划后查看导出预览" />
|
||||
<el-empty v-else-if="!quarterLoading" description="请选择合约规划后查看导出预览" />
|
||||
</div>
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -566,14 +568,12 @@ const loadPlanningRelatedData = async (planning: PlanningApi.ProjectPlanningVO)
|
||||
}
|
||||
quarterLoading.value = true
|
||||
try {
|
||||
const [planningDetail, outputSplit, quarterList] = await Promise.all([
|
||||
PlanningApi.getProjectPlanning(planning.id),
|
||||
OutputSplitApi.getProjectOutputSplitByPlanningId(planning.id),
|
||||
PlanningQuarterApi.getProjectPlanningQuarterListByPlanningId(planning.id)
|
||||
])
|
||||
currentPlanning.value = planningDetail
|
||||
formData.value = outputSplit
|
||||
quarterRows.value = buildQuarterRows(planningDetail, quarterList)
|
||||
const detail = await OutputSplitApi.getProjectOutputSplitPlanningDetail(planning.id)
|
||||
currentPlanning.value = detail?.planning
|
||||
formData.value = detail?.outputSplit
|
||||
quarterRows.value = detail?.planning
|
||||
? buildQuarterRows(detail.planning, detail.quarters || [])
|
||||
: []
|
||||
} finally {
|
||||
quarterLoading.value = false
|
||||
}
|
||||
@@ -684,11 +684,18 @@ const submitProjectLeadQuarterExport = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(() => {
|
||||
getProjectList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getProjectList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -105,14 +105,28 @@
|
||||
</el-col>
|
||||
|
||||
<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>
|
||||
<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"
|
||||
:disabled="!canExportCurrentGroup || !selectedYear"
|
||||
:loading="exportSpecialtyLoading"
|
||||
plain
|
||||
type="success"
|
||||
@@ -122,6 +136,7 @@
|
||||
导出专业内人员计取表
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-16px">
|
||||
<el-radio-group v-model="selectedGroupCode" size="small">
|
||||
@@ -140,7 +155,17 @@
|
||||
</el-col>
|
||||
</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="120">
|
||||
<template #default="scope">
|
||||
@@ -154,95 +179,115 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="人员合计" min-width="120">
|
||||
<template #default="scope">
|
||||
{{ formatPercentText(getPersonTotalRatio(scope.row)) }}
|
||||
{{ formatPercentText(scope.row.personTotalRatio) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="人员信息" min-width="360">
|
||||
<el-table-column align="center" label="人员明细">
|
||||
<el-table-column align="center" label="人员基本分配">
|
||||
<el-table-column align="center" label="姓名" min-width="110">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.persons?.length" class="person-display-list">
|
||||
<div
|
||||
v-for="(person, index) in scope.row.persons"
|
||||
:key="`${scope.row.specialtyCode}-${scope.row.roleCode}-display-${index}`"
|
||||
class="person-display-row"
|
||||
>
|
||||
<span class="person-display-name">{{ person.employeeName || '-' }}</span>
|
||||
<span>{{ formatPercentText(person.personRatio) }}</span>
|
||||
<span>{{ formatAmountText(person.personAmount) }} 元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="person-empty">暂无人员</div>
|
||||
<span class="person-display-name">{{ scope.row.employeeName || '暂无人员' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工作量比例" min-width="110">
|
||||
<template #default="scope">
|
||||
{{ scope.row.employeeName ? formatPercentText(scope.row.personRatio) : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="人员金额(元)" min-width="120">
|
||||
<template #default="scope">
|
||||
{{ 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>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
<ContentWrap v-else>
|
||||
<el-empty description="请选择合约规划后查看导出预览" />
|
||||
<el-empty v-else-if="!previewLoading" description="请选择合约规划后查看导出预览" />
|
||||
</div>
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
</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>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import * as PlanningApi from '@/api/tjt/planning'
|
||||
import * as ProjectApi from '@/api/tjt/project'
|
||||
import * as ReportApi from '@/api/tjt/report'
|
||||
import * as SpecialtyRoleSplitApi from '@/api/tjt/specialtyRoleSplit'
|
||||
import download from '@/utils/download'
|
||||
import { formatAmountText, formatPercentText, getOwnershipTypeLabel } from '@/views/tjt/shared/planning'
|
||||
|
||||
defineOptions({ name: 'TjtReportSpecialtyPerson' })
|
||||
|
||||
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 currentYear = new Date().getFullYear()
|
||||
|
||||
const loading = ref(false)
|
||||
const planningLoading = ref(false)
|
||||
const previewLoading = ref(false)
|
||||
const exportSpecialtyLoading = ref(false)
|
||||
const exportDialogVisible = ref(false)
|
||||
const exportYear = ref<number>()
|
||||
const selectedYear = ref<number | undefined>(currentYear)
|
||||
const total = ref(0)
|
||||
const projectList = ref<ProjectApi.ProjectVO[]>([])
|
||||
const planningList = ref<PlanningApi.ProjectPlanningVO[]>([])
|
||||
const currentProject = ref<ProjectApi.ProjectVO>()
|
||||
const currentPlanning = ref<PlanningApi.ProjectPlanningVO>()
|
||||
const roleList = ref<SpecialtyRoleSplitVO[]>([])
|
||||
const previewData = ref<ReportApi.SpecialtyPersonOutputPreviewRespVO>()
|
||||
const selectedGroupCode = ref('')
|
||||
const queryFormRef = ref()
|
||||
const projectTableRef = ref()
|
||||
@@ -256,7 +301,7 @@ const queryParams = reactive<ProjectApi.ProjectPageReqVO>({
|
||||
})
|
||||
|
||||
const getProjectRowIndex = (index: number) =>
|
||||
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
||||
((queryParams.pageNo || 1) - 1) * (queryParams.pageSize || 10) + index + 1
|
||||
|
||||
const queryProjectStartYearValue = computed({
|
||||
get: () => (queryParams.projectStartYear ? String(queryParams.projectStartYear) : undefined),
|
||||
@@ -265,49 +310,24 @@ const queryProjectStartYearValue = computed({
|
||||
}
|
||||
})
|
||||
|
||||
const exportYearValue = computed({
|
||||
get: () => (exportYear.value ? String(exportYear.value) : undefined),
|
||||
const selectedYearValue = computed({
|
||||
get: () => (selectedYear.value ? String(selectedYear.value) : undefined),
|
||||
set: (value?: string) => {
|
||||
exportYear.value = value ? Number(value) : undefined
|
||||
selectedYear.value = value ? Number(value) : undefined
|
||||
}
|
||||
})
|
||||
|
||||
const roundRatio = (value?: number | string | null) => {
|
||||
const numericValue = Number(value || 0)
|
||||
return Number.isNaN(numericValue) ? 0 : Number(numericValue.toFixed(4))
|
||||
}
|
||||
const formatWanAmountText = (value?: number | string | null) => formatAmountText(value)
|
||||
const formatRatioAmountText = (
|
||||
ratio?: number | string | null,
|
||||
amount?: number | string | null
|
||||
) => `${formatPercentText(ratio)} / ${formatWanAmountText(amount)}`
|
||||
|
||||
const countConfiguredPersons = (persons?: SpecialtyRoleSplitApi.SpecialtyRolePersonVO[]) =>
|
||||
(persons || []).filter(
|
||||
(person) =>
|
||||
(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 groups = computed(() =>
|
||||
(previewData.value?.groups || []).filter(
|
||||
(item) => item.specialtyCode !== PROJECT_LEAD_GROUP_CODE && item.exportable !== false
|
||||
)
|
||||
)
|
||||
const groupTabOptions = computed(() =>
|
||||
groups.value.map((item) => ({
|
||||
label: item.specialtyName,
|
||||
@@ -318,12 +338,62 @@ const currentGroup = computed(
|
||||
() => groups.value.find((item) => item.specialtyCode === selectedGroupCode.value) || groups.value[0]
|
||||
)
|
||||
const canExportCurrentGroup = computed(
|
||||
() =>
|
||||
!!currentGroup.value?.specialtyCode &&
|
||||
currentGroup.value.specialtyCode !== PROJECT_LEAD_GROUP_CODE
|
||||
() => !!currentGroup.value?.specialtyCode && currentGroup.value.exportable !== false
|
||||
)
|
||||
|
||||
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) {
|
||||
return []
|
||||
}
|
||||
@@ -331,7 +401,7 @@ const buildSummaryCards = (group?: SpecialtyGroup) => {
|
||||
{ label: '分组金额', value: `${formatAmountText(group.specialtyAmount)} 元` },
|
||||
{ label: '角色合计', value: formatPercentText(group.roleTotal) },
|
||||
{ label: '已配置人数', value: `${group.personCount} 人` },
|
||||
{ label: '超额提醒', value: group.roleTotal > 1 + EPSILON ? '存在' : '无' }
|
||||
{ label: '超额提醒', value: group.overRatio ? '存在' : '无' }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -343,9 +413,8 @@ watch(
|
||||
selectedGroupCode.value = ''
|
||||
return
|
||||
}
|
||||
const preferredCode = codes.find((code) => code !== PROJECT_LEAD_GROUP_CODE) || codes[0]
|
||||
if (!codes.includes(selectedGroupCode.value) || selectedGroupCode.value === PROJECT_LEAD_GROUP_CODE) {
|
||||
selectedGroupCode.value = preferredCode
|
||||
if (!codes.includes(selectedGroupCode.value)) {
|
||||
selectedGroupCode.value = codes[0]
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
@@ -361,7 +430,7 @@ const getProjectList = async () => {
|
||||
currentProject.value = undefined
|
||||
planningList.value = []
|
||||
currentPlanning.value = undefined
|
||||
roleList.value = []
|
||||
previewData.value = undefined
|
||||
return
|
||||
}
|
||||
const targetProjectId = currentProject.value?.id || projectList.value[0].id
|
||||
@@ -378,7 +447,7 @@ const getPlanningList = async () => {
|
||||
if (!currentProject.value?.id) {
|
||||
planningList.value = []
|
||||
currentPlanning.value = undefined
|
||||
roleList.value = []
|
||||
previewData.value = undefined
|
||||
return
|
||||
}
|
||||
planningLoading.value = true
|
||||
@@ -387,7 +456,7 @@ const getPlanningList = async () => {
|
||||
planningList.value = list
|
||||
if (!planningList.value.length) {
|
||||
currentPlanning.value = undefined
|
||||
roleList.value = []
|
||||
previewData.value = undefined
|
||||
return
|
||||
}
|
||||
const targetPlanningId = currentPlanning.value?.id || planningList.value[0].id
|
||||
@@ -400,8 +469,20 @@ const getPlanningList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const loadRoleList = async (planningId: number) => {
|
||||
roleList.value = await SpecialtyRoleSplitApi.getSpecialtyRoleSplitListByPlanningId(planningId)
|
||||
const loadSpecialtyPersonPreview = async () => {
|
||||
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 = () => {
|
||||
@@ -422,10 +503,11 @@ const handleCurrentProjectChange = async (row?: ProjectApi.ProjectVO) => {
|
||||
const handleCurrentPlanningChange = async (row?: PlanningApi.ProjectPlanningVO) => {
|
||||
currentPlanning.value = row || undefined
|
||||
if (!row?.id) {
|
||||
roleList.value = []
|
||||
previewData.value = undefined
|
||||
return
|
||||
}
|
||||
await loadRoleList(row.id)
|
||||
selectedYear.value = row.planningStartYear || currentYear
|
||||
previewData.value = undefined
|
||||
}
|
||||
|
||||
const handleExportSpecialtyPerson = async () => {
|
||||
@@ -437,20 +519,7 @@ const handleExportSpecialtyPerson = async () => {
|
||||
message.warning('请选择具体专业后再导出')
|
||||
return
|
||||
}
|
||||
exportYear.value = currentPlanning.value.planningStartYear || currentYear
|
||||
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) {
|
||||
if (!selectedYear.value) {
|
||||
message.warning('请选择年度')
|
||||
return
|
||||
}
|
||||
@@ -460,47 +529,41 @@ const submitSpecialtyExport = async () => {
|
||||
const data = await ReportApi.exportSpecialtyPersonOutput({
|
||||
planningId: currentPlanning.value.id,
|
||||
specialtyCode: currentGroup.value.specialtyCode,
|
||||
year: exportYear.value
|
||||
year: selectedYear.value
|
||||
})
|
||||
download.excel(
|
||||
data,
|
||||
`${currentProject.value?.projectName || '项目'}_${exportYear.value}_${currentGroup.value.specialtyName || '专业'}内人员年度季度计取表.xlsx`
|
||||
`${currentProject.value?.projectName || '项目'}_${selectedYear.value}_${currentGroup.value.specialtyName || '专业'}内人员年度季度计取表.xlsx`
|
||||
)
|
||||
exportDialogVisible.value = false
|
||||
} finally {
|
||||
exportSpecialtyLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
[() => currentPlanning.value?.id, selectedYear],
|
||||
() => {
|
||||
loadSpecialtyPersonPreview()
|
||||
}
|
||||
)
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(() => {
|
||||
getProjectList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getProjectList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<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 {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<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-item label="年度">
|
||||
<el-date-picker
|
||||
@@ -13,13 +13,11 @@
|
||||
value-format="YYYY"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>
|
||||
<el-button @click="getEmployeeBudgetList">
|
||||
<el-form-item>
|
||||
<el-button :loading="employeeSummaryPreviewLoading" @click="getEmployeeSummaryPreview">
|
||||
<Icon class="mr-5px" icon="ep:refresh" />
|
||||
刷新预览
|
||||
</el-button>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button
|
||||
v-hasPermi="['tjt:report-summary:export']"
|
||||
:loading="employeeSummaryExportLoading"
|
||||
@@ -34,29 +32,61 @@
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="employeeBudgetLoading"
|
||||
:data="employeeBudgetList"
|
||||
class="mt-12px"
|
||||
:empty-text="employeeSummaryForm.year ? '暂无年度成本预算数据' : '请先选择年度'"
|
||||
v-loading="employeeSummaryPreviewLoading"
|
||||
:data="employeeSummaryRows"
|
||||
: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" 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">
|
||||
<el-table-column align="center" fixed="left" label="序号" width="70">
|
||||
<template #default="scope">
|
||||
{{ formatAmount(scope.row.expectedCostAmount) }}
|
||||
{{ scope.row.totalRow ? '' : scope.row.serialNo }}
|
||||
</template>
|
||||
</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>
|
||||
<Pagination
|
||||
v-model:limit="employeeBudgetQuery.pageSize"
|
||||
v-model:page="employeeBudgetQuery.pageNo"
|
||||
:total="employeeBudgetTotal"
|
||||
@pagination="getEmployeeBudgetList"
|
||||
/>
|
||||
</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-item label="专业所">
|
||||
<el-select
|
||||
@@ -73,13 +103,21 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>
|
||||
<el-button @click="getProjectEmployeeList">
|
||||
<el-form-item label="年度">
|
||||
<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" />
|
||||
刷新预览
|
||||
</el-button>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button
|
||||
v-hasPermi="['tjt:report-summary:export']"
|
||||
:loading="projectOverviewExportLoading"
|
||||
@@ -94,22 +132,99 @@
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="projectEmployeeLoading"
|
||||
:data="projectEmployeeList"
|
||||
class="mt-12px"
|
||||
:empty-text="projectOverviewForm.officeId ? '该专业所下暂无员工' : '请先选择专业所'"
|
||||
v-loading="projectOverviewPreviewLoading"
|
||||
:data="projectOverviewRows"
|
||||
:empty-text="projectOverviewEmptyText"
|
||||
: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" label="员工姓名" min-width="160" prop="employeeName" />
|
||||
<el-table-column align="center" label="性别" prop="gender" width="100" />
|
||||
<el-table-column align="center" label="所属所" min-width="180" prop="officeName" />
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="projectEmployeeQuery.pageSize"
|
||||
v-model:page="projectEmployeeQuery.pageNo"
|
||||
:total="projectEmployeeTotal"
|
||||
@pagination="getProjectEmployeeList"
|
||||
<el-table-column align="center" fixed="left" label="序号" width="70">
|
||||
<template #default="scope">
|
||||
{{ scope.row.totalRow ? '' : scope.row.serialNo }}
|
||||
</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-tab-pane>
|
||||
</el-tabs>
|
||||
</ContentWrap>
|
||||
@@ -141,14 +256,7 @@
|
||||
<span>{{ currentOfficeName || '-' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="年度">
|
||||
<el-date-picker
|
||||
v-model="projectOverviewYearValue"
|
||||
class="!w-220px"
|
||||
clearable
|
||||
placeholder="请选择年度"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
/>
|
||||
<span>{{ projectOverviewForm.year || '-' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="导出排序">
|
||||
<el-select
|
||||
@@ -177,8 +285,6 @@
|
||||
</template>
|
||||
|
||||
<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 ReportApi from '@/api/tjt/report'
|
||||
import download from '@/utils/download'
|
||||
@@ -192,6 +298,10 @@ type SelectOption = {
|
||||
|
||||
type ExportDialogType = 'employeeSummary' | 'projectOverview'
|
||||
|
||||
type SummaryTableRow = {
|
||||
totalRow?: boolean
|
||||
}
|
||||
|
||||
const PROJECT_OVERVIEW_SORT_OPTIONS: SelectOption[] = [
|
||||
{ label: '产值从高到低', value: 'output_desc' },
|
||||
{ label: '产值从低到高', value: 'output_asc' },
|
||||
@@ -211,13 +321,11 @@ const exportDialogVisible = ref(false)
|
||||
const exportDialogType = ref<ExportDialogType>('employeeSummary')
|
||||
const projectOverviewExportLoading = ref(false)
|
||||
const employeeSummaryExportLoading = ref(false)
|
||||
const employeeBudgetLoading = ref(false)
|
||||
const projectEmployeeLoading = ref(false)
|
||||
const employeeSummaryPreviewLoading = ref(false)
|
||||
const projectOverviewPreviewLoading = ref(false)
|
||||
const officeOptions = ref<OfficeApi.OfficeSimpleVO[]>([])
|
||||
const employeeBudgetList = ref<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetVO[]>([])
|
||||
const projectEmployeeList = ref<EmployeeApi.EmployeeVO[]>([])
|
||||
const employeeBudgetTotal = ref(0)
|
||||
const projectEmployeeTotal = ref(0)
|
||||
const employeeSummaryPreview = ref<ReportApi.EmployeeOutputSummaryPreviewRespVO>()
|
||||
const projectOverviewPreview = ref<ReportApi.ProjectOverviewPreviewRespVO>()
|
||||
const currentYear = new Date().getFullYear()
|
||||
|
||||
const projectOverviewForm = reactive<ReportApi.ProjectOverviewExportReqVO>({
|
||||
@@ -234,26 +342,30 @@ const employeeSummaryForm = reactive<ReportApi.EmployeeOutputSummaryExportReqVO>
|
||||
sortType: 'annual_total_desc'
|
||||
})
|
||||
|
||||
const employeeBudgetQuery = reactive<EmployeeYearCostBudgetApi.EmployeeYearCostBudgetPageReqVO>({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
employeeId: undefined,
|
||||
employeeName: undefined,
|
||||
budgetYear: currentYear,
|
||||
enabledFlag: true
|
||||
const employeeSummaryRows = computed<ReportApi.EmployeeOutputSummaryRow[]>(() => {
|
||||
const rows = employeeSummaryPreview.value?.rows || []
|
||||
const totalRow = employeeSummaryPreview.value?.totalRow
|
||||
if (!totalRow) {
|
||||
return rows
|
||||
}
|
||||
return [...rows, { ...totalRow, totalRow: true }]
|
||||
})
|
||||
|
||||
const projectEmployeeQuery = reactive<EmployeeApi.EmployeePageReqVO>({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
employeeName: undefined,
|
||||
officeId: undefined,
|
||||
employeeStatus: undefined,
|
||||
enabledFlag: true
|
||||
const projectOverviewEmployeeColumns = computed(
|
||||
() => projectOverviewPreview.value?.employeeColumns || []
|
||||
)
|
||||
|
||||
const projectOverviewRows = computed<ReportApi.ProjectOverviewProjectRow[]>(() => {
|
||||
const rows = projectOverviewPreview.value?.rows || []
|
||||
const totalRow = projectOverviewPreview.value?.totalRow
|
||||
if (!totalRow) {
|
||||
return rows
|
||||
}
|
||||
return [...rows, { ...totalRow, totalRow: true }]
|
||||
})
|
||||
|
||||
const exportDialogTitle = computed(() =>
|
||||
exportDialogType.value === 'employeeSummary' ? '导出员工产值汇总' : '导出项目产值总览'
|
||||
exportDialogType.value === 'employeeSummary' ? '导出员工个人考核产值汇总表' : '导出项目总览表'
|
||||
)
|
||||
|
||||
const currentExportLoading = computed(() =>
|
||||
@@ -266,6 +378,16 @@ const currentOfficeName = computed(() => {
|
||||
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({
|
||||
get: () => (projectOverviewForm.year ? String(projectOverviewForm.year) : undefined),
|
||||
set: (value?: string) => {
|
||||
@@ -287,39 +409,61 @@ const formatAmount = (value?: number) => {
|
||||
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 () => {
|
||||
officeOptions.value = await OfficeApi.getOfficeSimpleList()
|
||||
}
|
||||
|
||||
const getEmployeeBudgetList = async () => {
|
||||
if (!employeeBudgetQuery.budgetYear) {
|
||||
employeeBudgetList.value = []
|
||||
employeeBudgetTotal.value = 0
|
||||
const getEmployeeSummaryPreview = async () => {
|
||||
if (!employeeSummaryForm.year) {
|
||||
employeeSummaryPreview.value = undefined
|
||||
return
|
||||
}
|
||||
employeeBudgetLoading.value = true
|
||||
employeeSummaryPreviewLoading.value = true
|
||||
try {
|
||||
const data = await EmployeeYearCostBudgetApi.getEmployeeYearCostBudgetPage(employeeBudgetQuery)
|
||||
employeeBudgetList.value = data.list
|
||||
employeeBudgetTotal.value = data.total
|
||||
employeeSummaryPreview.value = await ReportApi.getEmployeeOutputSummaryPreview(employeeSummaryForm)
|
||||
} finally {
|
||||
employeeBudgetLoading.value = false
|
||||
employeeSummaryPreviewLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const getProjectEmployeeList = async () => {
|
||||
if (!projectEmployeeQuery.officeId) {
|
||||
projectEmployeeList.value = []
|
||||
projectEmployeeTotal.value = 0
|
||||
const getProjectOverviewPreview = async () => {
|
||||
if (!projectOverviewForm.officeId || !projectOverviewForm.year) {
|
||||
projectOverviewPreview.value = undefined
|
||||
return
|
||||
}
|
||||
projectEmployeeLoading.value = true
|
||||
projectOverviewPreviewLoading.value = true
|
||||
try {
|
||||
const data = await EmployeeApi.getEmployeePage(projectEmployeeQuery)
|
||||
projectEmployeeList.value = data.list
|
||||
projectEmployeeTotal.value = data.total
|
||||
projectOverviewPreview.value = await ReportApi.getProjectOverviewPreview(projectOverviewForm)
|
||||
} finally {
|
||||
projectEmployeeLoading.value = false
|
||||
projectOverviewPreviewLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,7 +482,8 @@ const openProjectOverviewExportDialog = () => {
|
||||
return
|
||||
}
|
||||
if (!projectOverviewForm.year) {
|
||||
projectOverviewForm.year = currentYear
|
||||
message.warning('请选择年度')
|
||||
return
|
||||
}
|
||||
exportDialogType.value = 'projectOverview'
|
||||
exportDialogVisible.value = true
|
||||
@@ -389,27 +534,56 @@ const handleExportEmployeeSummary = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const refreshCurrentPreview = () => {
|
||||
if (activeTab.value === 'projectOverview') {
|
||||
getProjectOverviewPreview()
|
||||
return
|
||||
}
|
||||
getEmployeeSummaryPreview()
|
||||
}
|
||||
|
||||
watch(
|
||||
() => employeeSummaryForm.year,
|
||||
(year) => {
|
||||
employeeBudgetQuery.pageNo = 1
|
||||
employeeBudgetQuery.budgetYear = year
|
||||
getEmployeeBudgetList()
|
||||
() => [employeeSummaryForm.year, employeeSummaryForm.sortType],
|
||||
() => {
|
||||
getEmployeeSummaryPreview()
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => projectOverviewForm.officeId,
|
||||
(officeId) => {
|
||||
projectEmployeeQuery.pageNo = 1
|
||||
projectEmployeeQuery.officeId = officeId
|
||||
getProjectEmployeeList()
|
||||
() => [projectOverviewForm.officeId, projectOverviewForm.year, projectOverviewForm.sortType],
|
||||
() => {
|
||||
getProjectOverviewPreview()
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => activeTab.value,
|
||||
() => {
|
||||
refreshCurrentPreview()
|
||||
}
|
||||
)
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onActivated(() => {
|
||||
// immediate watch 已经负责首次预览加载,跳过 KeepAlive 首轮激活避免重复请求。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
refreshCurrentPreview()
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await getOfficeList()
|
||||
})
|
||||
</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 :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="text-16px font-600">{{ currentPlanning.planningContent }}</div>
|
||||
<div class="flex items-center gap-12px">
|
||||
@@ -172,10 +174,10 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
<ContentWrap v-else>
|
||||
<el-empty description="请选择合约规划后查看人员分配" />
|
||||
<el-empty v-else-if="!roleLoading" description="请选择合约规划后查看人员分配" />
|
||||
</div>
|
||||
</ContentWrap>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -306,7 +308,8 @@
|
||||
</template>
|
||||
|
||||
<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>
|
||||
</template>
|
||||
</Dialog>
|
||||
@@ -349,6 +352,7 @@ const message = useMessage()
|
||||
|
||||
const loading = ref(false)
|
||||
const planningLoading = ref(false)
|
||||
const roleLoading = ref(false)
|
||||
const saveLoading = ref(false)
|
||||
const total = ref(0)
|
||||
const projectList = ref<ProjectApi.ProjectVO[]>([])
|
||||
@@ -374,7 +378,7 @@ const queryParams = reactive<ProjectApi.ProjectPageReqVO>({
|
||||
})
|
||||
|
||||
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({
|
||||
get: () => (queryParams.projectStartYear ? String(queryParams.projectStartYear) : undefined),
|
||||
@@ -681,7 +685,8 @@ const updateRoleRatio = (row: SpecialtyRoleSplitVO, value?: number) => {
|
||||
}
|
||||
|
||||
const buildSavePersons = (
|
||||
row: SpecialtyRoleSplitVO
|
||||
row: SpecialtyRoleSplitVO,
|
||||
validate: boolean
|
||||
):
|
||||
| { persons: SpecialtyRolePersonVO[]; error?: never }
|
||||
| { persons?: never; error: string } => {
|
||||
@@ -693,35 +698,39 @@ const buildSavePersons = (
|
||||
if (!hasEmployeeId && !hasRatio) {
|
||||
continue
|
||||
}
|
||||
if (!hasEmployeeId || !hasRatio) {
|
||||
if (!validate && !hasEmployeeId) {
|
||||
continue
|
||||
}
|
||||
if (validate && (!hasEmployeeId || !hasRatio)) {
|
||||
return { error: `${row.roleName} 的员工和比例必须同时填写` }
|
||||
}
|
||||
persons.push({
|
||||
employeeId: person.employeeId,
|
||||
employeeName: employeeName || undefined,
|
||||
personRatio: roundRatio(person.personRatio)
|
||||
personRatio: roundRatio(hasRatio ? person.personRatio : 0)
|
||||
})
|
||||
}
|
||||
return { persons }
|
||||
}
|
||||
|
||||
const validateAndBuildSaveItems = () => {
|
||||
const buildSaveItems = (validate: boolean) => {
|
||||
const items: SpecialtyRoleSplitApi.SpecialtyRoleSplitSaveItemVO[] = []
|
||||
for (const group of editGroups.value) {
|
||||
let roleTotal = 0
|
||||
for (const row of group.rows) {
|
||||
const result = buildSavePersons(row)
|
||||
const result = buildSavePersons(row, validate)
|
||||
if (result.error) {
|
||||
message.warning(result.error)
|
||||
return undefined
|
||||
}
|
||||
const persons = result.persons || []
|
||||
const personTotalRatio = sumPersonRatios(persons)
|
||||
if (personTotalRatio > 1 + EPSILON) {
|
||||
if (validate && personTotalRatio > 1 + EPSILON) {
|
||||
message.warning(`${group.specialtyName}-${row.roleName} 的人员比例合计不能大于 100%`)
|
||||
return undefined
|
||||
}
|
||||
if (
|
||||
validate &&
|
||||
row.roleCode === DESIGN_ROLE_CODE &&
|
||||
Number(row.roleAmount || 0) > EPSILON &&
|
||||
persons.length === 0
|
||||
@@ -737,7 +746,7 @@ const validateAndBuildSaveItems = () => {
|
||||
persons: isProjectLeadRow(row) ? [] : persons
|
||||
})
|
||||
}
|
||||
if (Math.abs(roleTotal - 1) > EPSILON) {
|
||||
if (validate && Math.abs(roleTotal - 1) > EPSILON) {
|
||||
message.warning(`${group.specialtyName} 的角色比例合计必须等于 100%`)
|
||||
return undefined
|
||||
}
|
||||
@@ -798,10 +807,15 @@ const getPlanningList = async () => {
|
||||
}
|
||||
|
||||
const loadRoleList = async (planningId: number) => {
|
||||
roleLoading.value = true
|
||||
try {
|
||||
const data = await SpecialtyRoleSplitApi.getSpecialtyRoleSplitListByPlanningId(planningId)
|
||||
roleList.value = cloneRoleRows(data)
|
||||
roleList.value.forEach((row) => syncRoleRatiosForGroup(roleList.value, row.specialtyCode))
|
||||
syncAllDerivedValues(roleList.value)
|
||||
} finally {
|
||||
roleLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
@@ -841,11 +855,11 @@ const openEditDialog = () => {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
const handleSave = async () => {
|
||||
const saveRoleSplit = async (temporarySave: boolean) => {
|
||||
if (!currentPlanning.value?.id) {
|
||||
return
|
||||
}
|
||||
const items = validateAndBuildSaveItems()
|
||||
const items = buildSaveItems(!temporarySave)
|
||||
if (!items) {
|
||||
return
|
||||
}
|
||||
@@ -853,21 +867,35 @@ const handleSave = async () => {
|
||||
try {
|
||||
await SpecialtyRoleSplitApi.saveSpecialtyRoleSplitBatch({
|
||||
planningId: currentPlanning.value.id,
|
||||
items
|
||||
items,
|
||||
temporarySave
|
||||
})
|
||||
message.success('保存成功')
|
||||
message.success(temporarySave ? '临时保存成功' : '保存成功')
|
||||
if (!temporarySave) {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
await loadRoleList(currentPlanning.value.id)
|
||||
} finally {
|
||||
saveLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleTemporarySave = () => saveRoleSplit(true)
|
||||
|
||||
const handleSave = () => saveRoleSplit(false)
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(() => {
|
||||
getProjectList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求项目与合约规划列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getProjectList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
<ContentWrap>
|
||||
<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="K值" width="120">
|
||||
<template #default="scope">
|
||||
@@ -67,7 +67,13 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</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">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -144,6 +150,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { FormRules } from 'element-plus'
|
||||
import * as YearKValueApi from '@/api/tjt/yearKValue'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { formatPercentText, fromPercentValue, toPercentValue } from '@/views/tjt/shared/planning'
|
||||
|
||||
defineOptions({ name: 'TjtYearKValue' })
|
||||
@@ -168,6 +175,9 @@ const queryParams = reactive<YearKValueApi.YearKValuePageReqVO>({
|
||||
enabledFlag: undefined
|
||||
})
|
||||
|
||||
const getRowIndex = (index: number) =>
|
||||
(queryParams.pageNo - 1) * queryParams.pageSize + index + 1
|
||||
|
||||
const createFormData = (): YearKValueApi.YearKValueVO => ({
|
||||
kYear: new Date().getFullYear(),
|
||||
kValue: 0.4,
|
||||
@@ -289,11 +299,18 @@ const handleDelete = async (id: number) => {
|
||||
} catch {}
|
||||
}
|
||||
|
||||
let activatedOnce = false
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
// KeepAlive 首次挂载也会触发 onActivated,跳过首轮避免重复请求列表。
|
||||
if (!activatedOnce) {
|
||||
activatedOnce = true
|
||||
return
|
||||
}
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user