| | |
| | | let item = this.$refs['cascader'].getCheckedNodes()[0].data; |
| | | this.calcObj = item; |
| | | 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 + '分'; |
| | | if (item.deductCategory == "扣指定分数") { |
| | | this.needNum = false; |
| | |
| | | handleChangeUnit(value) { |
| | | getRuleListByUnitId(value).then((res) => { |
| | | this.options = this.getTreeData(res.data); |
| | | // 手动树形结构 |
| | | if (this.options) { |
| | | let groupedList = {}; |
| | | this.options.forEach(item => { |
| | | if (!groupedList[item.ruleName]) { |
| | | groupedList[item.ruleName] = { |
| | | value: 0, |
| | | children: [], |
| | | label: item.ruleName, |
| | | ruleName: item.ruleName, |
| | | contractId: item.contractId |
| | | }; |
| | | } |
| | | groupedList[item.ruleName].children.push(item); |
| | | }); |
| | | let result = Object.values(groupedList); |
| | | this.options = result; |
| | | } |
| | | }) |
| | | }, |
| | | getTreeData(data) { |