master
xy 2 years ago
parent a57321a2f0
commit bd27faa43a

@ -149,27 +149,15 @@ export default {
this.removeHande(file, fileList, row);
},
}}
accept="application/x-rar-compressed,application/zip,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,image/*,application/x-rar-compressed,application/zip,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf"
action={this.action}
file-list={row._fileList}
auto-upload={false}
>
<el-button slot="trigger" size="small" type="primary">
选取文件
</el-button>
<el-button
style="margin-left: 10px"
size="small"
type="success"
on={{
["click"]: (e) =>
this.$refs[`expand-form-upload${$index}`].submit(),
}}
>
开始上传
</el-button>
<div slot="tip" className="el-upload__tip">
支持文件格式.rar .zip .doc .docx .pdf
支持文件格式.rar .zip .doc .docx .xlsx .pdf .png .jpg
<br />
单个文件不能超过2Mb
</div>
@ -313,7 +301,7 @@ export default {
res.data.length > 0 ? this.$integrateData(row._form,res.data[0]) : ''
row._fileList = res.data[0]?.files?.map(i => {
return {
name: i.name,
name: i.original_name,
url: i.url,
response: {
id: i.id

@ -1,7 +1,7 @@
<template>
<div>
<Modal
:width="74"
:width="78"
v-model="isShow"
title="绩效自评表">
@ -30,12 +30,12 @@
<td colspan="2">
</td>
<td colspan="3">
<th colspan="3">
全年预算数
</td>
<td colspan="2">
</th>
<th colspan="2">
实际支出数
</td>
</th>
</tr>
<tr v-for="(item, index) in contractList">
<td colspan="2">
@ -57,16 +57,37 @@
<th style="max-width: 30%;">评价要点及评分规则</th>
<th>实际完成值</th>
<th>得分</th>
<th style="width: 46px;" class="no-export-xlsx">附件</th>
</tr>
<tr v-for="(item, index) in planTargetList" :key="item.id">
<td :rowspan="spanArr[index]" :style="{ 'display': spanArr[index] ? '' : 'none' }">{{ (item.target && item.target.target_type_detail) ? item.target.target_type_detail.name : '' }}</td>
<td :rowspan="spanArr1[index]" :style="{ 'display': spanArr1[index] ? '' : 'none' }">{{ (item.target && item.target.target_type2_detail) ? item.target.target_type2_detail.name : '' }}</td>
<td :rowspan="spanArr[index]" v-if="spanArr[index]" :style="{ 'display': spanArr[index] ? '' : 'none' }">{{ (item.target && item.target.target_type_detail) ? item.target.target_type_detail.name : '' }}</td>
<td :rowspan="spanArr1[index]" v-if="spanArr1[index]" :style="{ 'display': spanArr1[index] ? '' : 'none' }">{{ (item.target && item.target.target_type2_detail) ? item.target.target_type2_detail.name : '' }}</td>
<td>{{ item.target ? item.target.name : '' }}</td>
<td>{{ targetValue(item) }}</td>
<td>{{ item.score }}</td>
<td style="max-width: 300px;">{{ (item.plan_evaluates && item.plan_evaluates.find(j => j.plan_target_id === item.id)) ? item.plan_evaluates.find(j => j.plan_target_id === item.id).evaluation_main : '' }}</td>
<td style="max-width: 300px;">{{ evaluationMain(item) }}</td>
<td>{{ actResultFormat(item) }}</td>
<td>{{ (item.plan_evaluates && item.plan_evaluates.find(j => j.plan_target_id === item.id)) ? item.plan_evaluates.find(j => j.plan_target_id === item.id).socre : '' }}</td>
<td>{{ socre(item) }}</td>
<td class="no-export-xlsx">
<el-popover
placement="bottom-start"
title="附件"
width="220"
trigger="hover">
<el-link slot="reference" type="primary">查看</el-link>
<template>
<div v-if="files(item).length > 0">
<div v-for="(file) in files(item)">
<el-link :href="file.url" target="_blank">{{ file.original_name }}</el-link>
</div>
</div>
<div v-else>
<p style="text-align: center;color: #999;">暂无附件</p>
</div>
</template>
</el-popover>
</td>
</tr>
<tr>
<th colspan="4">合计</th>
@ -141,7 +162,6 @@ export default {
async getBudgetDetail() {
this.detail = await detailBudget({ id: this.planId },true)
console.log('detail',this.detail)
},
async getPlanTarget() {
@ -175,7 +195,6 @@ export default {
}
}
this.planTargetList = list;
console.log('plantarget',this.planTargetList)
},
async getContract () {
@ -185,17 +204,19 @@ export default {
page_size: 1000,
}))?.list?.data
this.contractList = res;
console.log('contract', res)
},
exportExcel () {
let wb = XLSX.utils.table_to_book(this.$refs['detail-achievement-table'])
async exportExcel () {
let tableDom = this.$refs['detail-achievement-table'].cloneNode(true);
tableDom.querySelectorAll(".no-export-xlsx").forEach(item => {
item.parentNode.removeChild(item)
})
let wb = XLSX.utils.table_to_book(tableDom)
let wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'binary' });
// table
const table = this.$refs['detail-achievement-table'];
const rowCount = table.rows.length;
console.log(rowCount,123)
//
const ws = wb.Sheets[wb.SheetNames[0]];
@ -214,7 +235,8 @@ export default {
return buf;
}
saveAs(new Blob([s2ab(wbout)], { type: 'application/octet-stream' }), "绩效自评价表.xlsx")
await saveAs(new Blob([s2ab(wbout)], { type: 'application/octet-stream' }), "绩效自评价表.xlsx")
}
},
computed: {
@ -242,10 +264,24 @@ export default {
},
actResultFormat () {
return function(item) {
return item.plan_evaluates?.find(j => j.plan_target_id === item.id)?.result
}
},
socre () {
return function(item) {
return item.plan_evaluates?.find(j => j.plan_target_id === item.id)?.socre
}
},
evaluationMain () {
return function(item) {
return item.plan_evaluates?.find(j => j.plan_target_id === item.id)?.evaluation_main
}
},
files () {
return function(item) {
return item.plan_evaluates?.find(j => j.plan_target_id === item.id)?.files || []
}
},
targetTotal () {
return this.planTargetList.reduce((pre, cur) => {
@ -296,6 +332,8 @@ thead {
}
th {
word-break: keep-all;
text-align: center;
height: 40px;
}
</style>

@ -114,7 +114,7 @@ export default {
year: new Date().getFullYear().toString(),
type: "",
department: "",
is_auth: 0,
is_auth: 1,
type_pid: "",
},
totalMoney: 0,

@ -172,6 +172,7 @@ export default {
return {
budgetTypes: [],
select: {
is_auth: 1,
name: "",
year: new Date().getFullYear().toString(),
keyword: "",

@ -113,7 +113,7 @@ export default {
year: new Date().getFullYear().toString(),
type: "",
department: "",
is_auth: 0,
is_auth: 1,
type_pid: "",
},
totalMoney: 0,

Loading…
Cancel
Save