Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuiantw1212 committed May 10, 2024
1 parent 53bca0f commit 4ba90bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
12 changes: 1 addition & 11 deletions components/calculator/career/government.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@
</el-row>
<el-row>
<el-col :span="12">
<!-- <el-form-item label="本俸點" required>
<econSelect v-model="career.payPoint" :options="pointOfPayOptions" @change="calculateCareer()">
</econSelect>
</el-form-item> -->
</el-col>
<el-col :span="12">
<el-form-item label="= 奉給總額">
Expand All @@ -85,9 +81,6 @@
</el-row>
<el-row>
<el-col :span="12">
<!-- <el-form-item label="健保提繳工資">
<el-text> {{ Number(healInsurance.salary).toLocaleString() }}</el-text>
</el-form-item> -->
</el-col>
<el-col :span="12">
<el-form-item label="- 健保自付額">
Expand All @@ -98,14 +91,11 @@
</el-row>
<el-row>
<el-col :span="12">
<!-- <el-form-item label="勞保提繳工資">
<el-text> {{ Number(career.insurance.salary).toLocaleString() }}</el-text>
</el-form-item> -->
</el-col>
<el-col :span="12">
<el-form-item :label="`- 公保自付額`">
<el-text>{{ Number(civilServantInsurance.expense).toLocaleString() }} (負擔率{{
civilServantInsurance.employeeContributionRate }}%)</el-text>
civilServantInsurance.employeeContributionRate }}%)</el-text>
</el-form-item>
</el-col>
</el-row>
Expand Down
12 changes: 10 additions & 2 deletions components/calculator/career/labor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<el-col :span="12">
<el-form-item :label="`- 勞保自付額`">
<el-text>{{ Number(career.insurance?.expense).toLocaleString() }} (負擔率{{
laborInsurace.premiumRate[career.insuredUnit] }}%)</el-text>
laborInsurace.premiumRate[career.insuredUnit] }}%)</el-text>
</el-form-item>
</el-col>
</el-row>
Expand Down Expand Up @@ -147,7 +147,7 @@
</el-collapse-item>
</el-collapse>
</template>
<canvas v-show="career.monthlyBasicSalary" id="incomeChart"></canvas>
<canvas v-show="!isUnableToDraw" id="incomeChart"></canvas>
</el-card>
</template>
<script setup lang="ts">
Expand Down Expand Up @@ -221,9 +221,14 @@ const props = defineProps({
required: true,
},
})
const isUnableToDraw = computed(() => {
const { monthlyBasicSalary } = career.value
return !monthlyBasicSalary
})
const career = computed(() => {
return props.modelValue
})
// methods
function calculateCareer(options: any = { propagate: true }) {
const { propagate = true } = options
try {
Expand Down Expand Up @@ -393,6 +398,9 @@ function calculateMonthlySaving() {
let incomeChartInstance = ref<Chart>()
function drawChartAndCalculateIncome(propagate = false) {
const { monthlyBasicSalary, insuredUnit, employeeWelfareFund, insurance, pension } = career.value
if (isUnableToDraw.value) {
return
}
// 繪製圖表
let pv = 0
let fv = 0
Expand Down

0 comments on commit 4ba90bb

Please sign in to comment.