sunlupeng 1 year ago
parent
commit
19eb9858f7
2 changed files with 59 additions and 41 deletions
  1. 43 41
      src/views/certManage/certList.vue
  2. 16 0
      src/views/noticeManage/noticeList.vue

+ 43 - 41
src/views/certManage/certList.vue

@@ -40,7 +40,7 @@
         <el-table-column align="center" label="操作" width="150px" class-name="small-padding fixed-width">
           <template slot-scope="scope">
             <el-button :disabled="scope.row.status == 0?false:true" type="primary" size="small" @click="handleComplete(scope.row.id,0)">通过</el-button>
-            <el-button :disabled="scope.row.status == 0?false:true" type="warning" size="small" @click="handleComplete(scope.row.id,1)">不通过</el-button>
+            <el-button :disabled="scope.row.status == 0?false:true" type="warning" size="small" @click="handleCreate(scope.row.id)">不通过</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -52,6 +52,18 @@
           layout="total, sizes, prev, pager, next, jumper" :total="total">
         </el-pagination>
       </div>
+      <!-- 添加或修改对话框 -->
+      <el-dialog :close-on-click-modal="false" title="证书审批" :visible.sync="dialogFormVisible" width="40%">
+            <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="80px">
+                <el-form-item label="审批内容" prop="content">
+                  <el-input type="textarea" :rows="2" placeholder="请输入审批内容" v-model="dataForm.content"></el-input>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click="dialogFormVisible = false">取消</el-button>
+                <el-button type="primary" @click="handleComplete(certificateId,1)">确定</el-button>
+            </div>
+        </el-dialog>
     </div>
   </template>
     
@@ -73,7 +85,6 @@
     
   <script>
   import {
-    types,
     complete,
     list,
   } from "@/api/certManage";
@@ -85,9 +96,14 @@
     directives: { waves },
     data() {
       return {
-        typeVisible: false,
-        fileImgUrl: this.upLoadUrl,
-        recipientsList: [],
+        certificateId:'',
+        dialogFormVisible: false,
+        dataForm: {
+          content: ''
+        },
+        rules: {
+          content: [{ required: true, message: "审批内容不能为空", trigger: "blur" }],
+        },
         statusTypeList: [
           {
             type: 0,
@@ -102,42 +118,15 @@
             name: "不通过",
           },
         ],
-        subTypeList: [
-          {
-            type: 0,
-            name: "奖状",
-          },
-          {
-            type: 1,
-            name: "邮件",
-          },
-        ],
         list: [
         ],
-        delarr: [],
-        multipleSelection: [],
         total: 0,
         listLoading: false,
         listQuery: {
           page: 1,
           limit: 10,
-        //   type: "",
           status: "",
         },
-        dataForm: {
-          type: undefined,
-          flag:'',
-          certificateId:'',
-        },
-        dialogFormVisible: false,
-        dialogStatus: "",
-        textMap: {
-          update: "证书审核",
-          create: "创建",
-        },
-        rules: {
-          type: [{ required: true, message: "请选择证书类型", trigger: "blur" }],
-        },
       };
     },
     created() {
@@ -173,19 +162,32 @@
         this.listQuery.page = val;
         this.getList();
       },
-  
-      handleView(row) {
-        this.dataForm.type = '';
-        this.dataForm.certificateId =row.id;
-        this.dialogStatus = "update";
+      handleCreate(id) {
         this.dialogFormVisible = true;
+        this.certificateId = id;
         this.$nextTick(() => {
-          this.$refs["dataForm"].clearValidate();
+            this.dataForm.content = '';
+            this.$refs["dataForm"].clearValidate();
         });
       },
       handleComplete(certificateId,flag){
-        complete({certificateId:certificateId,flag:flag}).then(() => {
-                        this.dialogFormVisible = false;
+        if(flag==1){
+          this.$refs["dataForm"].validate((valid) => {
+          if (valid) {
+            complete({certificateId:certificateId,flag:flag,content:this.dataForm.content}).then(() => {
+                  this.dialogFormVisible = false;
+                        this.$notify({
+                        title: "成功",
+                        message: "操作成功",
+                        type: "success",
+                        duration: 2000,
+                    });
+                        this.getList();
+                    });
+          }
+        })  
+        }else{
+          complete({certificateId:certificateId,flag:flag}).then(() => {
                         this.$notify({
                         title: "成功",
                         message: "操作成功",
@@ -194,7 +196,7 @@
                     });
                         this.getList();
                     });
-
+        }
         
       }
       

+ 16 - 0
src/views/noticeManage/noticeList.vue

@@ -68,6 +68,12 @@
                     </el-upload>
                         
                 </el-form-item>
+                <el-form-item label="参与人">
+                    <el-select v-model="dataForm.recipients" multiple filterable placeholder="请选择" style="width: 350px">
+                        <el-option :key="item.loginId" v-for="item in recipientsList" :label="item.userName" :value="item.loginId">
+                        </el-option>
+                    </el-select>
+                </el-form-item>
                 <el-form-item style="width: 800px" label="内容" prop="content">
                     <tinymce v-model="dataForm.content" ref="tinymce"></tinymce>
                 </el-form-item>
@@ -100,6 +106,7 @@
   
 <script>
 import { createItem, updateItem, list, state } from "@/api/noticeList";
+import { allUserList } from "@/api/public";
 import waves from "@/directive/waves"; // 水波纹指令
 import Tinymce from '@/components/Tinymce'
 
@@ -109,6 +116,7 @@ export default {
     data() {
         return {
             fileImgUrl: this.upLoadUrl,
+            recipientsList: [],
             list: [],
             total: 0,
             listLoading: false,
@@ -124,6 +132,7 @@ export default {
                 content: '',
                 imgUrl: '',
                 images: [],
+                recipients: [],
             },
             dialogFormVisible: false,
             dialogStatus: '',
@@ -138,9 +147,15 @@ export default {
         }
     },
     created() {
+        this.getAllUserList(); 
         this.getList();
     },
     methods: {
+        getAllUserList() {
+            allUserList().then(response => {
+                this.recipientsList = response.data.data;
+            }).catch(() => {});
+        },
         handleRemove(file, fileList) {
             console.log(file, fileList);
             let images = [];
@@ -185,6 +200,7 @@ export default {
                 subTitle:'',
                 content: '',
                 imgUrl: '',
+                recipients: [],
                 images: [],
             };
         },