From feaeb1ded8715f5da2fdaf9c22ee3b56867b95ac Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期三, 20 十一月 2024 16:14:30 +0800 Subject: [PATCH] 合同积分显示规则描述 --- src/views/system/contract/score/index.vue | 56 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 45 insertions(+), 11 deletions(-) diff --git a/src/views/system/contract/score/index.vue b/src/views/system/contract/score/index.vue index 77f6810..79680b3 100644 --- a/src/views/system/contract/score/index.vue +++ b/src/views/system/contract/score/index.vue @@ -123,16 +123,8 @@ :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> @@ -147,6 +139,10 @@ </div> </div> </div> + <div style="font-size: 5px"> + {{ ruleDescription}} + </div> + </el-form-item> <el-form-item label="杩愮淮鑰冩牳鎵e垎" style="width: 30%" prop="score"> <el-input v-model="form.score"></el-input> @@ -201,6 +197,7 @@ auditingOpen: false, auditingForm: {}, unitList: [], + ruleDescription: '', // 娣诲姞瑙勫垯鎻忚堪瀛楁 // 鑰冩牳妯℃澘 examineList: [ { id: 1, value: "杞﹁締鑰冩牳" }, @@ -293,6 +290,7 @@ 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 == "鎵f寚瀹氬垎鏁�") { this.needNum = false; this.form.score = item.calcFraction; @@ -484,8 +482,44 @@ 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> -- Gitblit v1.8.0