From 09f0861e61e69e2d818eafc7b9edbd17cf0822d4 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 06 十一月 2025 17:20:02 +0800
Subject: [PATCH] 页面优化以及扣分详情导出
---
src/views/system/contract/score/index.vue | 82 +++++++++++++++++++++++++++++++++--------
1 files changed, 66 insertions(+), 16 deletions(-)
diff --git a/src/views/system/contract/score/index.vue b/src/views/system/contract/score/index.vue
index 6b931fb..00fa913 100644
--- a/src/views/system/contract/score/index.vue
+++ b/src/views/system/contract/score/index.vue
@@ -101,7 +101,7 @@
</el-dialog>
<!-- 鏂板鎴栦慨鏀� -->
- <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
+ <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="杩愮淮鑰冩牳鍗曚綅" prop="unitId">
<el-select v-model="form.unitId" placeholder="杩愮淮鑰冩牳鍗曚綅" @change="handleChangeUnit">
@@ -115,18 +115,16 @@
<div class="row-left">
<div class="block">
<span class="demonstration"></span>
- <el-cascader ref="cascader" v-model="form.ruleIdsArray" :options="options" @change="handleChange">
+ <el-cascader
+ ref="cascader"
+ v-model="form.ruleIdsArray"
+ :options="options"
+ @change="handleChange"
+ :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>
@@ -134,15 +132,19 @@
</div>
</div>
<div class="row-right" v-if="needNum">
- <div>鎸囨爣</div>
+ <div>娆℃暟/鏁伴噺/灏忔椂</div>
<div class="margin-5">
<el-input placeholder="璇疯緭鍏�" v-model="form.num" @input="handleChangeNum" />
</div>
</div>
</div>
</div>
+ <div>
+ {{ ruleDescription}}
+ </div>
+
</el-form-item>
- <el-form-item label="杩愮淮鑰冩牳鎵e垎" style="width: 51%" prop="score">
+ <el-form-item label="杩愮淮鑰冩牳鎵e垎" style="width: 30%" prop="score">
<el-input v-model="form.score"></el-input>
</el-form-item>
</el-form>
@@ -195,6 +197,7 @@
auditingOpen: false,
auditingForm: {},
unitList: [],
+ ruleDescription: '', // 娣诲姞瑙勫垯鎻忚堪瀛楁
// 鑰冩牳妯℃澘
examineList: [
{ id: 1, value: "杞﹁締鑰冩牳" },
@@ -269,8 +272,11 @@
};
},
created() {
- this.getList();
this.getUnitSelect();
+ if(this.$route.query.time){
+ this.daterangeCreateTime= this.$route.query.time
+ }
+ this.getList();
},
methods: {
/** 璇︾粏鎸夐挳鎿嶄綔 */
@@ -287,6 +293,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;
@@ -358,6 +365,13 @@
// 杩愮淮鍗曚綅涓嬫媺鍒楄〃
unitSelect().then((res) => {
this.unitList = res.data;
+ if (this.$route.query.unitId) {
+ // 鍏堟壘鍒板搴旂殑閫夐」
+ const unit = this.unitList.find(item => item.id === Number(this.$route.query.unitId) || item.id === this.$route.query.unitId);
+ if (unit) {
+ this.queryParams.unitId = unit.id; // 纭繚绫诲瀷鍖归厤
+ }
+ }
})
},
/** 鏌ヨ杩濊瀹℃牳鍒楄〃 */
@@ -478,8 +492,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