From 39da98555350150352419d634b99306b712aa279 Mon Sep 17 00:00:00 2001
From: shiyue <1211061228@qq.com>
Date: 星期四, 16 二月 2023 12:50:09 +0800
Subject: [PATCH] 2023-02-16更新

---
 src/views/cause/Entry.vue  |   22 ++++++++--
 src/views/common/Audit.vue |   25 ++++++++++--
 src/views/manager/User.vue |   17 ++++----
 3 files changed, 46 insertions(+), 18 deletions(-)

diff --git a/src/views/cause/Entry.vue b/src/views/cause/Entry.vue
index 7c226aa..bc2238f 100644
--- a/src/views/cause/Entry.vue
+++ b/src/views/cause/Entry.vue
@@ -16,7 +16,7 @@
             <el-button type="primary" @click="search">鏌ヨ</el-button>
           </el-form-item>
           <el-form-item>
-            <el-button type="primary" @click="addAduitDialogVisible = true">娣诲姞</el-button>
+            <el-button type="primary" @click="addAduitAnJian">娣诲姞</el-button>
           </el-form-item>
 
           <el-form-item>
@@ -392,7 +392,7 @@
                   </el-input>
                 </el-form-item>
               </el-col>
-              
+
               <!-- <el-col :span="12">
                 <el-form-item prop="reportTime" label="鎶ユ鏃堕棿">
                   <el-date-picker v-model="updateReportForm.reportTime" type="datetime" placeholder="閫夋嫨鏃ユ湡鏃堕棿" clearable
@@ -1091,6 +1091,18 @@
   },
   methods:
   {
+    addAduitAnJian(){
+      let date=(new Date()).valueOf();//鑾峰彇鏃堕棿鎴�
+      let txt = '1234567890';//鐢熸垚鐨勯殢鏈烘満鍣ㄧ爜
+      let len =13;//鏈哄櫒鐮佹湁澶氬皯浣�
+      let pwd = '';//瀹氫箟绌哄彉閲忕敤鏉ユ帴鏀舵満鍣ㄧ爜
+      for (let i = 0; i < len; i++) {
+        pwd += txt.charAt(Math.floor(Math.random() * txt.length));//寰幆鏈哄櫒鐮佷綅鏁伴殢鏈哄~鍏�
+      }
+      let id= date+pwd;
+      this.causeForm.number=id;
+      this.addAduitDialogVisible=true;
+    },
 
     //鍏抽棴妗堜欢鐨勬浠朵汉鍛樻坊鍔�
     addReportVisibleClose() {
@@ -1230,7 +1242,7 @@
       this.updateReportPrams.groupId = this.updateReportForm.groupId
       this.updateReportPrams.id = this.updateReportForm.id
       this.updateReportPrams.reportMaterials = this.updateReportPrams.fileList.map(i => i.data).join(',')
-     
+
       this.updateReportPrams.pic=this.updateReportForm.pic
       let form = null;
       form = this.updateReportPrams;
@@ -1382,7 +1394,7 @@
           } else {
             this.$message({
               type: "error",
-              message: "琛ㄥ崟涓嶈兘涓虹┖"
+              message: res.data.msg
             })
           }
         }
@@ -1607,4 +1619,4 @@
 ::v-deep(.el-table thead) {
   color: #000000;
 }
-</style>
\ No newline at end of file
+</style>
diff --git a/src/views/common/Audit.vue b/src/views/common/Audit.vue
index 3eed36e..290c99f 100644
--- a/src/views/common/Audit.vue
+++ b/src/views/common/Audit.vue
@@ -165,7 +165,7 @@
     <!--瀹℃牳寮圭獥-->
     <el-dialog title="瀹℃牳" :visible.sync="checkVisible" width="50%" :before-close="infoAduitClose">
       <el-row :gutter="15">
-        <el-form ref="infoAduitForm" :model="auditInfo" size="medium" label-width="100px">
+        <el-form ref="infoAduitForm" :rules="rules2" :model="auditInfo" size="medium" label-width="100px">
           <el-col :span="12">
             <el-form-item label="澶村儚" prop="pic" required>
               <el-upload ref="pic" action="/api/minio/upload" :show-file-list="false" :on-success="handleAvatarSuccess"
@@ -347,6 +347,7 @@
         tmpTime: '',
       },
       auditInfo: {},
+
       picShow: "",
       reportData: [],
       optionsGroup: [
@@ -433,6 +434,11 @@
           trigger: 'change'
         }],
       },
+      rules2:{
+        causeId: [
+          { required: true, message: '璇烽�夋嫨娲诲姩鍖哄煙', trigger: 'change' }
+        ]
+      }
     }
   },
   created() {
@@ -470,11 +476,19 @@
     checkAdd() {
       let form = null;
       form = this.auditInfo;
-      checkPass(form).then(res => {
-        this.$message.success('鎻愪氦鎴愬姛')
-        this.getList()
-        this.checkVisible = false;
+      this.$refs.infoAduitForm.validate((valid)=>{
+        if(valid){
+          checkPass(form).then(res => {
+            this.$message.success('鎻愪氦鎴愬姛')
+            this.getList()
+            this.checkVisible = false;
+          })
+        }else{
+          return false;
+        }
+
       })
+
     },
     //瀹℃牳
     check(val) {
@@ -493,6 +507,7 @@
             if (item === '' || item === null) {
               // this.reportData.push('./logo.jpg');
             } else {
+              this.reportData=[];
               getImgUrl(item).then(res => {
                 this.reportData.push(res);
               })
diff --git a/src/views/manager/User.vue b/src/views/manager/User.vue
index 815e4cd..b557f33 100644
--- a/src/views/manager/User.vue
+++ b/src/views/manager/User.vue
@@ -30,8 +30,9 @@
           <el-table-column label="鎿嶄綔" align="conter">
             <template slot-scope="scope">
               <el-button type="text" size="medium" @click="details(scope.row)">缂栬緫</el-button>
-              <el-button type="text" size="medium" @click="reset(scope.row.id)">閲嶇疆瀵嗙爜</el-button>
-              <el-button type="text" size="medium" @click="remove(scope.row.id)" style="color:#ff0000">鍒犻櫎
+<!--              <el-button type="text" size="medium" @click="reset(scope.row.id)">閲嶇疆瀵嗙爜</el-button>-->
+<!--              <el-button type="text" size="medium" @click="remove(scope.row.id)" style="color:#ff0000">鍒犻櫎-->
+                <el-button type="text" size="medium" @click="updateStatus(scope.row.id,scope.row.status)">{{scope.row.status==1?"绂佺敤":"鍚敤"}}
               </el-button>
             </template>
           </el-table-column>
@@ -202,13 +203,13 @@
   },
   methods:
   {
-    //鍒犻櫎
-    remove(val) {
+    //鏇存柊鐢ㄦ埛鐘舵��
+    updateStatus(id,status) {
       var _this = this;
-      this.$confirm('纭鍒犻櫎锛�').then(() => {
-        _this.$http.delete('/api/user', { params: { id: val } }).then(res => {
+      this.$confirm('纭淇敼璐︽埛鐘舵�佸悧锛�').then(() => {
+        _this.$http.get('/api/user/status', { params: { id: id ,status:status} }).then(res => {
           _this.$message({
-            message: '鍒犻櫎鎴愬姛',
+            message: '淇敼鎴愬姛',
             type: 'success'
           })
           this.search();
@@ -329,4 +330,4 @@
 ::v-deep(.el-table thead) {
   color: #000000;
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.8.0