| | |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="考核对象" prop="unitName"> |
| | | <el-input |
| | | v-model="queryParams.status" |
| | | placeholder="请输入考核对象" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="创建时间"> |
| | | <el-date-picker |
| | | v-model="daterangeCreateTime" |
| | |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:checkTemplate:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:checkTemplate:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:checkTemplate:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:checkTemplate:export']" |
| | | >导出</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | |
| | | <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" /> |
| | | <el-table-column label="考核对象" align="center" prop="unitName" /> |
| | | <el-table-column label="调整系数" align="center" prop="adjustCoefficient" /> |
| | | <el-table-column label="调整计算方式" align="center" prop="adjustWay" /> |
| | | <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"> |
| | |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:checkTemplate:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:checkTemplate:remove']" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <!-- 添加或修改考核模板对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="模板名称" prop="adjustCoefficient"> |
| | | <el-input v-model="form.tempalteName" placeholder="请输入模板名称" /> |
| | | <el-form-item label="模板名称" prop="templateName"> |
| | | <el-input v-model="form.templateName" placeholder="请输入模板名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="考核规则"> |
| | | <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> |
| | | <el-form-item label="考核规则" prop="tempRuleFormList"> |
| | | <div class="row-warp"> |
| | | <div class="row" v-for="(form) in tempRuleFormList"> |
| | | <div class="row-left"> |
| | |
| | | <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' |
| | | |
| | | export default { |
| | | name: "CheckTemplate", |
| | | 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运维', |
| | | }, ] |
| | | }, |
| | | ], |
| | | ruleList: [], |
| | | unitList: [], |
| | | // 临时规则表单 |
| | | tempRuleForm: {}, |
| | | // 临时规则表单列表 |
| | |
| | | form: {}, |
| | | // 表单校验 |
| | | rules: { |
| | | templateName: [ |
| | | { required: true, message: "模板名称不能为空", trigger: "blur" } |
| | | ], |
| | | adjustCoefficient: [ |
| | | { required: true, message: "调整系数不能为空", trigger: "blur" } |
| | | ], |
| | |
| | | created() { |
| | | this.getList(); |
| | | this.selectCheckRule(); |
| | | this.selectUnit(); |
| | | }, |
| | | methods: { |
| | | handleChange(value) { |
| | | console.log(value); |
| | | }, |
| | | removeRule(form) { |
| | | console.log(form) |
| | | this.ruleFormList = this.ruleFormList.filter(item => item !== form); |
| | | this.tempRuleFormList = this.tempRuleFormList.filter(item => item !== form) |
| | | }, |
| | | nextAdd() { |
| | | if (this.tempRuleFormList.length === 0) { |
| | | this.tempRuleFormList.push({"ruleId": null, "adjustCoefficient": null}) |
| | | } else { |
| | | this.ruleFormList.push(this.tempRuleForm); |
| | | this.tempRuleFormList.push(this.tempRuleForm); |
| | | this.tempRuleForm = {}; |
| | | } |
| | | |
| | | // if (this.tempRuleFormList.length === 0) { |
| | | // this.tempRuleFormList.push({"ruleId": null, "weight": null}) |
| | | // } else { |
| | | // this.ruleFormList.push(this.tempRuleForm); |
| | | // this.tempRuleFormList.push(this.tempRuleForm); |
| | | // this.tempRuleForm = {}; |
| | | // } |
| | | this.tempRuleFormList.push({"ruleId": null, "weight": null}) |
| | | }, |
| | | // 考核规则下拉数据 |
| | | selectCheckRule() { |
| | | ruleSelect().then(res => { |
| | | this.ruleList = res.data; |
| | | }) |
| | | }, |
| | | // 运维公司下拉数据 |
| | | selectUnit() { |
| | | unitSelect().then(res => { |
| | | this.unitList = res.data; |
| | | }) |
| | | }, |
| | | /** 查询考核模板列表 */ |
| | |
| | | const id = row.id || this.ids |
| | | getCheckTemplate(id).then(response => { |
| | | this.form = response.data; |
| | | this.tempRuleFormList = this.form.ruleFormList; |
| | | this.ruleFormList = this.form.ruleFormList; |
| | | this.open = true; |
| | | this.title = "修改考核模板"; |
| | | }); |
| | |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | this.form.ruleFormList = this.tempRuleFormList; |
| | | if (this.form.id != null) { |
| | | updateCheckTemplate(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.tempRuleFormList = []; |
| | | this.form = {}; |
| | | this.getList(); |
| | | }); |
| | | } else { |