Bladeren bron

项目流程更改

lamphua 11 maanden geleden
bovenliggende
commit
9324d6c9a1

+ 97
- 0
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcSafeRequestController.java Bestand weergeven

@@ -0,0 +1,97 @@
1
+package com.ruoyi.web.controller.oa;
2
+
3
+import java.util.List;
4
+import javax.servlet.http.HttpServletResponse;
5
+import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.web.bind.annotation.GetMapping;
7
+import org.springframework.web.bind.annotation.PostMapping;
8
+import org.springframework.web.bind.annotation.PutMapping;
9
+import org.springframework.web.bind.annotation.DeleteMapping;
10
+import org.springframework.web.bind.annotation.PathVariable;
11
+import org.springframework.web.bind.annotation.RequestBody;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RestController;
14
+import com.ruoyi.common.annotation.Log;
15
+import com.ruoyi.common.core.controller.BaseController;
16
+import com.ruoyi.common.core.domain.AjaxResult;
17
+import com.ruoyi.common.enums.BusinessType;
18
+import com.ruoyi.oa.domain.CmcSafeRequest;
19
+import com.ruoyi.oa.service.ICmcSafeRequestService;
20
+import com.ruoyi.common.utils.poi.ExcelUtil;
21
+import com.ruoyi.common.core.page.TableDataInfo;
22
+
23
+/**
24
+ * cmc安全要求Controller
25
+ * 
26
+ * @author cmc
27
+ * @date 2024-07-08
28
+ */
29
+@RestController
30
+@RequestMapping("/oa/safeRequest")
31
+public class CmcSafeRequestController extends BaseController
32
+{
33
+    @Autowired
34
+    private ICmcSafeRequestService cmcSafeRequestService;
35
+
36
+    /**
37
+     * 查询cmc安全要求列表
38
+     */
39
+    @GetMapping("/list")
40
+    public TableDataInfo list(CmcSafeRequest cmcSafeRequest)
41
+    {
42
+        startPage();
43
+        List<CmcSafeRequest> list = cmcSafeRequestService.selectCmcSafeRequestList(cmcSafeRequest);
44
+        return getDataTable(list);
45
+    }
46
+
47
+    /**
48
+     * 导出cmc安全要求列表
49
+     */
50
+    @Log(title = "cmc安全要求", businessType = BusinessType.EXPORT)
51
+    @PostMapping("/export")
52
+    public void export(HttpServletResponse response, CmcSafeRequest cmcSafeRequest)
53
+    {
54
+        List<CmcSafeRequest> list = cmcSafeRequestService.selectCmcSafeRequestList(cmcSafeRequest);
55
+        ExcelUtil<CmcSafeRequest> util = new ExcelUtil<CmcSafeRequest>(CmcSafeRequest.class);
56
+        util.exportExcel(response, list, "cmc安全要求数据");
57
+    }
58
+
59
+    /**
60
+     * 获取cmc安全要求详细信息
61
+     */
62
+    @GetMapping(value = "/{requestId}")
63
+    public AjaxResult getInfo(@PathVariable("requestId") Integer requestId)
64
+    {
65
+        return success(cmcSafeRequestService.selectCmcSafeRequestByRequestId(requestId));
66
+    }
67
+
68
+    /**
69
+     * 新增cmc安全要求
70
+     */
71
+    @Log(title = "cmc安全要求", businessType = BusinessType.INSERT)
72
+    @PostMapping
73
+    public AjaxResult add(@RequestBody CmcSafeRequest cmcSafeRequest)
74
+    {
75
+        return toAjax(cmcSafeRequestService.insertCmcSafeRequest(cmcSafeRequest));
76
+    }
77
+
78
+    /**
79
+     * 修改cmc安全要求
80
+     */
81
+    @Log(title = "cmc安全要求", businessType = BusinessType.UPDATE)
82
+    @PutMapping
83
+    public AjaxResult edit(@RequestBody CmcSafeRequest cmcSafeRequest)
84
+    {
85
+        return toAjax(cmcSafeRequestService.updateCmcSafeRequest(cmcSafeRequest));
86
+    }
87
+
88
+    /**
89
+     * 删除cmc安全要求
90
+     */
91
+    @Log(title = "cmc安全要求", businessType = BusinessType.DELETE)
92
+	@DeleteMapping("/{requestIds}")
93
+    public AjaxResult remove(@PathVariable Integer[] requestIds)
94
+    {
95
+        return toAjax(cmcSafeRequestService.deleteCmcSafeRequestByRequestIds(requestIds));
96
+    }
97
+}

+ 5
- 3
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/oa/CallPlanActivityExecutionListener.java Bestand weergeven

@@ -7,12 +7,14 @@ import org.flowable.engine.delegate.DelegateExecution;
7 7
 import org.flowable.engine.delegate.ExecutionListener;
8 8
 import org.springframework.stereotype.Component;
9 9
 
10
+import java.util.Map;
11
+
10 12
 @Component("CallPlanActivityExecutionListener")
11 13
 public class CallPlanActivityExecutionListener implements ExecutionListener {
12 14
     @Override
13 15
     public void notify(DelegateExecution delegateExecution) {
14
-        SysUserPostMapper userPostMapper = SpringUtils.getBean(SysUserPostMapper.class);
15
-        Authentication.setAuthenticatedUserId(userPostMapper.selectDeptLeaderByDeptId("109").getUserId().toString());
16
-        delegateExecution.setVariable("approval", userPostMapper.selectDeptLeaderByDeptId("109").getUserId().toString());
16
+        Map<String, Object> variables = delegateExecution.getVariables();
17
+        Authentication.setAuthenticatedUserId(variables.get("planInitiator").toString());
18
+        delegateExecution.setVariable("approval", variables.get("planInitiator").toString());
17 19
     }
18 20
 }

+ 65
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcSafeRequest.java Bestand weergeven

@@ -0,0 +1,65 @@
1
+package com.ruoyi.oa.domain;
2
+
3
+import org.apache.commons.lang3.builder.ToStringBuilder;
4
+import org.apache.commons.lang3.builder.ToStringStyle;
5
+import com.ruoyi.common.annotation.Excel;
6
+import com.ruoyi.common.core.domain.BaseEntity;
7
+
8
+/**
9
+ * cmc安全要求对象 cmc_safe_request
10
+ * 
11
+ * @author cmc
12
+ * @date 2024-07-08
13
+ */
14
+public class CmcSafeRequest extends BaseEntity
15
+{
16
+    private static final long serialVersionUID = 1L;
17
+
18
+    /** 常用要求id */
19
+    private Integer requestId;
20
+
21
+    /** 安全提示类型(0环境管理要求 1安全生产要求 2信息安全要求) */
22
+    @Excel(name = "安全提示类型", readConverterExp = "0=环境管理要求,1=安全生产要求,2=信息安全要求")
23
+    private String safeType;
24
+
25
+    /** 内容 */
26
+    @Excel(name = "内容")
27
+    private String content;
28
+
29
+    public void setRequestId(Integer requestId) 
30
+    {
31
+        this.requestId = requestId;
32
+    }
33
+
34
+    public Integer getRequestId() 
35
+    {
36
+        return requestId;
37
+    }
38
+    public void setSafeType(String safeType) 
39
+    {
40
+        this.safeType = safeType;
41
+    }
42
+
43
+    public String getSafeType() 
44
+    {
45
+        return safeType;
46
+    }
47
+    public void setContent(String content) 
48
+    {
49
+        this.content = content;
50
+    }
51
+
52
+    public String getContent() 
53
+    {
54
+        return content;
55
+    }
56
+
57
+    @Override
58
+    public String toString() {
59
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
60
+            .append("requestId", getRequestId())
61
+            .append("safeType", getSafeType())
62
+            .append("content", getContent())
63
+            .toString();
64
+    }
65
+}

+ 61
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcSafeRequestMapper.java Bestand weergeven

@@ -0,0 +1,61 @@
1
+package com.ruoyi.oa.mapper;
2
+
3
+import java.util.List;
4
+import com.ruoyi.oa.domain.CmcSafeRequest;
5
+
6
+/**
7
+ * cmc安全要求Mapper接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2024-07-08
11
+ */
12
+public interface CmcSafeRequestMapper 
13
+{
14
+    /**
15
+     * 查询cmc安全要求
16
+     * 
17
+     * @param requestId cmc安全要求主键
18
+     * @return cmc安全要求
19
+     */
20
+    public CmcSafeRequest selectCmcSafeRequestByRequestId(Integer requestId);
21
+
22
+    /**
23
+     * 查询cmc安全要求列表
24
+     * 
25
+     * @param cmcSafeRequest cmc安全要求
26
+     * @return cmc安全要求集合
27
+     */
28
+    public List<CmcSafeRequest> selectCmcSafeRequestList(CmcSafeRequest cmcSafeRequest);
29
+
30
+    /**
31
+     * 新增cmc安全要求
32
+     * 
33
+     * @param cmcSafeRequest cmc安全要求
34
+     * @return 结果
35
+     */
36
+    public int insertCmcSafeRequest(CmcSafeRequest cmcSafeRequest);
37
+
38
+    /**
39
+     * 修改cmc安全要求
40
+     * 
41
+     * @param cmcSafeRequest cmc安全要求
42
+     * @return 结果
43
+     */
44
+    public int updateCmcSafeRequest(CmcSafeRequest cmcSafeRequest);
45
+
46
+    /**
47
+     * 删除cmc安全要求
48
+     * 
49
+     * @param requestId cmc安全要求主键
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcSafeRequestByRequestId(Integer requestId);
53
+
54
+    /**
55
+     * 批量删除cmc安全要求
56
+     * 
57
+     * @param requestIds 需要删除的数据主键集合
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcSafeRequestByRequestIds(Integer[] requestIds);
61
+}

+ 61
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcSafeRequestService.java Bestand weergeven

@@ -0,0 +1,61 @@
1
+package com.ruoyi.oa.service;
2
+
3
+import java.util.List;
4
+import com.ruoyi.oa.domain.CmcSafeRequest;
5
+
6
+/**
7
+ * cmc安全要求Service接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2024-07-08
11
+ */
12
+public interface ICmcSafeRequestService 
13
+{
14
+    /**
15
+     * 查询cmc安全要求
16
+     * 
17
+     * @param requestId cmc安全要求主键
18
+     * @return cmc安全要求
19
+     */
20
+    public CmcSafeRequest selectCmcSafeRequestByRequestId(Integer requestId);
21
+
22
+    /**
23
+     * 查询cmc安全要求列表
24
+     * 
25
+     * @param cmcSafeRequest cmc安全要求
26
+     * @return cmc安全要求集合
27
+     */
28
+    public List<CmcSafeRequest> selectCmcSafeRequestList(CmcSafeRequest cmcSafeRequest);
29
+
30
+    /**
31
+     * 新增cmc安全要求
32
+     * 
33
+     * @param cmcSafeRequest cmc安全要求
34
+     * @return 结果
35
+     */
36
+    public int insertCmcSafeRequest(CmcSafeRequest cmcSafeRequest);
37
+
38
+    /**
39
+     * 修改cmc安全要求
40
+     * 
41
+     * @param cmcSafeRequest cmc安全要求
42
+     * @return 结果
43
+     */
44
+    public int updateCmcSafeRequest(CmcSafeRequest cmcSafeRequest);
45
+
46
+    /**
47
+     * 批量删除cmc安全要求
48
+     * 
49
+     * @param requestIds 需要删除的cmc安全要求主键集合
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcSafeRequestByRequestIds(Integer[] requestIds);
53
+
54
+    /**
55
+     * 删除cmc安全要求信息
56
+     * 
57
+     * @param requestId cmc安全要求主键
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcSafeRequestByRequestId(Integer requestId);
61
+}

+ 93
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcSafeRequestServiceImpl.java Bestand weergeven

@@ -0,0 +1,93 @@
1
+package com.ruoyi.oa.service.impl;
2
+
3
+import java.util.List;
4
+import org.springframework.beans.factory.annotation.Autowired;
5
+import org.springframework.stereotype.Service;
6
+import com.ruoyi.oa.mapper.CmcSafeRequestMapper;
7
+import com.ruoyi.oa.domain.CmcSafeRequest;
8
+import com.ruoyi.oa.service.ICmcSafeRequestService;
9
+
10
+/**
11
+ * cmc安全要求Service业务层处理
12
+ * 
13
+ * @author cmc
14
+ * @date 2024-07-08
15
+ */
16
+@Service
17
+public class CmcSafeRequestServiceImpl implements ICmcSafeRequestService 
18
+{
19
+    @Autowired
20
+    private CmcSafeRequestMapper cmcSafeRequestMapper;
21
+
22
+    /**
23
+     * 查询cmc安全要求
24
+     * 
25
+     * @param requestId cmc安全要求主键
26
+     * @return cmc安全要求
27
+     */
28
+    @Override
29
+    public CmcSafeRequest selectCmcSafeRequestByRequestId(Integer requestId)
30
+    {
31
+        return cmcSafeRequestMapper.selectCmcSafeRequestByRequestId(requestId);
32
+    }
33
+
34
+    /**
35
+     * 查询cmc安全要求列表
36
+     * 
37
+     * @param cmcSafeRequest cmc安全要求
38
+     * @return cmc安全要求
39
+     */
40
+    @Override
41
+    public List<CmcSafeRequest> selectCmcSafeRequestList(CmcSafeRequest cmcSafeRequest)
42
+    {
43
+        return cmcSafeRequestMapper.selectCmcSafeRequestList(cmcSafeRequest);
44
+    }
45
+
46
+    /**
47
+     * 新增cmc安全要求
48
+     * 
49
+     * @param cmcSafeRequest cmc安全要求
50
+     * @return 结果
51
+     */
52
+    @Override
53
+    public int insertCmcSafeRequest(CmcSafeRequest cmcSafeRequest)
54
+    {
55
+        return cmcSafeRequestMapper.insertCmcSafeRequest(cmcSafeRequest);
56
+    }
57
+
58
+    /**
59
+     * 修改cmc安全要求
60
+     * 
61
+     * @param cmcSafeRequest cmc安全要求
62
+     * @return 结果
63
+     */
64
+    @Override
65
+    public int updateCmcSafeRequest(CmcSafeRequest cmcSafeRequest)
66
+    {
67
+        return cmcSafeRequestMapper.updateCmcSafeRequest(cmcSafeRequest);
68
+    }
69
+
70
+    /**
71
+     * 批量删除cmc安全要求
72
+     * 
73
+     * @param requestIds 需要删除的cmc安全要求主键
74
+     * @return 结果
75
+     */
76
+    @Override
77
+    public int deleteCmcSafeRequestByRequestIds(Integer[] requestIds)
78
+    {
79
+        return cmcSafeRequestMapper.deleteCmcSafeRequestByRequestIds(requestIds);
80
+    }
81
+
82
+    /**
83
+     * 删除cmc安全要求信息
84
+     * 
85
+     * @param requestId cmc安全要求主键
86
+     * @return 结果
87
+     */
88
+    @Override
89
+    public int deleteCmcSafeRequestByRequestId(Integer requestId)
90
+    {
91
+        return cmcSafeRequestMapper.deleteCmcSafeRequestByRequestId(requestId);
92
+    }
93
+}

+ 61
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcSafeRequestMapper.xml Bestand weergeven

@@ -0,0 +1,61 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.oa.mapper.CmcSafeRequestMapper">
6
+    
7
+    <resultMap type="CmcSafeRequest" id="CmcSafeRequestResult">
8
+        <result property="requestId"    column="request_id"    />
9
+        <result property="safeType"    column="safe_type"    />
10
+        <result property="content"    column="content"    />
11
+    </resultMap>
12
+
13
+    <sql id="selectCmcSafeRequestVo">
14
+        select request_id, safe_type, content from cmc_safe_request
15
+    </sql>
16
+
17
+    <select id="selectCmcSafeRequestList" parameterType="CmcSafeRequest" resultMap="CmcSafeRequestResult">
18
+        <include refid="selectCmcSafeRequestVo"/>
19
+        <where>  
20
+            <if test="safeType != null  and safeType != ''"> and safe_type = #{safeType}</if>
21
+            <if test="content != null  and content != ''"> and content = #{content}</if>
22
+        </where>
23
+    </select>
24
+    
25
+    <select id="selectCmcSafeRequestByRequestId" parameterType="Integer" resultMap="CmcSafeRequestResult">
26
+        <include refid="selectCmcSafeRequestVo"/>
27
+        where request_id = #{requestId}
28
+    </select>
29
+        
30
+    <insert id="insertCmcSafeRequest" parameterType="CmcSafeRequest" useGeneratedKeys="true" keyProperty="requestId">
31
+        insert into cmc_safe_request
32
+        <trim prefix="(" suffix=")" suffixOverrides=",">
33
+            <if test="safeType != null">safe_type,</if>
34
+            <if test="content != null">content,</if>
35
+         </trim>
36
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
37
+            <if test="safeType != null">#{safeType},</if>
38
+            <if test="content != null">#{content},</if>
39
+         </trim>
40
+    </insert>
41
+
42
+    <update id="updateCmcSafeRequest" parameterType="CmcSafeRequest">
43
+        update cmc_safe_request
44
+        <trim prefix="SET" suffixOverrides=",">
45
+            <if test="safeType != null">safe_type = #{safeType},</if>
46
+            <if test="content != null">content = #{content},</if>
47
+        </trim>
48
+        where request_id = #{requestId}
49
+    </update>
50
+
51
+    <delete id="deleteCmcSafeRequestByRequestId" parameterType="Integer">
52
+        delete from cmc_safe_request where request_id = #{requestId}
53
+    </delete>
54
+
55
+    <delete id="deleteCmcSafeRequestByRequestIds" parameterType="String">
56
+        delete from cmc_safe_request where request_id in 
57
+        <foreach item="requestId" collection="array" open="(" separator="," close=")">
58
+            #{requestId}
59
+        </foreach>
60
+    </delete>
61
+</mapper>

+ 239
- 184
oa-back/sql/sql.sql
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 44
- 0
oa-ui/src/api/oa/safe/safeRequest.js Bestand weergeven

@@ -0,0 +1,44 @@
1
+import request from '@/utils/request'
2
+
3
+// 查询cmc安全要求列表
4
+export function listSafeRequest(query) {
5
+  return request({
6
+    url: '/oa/safeRequest/list',
7
+    method: 'get',
8
+    params: query
9
+  })
10
+}
11
+
12
+// 查询cmc安全要求详细
13
+export function getSafeRequest(requestId) {
14
+  return request({
15
+    url: '/oa/safeRequest/' + requestId,
16
+    method: 'get'
17
+  })
18
+}
19
+
20
+// 新增cmc安全要求
21
+export function addSafeRequest(data) {
22
+  return request({
23
+    url: '/oa/safeRequest',
24
+    method: 'post',
25
+    data: data
26
+  })
27
+}
28
+
29
+// 修改cmc安全要求
30
+export function updateSafeRequest(data) {
31
+  return request({
32
+    url: '/oa/safeRequest',
33
+    method: 'put',
34
+    data: data
35
+  })
36
+}
37
+
38
+// 删除cmc安全要求
39
+export function delSafeRequest(requestId) {
40
+  return request({
41
+    url: '/oa/safeRequest/' + requestId,
42
+    method: 'delete'
43
+  })
44
+}

+ 3
- 3
oa-ui/src/views/index.vue Bestand weergeven

@@ -1,8 +1,8 @@
1 1
 <!--
2 2
  * @Author: ysh
3 3
  * @Date: 2024-01-03 09:23:11
4
- * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-06-14 14:03:01
4
+ * @LastEditors: wrh
5
+ * @LastEditTime: 2024-07-08 15:03:19
6 6
 -->
7 7
 
8 8
 <template>
@@ -172,7 +172,7 @@ export default {
172 172
           icon: 'dict',
173 173
           bgColor: '#e64c56',
174 174
           boxShadow: '0 5px 20px rgba(230,76,86,0.5)',
175
-          path: '/product/project',
175
+          path: '/product/account/project',
176 176
           privilege:['oa:project:query']
177 177
         }, {
178 178
           id: 5,

+ 1
- 1
oa-ui/src/views/oa/project/info.vue Bestand weergeven

@@ -638,7 +638,7 @@ export default {
638 638
     goBack() {
639 639
       let obj = { path: "/project/info" }
640 640
       this.$tab.closeOpenPage(obj);
641
-      this.$router.push({ path: '/product/project' });
641
+      this.$router.push({ path: '/product/account/project' });
642 642
     },
643 643
     reviewWord(url) {
644 644
       this.$router.push({

+ 240
- 0
oa-ui/src/views/oa/safe/request.vue Bestand weergeven

@@ -0,0 +1,240 @@
1
+<template>
2
+  <div class="app-container">
3
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
4
+      <el-form-item>
5
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
6
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
7
+      </el-form-item>
8
+    </el-form>
9
+
10
+    <el-row :gutter="10" class="mb8">
11
+      <el-col :span="1.5">
12
+        <el-button
13
+          type="primary"
14
+          plain
15
+          icon="el-icon-plus"
16
+          size="mini"
17
+          @click="handleAdd"
18
+          v-hasPermi="['oa:safe:add']"
19
+        >新增</el-button>
20
+      </el-col>
21
+      <el-col :span="1.5">
22
+        <el-button
23
+          type="success"
24
+          plain
25
+          icon="el-icon-edit"
26
+          size="mini"
27
+          :disabled="single"
28
+          @click="handleUpdate"
29
+          v-hasPermi="['oa:safe:edit']"
30
+        >修改</el-button>
31
+      </el-col>
32
+      <el-col :span="1.5">
33
+        <el-button
34
+          type="danger"
35
+          plain
36
+          icon="el-icon-delete"
37
+          size="mini"
38
+          :disabled="multiple"
39
+          @click="handleDelete"
40
+          v-hasPermi="['oa:safe:remove']"
41
+        >删除</el-button>
42
+      </el-col>
43
+      <el-col :span="1.5">
44
+        <el-button
45
+          type="warning"
46
+          plain
47
+          icon="el-icon-download"
48
+          size="mini"
49
+          @click="handleExport"
50
+          v-hasPermi="['oa:safe:export']"
51
+        >导出</el-button>
52
+      </el-col>
53
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
54
+    </el-row>
55
+
56
+    <el-table v-loading="loading" :data="safeRequestList" @selection-change="handleSelectionChange">
57
+      <el-table-column type="selection" width="55" align="center" />
58
+      <el-table-column label="常用要求id" align="center" prop="requestId" />
59
+      <el-table-column label="安全提示类型" align="center" prop="safeType" />
60
+      <el-table-column label="内容" align="center" prop="content" />
61
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
62
+        <template slot-scope="scope">
63
+          <el-button
64
+            size="mini"
65
+            type="text"
66
+            icon="el-icon-edit"
67
+            @click="handleUpdate(scope.row)"
68
+            v-hasPermi="['oa:safe:edit']"
69
+          >修改</el-button>
70
+          <el-button
71
+            size="mini"
72
+            type="text"
73
+            icon="el-icon-delete"
74
+            @click="handleDelete(scope.row)"
75
+            v-hasPermi="['oa:safe:remove']"
76
+          >删除</el-button>
77
+        </template>
78
+      </el-table-column>
79
+    </el-table>
80
+    
81
+    <pagination
82
+      v-show="total>0"
83
+      :total="total"
84
+      :page.sync="queryParams.pageNum"
85
+      :limit.sync="queryParams.pageSize"
86
+      @pagination="getList"
87
+    />
88
+
89
+    <!-- 添加或修改cmc安全要求对话框 -->
90
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
91
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
92
+        <el-form-item label="内容">
93
+          <editor v-model="form.content" :min-height="192"/>
94
+        </el-form-item>
95
+      </el-form>
96
+      <div slot="footer" class="dialog-footer">
97
+        <el-button type="primary" @click="submitForm">确 定</el-button>
98
+        <el-button @click="cancel">取 消</el-button>
99
+      </div>
100
+    </el-dialog>
101
+  </div>
102
+</template>
103
+
104
+<script>
105
+import { listSafeRequest, getSafeRequest, delSafeRequest, addSafeRequest, updateSafeRequest } from "@/api/oa/safe/safeRequest";
106
+
107
+export default {
108
+  name: "SafeRequest",
109
+  data() {
110
+    return {
111
+      // 遮罩层
112
+      loading: true,
113
+      // 选中数组
114
+      ids: [],
115
+      // 非单个禁用
116
+      single: true,
117
+      // 非多个禁用
118
+      multiple: true,
119
+      // 显示搜索条件
120
+      showSearch: true,
121
+      // 总条数
122
+      total: 0,
123
+      // cmc安全要求表格数据
124
+      safeRequestList: [],
125
+      // 弹出层标题
126
+      title: "",
127
+      // 是否显示弹出层
128
+      open: false,
129
+      // 查询参数
130
+      queryParams: {
131
+        pageNum: 1,
132
+        pageSize: 10,
133
+        safeType: null,
134
+        content: null
135
+      },
136
+      // 表单参数
137
+      form: {},
138
+      // 表单校验
139
+      rules: {
140
+      }
141
+    };
142
+  },
143
+  created() {
144
+    this.getList();
145
+  },
146
+  methods: {
147
+    /** 查询cmc安全要求列表 */
148
+    getList() {
149
+      this.loading = true;
150
+      listSafeRequest(this.queryParams).then(response => {
151
+        this.safeRequestList = response.rows;
152
+        this.total = response.total;
153
+        this.loading = false;
154
+      });
155
+    },
156
+    // 取消按钮
157
+    cancel() {
158
+      this.open = false;
159
+      this.reset();
160
+    },
161
+    // 表单重置
162
+    reset() {
163
+      this.form = {
164
+        requestId: null,
165
+        safeType: null,
166
+        content: null
167
+      };
168
+      this.resetForm("form");
169
+    },
170
+    /** 搜索按钮操作 */
171
+    handleQuery() {
172
+      this.queryParams.pageNum = 1;
173
+      this.getList();
174
+    },
175
+    /** 重置按钮操作 */
176
+    resetQuery() {
177
+      this.resetForm("queryForm");
178
+      this.handleQuery();
179
+    },
180
+    // 多选框选中数据
181
+    handleSelectionChange(selection) {
182
+      this.ids = selection.map(item => item.requestId)
183
+      this.single = selection.length!==1
184
+      this.multiple = !selection.length
185
+    },
186
+    /** 新增按钮操作 */
187
+    handleAdd() {
188
+      this.reset();
189
+      this.open = true;
190
+      this.title = "添加cmc安全要求";
191
+    },
192
+    /** 修改按钮操作 */
193
+    handleUpdate(row) {
194
+      this.reset();
195
+      const requestId = row.requestId || this.ids
196
+      getSafeRequest(requestId).then(response => {
197
+        this.form = response.data;
198
+        this.open = true;
199
+        this.title = "修改cmc安全要求";
200
+      });
201
+    },
202
+    /** 提交按钮 */
203
+    submitForm() {
204
+      this.$refs["form"].validate(valid => {
205
+        if (valid) {
206
+          if (this.form.requestId != null) {
207
+            updateSafeRequest(this.form).then(response => {
208
+              this.$modal.msgSuccess("修改成功");
209
+              this.open = false;
210
+              this.getList();
211
+            });
212
+          } else {
213
+            addSafeRequest(this.form).then(response => {
214
+              this.$modal.msgSuccess("新增成功");
215
+              this.open = false;
216
+              this.getList();
217
+            });
218
+          }
219
+        }
220
+      });
221
+    },
222
+    /** 删除按钮操作 */
223
+    handleDelete(row) {
224
+      const requestIds = row.requestId || this.ids;
225
+      this.$modal.confirm('是否确认删除cmc安全要求编号为"' + requestIds + '"的数据项?').then(function() {
226
+        return delSafeRequest(requestIds);
227
+      }).then(() => {
228
+        this.getList();
229
+        this.$modal.msgSuccess("删除成功");
230
+      }).catch(() => {});
231
+    },
232
+    /** 导出按钮操作 */
233
+    handleExport() {
234
+      this.download('oa/safeRequest/export', {
235
+        ...this.queryParams
236
+      }, `safeRequest_${new Date().getTime()}.xlsx`)
237
+    }
238
+  }
239
+};
240
+</script>

Laden…
Annuleren
Opslaan