|
@@ -7,7 +7,7 @@
|
|
|
开启填报
|
|
|
</el-button>
|
|
|
<el-button type="danger" v-if="status === 0" @click="archiveProjectReportPeriodHandle">
|
|
|
- 归档
|
|
|
+ 结束本年度考核
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -19,7 +19,7 @@
|
|
|
v-for="(item, index) in tabList"
|
|
|
:class="{ active: cTabIndex === index }"
|
|
|
:key="index"
|
|
|
- @click="switchTabHandle(item, index)"
|
|
|
+ @click="switchTabHandle(index)"
|
|
|
>{{ item['xmbm'] }}</li
|
|
|
>
|
|
|
</ul>
|
|
@@ -108,7 +108,7 @@
|
|
|
<template #default="scope">{{ scope.row.returnAmount }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="本年初始进度" width="140" align="center">
|
|
|
- <template #default="scope">{{ scope.row.finishProgress }}</template>
|
|
|
+ <template #default="scope">{{ scope.row.finishProgress * 100 }}%</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="现进度" width="120" align="center">
|
|
|
<template #default="scope">
|
|
@@ -214,7 +214,8 @@ const getProjectPassByList = async () => {
|
|
|
)
|
|
|
tabList.value.push(...getRowMapByList(result, 'xmbm'))
|
|
|
if (tabList.value.length === 1) {
|
|
|
- switchTabHandle(tabList.value[0], 0)
|
|
|
+ cTabIndex.value = 0
|
|
|
+ initInfoData(tabList.value[cTabIndex.value])
|
|
|
}
|
|
|
}
|
|
|
const getRowMapByList = (arrs: any[], key: string) => {
|
|
@@ -240,10 +241,16 @@ const getRowMapByList = (arrs: any[], key: string) => {
|
|
|
})
|
|
|
return nArr
|
|
|
}
|
|
|
-const switchTabHandle = (item, index) => {
|
|
|
- infoList[0]['num'] = item['num1']
|
|
|
- infoList[1]['num'] = item['num2']
|
|
|
- infoList[2]['num'] = item['num3']
|
|
|
+const computedRowMap = (arr, xmbm: string) => {
|
|
|
+ const obj = {}
|
|
|
+ obj['xmbm'] = xmbm
|
|
|
+ obj['num1'] = arr.length
|
|
|
+ obj['num2'] = arr.reduce((a, b) => a + b['periodCheckValue'], 0)
|
|
|
+ obj['num3'] = arr.reduce((a, b) => a + b['periodValue'], 0)
|
|
|
+ obj['data'] = arr
|
|
|
+ return obj
|
|
|
+}
|
|
|
+const switchTabHandle = (index) => {
|
|
|
cTabIndex.value = index
|
|
|
queryParams.value = {
|
|
|
xmmc: '',
|
|
@@ -252,6 +259,11 @@ const switchTabHandle = (item, index) => {
|
|
|
}
|
|
|
searchHandle()
|
|
|
}
|
|
|
+const initInfoData = (item) => {
|
|
|
+ infoList[0]['num'] = item['num1']
|
|
|
+ infoList[1]['num'] = item['num2']
|
|
|
+ infoList[2]['num'] = item['num3']
|
|
|
+}
|
|
|
const searchHandle = async () => {
|
|
|
const result: any = await request.get(
|
|
|
{
|
|
@@ -260,14 +272,12 @@ const searchHandle = async () => {
|
|
|
},
|
|
|
'/business'
|
|
|
)
|
|
|
- if (result && result.length === 0) {
|
|
|
- tabList.value[cTabIndex.value]['data'] = []
|
|
|
- return
|
|
|
- }
|
|
|
+ const xmbm = tabList.value[cTabIndex.value]['xmbm']
|
|
|
const nArr = result.filter((item) => {
|
|
|
- return String(item['xmbm']) == tabList.value[cTabIndex.value]['xmbm']
|
|
|
+ return String(item['xmbm']) == xmbm
|
|
|
})
|
|
|
- tabList.value[cTabIndex.value]['data'] = nArr
|
|
|
+ tabList.value[cTabIndex.value] = computedRowMap(nArr, xmbm)
|
|
|
+ initInfoData(tabList.value[cTabIndex.value])
|
|
|
}
|
|
|
const currentYear = ref<string>('')
|
|
|
const status = ref<number>()
|
|
@@ -292,7 +302,8 @@ const startProjectReportPeriodHandle = async () => {
|
|
|
'/business'
|
|
|
)
|
|
|
if (result) {
|
|
|
- message.success('开启成功!')
|
|
|
+ message.success('结束成功!')
|
|
|
+ getProjectPassByList()
|
|
|
}
|
|
|
}
|
|
|
const archiveProjectReportPeriodHandle = async () => {
|
|
@@ -304,6 +315,7 @@ const archiveProjectReportPeriodHandle = async () => {
|
|
|
)
|
|
|
if (result) {
|
|
|
message.success('开启成功!')
|
|
|
+ getProjectPassByList()
|
|
|
}
|
|
|
}
|
|
|
onMounted(() => {
|