From e5fb337fe1b0e788f4d99523f889aa28aa03fc86 Mon Sep 17 00:00:00 2001
From: songhuangfeng123 <shf18767906695@163.com>
Date: 星期四, 07 四月 2022 16:47:41 +0800
Subject: [PATCH] 已评审

---
 src/views/safetyproduction/gojudging.vue     |   30 ++++++++++++++
 src/views/safetyproduction/checklistself.vue |   12 +++---
 src/api/safetySelfInspection.js              |   13 ++++++
 src/views/safetyproduction/new.vue           |   15 +++----
 4 files changed, 54 insertions(+), 16 deletions(-)

diff --git a/src/api/safetySelfInspection.js b/src/api/safetySelfInspection.js
index af27ced..95d743e 100644
--- a/src/api/safetySelfInspection.js
+++ b/src/api/safetySelfInspection.js
@@ -117,4 +117,15 @@
         method: 'post',
         data
     })
-}
\ No newline at end of file
+}
+
+export function safetySelfInspectionFinish(data) {
+    return request({
+        headers:{
+            'Authorization': getToken()
+        },
+        url: process.env.BASE_API+'/safetySelfInspection/finish',
+        method: 'post',
+        data
+    })
+}
diff --git a/src/views/safetyproduction/checklistself.vue b/src/views/safetyproduction/checklistself.vue
index 47fa993..a5141b3 100644
--- a/src/views/safetyproduction/checklistself.vue
+++ b/src/views/safetyproduction/checklistself.vue
@@ -71,22 +71,22 @@
       </el-table-column>
       <el-table-column align="center" label="状态">
         <template slot-scope="scope">
-          <span v-if="scope.row.status == -1">暂存</span>
-          <span v-if="scope.row.status == 0">评审中</span>
-          <span v-if="scope.row.status == 1">已评审</span>
+          <span v-if="scope.row.status == 0">暂存</span>
+          <span v-if="scope.row.status == 1">评审中</span>
+          <span v-if="scope.row.status == 2">已评审</span>
         </template>
       </el-table-column>
       <el-table-column align="center" prop="updateTime" label="更新时间">
       </el-table-column>
       <el-table-column align="center" label="操作">
         <template slot-scope="scope">
-          <el-button v-if="scope.row.status==-1" @click="handleClick(scope.row)" type="text" size="small"
+          <el-button v-if="scope.row.status==0" @click="handleClick(scope.row)" type="text" size="small"
             >编辑</el-button
           >
-           <el-button v-if="scope.row.status==0" @click="handleClick(scope.row)" type="text" size="small"
+           <el-button v-if="scope.row.status==1" @click="handleClick(scope.row)" type="text" size="small"
             >去评审</el-button
           >
-           <el-button v-if="scope.row.status==1" @click="handleClick(scope.row)" type="text" size="small"
+           <el-button v-if="scope.row.status==2" @click="handleClick(scope.row)" type="text" size="small"
             >查看</el-button
           >
           <el-button  @click="Del(scope.row.id)" v-if="scope.row.status==1?false:true" type="text" size="small" style="color: red"
diff --git a/src/views/safetyproduction/gojudging.vue b/src/views/safetyproduction/gojudging.vue
index 230f406..80eb638 100644
--- a/src/views/safetyproduction/gojudging.vue
+++ b/src/views/safetyproduction/gojudging.vue
@@ -1,6 +1,7 @@
 <template>
   <div>
     <div class="box-right">
+      <el-button type="primary" style="float: right" @click="finish()">结单</el-button>
       <div v-for="(item, index) in lists" :key="index" style="padding:0 0 20px 0">
         <div class="title">
           A级要素:<span>{{ item.elementAName }}</span>
@@ -103,7 +104,7 @@
 </template>
 <script>
 import Titlename from "../../components/Titlename/index.vue";
-import { safetySelfInspectionInfo } from "@/api/safetySelfInspection.js";
+import { safetySelfInspectionInfo ,safetySelfInspectionFinish} from "@/api/safetySelfInspection.js";
 export default {
   components: { Titlename },
   data() {
@@ -126,6 +127,33 @@
     this.safeInitem(this.id);
   },
   methods: {
+      finish(){
+          let id = this.id
+          this.$confirm('确定要结单吗?','提示',{
+              confirmButtonText:'确定',
+              cancelButtonText:'取消',
+              type:'warning',
+          }).then(()=> {
+              safetySelfInspectionFinish({id:this.id}).then(res=>{
+                  console.log(123,res)
+                  if (res.data.code === '200') {
+                      this.$notify({
+                          title:'成功',
+                          message:'结单成功',
+                          type:'success',
+                          duration:2000,
+                      })
+                  }else{
+                      this.$message({
+                          message:res.data.message,
+                          type:'warning'
+                      })
+                  }
+              })
+          }).catch(error =>{
+          })
+      },
+
     safeInitem(id) {
       safetySelfInspectionInfo({ id: id }).then((res) => {
         if (res.data.code == 200) this.list = res.data.result;
diff --git a/src/views/safetyproduction/new.vue b/src/views/safetyproduction/new.vue
index bbf960a..f0e9581 100644
--- a/src/views/safetyproduction/new.vue
+++ b/src/views/safetyproduction/new.vue
@@ -17,10 +17,10 @@
       </div>
       <div class="box-right" v-if="lists == '' ? false : true">
         <div class="btns">
-          <el-button type="primary" class="btn" @click="open(0)"
+          <el-button type="primary" class="btn" @click="open(1)"
             >添加</el-button
           >
-          <el-button type="primary" class="btn" @click="open(-1)"
+          <el-button type="primary" class="btn" @click="open(0)"
             >暂存</el-button
           >
         </div>
@@ -225,10 +225,10 @@
             trees.push(this.list.itemList[i].elementA);
           }
           this.treeList = Array.from(new Set(trees));
-          var arr = this.checkSameDataA(this.list.itemList);  
+          var arr = this.checkSameDataA(this.list.itemList);
           for (var i = 0; i < arr.length; i++) {
             var cser=[]
-              for(var j=0;j<arr[i].child.length;j++){ 
+              for(var j=0;j<arr[i].child.length;j++){
              var capB = {
                 safetySelfInspectionId: "",
                 safetyInspectionItemId: "",
@@ -290,7 +290,7 @@
           if(this.list.length!=0){
           var capA = { elementAName: "", id: [], child: [] };
           var atte = [];
-        
+
           capA.elementAName = this.list[0].elementAName;
           for (var i = 0; i < this.list.length; i++) {
                var capB = {
@@ -360,7 +360,7 @@
           query: {
             idX: data.safetyInspectionItemId,
             name:this.id,
-            id:this.itemId 
+            id:this.itemId
           },
         });
       } else {
@@ -369,7 +369,7 @@
           query: {
             idX: data.id,
             name:this.id,
-            id:this.itemId 
+            id:this.itemId
           },
         });
       }
@@ -377,7 +377,6 @@
     open(type) {
       this.dialogVisible = true;
       this.form.status = type;
-      console.log("xxxxx",this.lists)
       var arr = [];
       for (var i = 0; i < this.lists.length; i++) {
         // this.lists[i].id;

--
Gitblit v1.9.2