| | |
| | | :props="{ expandTrigger: 'hover'}" |
| | | > |
| | | <template slot-scope="{ data }"> |
| | | <el-tooltip class="item" :disabled="data.label.length < 16 && !data.deductCategory" effect="dark" |
| | | :content=" |
| | | data.label.length < 16 ? |
| | | data.deductCategory ? |
| | | data.deductCategory == '分数乘以数量' ? '扣' + data.calcFraction + '分*数量 ' : data.deductCategory == '除以数量后乘以分数' ? '扣' + data.calcFraction + '分/' + data.calcUnit + '小时' : '扣' + data.calcFraction + '分' : |
| | | '' : |
| | | (data.deductCategory ? |
| | | data.label + ' ' + (data.deductCategory == '分数乘以数量' ? '扣' + data.calcFraction + '分*数量 ' : data.deductCategory == '除以数量后乘以分数' ? '扣' + data.calcFraction + '分/' + data.calcUnit + '小时' : '扣' + data.calcFraction + '分') : |
| | | data.label)" |
| | | placement="left"> |
| | | <el-tooltip class="item" :disabled="calculateTooltipDisabled(data)" effect="dark" |
| | | :content="calculateTooltipContent(data)" placement="left"> |
| | | <span>{{ data.label }}</span> |
| | | </el-tooltip> |
| | | </template> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="font-size: 5px"> |
| | | {{ ruleDescription}} |
| | | </div> |
| | | |
| | | </el-form-item> |
| | | <el-form-item label="运维考核扣分" style="width: 30%" prop="score"> |
| | | <el-input v-model="form.score"></el-input> |
| | |
| | | auditingOpen: false, |
| | | auditingForm: {}, |
| | | unitList: [], |
| | | ruleDescription: '', // 添加规则描述字段 |
| | | // 考核模板 |
| | | examineList: [ |
| | | { id: 1, value: "车辆考核" }, |
| | |
| | | this.form.contractId = item.contractId; |
| | | this.form.ruleName = item.ruleName + " / " + item.label; |
| | | this.form.deductCategory = item.deductCategory == '分数乘以数量' ? '扣' + item.calcFraction + '分*数量 ' : item.deductCategory == '除以数量后乘以分数' ? '扣' + item.calcFraction + '分/' + item.calcUnit + '小时' : '扣' + item.calcFraction + '分'; |
| | | this.ruleDescription = this.calculateTooltipContent(item); |
| | | if (item.deductCategory == "扣指定分数") { |
| | | this.needNum = false; |
| | | this.form.score = item.calcFraction; |
| | |
| | | this.download('/contract/score/export', { |
| | | ...this.queryParams |
| | | }, `合同考核积分_${new Date().getTime()}.xlsx`) |
| | | }, |
| | | calculateTooltipDisabled(data) { |
| | | return data.label.length < 16 && !data.deductCategory; |
| | | }, |
| | | calculateTooltipContent(data) { |
| | | let content = ''; |
| | | if (data.label.length < 16) { |
| | | if (data.deductCategory) { |
| | | switch (data.deductCategory) { |
| | | case '分数乘以数量': |
| | | content = '扣' + data.calcFraction + '分*数量 '; |
| | | break; |
| | | case '除以数量后乘以分数': |
| | | content = '扣' + data.calcFraction + '分/' + data.calcUnit + '小时'; |
| | | break; |
| | | default: |
| | | content = '扣' + data.calcFraction + '分'; |
| | | } |
| | | } |
| | | } else { |
| | | if (data.deductCategory) { |
| | | switch (data.deductCategory) { |
| | | case '分数乘以数量': |
| | | content = data.label + ' 扣' + data.calcFraction + '分*数量 '; |
| | | break; |
| | | case '除以数量后乘以分数': |
| | | content = data.label + ' 扣' + data.calcFraction + '分/' + data.calcUnit + '小时'; |
| | | break; |
| | | default: |
| | | content = data.label + ' 扣' + data.calcFraction + '分'; |
| | | } |
| | | } else { |
| | | content = data.label; |
| | | } |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |