From e0208124183d65bd4c2228ccd6dce35b04876784 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期四, 21 三月 2024 16:31:09 +0800
Subject: [PATCH] 违约单、核算报告,运维打分修改

---
 src/views/system/calculate/order/index.vue |  430 ++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 322 insertions(+), 108 deletions(-)

diff --git a/src/views/system/calculate/order/index.vue b/src/views/system/calculate/order/index.vue
index 7372335..155ebdc 100644
--- a/src/views/system/calculate/order/index.vue
+++ b/src/views/system/calculate/order/index.vue
@@ -1,8 +1,49 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="杩濈害鍚�" prop="examineId">
-        <el-input v-model="queryParams.examineId" placeholder="璇疯緭鍏ヨ繚绾﹀悕" clearable @keyup.enter.native="handleQuery" />
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="鑰冩牳瀵硅薄" prop="checkUnitId">
+        <el-input
+          v-model="queryParams.checkUnitName"
+          placeholder="璇疯緭鍏ヨ�冩牳瀵硅薄"
+          clearable
+          @clear="handleQuery"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="鑰冩牳棰戠巼" prop="frequency">
+        <el-select v-model="queryParams.frequency" clearable @clear="handleQuery" placeholder="鑰冩牳棰戠巼">
+          <el-option
+            label="鏈堝害鑰冩牳"
+            value="1">
+          </el-option>
+          <el-option
+            label="瀛e害鑰冩牳"
+            value="2">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="鑰冩牳鑼冨洿" prop="examineRange">
+        <el-select v-model="queryParams.examineRange" clearable  @clear="handleQuery" placeholder="鑰冩牳鑼冨洿">
+          <el-option
+            label="甯傚眬鑰冩牳"
+            value="2">
+          </el-option>
+          <el-option
+            label="鍒嗗眬鑰冩牳"
+            value="1">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="鑰冩牳鏃堕棿">
+        <el-date-picker
+          v-model="daterangeCheckTime"
+          style="width: 240px"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="寮�濮嬫棩鏈�"
+          end-placeholder="缁撴潫鏃ユ湡"
+        ></el-date-picker>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
@@ -11,73 +52,164 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="el-icon-plus"-->
+<!--          size="mini"-->
+<!--          @click="handleAdd"-->
+<!--          v-hasPermi="['system:checkResult:add']"-->
+<!--        >鏂板</el-button>-->
+<!--      </el-col>-->
       <el-col :span="1.5">
-        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">鏂板</el-button>
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+        >鍒犻櫎</el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
-          @click="handleUpdate">淇敼</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
-          @click="handleDelete">鍒犻櫎</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">瀵煎嚭</el-button>
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+        >瀵煎嚭</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="scoreList" @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">{{ "瀛e害鑰冩牳" }}</span></div>
+      <div class="text item">鑰冩牳鍒嗘暟<span class="time">{{ item.checkScore }}</span></div>
+      <div class="text item">鑰冩牳鏃堕棿
+        <span class="time">{{ item.checkTime }}</span>
+      </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="examineName" />
-      <el-table-column label="杩濈害瀵硅薄" align="center" prop="unitName" />
-      <el-table-column label="鍒嗗��" align="center" prop="score" />
-      <el-table-column label="杩濈害瑙勫垯" align="center" prop="scoreCategory">
-        <template slot-scope="scope">
-          <div v-if="scope.row.scoreCategory === 1">瑙嗛鍦ㄧ嚎鐜�</div>
-          <div v-else-if="scope.row.scoreCategory === 2">瀛樺偍鏁呴殰</div>
-          <div v-else-if="scope.row.scoreCategory === 4">涓�鏈轰竴妗�24灏忔椂鏈慨澶�</div>
-          <div v-else-if="scope.row.scoreCategory === 5">鏃堕挓涓嶅悓姝�24灏忔椂鏈慨澶�</div>
-        </template>
-      </el-table-column>
-      <el-table-column label="鍒涘缓浜�" align="center" prop="createBy" />
-      <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" />
+      <el-table-column label="鑰冩牳瀵硅薄" align="center" prop="checkUnitName" />
+      <el-table-column label="鑰冩牳" align="center" prop="examineName" />
+      <el-table-column label="鑰冩牳鑼冨洿":formatter="examineRangeFormatter" align="center" prop="examineRange" />
+      <el-table-column label="鑰冩牳棰戠巼" :formatter="frequencyFormatter" align="center" prop="frequency" />
+      <el-table-column label="鑰冩牳鍒嗘暟" falign="center" prop="checkScore" />
+      <el-table-column label="鑰冩牳鏃堕棿" align="center" prop="checkTime" />
       <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">淇敼</el-button>
-          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            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
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+          >鍒犻櫎</el-button>
         </template>
       </el-table-column>
     </el-table>
 
-    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
-      @pagination="getList" />
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :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="璇蜂负璇ュ崟浣嶆墦鍒�"/>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitManualScore">纭� 瀹�</el-button>
+        <el-button @click="cancelManualScore">鍙� 娑�</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="detailTitle" :visible.sync="detailOpen" width="700px" append-to-body>
+      <el-descriptions class="margin-top" :column="3" border>
+<!--        <template slot="extra">-->
+<!--          <el-button type="primary" size="small">鎿嶄綔</el-button>-->
+<!--        </template>-->
+        <el-descriptions-item>
+          <template slot="label">
+            <i class="el-icon-user"></i>
+            鑰冩牳瀵硅薄
+          </template>
+          {{detail.checkUnitName}}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label">
+            <i class="el-icon-s-management"></i>
+            鑰冩牳鍚嶇О
+          </template>
+          {{detail.examineName}}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label">
+            <i class="el-icon-full-screen"></i>
+            鑰冩牳鑼冨洿
+          </template>
+          <el-tag size="small">{{detail.examineRange === 1 ? '鍒嗗眬鑰冩牳' : '甯傚眬鑰冩牳'}}</el-tag>
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label">
+            <i class="el-icon-timer"></i>
+            鑰冩牳棰戠巼
+          </template>
+          <el-tag size="small">{{detail.frequency === 1 ? '鏈堝害鑰冩牳' : '瀛e害鑰冩牳'}}</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.checkScore}}</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>
+
+    <!-- 娣诲姞鎴栦慨鏀硅�冩牳缁撴灉瀵硅瘽妗� -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="鍒嗗��" prop="score">
-          <el-input v-model="form.score" placeholder="璇疯緭鍏ュ垎鍊�" />
-        </el-form-item>
-        <el-form-item label="鍗曚綅鍚�" prop="unitId">
-          <el-select v-model="form.unitId" placeholder="璇烽�夋嫨">
-            <el-option v-for="item in unitList" :key="item.id" :label="item.value" :value="item.id">
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="杩濈害鍚�" prop="examineId">
-          <el-select v-model="form.examineId" placeholder="璇烽�夋嫨">
-            <el-option v-for="item in examineList" :key="item.id" :label="item.value" :value="item.id">
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="绉垎绫诲瀷" prop="scoreCategory">
-          <el-select v-model="form.scoreCategory" placeholder="璇烽�夋嫨">
-            <el-option v-for="item in scoreCategoryList" :key="item.id" :label="item.value" :value="item.id">
-            </el-option>
-          </el-select>
-        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
@@ -88,27 +220,37 @@
 </template>
 
 <script>
-import { listScore, getScore, delScore, addScore, updateScore } from "@/api/platform/score";
-import { unitSelect } from "@/api/platform/unit";
-import { publishSelect } from "@/api/platform/publish";
+import { listCheckResult, getCheckResult, delCheckResult, addCheckResult, updateCheckResult,manualScore, publishCheckResult } from "@/api/platform/check-result";
 
 export default {
-  name: "Score",
-  dicts: ['platform_operate_category'],
+  name: "CheckResult",
   data() {
     return {
-      operateCategoryList: [
-        { id: 2, value: '浜哄伐鎵撳垎' },
-        { id: 1, value: '绯荤粺鎵撳垎' },
-      ],
-      scoreCategoryList: [
-        { id: 2, value: '瀛樺偍鏁呴殰' },
-        { id: 1, value: '瑙嗛鍦ㄧ嚎鐜�' },
-        { id: 3, value: '淇濋殰宸ヤ綔' },
-      ],
+      detailTitle: '',
+      detailOpen: false,
+      detail:{
 
-      unitList: [],
-      examineList: [],
+      },
+      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: '',
       // 閬僵灞�
       loading: true,
       // 閫変腑鏁扮粍
@@ -121,21 +263,20 @@
       showSearch: true,
       // 鎬绘潯鏁�
       total: 0,
-      // 杩濈害璁″垎琛ㄦ牸鏁版嵁
-      scoreList: [],
+      // 鑰冩牳缁撴灉琛ㄦ牸鏁版嵁
+      checkResultList: [],
       // 寮瑰嚭灞傛爣棰�
       title: "",
       // 鏄惁鏄剧ず寮瑰嚭灞�
       open: false,
+      // 閫昏緫鍒犻櫎鏃堕棿鑼冨洿
+      daterangeCheckTime: [],
       // 鏌ヨ鍙傛暟
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        score: null,
-        unitId: null,
-        examineId: null,
-        operateCategory: null,
-        scoreCategory: null,
+        checkUnitId: null,
+        checkTime: null,
       },
       // 琛ㄥ崟鍙傛暟
       form: {},
@@ -146,27 +287,33 @@
   },
   created() {
     this.getList();
-    this.selectUnit();
-    this.selectExamine();
   },
   methods: {
-    // 杩愮淮鍏徃涓嬫媺鏁版嵁
-    selectUnit() {
-      unitSelect().then(res => {
-        this.unitList = res.data;
-      })
+    frequencyFormatter(row) {
+      if (row.frequency === "1") {
+        return "鏈堝害鑰冩牳"
+      }
+      if (row.frequency === "2") {
+        return "瀛e害鑰冩牳"
+      }
     },
-    // 杩濈害涓嬫媺鏁版嵁
-    selectExamine() {
-      publishSelect().then(res => {
-        this.examineList = res.data;
-      })
+    examineRangeFormatter(row) {
+      if (row.examineRange === "1") {
+        return "鍒嗗眬鑰冩牳"
+      }
+      if (row.examineRange === "2") {
+        return "甯傚眬鑰冩牳"
+      }
     },
-    /** 鏌ヨ杩濈害璁″垎鍒楄〃 */
+    /** 鏌ヨ鑰冩牳缁撴灉鍒楄〃 */
     getList() {
       this.loading = true;
-      listScore(this.queryParams).then(response => {
-        this.scoreList = response.rows;
+      if (null != this.daterangeCheckTime && '' != this.daterangeCheckTime) {
+        this.queryParams["start"] = this.daterangeCheckTime[0];
+        this.queryParams["end"] = this.daterangeCheckTime[1];
+      }
+      listCheckResult(this.queryParams).then(response => {
+        this.checkResultList = response.data;
         this.total = response.total;
         this.loading = false;
       });
@@ -180,15 +327,57 @@
     reset() {
       this.form = {
         id: null,
-        score: null,
-        unitId: null,
-        examineId: null,
-        operateCategory: null,
-        scoreCategory: null,
+        checkUnitId: null,
+        checkPublishId: null,
+        checkScore: null,
+        systemScore: null,
+        manualScore: null,
+        checkTime: null,
         createTime: null,
-        createBy: null
+        updateTime: null,
+        deleted: null
       };
       this.resetForm("form");
+    },
+    cancelManualScore() {
+      this.manualScoreForm = {};
+      this.manualScoreTitle = "";
+      this.manualScoreOpen = false;
+    },
+    submitManualScore() {
+      if (! this.manualScoreForm.manualScore) {
+        this.$modal.msgWarning("璇峰~鍐欏垎鏁�");
+        return
+      }
+      manualScore(this.manualScoreForm).then(res => {
+        this.$modal.msgSuccess("鎿嶄綔鎴愬姛");
+        this.cancelManualScore();
+        this.getList();
+      })
+    },
+    handleSetManualScore(row) {
+      this.manualScoreForm.id = row.id;
+      this.manualScoreForm.manualScore = parseInt(row.manualScore);
+      this.manualScoreTitle = row.checkUnitName + '浜哄伐鎵撳垎'
+      this.manualScoreOpen = true;
+    },
+    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(() => {});
+
     },
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
@@ -197,29 +386,30 @@
     },
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
+      this.daterangeCheckTime = [];
       this.resetForm("queryForm");
       this.handleQuery();
     },
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length !== 1
+      this.single = selection.length!==1
       this.multiple = !selection.length
     },
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
       this.reset();
       this.open = true;
-      this.title = "娣诲姞杩濈害璁″垎";
+      this.title = "娣诲姞鑰冩牳缁撴灉";
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
-      getScore(id).then(response => {
+      getCheckResult(id).then(response => {
         this.form = response.data;
         this.open = true;
-        this.title = "淇敼杩濈害璁″垎";
+        this.title = "淇敼鑰冩牳缁撴灉";
       });
     },
     /** 鎻愪氦鎸夐挳 */
@@ -227,13 +417,13 @@
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
-            updateScore(this.form).then(response => {
+            updateCheckResult(this.form).then(response => {
               this.$modal.msgSuccess("淇敼鎴愬姛");
               this.open = false;
               this.getList();
             });
           } else {
-            addScore(this.form).then(response => {
+            addCheckResult(this.form).then(response => {
               this.$modal.msgSuccess("鏂板鎴愬姛");
               this.open = false;
               this.getList();
@@ -245,19 +435,43 @@
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('鏄惁纭鍒犻櫎杩濈害璁″垎缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function () {
-        return delScore(ids);
+      this.$modal.confirm('鏄惁纭鍒犻櫎鑰冩牳缁撴灉缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() {
+        return delCheckResult(ids);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-      }).catch(() => { });
+      }).catch(() => {});
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.download('platform/score/export', {
+      this.download('system/checkResult/export', {
         ...this.queryParams
-      }, `score_${new Date().getTime()}.xlsx`)
+      }, `checkResult_${new Date().getTime()}.xlsx`)
     }
   }
 };
 </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>

--
Gitblit v1.8.0