ZhangXianQiang
2024-03-21 27c87cc797f4fc9b0744ed8c44b58dbe4ff3a63c
src/views/system/check-result/index.vue
@@ -84,7 +84,22 @@
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="checkResultList" @selection-change="handleSelectionChange">
    <el-card class="box-card" v-for="(item) in checkResultList">
      <div slot="header" class="clearfix">
        <span>{{ item.checkUnitName }}</span>
        <el-button style="float: right; padding: 3px 0" type="text" @click="handleDetail(item)">详情</el-button>
      </div>
      <div class="text item">考核<span class="time">{{ item.examineName }}</span></div>
      <div class="text item">考核频率<span class="time">{{ "季度考核" }}</span></div>
      <div class="text item">考核分数<span class="time">{{ item.checkScore }}</span></div>
      <div class="text item">考核时间
        <span class="time">{{ item.checkTime }}</span>
        <el-button size="small" round style="float: right;" @click="handlePublish(item)" v-show="item.publish != 1"  v-hasPermi="['result:contract:publish']">确认发布</el-button>
        <el-button size="small" round style="float: right;" @click="handlePublish(item)" v-show="item.publish == 1"  v-hasPermi="['result:contract:publish']">已发布</el-button>
      </div>
    </el-card>
    <!-- <el-table v-loading="loading" :data="checkResultList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="考核对象" align="center" prop="checkUnitName" />
      <el-table-column label="考核" align="center" prop="examineName" />
@@ -100,12 +115,12 @@
            icon="el-icon-view"
            @click="handleDetail(scope.row)"
          >详情</el-button>
          <el-button
            type="text"
            size="mini"
            icon="el-icon-edit"
            @click="handleSetManualScore(scope.row)"
          >人工打分</el-button>
         <el-button
           type="text"
           size="mini"
           icon="el-icon-edit"
           @click="handleSetManualScore(scope.row)"
         >人工打分</el-button>
          <el-button
            size="mini"
            type="text"
@@ -122,7 +137,7 @@
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    /> -->
    <el-dialog :title="manualScoreTitle" :visible.sync="manualScoreOpen" width="500px" append-to-body>
      <el-input v-model="manualScoreForm.manualScore" type="number" placeholder="请为该单位打分"/>
@@ -172,21 +187,26 @@
          </template>
          <el-tag type="danger" size="small">{{detail.checkScore}}</el-tag>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-medal"></i>
            人工分数
          </template>
          <el-tag type="danger" size="small">{{detail.manualScore}}</el-tag>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-medal"></i>
            系统分数
          </template>
          <el-tag type="danger" size="small">{{detail.systemScore}}</el-tag>
        </el-descriptions-item>
      </el-descriptions>
        <el-table
          :data="tableData"
          show-summary
          style="width: 100%">
          <el-table-column
            prop="name"
            label="规则名"
            width="180">
          </el-table-column>
          <el-table-column
            prop="content"
            label="指标"
            width="180">
          </el-table-column>
          <el-table-column
            prop="score"
            label="得分">
          </el-table-column>
        </el-table>
    </el-dialog>
    <!-- 添加或修改考核结果对话框 -->
@@ -202,7 +222,7 @@
</template>
<script>
import { listCheckResult, getCheckResult, delCheckResult, addCheckResult, updateCheckResult,manualScore } from "@/api/platform/check-result";
import { listCheckResult, getCheckResult, delCheckResult, addCheckResult, updateCheckResult,manualScore, publishCheckResult } from "@/api/platform/check-result";
export default {
  name: "CheckResult",
@@ -210,7 +230,26 @@
    return {
      detailTitle: '',
      detailOpen: false,
      detail: {},
      detail:{
      },
      tableData: [{
        name: '视频平均在线率',
        content: '97%',
        score: '-5'
      }, {
        name: '一机一档24小时未修复',
        content: '5个',
        score: '-0.5'
      }, {
        name: '存储故障',
        content: '5小时',
        score: '-0.3'
      }, {
        name: '时钟不同步24小时未修复',
        content: '3个',
        score: '-0.5'
      }],
      manualScoreOpen: false,
      manualScoreForm: {},
      manualScoreTitle: '',
@@ -326,8 +365,20 @@
    },
    handleDetail(row) {
      this.detail = row;
      this.detail.carOnlineRate =  '97%';
      this.detailTitle = row.checkUnitName + '考核结果';
      this.detailOpen = true;
    },
    handlePublish(row) {
      let text = row.publish == 1 ? '取消发布' : '发布';
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认' + text + '考核结果编号为"' + ids + '"的数据项?').then(function() {
        return publishCheckResult(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess(text + "成功");
      }).catch(() => {});
    },
    /** 搜索按钮操作 */
@@ -402,3 +453,27 @@
  }
};
</script>
<style>
  .text {
    font-size: 14px;
  }
  .time {
    font-size: 13px;
    color: #999;
    margin-left: 10px;
  }
  .item {
    margin-bottom: 18px;
  }
  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }
  .box-card {
    width: 480px;
  }
</style>