|
@@ -1,41 +1,66 @@
|
|
|
<template>
|
|
|
<div class="evaluationWaring">
|
|
|
<div class="evaluationWaringBtn">
|
|
|
- <div class="collectSeach">
|
|
|
- <div class="exceed">
|
|
|
- <span class="exceedSpan">业务属性:</span>
|
|
|
- <el-select v-model="sectionStr" placeholder="请选择业务属性">
|
|
|
- <el-option
|
|
|
- v-for="item in moduleData"
|
|
|
- :key="item.id"
|
|
|
- :label="item.sectionName"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <div style="display:flex;justify-content: space-between;border-bottom: 1px solid#D6DBEA;">
|
|
|
+ <div class="collectSeach">
|
|
|
+ <div class="exceed">
|
|
|
+ <span class="exceedSpan">业务属性:</span>
|
|
|
+ <el-select v-model="sectionStr" placeholder="请选择业务属性">
|
|
|
+ <el-option
|
|
|
+ v-for="item in moduleData"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.sectionName"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="exceed">
|
|
|
+ <span class="exceedSpan">预警时间:</span>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="warnTime"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
+ @change="changeTime"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
|
|
|
+ </div>
|
|
|
+ <div class="warningExport">
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ icon="Download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ >导出</el-button>
|
|
|
</div>
|
|
|
- <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
|
|
|
- </div>
|
|
|
- <div class="PeriodBtn">
|
|
|
- <btns
|
|
|
- :showImport="false" :showExport="false" :showAdd="true"
|
|
|
- :showSave="false" :showDelete="false"
|
|
|
- :disImport="false" :disExport="false"
|
|
|
- @handleAdd="handleAdd" @handleEdit="handleEdit" @handleDelete="handleDelete"
|
|
|
- ></btns>
|
|
|
</div>
|
|
|
<div class="evaluationWaringTableData">
|
|
|
- <el-table :data="evaluationWaringData" style="width: 100%" @select="rowClick" @select-all="rowClick">
|
|
|
- <el-table-column type="selection" label="操作" align="center"></el-table-column>
|
|
|
- <el-table-column label="序号" type="index" />
|
|
|
- <el-table-column label="单位名称" prop="createOrgName" width="300" />
|
|
|
- <el-table-column label="业务属性" prop="sectionName" />
|
|
|
- <el-table-column label="年度" prop="year" />
|
|
|
- <el-table-column label="党建系数" prop="multiplier">
|
|
|
+ <el-table :data="evaluationWaringData" style="width: 100%">
|
|
|
+ <el-table-column label="序号" type="index" align="center" />
|
|
|
+ <el-table-column label="考评单位" prop="company" width="200" />
|
|
|
+ <el-table-column label="指标类型" prop="title" width="200" />
|
|
|
+ <el-table-column label="预警内容" prop="content" />
|
|
|
+ <el-table-column label="目标值" prop="targetValue" width="100" />
|
|
|
+ <el-table-column label="完成值" prop="completeValue" width="100" />
|
|
|
+ <el-table-column label="预警时间" prop="createTime" />
|
|
|
+ <el-table-column label="确认人" prop="userName" />
|
|
|
+ <el-table-column label="确认时间" prop="confirmTime" />
|
|
|
+ <el-table-column label="状态" width="100">
|
|
|
<template #default="scope">
|
|
|
- <span>{{scope.row.multiplier}}</span>
|
|
|
+ <span class="statusSty"
|
|
|
+ :style="scope.row.isConfirm ? 'background:#61C760':'background:#5093E1'">
|
|
|
+ {{scope.row.isConfirm?'已确认':'未确认'}}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="100">
|
|
|
+ <template #default="scope">
|
|
|
+ <p class="indicitem" @click="confirmFn(scope.row)">确认</p>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="备注" prop="remarks" width="350" />
|
|
|
</el-table>
|
|
|
<el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
@@ -46,118 +71,47 @@
|
|
|
:total="page.total">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
- <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
|
|
|
- <div class="periodFrom">
|
|
|
- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
|
|
|
- <el-form-item label="单位名称" prop="organizationName">
|
|
|
- <el-select v-model="ruleForm.organizationName" placeholder="请选择单位名称">
|
|
|
- <el-option
|
|
|
- v-for="item in companyDatas"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="业务属性" prop="sectionName">
|
|
|
- <el-select v-model="ruleForm.sectionName" placeholder="请选择业务属性">
|
|
|
- <el-option
|
|
|
- v-for="item in moduleData"
|
|
|
- :key="item.id"
|
|
|
- :label="item.sectionName"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="年份" prop="year">
|
|
|
- <el-date-picker
|
|
|
- v-model="ruleForm.year"
|
|
|
- type="year"
|
|
|
- value-format="YYYY"
|
|
|
- placeholder="请选择年份"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="党建系数" prop="multiplier">
|
|
|
- <el-input-number v-model="ruleForm.multiplier" :precision="2" :step="0.1" :min="0" :max="1" placeholder="请输入党建系数" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="描述" prop="remarks">
|
|
|
- <el-input v-model="ruleForm.remarks" :rows="5" type="textarea" placeholder="请输入描述"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- <template #footer>
|
|
|
- <span class="dialog-footer">
|
|
|
- <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="saveevaluaStart('ruleForm')">确 定</el-button>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
- <indicator-item ref="indicatorItem"></indicator-item>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import btns from '../elbuttonS.vue'
|
|
|
+import ExcelJS from 'exceljs'
|
|
|
+import fileSave from 'file-saver'
|
|
|
import seachs from '../seachGroup.vue'
|
|
|
-import {apiGetevaluationwarninginfoList, apiDeletepartyBuildRemove,apiGetbinsectionList,
|
|
|
- apiGetorganizationgetTree, apiPostpartybuildSave} from '../../api/api'
|
|
|
+import exportIcon from '../../assets/btnIcon/export.png'
|
|
|
+import {apiGetevaluationwarninginfoList, apiGetbinsectionList, apiGetevaluationwarninginfoSave} from '../../api/api'
|
|
|
export default {
|
|
|
- components: { btns, seachs },
|
|
|
+ components: { seachs },
|
|
|
data() {
|
|
|
return {
|
|
|
- dialogVisible: false,
|
|
|
- title: '',
|
|
|
- isSave: false,
|
|
|
- changeDateSelect: [],
|
|
|
sectionStr: '',
|
|
|
+ warnTime: [],
|
|
|
evaluationWaringData:[],
|
|
|
- departmentDataAll: [],
|
|
|
- companyDatas: [],
|
|
|
moduleData: [],
|
|
|
- ruleForm: {
|
|
|
- organizationName: '',
|
|
|
- sectionName: '',
|
|
|
- year: '',
|
|
|
- multiplier: 0,
|
|
|
- remarks: ''
|
|
|
- },
|
|
|
- rules: {
|
|
|
- organizationName: [
|
|
|
- { required: true, message: '请选择单位名称', trigger: 'change' }
|
|
|
- ],
|
|
|
- sectionName: [
|
|
|
- { required: true, message: '请选择业务属性', trigger: 'change' }
|
|
|
- ],
|
|
|
- year: [
|
|
|
- { required: true, message: '请选择年份', trigger: 'change' }
|
|
|
- ],
|
|
|
- multiplier: [
|
|
|
- { required: true, message: '请输入党建系数', trigger: 'blur' }
|
|
|
- ],
|
|
|
- remarks: [
|
|
|
- { required: true, message: '请输入描述', trigger: 'blur' }
|
|
|
- ]
|
|
|
- },
|
|
|
+ exportIcon: exportIcon,
|
|
|
page:{
|
|
|
- pagesize: 12,
|
|
|
+ pagesize: 15,
|
|
|
currentPage: 1,
|
|
|
total: 0
|
|
|
- },
|
|
|
- evalradio: {}
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.getevaluationWaringData()
|
|
|
- this.getOrganizetionData()
|
|
|
this.getBinSectionS()
|
|
|
},
|
|
|
methods:{
|
|
|
getevaluationWaringData() {
|
|
|
let that = this
|
|
|
+ let st = that.warnTime.length>0?that.warnTime[0]:''
|
|
|
+ let et = that.warnTime.length>0?that.warnTime[1]:''
|
|
|
let params = {
|
|
|
pageNum: that.page.currentPage,
|
|
|
- pageSize: that.page.pagesize
|
|
|
+ pageSize: that.page.pagesize,
|
|
|
+ binStation: that.sectionStr,
|
|
|
+ st: st,
|
|
|
+ et: et
|
|
|
}
|
|
|
apiGetevaluationwarninginfoList(params).then(datas =>{
|
|
|
if (datas && datas.data) {
|
|
@@ -175,126 +129,17 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- //查询组织数据
|
|
|
- getOrganizetionData() {
|
|
|
+ confirmFn(row) {
|
|
|
let that = this
|
|
|
- let params = {
|
|
|
- id: '23031000',
|
|
|
- num: 1
|
|
|
- }
|
|
|
- apiGetorganizationgetTree(params).then(datas =>{
|
|
|
- if (datas && datas.data && datas.data[0].children.length>0) {
|
|
|
- that.companyDatas = datas.data[0].children
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- handleAdd() {
|
|
|
- this.dialogVisible = true
|
|
|
- this.isSave = false
|
|
|
- this.title = '新增党建考核系数'
|
|
|
- this.ruleForm = {
|
|
|
- organizationName: '',
|
|
|
- sectionName: '',
|
|
|
- year: '',
|
|
|
- multiplier: 0,
|
|
|
- remarks: ''
|
|
|
- }
|
|
|
- },
|
|
|
- handleEdit() {
|
|
|
- this.dialogVisible = true
|
|
|
- this.isSave = true
|
|
|
- this.title = '修改党建考核系数'
|
|
|
- this.evalradio = this.changeDateSelect[0]
|
|
|
- this.ruleForm = {
|
|
|
- organizationName: this.evalradio.departId,
|
|
|
- sectionName: this.evalradio.sectionId,
|
|
|
- year: this.evalradio.year,
|
|
|
- multiplier: this.evalradio.multiplier,
|
|
|
- remarks: this.evalradio.remarks
|
|
|
- }
|
|
|
- },
|
|
|
- saveevaluaStart(formName) {
|
|
|
- let that = this
|
|
|
- that.$refs[formName].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- that.saveAndEditpartBuildData()
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- saveAndEditpartBuildData() {
|
|
|
- let that = this
|
|
|
- let userMes = JSON.parse(window.sessionStorage.getItem('user'))
|
|
|
- let comName = ''
|
|
|
- that.companyDatas.forEach(item =>{
|
|
|
- if (item.id === that.ruleForm.organizationName) {
|
|
|
- comName = item.name
|
|
|
- }
|
|
|
- })
|
|
|
- let params = {
|
|
|
- departId: that.ruleForm.organizationName,
|
|
|
- organizationName: comName,
|
|
|
- sectionId: that.ruleForm.sectionName,
|
|
|
- year: that.ruleForm.year,
|
|
|
- multiplier: that.ruleForm.multiplier,
|
|
|
- remarks: that.ruleForm.remarks,
|
|
|
- createOrgId: userMes.unitId,
|
|
|
- createOrgName: userMes.unitName,
|
|
|
- createBy: userMes.id,
|
|
|
- createName: userMes.name
|
|
|
- }
|
|
|
- if (that.isSave) {
|
|
|
- params.id = that.evalradio.id
|
|
|
- }
|
|
|
- apiPostpartybuildSave(params).then(datas =>{
|
|
|
- if (!datas.success) {
|
|
|
- that.$message({
|
|
|
- message: datas.message,
|
|
|
- type: 'error'
|
|
|
- });
|
|
|
- } else {
|
|
|
- if (!that.isSave) {
|
|
|
- that.$message({
|
|
|
- message: '党建考核系数新增成功',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- } else {
|
|
|
- that.$message({
|
|
|
- message: '党建考核系数修改成功',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- }
|
|
|
- that.dialogVisible = false
|
|
|
- that.changeDateSelect = []
|
|
|
+ row.isConfirm = true
|
|
|
+ apiGetevaluationwarninginfoSave(row).then(datas =>{
|
|
|
+ if (datas) {
|
|
|
that.getevaluationWaringData()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- //删除指标数据
|
|
|
- handleDelete() {
|
|
|
- this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let that = this
|
|
|
- let paramsArr = []
|
|
|
- that.changeDateSelect.forEach(it =>{
|
|
|
- paramsArr.push(it.id)
|
|
|
- })
|
|
|
- apiDeletepartyBuildRemove(paramsArr.join(',')).then(datas =>{
|
|
|
- if (datas) {
|
|
|
- that.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
- });
|
|
|
- that.changeDateSelect = []
|
|
|
- that.getevaluationWaringData()
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- rowClick(selection, row) {
|
|
|
- this.changeDateSelect = selection
|
|
|
+ changeTime(val) {
|
|
|
+ console.log(val)
|
|
|
},
|
|
|
getSeachData() {
|
|
|
this.page.currentPage = 1
|
|
@@ -312,7 +157,54 @@ export default {
|
|
|
handleCurrentChange(val){
|
|
|
this.page.currentPage =val
|
|
|
this.getevaluationWaringData()
|
|
|
- }
|
|
|
+ },
|
|
|
+ handleExport() {
|
|
|
+ let that = this
|
|
|
+ let st = that.warnTime.length>0?that.warnTime[0]:''
|
|
|
+ let et = that.warnTime.length>0?that.warnTime[1]:''
|
|
|
+ let params = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10000,
|
|
|
+ binStation: that.sectionStr,
|
|
|
+ st: st,
|
|
|
+ et: et
|
|
|
+ }
|
|
|
+ apiGetevaluationwarninginfoList(params).then(datas =>{
|
|
|
+ if (datas && datas.data) {
|
|
|
+ that.getExportWarData(datas.data.records)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getExportWarData(datas) {
|
|
|
+ let data = datas //接口返回数据
|
|
|
+ const workbook = new ExcelJS.Workbook()
|
|
|
+ const worksheet = workbook.addWorksheet('Sheet1')
|
|
|
+ //根据数据自己调整
|
|
|
+ let colums = []
|
|
|
+ colums = [
|
|
|
+ { header: 'ID', key: 'id', width: 26 },
|
|
|
+ { header: '考评单位', key: 'company', width: 26 },
|
|
|
+ { header: '指标类型', key: 'title', width: 26 },
|
|
|
+ { header: '预警内容', key: 'content', width: 26 },
|
|
|
+ { header: '目标值', key: 'targetValue', width: 26 },
|
|
|
+ { header: '完成值', key: 'completeValue', width: 26 },
|
|
|
+ { header: '预警时间', key: 'createTime', width: 26 },
|
|
|
+ { header: '确认人', key: 'userName', width: 26 },
|
|
|
+ { header: '确认时间', key: 'confirmTime', width: 26 }
|
|
|
+ ]
|
|
|
+ worksheet.columns = colums
|
|
|
+ worksheet.getRow(1).font = {
|
|
|
+ size: 12,
|
|
|
+ bold: true
|
|
|
+ }
|
|
|
+ worksheet.addRows(data)
|
|
|
+
|
|
|
+ workbook.xlsx.writeBuffer().then(buffer => {
|
|
|
+ //这里为type
|
|
|
+ const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' })
|
|
|
+ fileSave(blob, `考评预警数据导出.xlsx`)
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -323,7 +215,6 @@ export default {
|
|
|
.collectSeach{
|
|
|
display: flex;
|
|
|
padding: 24px 20px;
|
|
|
- border-bottom: 1px solid#D6DBEA;
|
|
|
.exceed{
|
|
|
display: flex;
|
|
|
.exceedSpan{
|
|
@@ -336,22 +227,11 @@ export default {
|
|
|
line-height: 12px;
|
|
|
margin-top: 14px;
|
|
|
}
|
|
|
- .el-input{
|
|
|
- margin-right:10px;
|
|
|
- .el-input__inner{
|
|
|
- height:30px;
|
|
|
- }
|
|
|
- .el-input__suffix{
|
|
|
- .el-select__caret{
|
|
|
- line-height:30px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
.el-select{
|
|
|
margin-right:10px;
|
|
|
.el-input__inner{
|
|
|
- height:30px;
|
|
|
+ height:40px;
|
|
|
}
|
|
|
.el-input__suffix{
|
|
|
.el-select__caret{
|
|
@@ -359,6 +239,16 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .el-date-editor{
|
|
|
+ height: 40px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .warningExport{
|
|
|
+ .el-button{
|
|
|
+ position: relative;
|
|
|
+ top: 24px;
|
|
|
+ right: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
span{
|
|
|
font-size:14px;
|
|
@@ -378,9 +268,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.evaluationWaringTableData{
|
|
|
+ margin-top: 20px;
|
|
|
.el-table{
|
|
|
.el-table__body-wrapper{
|
|
|
- height: 60vh !important;
|
|
|
+ height: 65vh !important;
|
|
|
}
|
|
|
.el-input__inner{
|
|
|
height: 30px !important;
|
|
@@ -388,7 +279,15 @@ export default {
|
|
|
.el-radio__label{
|
|
|
display: none;
|
|
|
}
|
|
|
-
|
|
|
+ .statusSty{
|
|
|
+ width: 52px;
|
|
|
+ height: 21px;
|
|
|
+ line-height: 21px;
|
|
|
+ display: inline-block;
|
|
|
+ border-radius: 3px;
|
|
|
+ color: #fff;
|
|
|
+ padding: 0 0 0 10px;
|
|
|
+ }
|
|
|
.indicitem{
|
|
|
color: #409EFF;
|
|
|
font-size: 12px;
|