value
2024-06-23 7345595fdb083a70e8c708dce246af34b2d7f69f
src/components/do/b3-personnel-evaluation/supervisor-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="20"></el-input-number>
            v-model="scope.row.skill" @change="m=>handleChange(m,scope.row,'skill')" :min="0" :max="20"></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="20"></el-input-number>
            v-model="scope.row.compliance" @change="m=>handleChange(m,scope.row,'compliance')" :min="0" :max="20"></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.tidy" @change="m=>handleChange(m,scope.row,'tidy')" :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.discipline" @change="m=>handleChange(m,scope.row,'discipline')" :min="0" :max="10"></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
@@ -61,7 +61,7 @@
          <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.solidarity" @change="m=>handleChange(m,scope.row,'solidarity')" :min="0" :max="10"></el-input-number>
          </template>
        </el-table-column>
      </el-table-column>
@@ -70,11 +70,11 @@
          <template slot-scope="scope">
            <el-input-number
            size="small"
            v-model="scope.row.num6" @change="handleChange" :min="0" :max="10"></el-input-number>
            v-model="scope.row.proposal" @change="m=>handleChange(m,scope.row,'proposal')" :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>
@@ -83,26 +83,47 @@
<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,
        }
      ]
      tableData:[],
      loading:false,
    }
  },
  created(){
    this.refreshTable()
  },
  methods:{
    handleChange(){}
    handleChange(value,row,prop){
      row[prop] = Number(value)
      this.$axios.post(this.$api.evaluate.writeEvaluateCompetent, {
        ...row
        },{
          headers: {
            'Content-Type': 'application/json'
          },
          noQs:true
        }).then(res => {
          row.total = res.data
        })
    },
    refreshTable(){
      this.loading = true
      this.$axios.post(this.$api.evaluate.getEvaluateCompetent, {
        ...this.$parent.entity
        },{
          headers: {
            'Content-Type': 'application/json'
          }
        }).then(res => {
          this.loading = false
          this.tableData = res.data
        })
    },
    refresh(){
      this.refreshTable()
    }
  }
}
</script>