|
@@ -0,0 +1,343 @@
|
|
|
+<template>
|
|
|
+ <div class="baseIndicatorType">
|
|
|
+ <div class="baseIndicatorTypeBtn">
|
|
|
+ <div class="collectSeach" :style="$utils.collectSeachSty()">
|
|
|
+ <div class="exceed">
|
|
|
+ <span class="exceedSpan">指标分类:</span>
|
|
|
+ <el-input v-model="typeNameS" placeholder="请输入指标分类"></el-input>
|
|
|
+ </div>
|
|
|
+ <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
|
|
|
+ </div>
|
|
|
+ <div class="PeriodBtn" :style="$utils.PeriodBtnSty()">
|
|
|
+ <btns
|
|
|
+ :showImport="false"
|
|
|
+ :showExport="false"
|
|
|
+ :showAdd="true"
|
|
|
+ :showSave="true"
|
|
|
+ :showDelete="true"
|
|
|
+ :disSave="changeDateSelect.length === 0 || changeDateSelect.length>1"
|
|
|
+ :disDelete="changeDateSelect.length === 0"
|
|
|
+ @handleAdd="handleAdd"
|
|
|
+ @handleEdit="handleEdit"
|
|
|
+ @handleDelete="handleDelete"
|
|
|
+ ></btns>
|
|
|
+ </div>
|
|
|
+ <div class="baseIndicatorTypeTableData">
|
|
|
+ <el-table :data="baseIndicatorTypeData" style="width: 100%" @select="rowClick" @select-all="rowClick">
|
|
|
+ <el-table-column type="selection" label="操作" align="center" />
|
|
|
+ <el-table-column label="指标名称" prop="typeName" />
|
|
|
+ <el-table-column label="指标编码" prop="typeCode" />
|
|
|
+ <el-table-column label="排序" prop="orderNum" />
|
|
|
+ <el-table-column label="类型" prop="type" />
|
|
|
+ </el-table>
|
|
|
+ </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="typeName">
|
|
|
+ <el-input v-model="ruleForm.typeName" placeholder="请输入指标名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="指标编码" prop="typeCode">
|
|
|
+ <el-input v-model="ruleForm.typeCode" placeholder="请输入指标编码" :disabled="isSave"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="排序">
|
|
|
+ <el-input-number v-model="ruleForm.orderNum" min="1" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="类型" prop="type">
|
|
|
+ <el-input v-model="ruleForm.type" 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="savebaseIndicatorTypeMsg('ruleForm')">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import btns from '../elbuttonS.vue'
|
|
|
+import seachs from '../seachGroup.vue'
|
|
|
+import addW from '../../assets/btnIcon/addW.png'
|
|
|
+import addIcon from '../../assets/btnIcon/add.png'
|
|
|
+import {apiGetBaseIndicatorTypeList, apiPostBaseIndicatorTypeSave, apiPostBaseIndicatorTypeRemove} from '../../api/api'
|
|
|
+export default {
|
|
|
+ components: { btns, seachs },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ dialogVisible: false,
|
|
|
+ title: '',
|
|
|
+ isSave: false,
|
|
|
+ changeDateSelect: [],
|
|
|
+ typeNameS: '',
|
|
|
+ baseIndicatorTypeData:[],
|
|
|
+ addW: addW,
|
|
|
+ addIcon: addIcon,
|
|
|
+ ruleForm: {
|
|
|
+ typeName: '',
|
|
|
+ typeCode: '',
|
|
|
+ orderNum: 1,
|
|
|
+ type: ''
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ typeName: [
|
|
|
+ { required: true, message: '请输入指标名称', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ typeCode: [
|
|
|
+ { required: true, message: '请输入指标编码', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ type: [
|
|
|
+ { required: true, message: '请输入类型', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ evalradio: {},
|
|
|
+ winPix: window.devicePixelRatio,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getIndicatorTypeData()
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ // 查询列表数据
|
|
|
+ getIndicatorTypeData() {
|
|
|
+ let that = this
|
|
|
+ let params = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 500,
|
|
|
+ typeName: that.typeNameS
|
|
|
+ }
|
|
|
+ apiGetBaseIndicatorTypeList(params).then(datas =>{
|
|
|
+ if (datas && datas.data) {
|
|
|
+ that.baseIndicatorTypeData = datas.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleAdd() {
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.isSave = false
|
|
|
+ this.title = '新增指标分类'
|
|
|
+ this.$nextTick(() =>{
|
|
|
+ this.ruleForm = {
|
|
|
+ typeName: '',
|
|
|
+ typeCode: '',
|
|
|
+ orderNum: 1,
|
|
|
+ type: ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleEdit() {
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.isSave = true
|
|
|
+ this.title = '修改指标分类'
|
|
|
+ this.evalradio = this.changeDateSelect[0]
|
|
|
+ this.ruleForm = {
|
|
|
+ typeName: this.evalradio.typeName,
|
|
|
+ typeCode: this.evalradio.typeCode,
|
|
|
+ orderNum: this.evalradio.orderNum,
|
|
|
+ type: this.evalradio.type
|
|
|
+ }
|
|
|
+ },
|
|
|
+ savebaseIndicatorTypeMsg(formName) {
|
|
|
+ let that = this
|
|
|
+ that.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ that.saveAndEditIndicatorData()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //新增/修改指标数据
|
|
|
+ saveAndEditIndicatorData() {
|
|
|
+ let that = this
|
|
|
+ let params = {
|
|
|
+ typeName: that.ruleForm.typeName,
|
|
|
+ typeCode: that.ruleForm.typeCode,
|
|
|
+ orderNum: that.ruleForm.orderNum,
|
|
|
+ type: that.ruleForm.type
|
|
|
+ }
|
|
|
+ if (that.isSave) {
|
|
|
+ params.id = that.evalradio.id
|
|
|
+ }
|
|
|
+ apiPostBaseIndicatorTypeSave(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 = []
|
|
|
+ that.getIndicatorTypeData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //删除部门数据
|
|
|
+ handleDelete() {
|
|
|
+ this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ let that = this
|
|
|
+ let paramsArr = []
|
|
|
+ that.changeDateSelect.forEach(it =>{
|
|
|
+ paramsArr.push(it.id)
|
|
|
+ })
|
|
|
+ apiPostBaseIndicatorTypeRemove(paramsArr.join(',')).then(datas =>{
|
|
|
+ if (datas) {
|
|
|
+ that.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ });
|
|
|
+ that.changeDateSelect = []
|
|
|
+ that.getIndicatorTypeData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ rowClick(selection, row) {
|
|
|
+ this.changeDateSelect = selection
|
|
|
+ },
|
|
|
+ getSeachData() {
|
|
|
+ this.getIndicatorTypeData()
|
|
|
+ },
|
|
|
+ resetSeach() {
|
|
|
+ this.typeNameS = ''
|
|
|
+ this.getIndicatorTypeData()
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less">
|
|
|
+.baseIndicatorType{
|
|
|
+ .baseIndicatorTypeBtn{
|
|
|
+ .collectSeach{
|
|
|
+ display: flex;
|
|
|
+ padding: 24px 20px;
|
|
|
+ border-bottom: 1px solid#D6DBEA;
|
|
|
+ .exceed{
|
|
|
+ display: flex;
|
|
|
+ .exceedSpan{
|
|
|
+ width: 100px;
|
|
|
+ height: 12px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: Microsoft YaHei;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #8991B0;
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ .el-input__suffix{
|
|
|
+ .el-select__caret{
|
|
|
+ line-height:30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ span{
|
|
|
+ font-size:14px;
|
|
|
+ }
|
|
|
+ .PeriodBtn{
|
|
|
+ display: flex;
|
|
|
+ justify-content: end;
|
|
|
+ padding: 20px 0;
|
|
|
+ }
|
|
|
+ .el-button{
|
|
|
+ height: 30px;
|
|
|
+ // width:100px;
|
|
|
+ padding: 0 30px ;
|
|
|
+ // padding-top: 8px;
|
|
|
+ span{
|
|
|
+ margin:0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .el-overlay{
|
|
|
+ .el-dialog{
|
|
|
+ margin-top: 10vh;
|
|
|
+ .el-dialog__body{
|
|
|
+ padding: 30px 60px 30px 20px !important;
|
|
|
+ .periodFrom{
|
|
|
+ .el-select, .el-input{
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .el-input{
|
|
|
+ height: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .el-dialog__footer{
|
|
|
+ .dialog-footer{
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ .el-button{
|
|
|
+ width: 180px !important;
|
|
|
+ height: 40px !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .baseIndicatorTypeTableData{
|
|
|
+ .el-table{
|
|
|
+ .el-table__body-wrapper{
|
|
|
+ height: 60vh !important;
|
|
|
+ }
|
|
|
+ .el-input__inner{
|
|
|
+ height: 30px !important;
|
|
|
+ }
|
|
|
+ .el-radio__label{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .indicitem{
|
|
|
+ color: #409EFF;
|
|
|
+ font-size: 12px;
|
|
|
+ margin-right: 20px;
|
|
|
+ cursor:pointer;
|
|
|
+ &:hover{
|
|
|
+ text-decoration: underline;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .el-pagination{
|
|
|
+ margin-top: 20px;
|
|
|
+ text-align: end;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+</style>
|