|
@@ -56,11 +56,17 @@
|
|
|
</el-tag>
|
|
|
</div>
|
|
|
<div class="headerRight">
|
|
|
- <div class="tableBtn add" @click="addTableDetail" v-if="activeName === 'ZDZX' || activeName === 'GLSX'">
|
|
|
+ <div class="tableBtn add" @click="addTableDetail"
|
|
|
+ v-if="(activeName === 'ZDZX' || activeName === 'GLSX') && indicatorList.length > 0">
|
|
|
<img :src="addIcon" alt="">
|
|
|
<span>新增</span>
|
|
|
</div>
|
|
|
- <div class="tableBtn save" @click="saveDetail">
|
|
|
+ <div class="tableBtn save" @click="saveAddDetail"
|
|
|
+ v-if="(activeName === 'ZDZX' || activeName === 'GLSX') && indicatorList.length > 0">
|
|
|
+ <img :src="saveIcon" alt="">
|
|
|
+ <span>保存</span>
|
|
|
+ </div>
|
|
|
+ <div class="tableBtn save" @click="saveDetail" v-else>
|
|
|
<img :src="saveIcon" alt="">
|
|
|
<span>保存</span>
|
|
|
</div>
|
|
@@ -80,12 +86,8 @@
|
|
|
<el-table-column v-for="(it, index) in monthQuarterYearHeader" :key="index" :label="it.name" align="center">
|
|
|
<el-table-column v-for="(iv, index) in it.children" :key="index" :label="iv.key" align="center">
|
|
|
<template #default="scope">
|
|
|
- <!-- <span
|
|
|
- style="font-weight: bold"
|
|
|
- :style="scope.row[iv.code+'_flag'] === '1'?'color:#3B7AD1': scope.row[iv.code+'_flag'] === '-1'?'color:#F65177':'color:#666666'">
|
|
|
- {{scope.row[iv.code]}}
|
|
|
- </span> -->
|
|
|
- <el-input-number v-model="scope.row[iv.code]" :min="0" />
|
|
|
+ <el-input v-model="scope.row[iv.code]" v-if="!scope.row['IS_LH_'+iv.code]"></el-input>
|
|
|
+ <el-input-number v-model="scope.row[iv.code]" v-else />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table-column>
|
|
@@ -115,7 +117,7 @@
|
|
|
<script>
|
|
|
import importDailog from '../importPage/importDailog.vue'
|
|
|
import {apiGetEvaluationIndicatorList,apiGetgetEvaluationInfoDataList,apiGetbinsectionList, apiGetbinstageList,
|
|
|
-apiPostorganizationUpdateEvaluationInfo} from '../../api/api'
|
|
|
+apiPostorganizationUpdateEvaluationInfo, apiPostorganizationUpdateAddEvaluationInfo} from '../../api/api'
|
|
|
import * as XLSX from 'xlsx'
|
|
|
import { saveAs } from 'file-saver'
|
|
|
import * as XLSXD from 'xlsx-js-style'
|
|
@@ -170,6 +172,8 @@ export default {
|
|
|
saveIcon: saveIcon,
|
|
|
exportIcon: exportIcon,
|
|
|
importIcon: importIcon,
|
|
|
+ addstageId: '',
|
|
|
+ userMes: {}
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -187,6 +191,8 @@ export default {
|
|
|
year: row.year,
|
|
|
recStage: '有效'
|
|
|
}
|
|
|
+
|
|
|
+ this.userMes = JSON.parse(window.sessionStorage.getItem('user'))
|
|
|
this.getModelData(type)
|
|
|
this.rowMsg = row
|
|
|
},
|
|
@@ -265,8 +271,9 @@ export default {
|
|
|
//获取指标数据
|
|
|
getTableHeaderData(id) {
|
|
|
let that = this
|
|
|
- this.monthQuarterYearHeader = []
|
|
|
- this.monthQuarterYearData = []
|
|
|
+ that.monthQuarterYearHeader = []
|
|
|
+ that.monthQuarterYearData = []
|
|
|
+ that.isClickTagId = ''
|
|
|
let params = {
|
|
|
organizationEvaluationId: that.rowMsg.id,
|
|
|
binSection: that.binSectionStr,
|
|
@@ -337,10 +344,98 @@ export default {
|
|
|
})
|
|
|
this.getTableHeaderData(stageId)
|
|
|
},
|
|
|
+ addTableDetail() {
|
|
|
+ console.log('表头数据11====>>>>>>>', this.monthQuarterYearHeader)
|
|
|
+ if (this.monthQuarterYearHeader.length>0) {
|
|
|
+ let headerArr = []
|
|
|
+ this.monthQuarterYearHeader.forEach(item =>{
|
|
|
+ headerArr = headerArr.concat(item.children)
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log('表头数据22====>>>>>>>', headerArr)
|
|
|
+ this.addstageId = ''
|
|
|
+ this.stageData.forEach(it =>{
|
|
|
+ if (it.stageCode === this.activeName) {
|
|
|
+ this.addstageId = it.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ let obj = {
|
|
|
+ isAdd: true,
|
|
|
+
|
|
|
+ }
|
|
|
+ headerArr.forEach(it =>{
|
|
|
+ obj[it.code] = ''
|
|
|
+ obj['IS_LH_'+it.code] = it.flag
|
|
|
+ })
|
|
|
+ this.monthQuarterYearData.unshift(obj)
|
|
|
+ }
|
|
|
+ console.log('表格数据====>>>>>>>', this.monthQuarterYearData)
|
|
|
+ },
|
|
|
+ saveAddDetail() {
|
|
|
+ let that = this
|
|
|
+ let addParams = []
|
|
|
+ let saveParams = []
|
|
|
+ let addObj = {
|
|
|
+ organizationId: that.userMes.unitId,
|
|
|
+ // organizationId: "23079300",
|
|
|
+ organizationEvaluationId: that.rowMsg.id,
|
|
|
+ indicatorId: that.isClickTagId,
|
|
|
+ binSection: that.binSectionStr,
|
|
|
+ binStage: that.addstageId,
|
|
|
+ optionMap: {}
|
|
|
+ }
|
|
|
+ that.monthQuarterYearData.forEach(it =>{
|
|
|
+ if (it.isAdd) {
|
|
|
+ addObj.optionMap = it
|
|
|
+ addParams.push(addObj)
|
|
|
+ } else {
|
|
|
+ saveParams.push(it)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ apiPostorganizationUpdateAddEvaluationInfo(addParams).then(datas =>{
|
|
|
+ if (datas) {
|
|
|
+ that.responseData(datas)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (saveParams.length > 0) {
|
|
|
+ apiPostorganizationUpdateEvaluationInfo(saveParams).then(datas =>{
|
|
|
+ if (datas) {
|
|
|
+ that.responseData(datas)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 返回数据
|
|
|
+ responseData(datas) {
|
|
|
+ if (datas.message === '成功') {
|
|
|
+ this.$message({
|
|
|
+ message: '考评详情信息保存成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: datas.message,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.getTableData(this.isClickTagId)
|
|
|
+ },
|
|
|
saveDetail() {
|
|
|
let that = this
|
|
|
apiPostorganizationUpdateEvaluationInfo(that.monthQuarterYearData).then(datas =>{
|
|
|
if (datas) {
|
|
|
+ if (datas.message === '成功') {
|
|
|
+ that.$message({
|
|
|
+ message: '考评详情信息保存成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.$message({
|
|
|
+ message: datas.message,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
that.getTableData(that.isClickTagId)
|
|
|
}
|
|
|
})
|
|
@@ -348,7 +443,7 @@ export default {
|
|
|
handleImport() {
|
|
|
this.$refs.importPage.upload.title = "考评详情信息导入"
|
|
|
this.$refs.importPage.upload.open = true
|
|
|
- this.$refs.importPage.upload.url = '/organization-evaluation-info/import'
|
|
|
+ this.$refs.importPage.upload.url = '/organization-evaluation-info/import-excel'
|
|
|
},
|
|
|
successImport(val) {
|
|
|
that.getTableData(that.isClickTagId)
|