copy from src/views/system/check-template/index.vue
copy to src/views/system/template/index.vue
File was copied from src/views/system/check-template/index.vue |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="状态" prop="status"> |
| | | <!-- <el-form-item label="状态" prop="status"> |
| | | <el-input |
| | | v-model="queryParams.status" |
| | | placeholder="请输入状态" |
| | |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item label="考核类型" prop="examineCategory"> |
| | | <el-select v-model="queryParams.status" placeholder="考核类型" clearable @keyup.enter.native="handleQuery"> |
| | | <el-option |
| | | v-for="dict in dict.type.platform_examine_category" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="parseInt(dict.value)" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| | |
| | | @click="handleAdd" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <!-- <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | >删除</el-button> |
| | | </el-col> |
| | | </el-col> --> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="checkTemplateList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="模板名称" align="center" prop="templateName" width="220px"/> |
| | | <el-table-column label="考核类型" align="center" prop="examineCategory" /> |
| | | <el-table-column label="考核对象" align="center" prop="unitId" width="400px" > |
| | | <template slot-scope="scope"> |
| | | <div v-if="scope.row.unitId === 2">成都x运维</div> |
| | | <div v-else-if="scope.row.unitId === 3">富顺县,荣县,高新区,自流井区,贡井区,大安区,沿滩区</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="调整系数" align="center" prop="adjustCoefficient" /> |
| | | <el-table-column label="调整系数计算方式" align="center" prop="adjustWay"/> |
| | | <el-table-column label="状态" align="center" prop="status" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | >修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-card class="box-card" v-for="item in checkTemplateList" :key="item"> |
| | | <div class="text item">模板名称:{{ item.templateName }}</div> |
| | | <div class="text item">考核类型:{{ item.examineCategory == 0 ? '省厅考核' : '区域考核' }}</div> |
| | | <div class="text item">考核对象:{{ item.deptId }}</div> |
| | | <div class="text item">发布状态:{{ item.status == 0 ? '启用' : '停用' }}</div> |
| | | <div class="bottom clearfix"> |
| | | <el-button type="text" class="button" @click="">审核</el-button> |
| | | <el-button type="text" class="button" @click="">发布</el-button> |
| | | <el-button type="text" class="button" @click="">复制</el-button> |
| | | <el-button type="text" class="button" @click="handleUpdate(item)">修改</el-button> |
| | | <el-button type="text" class="button" @click="handleDelete(item)">删除</el-button> |
| | | </div> |
| | | </el-card> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | |
| | | <el-form-item label="模板名称" prop="templateName"> |
| | | <el-input v-model="form.templateName" placeholder="请输入模板名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="考核对象" prop="unitName"> |
| | | <div class="block"> |
| | | <span class="demonstration"></span> |
| | | <el-cascader |
| | | v-model="value" |
| | | :options="options" |
| | | :props = "props" |
| | | @change="handleChange"></el-cascader> |
| | | </div> |
| | | |
| | | <el-form-item label="考核类型" prop="examineCategory"> |
| | | <el-select v-model="form.examineCategory" placeholder="考核类型"> |
| | | <el-option |
| | | v-for="dict in dict.type.platform_examine_category" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="parseInt(dict.value)" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="考核对象" prop="deptId"> |
| | | <el-select v-model="form.deptId" multiple placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in areaList" |
| | | :key="item.id" |
| | | :label="item.value" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="考核规则" prop="tempRuleFormList"> |
| | | <div class="row-warp"> |
| | |
| | | |
| | | <script> |
| | | import { listCheckTemplate, getCheckTemplate, delCheckTemplate, addCheckTemplate, updateCheckTemplate } from "@/api/platform/check-template"; |
| | | import { ruleSelect } from '../../../api/platform/check-rule' |
| | | import { unitSelect } from '../../../api/platform/unit' |
| | | // import { ruleSelect } from '@/api/platform/check-rule' |
| | | import { areaSelect } from '@/api/system/dept' |
| | | |
| | | export default { |
| | | name: "CheckTemplate", |
| | | dicts: ['platform_audit_state','platform_examine_category','platform_rule_category'], |
| | | data() { |
| | | return { |
| | | props: { multiple: true }, |
| | | value: [], |
| | | options: [{ |
| | | value: 'city', |
| | | label: '区县', |
| | | children: [{ |
| | | value: 'fushun', |
| | | label: '富顺县', |
| | | }, { |
| | | value: 'rong', |
| | | label: '荣县', |
| | | },{ |
| | | value: 'gaoxin', |
| | | label: '高新区', |
| | | },{ |
| | | value: 'ziliujing', |
| | | label: '自流井区', |
| | | },{ |
| | | value: 'gongjing', |
| | | label: '贡井区', |
| | | },{ |
| | | value: 'daan', |
| | | label: '大安区', |
| | | },{ |
| | | value: 'yantan', |
| | | label: '沿滩区', |
| | | }, |
| | | ] |
| | | }, { |
| | | value: 'company', |
| | | label: '公司', |
| | | children: [{ |
| | | value: 'yunwei', |
| | | label: '成都x运维', |
| | | }, { |
| | | value: 'yunwei2', |
| | | label: '自贡x运维', |
| | | }, ] |
| | | }, |
| | | ], |
| | | areaList:[], |
| | | ruleList: [], |
| | | unitList: [], |
| | | // 临时规则表单 |
| | |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.areaSelect(); |
| | | this.selectCheckRule(); |
| | | this.selectUnit(); |
| | | if (typeof this.form.deptId === 'string' && this.form.deptId.length > 0) { |
| | | this.form.deptId = this.form.deptId.split(',').map(Number); // 假设deptId的值是以逗号分隔的数字字符串 |
| | | } |
| | | }, |
| | | methods: { |
| | | handleChange(value) { |
| | |
| | | }) |
| | | }, |
| | | // 运维公司下拉数据 |
| | | selectUnit() { |
| | | unitSelect().then(res => { |
| | | this.unitList = res.data; |
| | | areaSelect() { |
| | | areaSelect().then(res => { |
| | | this.areaList = res.data; |
| | | }) |
| | | }, |
| | | /** 查询考核模板列表 */ |
| | |
| | | this.queryParams["end"] = this.daterangeCreateTime[1]; |
| | | } |
| | | listCheckTemplate(this.queryParams).then(response => { |
| | | this.checkTemplateList = response.data; |
| | | this.checkTemplateList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | |
| | | display: flex; |
| | | flex-direction: row; |
| | | } |
| | | .text { |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .item { |
| | | margin-bottom: 18px; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .box-card { |
| | | width: 20%; |
| | | } |
| | | </style> |