From c67f52b0060a3d3339a0c62850e919c152d3a669 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期五, 21 六月 2024 10:00:31 +0800 Subject: [PATCH] 完成人员考评接口对接 --- src/components/do/b3-personnel-evaluation/leader-rate.vue | 66 ++++++++++++++++++++++----------- 1 files changed, 44 insertions(+), 22 deletions(-) diff --git a/src/components/do/b3-personnel-evaluation/leader-rate.vue b/src/components/do/b3-personnel-evaluation/leader-rate.vue index 2253352..edef602 100644 --- a/src/components/do/b3-personnel-evaluation/leader-rate.vue +++ b/src/components/do/b3-personnel-evaluation/leader-rate.vue @@ -1,9 +1,9 @@ <template> <div class="table-item"> - <p style="text-align: center;margin-bottom: 10px;">{{ laboratory.label }} {{ Number(month.split('-')[1]) }} 鏈堜唤缁勯暱鎵撳垎琛�</p> + <p style="text-align: center;margin-bottom: 10px;">{{ entity.departLims }} {{ Number(entity.month.split('-')[1]) }} 鏈堜唤缁勯暱鎵撳垎琛�</p> <el-table :data="tableData" - style="width: 100%" height="calc(100% - 20px)"> + style="width: 100%" height="calc(100% - 20px)" v-loading="loading"> <el-table-column type="index" label="搴忓彿" @@ -16,7 +16,7 @@ <template slot-scope="scope"> <el-input-number size="small" - v-model="scope.row.num0" @change="handleChange" :min="0" :max="25"></el-input-number> + v-model="scope.row.responsibility" @change="m=>handleChange(m,scope.row,'responsibility')" :min="0" :max="25"></el-input-number> </template> </el-table-column> </el-table-column> @@ -25,7 +25,7 @@ <template slot-scope="scope"> <el-input-number size="small" - v-model="scope.row.num1" @change="handleChange" :min="0" :max="25"></el-input-number> + v-model="scope.row.compliance" @change="m=>handleChange(m,scope.row,'compliance')" :min="0" :max="25"></el-input-number> </template> </el-table-column> </el-table-column> @@ -34,7 +34,7 @@ <template slot-scope="scope"> <el-input-number size="small" - v-model="scope.row.num2" @change="handleChange" :min="0" :max="20"></el-input-number> + v-model="scope.row.positive" @change="m=>handleChange(m,scope.row,'positive')" :min="0" :max="20"></el-input-number> </template> </el-table-column> </el-table-column> @@ -43,7 +43,7 @@ <template slot-scope="scope"> <el-input-number size="small" - v-model="scope.row.num3" @change="handleChange" :min="0" :max="10"></el-input-number> + v-model="scope.row.solidarity" @change="m=>handleChange(m,scope.row,'solidarity')" :min="0" :max="10"></el-input-number> </template> </el-table-column> </el-table-column> @@ -52,7 +52,7 @@ <template slot-scope="scope"> <el-input-number size="small" - v-model="scope.row.num4" @change="handleChange" :min="0" :max="10"></el-input-number> + v-model="scope.row.seasonable" @change="m=>handleChange(m,scope.row,'seasonable')" :min="0" :max="10"></el-input-number> </template> </el-table-column> </el-table-column> @@ -61,11 +61,11 @@ <template slot-scope="scope"> <el-input-number size="small" - v-model="scope.row.num5" @change="handleChange" :min="0" :max="10"></el-input-number> + v-model="scope.row.exact" @change="m=>handleChange(m,scope.row,'exact')" :min="0" :max="10"></el-input-number> </template> </el-table-column> </el-table-column> - <el-table-column label="寰楀垎"> + <el-table-column label="寰楀垎" prop="total"> </el-table-column> </el-table> </div> @@ -74,26 +74,48 @@ <script> export default { props:{ - month:String, - laboratory:Object + entity:Object, }, data () { return{ tableData:[ - { - num0:null, - num1:null, - num2:null, - num3:null, - num4:null, - num5:null, - num6:null, - } - ] + ], + loading:false, } }, + created(){ + this.refreshTable() + }, methods:{ - handleChange(){} + handleChange(value,row,prop){ + row[prop] = Number(value) + this.$axios.post(this.$api.evaluate.writeEvaluateLeader, { + ...row + },{ + headers: { + 'Content-Type': 'application/json' + }, + noQs:true + }).then(res => { + row.total = res.data + }) + }, + refreshTable(){ + this.loading = true + this.$axios.post(this.$api.evaluate.getEvaluateLeader, { + ...this.$parent.entity + },{ + headers: { + 'Content-Type': 'application/json' + } + }).then(res => { + this.loading = false + this.tableData = res.data + }) + }, + refresh(){ + this.refreshTable() + } } } </script> -- Gitblit v1.9.3