ly il y a 1 an
Parent
commit
11edd766ef

+ 140 - 20
master/src/main/java/com/ruoyi/project/plant/controller/TMtMeetingController.java

@@ -1,17 +1,21 @@
 package com.ruoyi.project.plant.controller;
 
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
 import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
+import com.ruoyi.common.sendEmail.IMailService;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.framework.config.RuoYiConfig;
 import com.ruoyi.project.plant.domain.TMtOpextrack;
+import com.ruoyi.project.plant.domain.TMtdDaily;
+import com.ruoyi.project.plant.domain.TMtdEmail;
 import com.ruoyi.project.plant.mapper.TMtOpextrackMapper;
 import com.ruoyi.project.plant.service.*;
 import com.ruoyi.project.production.domain.TMonthplan;
+import com.ruoyi.project.system.domain.SysUser;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.xwpf.usermodel.*;
@@ -58,6 +62,12 @@ public class TMtMeetingController extends BaseController
     private TMtOpextrackMapper tMtOpextrackMapper;
     @Autowired
     private ITMtPersonService tMtPersonService;
+    @Autowired
+    private IMailService mailService;
+    //系统基础配置
+    @Autowired
+    private RuoYiConfig ruoyiConfig;
+
     /**
      * 查询装置会议列表
      */
@@ -100,7 +110,9 @@ public class TMtMeetingController extends BaseController
     @GetMapping("/last")
     public AjaxResult getLast(TMtMeeting tMtMeeting)
     {
-        return AjaxResult.success(tMtMeetingService.selectTMtMeetingLast(tMtMeeting));
+        TMtMeeting t = tMtMeetingService.selectTMtMeetingLast(tMtMeeting);
+        t.setId(null);
+        return AjaxResult.success(t);
     }
 
     /**
@@ -111,7 +123,11 @@ public class TMtMeetingController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TMtMeeting tMtMeeting)
     {
-        return toAjax(tMtMeetingService.insertTMtMeeting(tMtMeeting));
+        tMtMeetingService.insertTMtMeeting(tMtMeeting);
+        String url = getReport(null,tMtMeeting.getId());
+        tMtMeeting.setWordUrl(url);
+        tMtMeetingService.updateTMtMeeting(tMtMeeting);
+        return AjaxResult.success();
     }
 
     /**
@@ -122,7 +138,11 @@ public class TMtMeetingController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody TMtMeeting tMtMeeting)
     {
-        return toAjax(tMtMeetingService.updateTMtMeeting(tMtMeeting));
+        tMtMeetingService.updateTMtMeeting(tMtMeeting);
+        String url = getReport(null,tMtMeeting.getId());
+        tMtMeeting.setWordUrl(url);
+        tMtMeetingService.updateTMtMeeting(tMtMeeting);
+        return AjaxResult.success();
     }
 
     /**
@@ -139,11 +159,10 @@ public class TMtMeetingController extends BaseController
     /**
      * 生成报告
      */
-    @RequestMapping(value = "/meetingReport", produces = "application/json;charset=utf-8")
-    @ResponseBody
-    public void AutoReport(HttpServletRequest request, HttpServletResponse response, Long year ,Long meetingId) {
+//    @RequestMapping(value = "/meetingReport", produces = "application/json;charset=utf-8")
+//    @ResponseBody
+    public String getReport( Long year ,Long meetingId) {
         logger.info("meetingId:" + meetingId);
-        String savePath = request.getSession().getServletContext().getRealPath("/"); // 系统根路径
         String tempUrl = "";
         tempUrl =  "static/word/meeting.docx"; // 经理模板文件
         // 保存结果文
@@ -154,18 +173,37 @@ public class TMtMeetingController extends BaseController
             // 替换word模板数据
             replaceAll(doc,year,meetingId);
 
-            response.setContentType("application/octet-stream");// 下载,默认就是下载
-            response.setCharacterEncoding("UTF-8");
-            response.setHeader("Content-Disposition",
-                    "attachment;fileName=" + URLEncoder.encode("meetingReport" + ".docx", "UTF-8"));
+//            response.setContentType("application/octet-stream");// 下载,默认就是下载
+//            response.setCharacterEncoding("UTF-8");
+//            response.setHeader("Content-Disposition",
+//                    "attachment;fileName=" + URLEncoder.encode("meetingReport" + ".docx", "UTF-8"));
+
+
+            // 生成word的路径
+            String fileDir = RuoYiConfig.getProfile() + "/" + "plant/meeting";
+            // 生成word的文件名称
+            String fileName = "装置周会议"+ meetingId + ".docx";
+            String filePath = fileDir + "/" + fileName;
+            File dir = new File(fileDir);
+            if (!dir.exists()) {
+                logger.info("目录不存在,创建文件夹{}!", fileDir);
+                dir.mkdirs();
+            }
+            FileOutputStream out = new FileOutputStream(filePath);
+            doc.write(out);
+            out.close();
+            String pathFileName = FileUploadUtils.getPathFileName(RuoYiConfig.getFilePath("/" + "plant/meeting"), fileName);
+            logger.info("pathFileName::::::::" + pathFileName);
+            return pathFileName;
             // 刷新缓冲
-            response.flushBuffer();
-            OutputStream ouputStream = response.getOutputStream();
-            doc.write(ouputStream);
-            ouputStream.flush();
-            ouputStream.close();
+//            response.flushBuffer();
+//            OutputStream ouputStream = response.getOutputStream();
+//            doc.write(ouputStream);
+//            ouputStream.flush();
+//            ouputStream.close();
         } catch (Exception e) {
             e.printStackTrace();
+            return "";
         }
     }
     /**
@@ -313,4 +351,86 @@ public class TMtMeetingController extends BaseController
         }
     }
 
+    /**
+     * 发送调度会议邮件
+     */
+    @PreAuthorize("@ss.hasPermi('plant:dailyMeeting:edit')")
+    @Log(title = "发送调度会议邮件", businessType = BusinessType.OTHER)
+    @GetMapping("/sendMail")
+    public AjaxResult sendMail(TMtMeeting tMtMeeting)
+    {
+        TMtMeeting mtMeeting = tMtMeetingService.selectTMtMeetingById(tMtMeeting.getId());
+
+        //写html开始内容
+        String start = "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title></title></head><body><div style=\"background-color:#ECECEC; padding: 35px;\">" +
+                "<table cellpadding=\"0\" align=\"center\"" +
+                "style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family:微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial;background:#fff;\">" +
+                "<tbody><tr><th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #42a3d3; background-color: #49bcff; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">" +
+                "<font face=\"微软雅黑\" size=\"5\" style=\"color: rgb(255, 255, 255); \">化工装置管理系统 </font><font face=\"微软雅黑\" size=\"3\" style=\"color: rgb(255, 255, 255); \">Chemical Plant Management System(CPMS)</font></th></tr>";
+        //写html结尾内容
+        String end = "</tbody></table></div></body></html>";
+        String username = "";
+
+//        email = "735032128@qq.com";
+        //表html中间内容
+        String prime = "";
+        String firstcenter = "<tr><td><div style=\"padding:25px 35px 40px; background-color:#fff;\"><h2 style=\"margin: 5px 0px; \">" +
+                "<font color=\"#333333\" style=\"line-height: 20px; \"><font style=\"line-height: 22px; \" size=\"4\">" +
+                "亲爱的 CPMS用户</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
+                "<p>您有一条新的调度会议:<br>" +
+                "会议日期:<b>meetingDate</b><br>" +
+                "请前往<a href=\"requestJumpPath/plant/meeting/detail/dailyId\">会议详情</a>查看或下载邮件附件。<br>" +
+                "<p align=\"right\">date</p>" +
+                "<div style=\"width:700px;margin:0 auto;\">" +
+                "<div style=\"padding:10px 10px 0;border-top:1px solid #ccc;color:#747474;margin-bottom:20px;line-height:1.3em;font-size:12px;\">" +
+                "<p>此为系统邮件,请勿回复<br>This e-Mail is an automatic reminder sent by CPMS, please do not reply</p>" +
+                "</div></div></div></td></tr>";
+
+        String pattern = "yyyy年MM月dd日"; // 定义日期格式化模板
+
+        SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); // 创建日期格式化器
+
+        String formattedDate = dateFormat.format(mtMeeting.getMeetingDate()); // 将日期转换为字符串
+
+        String one = firstcenter.replaceFirst("meetingDate", formattedDate);
+        String two = one.replace("requestJumpPath", this.ruoyiConfig.getRequestJumpPath());
+        String three = two.replace("dailyId", mtMeeting.getId().toString());
+        String result = three.replaceFirst("date",  dateFormat.format(new Date()));
+        prime = prime + result;
+        //拼接html
+        String html = start + prime + end;
+
+        // 需要转换的文件路径
+        String filePath = RuoYiConfig.getProfile()+mtMeeting.getWordUrl().replace("/profile","");
+
+        //发送人和抄送人
+        String[] email = {"735032128@qq.com", "1213269375@qq.com"};
+        String[] emailCc = {"ly@seashoreept.com", "ly735032128@gmail.com"};
+
+        ArrayList<String> emailList = new ArrayList<>();
+        ArrayList<String> emailCcList = new ArrayList<>();
+
+//        List<TMtdEmail> list = tMtdEmailService.selectTMtdEmailList(new TMtdEmail());
+//        for (TMtdEmail t: list
+//        ) {
+//            SysUser user = sysUserService.selectUserByStaffId(t.getStaffid());
+//            if (user != null) {
+//                if (t.getType() == 1) {
+//                    emailList.add(user.getEmail());
+//                }
+//                if (t.getType() == 2) {
+//                    emailCcList.add(user.getEmail());
+//                }
+//            }
+//
+//        }
+        email = emailList.toArray(new String[emailList.size()]);
+        emailCc = emailCcList.toArray(new String[emailCcList.size()]);
+        logger.info("发送人:" + email.toString());
+        logger.info("抄送人:" + emailCc.toString());
+        mailService.sendAttachmentsMail(email, "CPMS:您有一条"+ formattedDate+"装置调度会议信息", html, emailCc,filePath);
+        return AjaxResult.success();
+    }
+
+
 }

+ 33 - 7
master/src/main/java/com/ruoyi/project/plant/controller/TMtdDailyController.java

@@ -4,10 +4,7 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 import com.alibaba.fastjson.JSON;
 import com.deepoove.poi.XWPFTemplate;
@@ -21,11 +18,14 @@ import com.ruoyi.common.sendEmail.IMailService;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.framework.config.RuoYiConfig;
+import com.ruoyi.project.plant.domain.TMtdEmail;
 import com.ruoyi.project.plant.domain.TMtdItem;
 import com.ruoyi.project.plant.mapper.TMtdItemMapper;
+import com.ruoyi.project.plant.service.ITMtdEmailService;
 import com.ruoyi.project.sems.safecheck.domain.TSpecWeekcheck;
 import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.mapper.SysUserMapper;
+import com.ruoyi.project.system.service.ISysUserService;
 import io.jsonwebtoken.lang.Assert;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -70,7 +70,10 @@ public class TMtdDailyController extends BaseController
     private RuoYiConfig ruoyiConfig;
     @Resource
     private SysUserMapper sysUserMapper;
-
+    @Autowired
+    private ITMtdEmailService tMtdEmailService;
+    @Autowired
+    private ISysUserService sysUserService;
     /**
      * 查询调度会议列表
      */
@@ -196,8 +199,7 @@ public class TMtdDailyController extends BaseController
         //写html结尾内容
         String end = "</tbody></table></div></body></html>";
         String username = "";
-        String[] email = {"735032128@qq.com", "1213269375@qq.com"};
-        String[] emailCc = {"ly@seashoreept.com", "ly735032128@gmail.com"};
+
 //        email = "735032128@qq.com";
         //表html中间内容
         String prime = "";
@@ -230,7 +232,31 @@ public class TMtdDailyController extends BaseController
         // 需要转换的文件路径
         String filePath = RuoYiConfig.getProfile()+daily.getWordUrl().replace("/profile","");
 
+        //发送人和抄送人
+        String[] email = {"735032128@qq.com", "1213269375@qq.com"};
+        String[] emailCc = {"ly@seashoreept.com", "ly735032128@gmail.com"};
+
+        ArrayList<String> emailList = new ArrayList<>();
+        ArrayList<String> emailCcList = new ArrayList<>();
+
+        List<TMtdEmail> list = tMtdEmailService.selectTMtdEmailList(new TMtdEmail());
+        for (TMtdEmail t: list
+        ) {
+            SysUser user = sysUserService.selectUserByStaffId(t.getStaffid());
+            if (user != null) {
+                if (t.getType() == 1) {
+                    emailList.add(user.getEmail());
+                }
+                if (t.getType() == 2) {
+                    emailCcList.add(user.getEmail());
+                }
+            }
 
+        }
+        email = emailList.toArray(new String[emailList.size()]);
+        emailCc = emailCcList.toArray(new String[emailCcList.size()]);
+        logger.info("发送人:" + email.toString());
+        logger.info("抄送人:" + emailCc.toString());
         mailService.sendAttachmentsMail(email, "CPMS:您有一条"+ formattedDate+"装置调度会议信息", html, emailCc,filePath);
         return AjaxResult.success();
     }

+ 10 - 0
master/src/main/java/com/ruoyi/project/plant/domain/TMtMeeting.java

@@ -65,6 +65,8 @@ public class TMtMeeting extends BaseEntity
     @Excel(name = "所属部门")
     private Long deptId;
 
+    private String wordUrl;
+
     /** 部门名称 */
     @Excel(name = "部门名称")
     private String deptName;
@@ -208,6 +210,14 @@ public class TMtMeeting extends BaseEntity
         return remarks;
     }
 
+    public String getWordUrl() {
+        return wordUrl;
+    }
+
+    public void setWordUrl(String wordUrl) {
+        this.wordUrl = wordUrl;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 5 - 1
master/src/main/resources/mybatis/plant/TMtMeetingMapper.xml

@@ -20,10 +20,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptId"    column="dept_id"    />
         <result property="remarks"    column="remarks"    />
         <result property="deptName" column="dept_name" />
+        <result property="wordUrl"    column="word_url"    />
     </resultMap>
 
     <sql id="selectTMtMeetingVo">
-        select d.id, d.plant_code, d.recorder, d.meeting_no, d.meeting_date, d.venue, d.subject, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_mt_meeting d
+        select d.id, d.plant_code, d.recorder,d.word_url, d.meeting_no, d.meeting_date, d.venue, d.subject, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_mt_meeting d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -75,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="remarks != null">remarks,</if>
+            <if test="wordUrl != null">word_url,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -91,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">#{updatedate},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="remarks != null">#{remarks},</if>
+            <if test="wordUrl != null">#{wordUrl},</if>
          </trim>
     </insert>
 
@@ -110,6 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate = #{updatedate},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="wordUrl != null">word_url = #{wordUrl},</if>
         </trim>
         where id = #{id}
     </update>

+ 1 - 1
master/src/main/resources/mybatis/plant/TMtPersonMapper.xml

@@ -34,8 +34,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectTMtPersonVo"/>
         <where>
             <if test="name != null  and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
-            and is_cc = #{isCc}
             <if test="meetingId != null  and meetingId != ''"> and meeting_id = #{meetingId}</if>
+            <if test="isCc != null  and isCc != ''"> and is_cc = #{isCc}</if>
             <if test="meetingId == null  or meetingId == ''"> and is_his = 0</if>
             and d.del_flag = 0
         </where>

+ 1 - 1
ui/src/api/plant/dailyMeeting.js

@@ -9,7 +9,7 @@ export function listDailyMeeting(query) {
   })
 }
 
-// 查询调度会议列表
+// 发送邮件
 export function sendMail(query) {
   return request({
     url: '/plant/dailyMeeting/sendMail',

+ 9 - 0
ui/src/api/plant/meeting.js

@@ -61,3 +61,12 @@ export function exportMeeting(query) {
     params: query
   })
 }
+
+// 发送邮件
+export function sendMail(query) {
+  return request({
+    url: '/plant/meeting/sendMail',
+    method: 'get',
+    params: query
+  })
+}

+ 1 - 2
ui/src/views/components/meeting/actionlist.vue

@@ -59,7 +59,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['plant:meeting:add']"
         >{{ $t('新增') }}</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -129,7 +128,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['plant:meeting:remove']"
+            v-if="checkPermi(['plant:meeting:remove']) || scope.row.responsible == getStaffId()"
           >{{ $t('删除') }}</el-button>
         </template>
       </el-table-column>

+ 0 - 1
ui/src/views/components/meeting/ehsopenitem.vue

@@ -50,7 +50,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['plant:meeting:add']"
         >{{ $t('新增') }}</el-button>
       </el-col>
       <el-col :span="1.5">

+ 0 - 1
ui/src/views/components/meeting/interlock.vue

@@ -14,7 +14,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['plant:meeting:add']"
         >{{ $t('新增') }}</el-button>
       </el-col>
       <el-col :span="1.5">

+ 4 - 4
ui/src/views/components/meeting/keymaintenance.vue

@@ -50,7 +50,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['plant:meeting:add']"
         >{{ $t('新增') }}</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -60,7 +59,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['plant:meeting:edit']"
+          v-if="checkPermi(['plant:meeting:edit']) || scope.row.responsible == getStaffId()"
         >{{ $t('修改') }}</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -70,7 +69,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['plant:meeting:remove']"
+          v-if="checkPermi(['plant:meeting:remove']) || scope.row.responsible == getStaffId()"
         >{{ $t('删除') }}</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -120,7 +119,8 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['plant:meeting:remove']"
+            v-if="checkPermi(['plant:meeting:remove']) || scope.row.responsible == getStaffId()"
+
           >{{ $t('删除') }}</el-button>
         </template>
       </el-table-column>

+ 3 - 3
ui/src/views/components/meeting/messageattention.vue

@@ -43,7 +43,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['plant:meeting:add']"
         >{{ $t('新增') }}</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -53,7 +52,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['plant:meeting:edit']"
+          v-if="checkPermi(['plant:meeting:edit']) || scope.row.responsible == getStaffId()"
         >{{ $t('修改') }}</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -101,7 +100,8 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['plant:meeting:remove']"
+            v-if="checkPermi(['plant:meeting:remove']) || scope.row.responsible == getStaffId()"
+
           >{{ $t('删除') }}</el-button>
         </template>
       </el-table-column>

+ 0 - 1
ui/src/views/components/meeting/opextrack.vue

@@ -32,7 +32,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['plant:meeting:add']"
         >{{ $t('新增') }}</el-button>
       </el-col>
       <el-col :span="1.5">

+ 0 - 1
ui/src/views/components/meeting/riskreminder.vue

@@ -32,7 +32,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['plant:meeting:add']"
         >{{ $t('新增') }}</el-button>
       </el-col>
       <el-col :span="1.5">

+ 1 - 0
ui/src/views/plant/dailyMeeting/detail.vue

@@ -395,6 +395,7 @@ export default {
         this.form.optMode = this.optModeData
         updateDailyMeeting(this.form).then(response => {
           this.msgSuccess("修改成功");
+          this.close()
         });
       } else {
         this.form.optItem = this.optItemList.join(",")

+ 26 - 18
ui/src/views/plant/hismeeting/index.vue

@@ -103,30 +103,23 @@
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-folder"
-            @click="handleEditTable(scope.row)"
-            v-hasPermi="['plant:meeting:edit']"
-          >{{ $t('会议内容') }}</el-button>
+            icon="el-icon-view"
+            @click="wordView(scope.row.wordUrl)"
+          >预览</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-folder"
-            @click="getReport(scope.row)"
-          >{{ $t('生成报告') }}</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
+            @click="handleEditTable(scope.row)"
             v-hasPermi="['plant:meeting:edit']"
-          >{{ $t('修改') }}</el-button>
+          >{{ $t('会议内容') }}</el-button>
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['plant:meeting:remove']"
-          >{{ $t('删除') }}</el-button>
+            icon="el-icon-mail"
+            @click="handleMail(scope.row)"
+            v-hasPermi="['plant:dailyMeeting:edit']"
+          >发送邮件</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -219,19 +212,22 @@
               <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
           </div>
       </el-dialog>
+    <Yulan ref="yulanRef"></Yulan>
   </div>
 </template>
 
 <script>
-import { listMeeting, getMeeting, delMeeting, addMeeting, updateMeeting, exportMeeting, importTemplate} from "@/api/plant/meeting";
+import { listMeeting, getMeeting, delMeeting, addMeeting, updateMeeting, exportMeeting, importTemplate,sendMail} from "@/api/plant/meeting";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import Yulan from '@/views/components/yulan/index.vue'
+
 
 export default {
   name: "Meeting",
-  components: { Treeselect },
+  components: { Treeselect,Yulan },
   data() {
     return {
       meetingId: 0,
@@ -477,6 +473,18 @@ export default {
           this.$refs['downloadFileForm'].submit()
         })
       },
+    wordView(url){
+      // 通过ref引用子组件
+      const yulan = this.$refs.yulanRef;
+      // 调用子组件的方法并传递参数
+      yulan.handleSee("调度会议" , url);
+    },
+    handleMail(row){
+      let parm = {id: row.id}
+      sendMail(parm).then(response => {
+        this.msgSuccess("发送成功");
+      });
+    },
   }
 };
 </script>