| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="权值" prop="weight"> |
| | | <el-input-number v-model="form.weight" placeholder="请输入权值" |
| | | style="width: 100%;"></el-input-number> |
| | | <el-input v-model="form.weight" :placeholder="`请输入权值(输入的权值大于等于${weightRange})`" style="width: 100%;"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | }, |
| | | }) |
| | | |
| | | |
| | | const emits = defineEmits(['refresh']) |
| | | |
| | | const formRef = ref(null) |
| | |
| | | deptId: '', |
| | | deptName: '', |
| | | postName: '', |
| | | weight: 0, |
| | | rangeVal: 0 |
| | | weight: '' |
| | | }) |
| | | |
| | | |
| | | |
| | | const weightRange = ref(0) |
| | | |
| | | const weightValidator = (rule, value, callback) => { |
| | | console.log(value); |
| | | if (value === '') { |
| | | callback(new Error('请输入权值')) |
| | | } else { |
| | | if (value > weightRange.value) { |
| | | callback(new Error('输入的权值不可超过' + weightRange.value)) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | |
| | | const rules = markRaw({ |
| | | userId: [ |
| | |
| | | weight: [ |
| | | { |
| | | required: true, |
| | | message: '请输入权值', |
| | | validator: weightValidator, |
| | | trigger: 'click', |
| | | }, |
| | | // { |
| | | // min: 0, |
| | | // max: weightRange.value, |
| | | // message: `请输入大于或等于${weightRange.value}的权值`, |
| | | // } |
| | | } |
| | | ] |
| | | }) |
| | | |
| | | // const weightRange = ref(0) |
| | | |
| | | const requestParams = reactive({ |
| | | assessmentSetId: '', |
| | |
| | | if (!val) return |
| | | const { id } = props.dialogParams.taskParams |
| | | requestParams.assessmentSetId = id |
| | | // console.log(props.dialogParams); |
| | | // weightRange.value = props.dialogParams.weightRange |
| | | console.log(props.dialogParams.weightRange); |
| | | weightRange.value = props.dialogParams.weightRange |
| | | }, { |
| | | deep: true |
| | | }) |
| | |
| | | </el-button> |
| | | </template> |
| | | <template #menu="{ size, row, index }"> |
| | | <el-button type="primary" size="small" @click="handleWeight(row)"> |
| | | <el-button type="primary" text icon="el-icon-plus" @click="handleWeight(row)"> |
| | | 添加考核人 |
| | | </el-button> |
| | | <el-button type="danger" text icon="el-icon-delete" @click="rowDel(row)"> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | <template #assessmentPerson="{ row }"> |
| | |
| | | import assessmentWeight from './assessmentWeight.vue' |
| | | import addAssessor from './addAssessor.vue'; |
| | | import popoverTable from '@/views/assessment/components/popoverTable.vue' |
| | | import { getList } from '@/api/assessment/assessmentSet.js' |
| | | import { getList, remove } from '@/api/assessment/assessmentSet.js' |
| | | import { getLazyList } from '@/api/system/dept'; |
| | | import _ from 'lodash' |
| | | |
| | |
| | | taskParams: this.params |
| | | } |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | searchChange(params, done) { |
| | | if (!this.defaultTaskType) { |
| | | params.deptId = params.deptName || '' |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | const { |
| | | } = this.query; |
| | | // console.log({ |
| | | // ...this.query, |
| | | // ...params |
| | | // }); |
| | | let values = { |
| | | ...this.query, |
| | | ...params, |
| | | userType: 2 |
| | | // ...this.query, |
| | | // ...params, |
| | | // // userType: 2, |
| | | |
| | | }; |
| | | this.data = [] |
| | | const { id } = this.params |
| | | getList(page.currentPage, page.pageSize, { assessmentTaskId: id }).then(res => { |
| | | getList(page.currentPage, page.pageSize, {assessmentTaskId: id}).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | |
| | | this.dialogParams = { |
| | | visible: true, |
| | | isDept: false, |
| | | taskParams: this.params |
| | | taskParams: this.params, |
| | | weightRange: this.weightRange |
| | | } |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | (this.params.isDept ? updateDept(row) : update(row)).then(() => { |
| | | updateAssessor(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | this.form = res.data.data; |
| | | }); |
| | | if (type === "edit") { |
| | | |
| | | this.weightRange += this.form.weight |
| | | this.defaults.weight.placeholder = `请输入权重(输入的权值大于等于${this.weightRange})` |
| | | } |
| | | } |
| | | done(); |