瀏覽代碼

办公用品表

lamphua 1 年之前
父節點
當前提交
3e2eb6b95a

+ 98
- 0
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcSupplyController.java 查看文件

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

+ 253
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcSupply.java 查看文件

@@ -0,0 +1,253 @@
1
+package com.ruoyi.oa.domain;
2
+
3
+import java.math.BigDecimal;
4
+import java.util.Date;
5
+import com.fasterxml.jackson.annotation.JsonFormat;
6
+import org.apache.commons.lang3.builder.ToStringBuilder;
7
+import org.apache.commons.lang3.builder.ToStringStyle;
8
+import com.ruoyi.common.annotation.Excel;
9
+import com.ruoyi.common.core.domain.BaseEntity;
10
+
11
+/**
12
+ * cmc用品信息对象 cmc_supply
13
+ * 
14
+ * @author cmc
15
+ * @date 2024-04-25
16
+ */
17
+public class CmcSupply extends BaseEntity
18
+{
19
+    private static final long serialVersionUID = 1L;
20
+
21
+    /** 办公用品id */
22
+    private Long supplyId;
23
+
24
+    /** 办公用品编码 */
25
+    @Excel(name = "办公用品编码")
26
+    private String supplyNumber;
27
+
28
+    /** 出厂编号 */
29
+    @Excel(name = "出厂编号")
30
+    private String code;
31
+
32
+    /** 用品名称 */
33
+    @Excel(name = "用品名称")
34
+    private String name;
35
+
36
+    /** 用品类别 */
37
+    @Excel(name = "用品类别")
38
+    private String type;
39
+
40
+    /** 购置时间 */
41
+    @JsonFormat(pattern = "yyyy-MM-dd")
42
+    @Excel(name = "购置时间", width = 30, dateFormat = "yyyy-MM-dd")
43
+    private Date acquisitionTime;
44
+
45
+    /** 购买价格 */
46
+    @Excel(name = "购买价格")
47
+    private BigDecimal cost;
48
+
49
+    /** 预计使用年限 */
50
+    @Excel(name = "预计使用年限")
51
+    private Long expectLife;
52
+
53
+    /** 规格型号 */
54
+    @Excel(name = "规格型号")
55
+    private String series;
56
+
57
+    /** 用品品牌 */
58
+    @Excel(name = "用品品牌")
59
+    private String brand;
60
+
61
+    /** 单日成本 */
62
+    @Excel(name = "单日成本")
63
+    private BigDecimal dayCost;
64
+
65
+    /** 存放地点 */
66
+    @Excel(name = "存放地点")
67
+    private String place;
68
+
69
+    /** 校验周期(年) */
70
+    @Excel(name = "校验周期", readConverterExp = "年=")
71
+    private Long checkTerm;
72
+
73
+    /** 保修期(月) */
74
+    @Excel(name = "保修期", readConverterExp = "月=")
75
+    private Long warranty;
76
+
77
+    /** 校验日期 */
78
+    @JsonFormat(pattern = "yyyy-MM-dd")
79
+    @Excel(name = "校验日期", width = 30, dateFormat = "yyyy-MM-dd")
80
+    private Date checkTime;
81
+
82
+    /** 管理部门 */
83
+    @Excel(name = "管理部门")
84
+    private Long manageDept;
85
+
86
+    public void setSupplyId(Long supplyId) 
87
+    {
88
+        this.supplyId = supplyId;
89
+    }
90
+
91
+    public Long getSupplyId() 
92
+    {
93
+        return supplyId;
94
+    }
95
+    public void setSupplyNumber(String supplyNumber) 
96
+    {
97
+        this.supplyNumber = supplyNumber;
98
+    }
99
+
100
+    public String getSupplyNumber() 
101
+    {
102
+        return supplyNumber;
103
+    }
104
+    public void setCode(String code) 
105
+    {
106
+        this.code = code;
107
+    }
108
+
109
+    public String getCode() 
110
+    {
111
+        return code;
112
+    }
113
+    public void setName(String name) 
114
+    {
115
+        this.name = name;
116
+    }
117
+
118
+    public String getName() 
119
+    {
120
+        return name;
121
+    }
122
+    public void setType(String type) 
123
+    {
124
+        this.type = type;
125
+    }
126
+
127
+    public String getType() 
128
+    {
129
+        return type;
130
+    }
131
+    public void setAcquisitionTime(Date acquisitionTime) 
132
+    {
133
+        this.acquisitionTime = acquisitionTime;
134
+    }
135
+
136
+    public Date getAcquisitionTime() 
137
+    {
138
+        return acquisitionTime;
139
+    }
140
+    public void setCost(BigDecimal cost) 
141
+    {
142
+        this.cost = cost;
143
+    }
144
+
145
+    public BigDecimal getCost() 
146
+    {
147
+        return cost;
148
+    }
149
+    public void setExpectLife(Long expectLife) 
150
+    {
151
+        this.expectLife = expectLife;
152
+    }
153
+
154
+    public Long getExpectLife() 
155
+    {
156
+        return expectLife;
157
+    }
158
+    public void setSeries(String series) 
159
+    {
160
+        this.series = series;
161
+    }
162
+
163
+    public String getSeries() 
164
+    {
165
+        return series;
166
+    }
167
+    public void setBrand(String brand) 
168
+    {
169
+        this.brand = brand;
170
+    }
171
+
172
+    public String getBrand() 
173
+    {
174
+        return brand;
175
+    }
176
+    public void setDayCost(BigDecimal dayCost) 
177
+    {
178
+        this.dayCost = dayCost;
179
+    }
180
+
181
+    public BigDecimal getDayCost() 
182
+    {
183
+        return dayCost;
184
+    }
185
+    public void setPlace(String place) 
186
+    {
187
+        this.place = place;
188
+    }
189
+
190
+    public String getPlace() 
191
+    {
192
+        return place;
193
+    }
194
+    public void setCheckTerm(Long checkTerm) 
195
+    {
196
+        this.checkTerm = checkTerm;
197
+    }
198
+
199
+    public Long getCheckTerm() 
200
+    {
201
+        return checkTerm;
202
+    }
203
+    public void setWarranty(Long warranty) 
204
+    {
205
+        this.warranty = warranty;
206
+    }
207
+
208
+    public Long getWarranty() 
209
+    {
210
+        return warranty;
211
+    }
212
+    public void setCheckTime(Date checkTime) 
213
+    {
214
+        this.checkTime = checkTime;
215
+    }
216
+
217
+    public Date getCheckTime() 
218
+    {
219
+        return checkTime;
220
+    }
221
+    public void setManageDept(Long manageDept) 
222
+    {
223
+        this.manageDept = manageDept;
224
+    }
225
+
226
+    public Long getManageDept() 
227
+    {
228
+        return manageDept;
229
+    }
230
+
231
+    @Override
232
+    public String toString() {
233
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
234
+            .append("supplyId", getSupplyId())
235
+            .append("supplyNumber", getSupplyNumber())
236
+            .append("code", getCode())
237
+            .append("name", getName())
238
+            .append("type", getType())
239
+            .append("acquisitionTime", getAcquisitionTime())
240
+            .append("cost", getCost())
241
+            .append("expectLife", getExpectLife())
242
+            .append("series", getSeries())
243
+            .append("brand", getBrand())
244
+            .append("dayCost", getDayCost())
245
+            .append("place", getPlace())
246
+            .append("remark", getRemark())
247
+            .append("checkTerm", getCheckTerm())
248
+            .append("warranty", getWarranty())
249
+            .append("checkTime", getCheckTime())
250
+            .append("manageDept", getManageDept())
251
+            .toString();
252
+    }
253
+}

+ 61
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcSupplyMapper.java 查看文件

@@ -0,0 +1,61 @@
1
+package com.ruoyi.oa.mapper;
2
+
3
+import java.util.List;
4
+import com.ruoyi.oa.domain.CmcSupply;
5
+
6
+/**
7
+ * cmc用品信息Mapper接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2024-04-25
11
+ */
12
+public interface CmcSupplyMapper 
13
+{
14
+    /**
15
+     * 查询cmc用品信息
16
+     * 
17
+     * @param supplyId cmc用品信息主键
18
+     * @return cmc用品信息
19
+     */
20
+    public CmcSupply selectCmcSupplyBySupplyId(Long supplyId);
21
+
22
+    /**
23
+     * 查询cmc用品信息列表
24
+     * 
25
+     * @param cmcSupply cmc用品信息
26
+     * @return cmc用品信息集合
27
+     */
28
+    public List<CmcSupply> selectCmcSupplyList(CmcSupply cmcSupply);
29
+
30
+    /**
31
+     * 新增cmc用品信息
32
+     * 
33
+     * @param cmcSupply cmc用品信息
34
+     * @return 结果
35
+     */
36
+    public int insertCmcSupply(CmcSupply cmcSupply);
37
+
38
+    /**
39
+     * 修改cmc用品信息
40
+     * 
41
+     * @param cmcSupply cmc用品信息
42
+     * @return 结果
43
+     */
44
+    public int updateCmcSupply(CmcSupply cmcSupply);
45
+
46
+    /**
47
+     * 删除cmc用品信息
48
+     * 
49
+     * @param supplyId cmc用品信息主键
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcSupplyBySupplyId(Long supplyId);
53
+
54
+    /**
55
+     * 批量删除cmc用品信息
56
+     * 
57
+     * @param supplyIds 需要删除的数据主键集合
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcSupplyBySupplyIds(Long[] supplyIds);
61
+}

+ 61
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcSupplyService.java 查看文件

@@ -0,0 +1,61 @@
1
+package com.ruoyi.oa.service;
2
+
3
+import java.util.List;
4
+import com.ruoyi.oa.domain.CmcSupply;
5
+
6
+/**
7
+ * cmc用品信息Service接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2024-04-25
11
+ */
12
+public interface ICmcSupplyService 
13
+{
14
+    /**
15
+     * 查询cmc用品信息
16
+     * 
17
+     * @param supplyId cmc用品信息主键
18
+     * @return cmc用品信息
19
+     */
20
+    public CmcSupply selectCmcSupplyBySupplyId(Long supplyId);
21
+
22
+    /**
23
+     * 查询cmc用品信息列表
24
+     * 
25
+     * @param cmcSupply cmc用品信息
26
+     * @return cmc用品信息集合
27
+     */
28
+    public List<CmcSupply> selectCmcSupplyList(CmcSupply cmcSupply);
29
+
30
+    /**
31
+     * 新增cmc用品信息
32
+     * 
33
+     * @param cmcSupply cmc用品信息
34
+     * @return 结果
35
+     */
36
+    public int insertCmcSupply(CmcSupply cmcSupply);
37
+
38
+    /**
39
+     * 修改cmc用品信息
40
+     * 
41
+     * @param cmcSupply cmc用品信息
42
+     * @return 结果
43
+     */
44
+    public int updateCmcSupply(CmcSupply cmcSupply);
45
+
46
+    /**
47
+     * 批量删除cmc用品信息
48
+     * 
49
+     * @param supplyIds 需要删除的cmc用品信息主键集合
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcSupplyBySupplyIds(Long[] supplyIds);
53
+
54
+    /**
55
+     * 删除cmc用品信息信息
56
+     * 
57
+     * @param supplyId cmc用品信息主键
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcSupplyBySupplyId(Long supplyId);
61
+}

+ 93
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcSupplyServiceImpl.java 查看文件

@@ -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.CmcSupplyMapper;
7
+import com.ruoyi.oa.domain.CmcSupply;
8
+import com.ruoyi.oa.service.ICmcSupplyService;
9
+
10
+/**
11
+ * cmc用品信息Service业务层处理
12
+ * 
13
+ * @author cmc
14
+ * @date 2024-04-25
15
+ */
16
+@Service
17
+public class CmcSupplyServiceImpl implements ICmcSupplyService 
18
+{
19
+    @Autowired
20
+    private CmcSupplyMapper cmcSupplyMapper;
21
+
22
+    /**
23
+     * 查询cmc用品信息
24
+     * 
25
+     * @param supplyId cmc用品信息主键
26
+     * @return cmc用品信息
27
+     */
28
+    @Override
29
+    public CmcSupply selectCmcSupplyBySupplyId(Long supplyId)
30
+    {
31
+        return cmcSupplyMapper.selectCmcSupplyBySupplyId(supplyId);
32
+    }
33
+
34
+    /**
35
+     * 查询cmc用品信息列表
36
+     * 
37
+     * @param cmcSupply cmc用品信息
38
+     * @return cmc用品信息
39
+     */
40
+    @Override
41
+    public List<CmcSupply> selectCmcSupplyList(CmcSupply cmcSupply)
42
+    {
43
+        return cmcSupplyMapper.selectCmcSupplyList(cmcSupply);
44
+    }
45
+
46
+    /**
47
+     * 新增cmc用品信息
48
+     * 
49
+     * @param cmcSupply cmc用品信息
50
+     * @return 结果
51
+     */
52
+    @Override
53
+    public int insertCmcSupply(CmcSupply cmcSupply)
54
+    {
55
+        return cmcSupplyMapper.insertCmcSupply(cmcSupply);
56
+    }
57
+
58
+    /**
59
+     * 修改cmc用品信息
60
+     * 
61
+     * @param cmcSupply cmc用品信息
62
+     * @return 结果
63
+     */
64
+    @Override
65
+    public int updateCmcSupply(CmcSupply cmcSupply)
66
+    {
67
+        return cmcSupplyMapper.updateCmcSupply(cmcSupply);
68
+    }
69
+
70
+    /**
71
+     * 批量删除cmc用品信息
72
+     * 
73
+     * @param supplyIds 需要删除的cmc用品信息主键
74
+     * @return 结果
75
+     */
76
+    @Override
77
+    public int deleteCmcSupplyBySupplyIds(Long[] supplyIds)
78
+    {
79
+        return cmcSupplyMapper.deleteCmcSupplyBySupplyIds(supplyIds);
80
+    }
81
+
82
+    /**
83
+     * 删除cmc用品信息信息
84
+     * 
85
+     * @param supplyId cmc用品信息主键
86
+     * @return 结果
87
+     */
88
+    @Override
89
+    public int deleteCmcSupplyBySupplyId(Long supplyId)
90
+    {
91
+        return cmcSupplyMapper.deleteCmcSupplyBySupplyId(supplyId);
92
+    }
93
+}

+ 130
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcSupplyMapper.xml 查看文件

@@ -0,0 +1,130 @@
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.CmcSupplyMapper">
6
+    
7
+    <resultMap type="CmcSupply" id="CmcSupplyResult">
8
+        <result property="supplyId"    column="supply_id"    />
9
+        <result property="supplyNumber"    column="supply_number"    />
10
+        <result property="code"    column="code"    />
11
+        <result property="name"    column="name"    />
12
+        <result property="type"    column="type"    />
13
+        <result property="acquisitionTime"    column="acquisition_time"    />
14
+        <result property="cost"    column="cost"    />
15
+        <result property="expectLife"    column="expect_life"    />
16
+        <result property="series"    column="series"    />
17
+        <result property="brand"    column="brand"    />
18
+        <result property="dayCost"    column="day_cost"    />
19
+        <result property="place"    column="place"    />
20
+        <result property="remark"    column="remark"    />
21
+        <result property="checkTerm"    column="check_term"    />
22
+        <result property="warranty"    column="warranty"    />
23
+        <result property="checkTime"    column="check_time"    />
24
+        <result property="manageDept"    column="manage_dept"    />
25
+    </resultMap>
26
+
27
+    <sql id="selectCmcSupplyVo">
28
+        select supply_id, supply_number, code, name, type, acquisition_time, cost, expect_life, series, brand, day_cost, place, remark, check_term, warranty, check_time, manage_dept from cmc_supply
29
+    </sql>
30
+
31
+    <select id="selectCmcSupplyList" parameterType="CmcSupply" resultMap="CmcSupplyResult">
32
+        <include refid="selectCmcSupplyVo"/>
33
+        <where>  
34
+            <if test="supplyNumber != null  and supplyNumber != ''"> and supply_number = #{supplyNumber}</if>
35
+            <if test="code != null  and code != ''"> and code = #{code}</if>
36
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
37
+            <if test="type != null  and type != ''"> and type = #{type}</if>
38
+            <if test="acquisitionTime != null "> and acquisition_time = #{acquisitionTime}</if>
39
+            <if test="cost != null "> and cost = #{cost}</if>
40
+            <if test="expectLife != null "> and expect_life = #{expectLife}</if>
41
+            <if test="series != null  and series != ''"> and series = #{series}</if>
42
+            <if test="brand != null  and brand != ''"> and brand = #{brand}</if>
43
+            <if test="dayCost != null "> and day_cost = #{dayCost}</if>
44
+            <if test="place != null  and place != ''"> and place = #{place}</if>
45
+            <if test="checkTerm != null "> and check_term = #{checkTerm}</if>
46
+            <if test="warranty != null "> and warranty = #{warranty}</if>
47
+            <if test="checkTime != null "> and check_time = #{checkTime}</if>
48
+            <if test="manageDept != null "> and manage_dept = #{manageDept}</if>
49
+        </where>
50
+    </select>
51
+    
52
+    <select id="selectCmcSupplyBySupplyId" parameterType="Long" resultMap="CmcSupplyResult">
53
+        <include refid="selectCmcSupplyVo"/>
54
+        where supply_id = #{supplyId}
55
+    </select>
56
+        
57
+    <insert id="insertCmcSupply" parameterType="CmcSupply" useGeneratedKeys="true" keyProperty="supplyId">
58
+        insert into cmc_supply
59
+        <trim prefix="(" suffix=")" suffixOverrides=",">
60
+            <if test="supplyNumber != null">supply_number,</if>
61
+            <if test="code != null">code,</if>
62
+            <if test="name != null">name,</if>
63
+            <if test="type != null">type,</if>
64
+            <if test="acquisitionTime != null">acquisition_time,</if>
65
+            <if test="cost != null">cost,</if>
66
+            <if test="expectLife != null">expect_life,</if>
67
+            <if test="series != null">series,</if>
68
+            <if test="brand != null">brand,</if>
69
+            <if test="dayCost != null">day_cost,</if>
70
+            <if test="place != null">place,</if>
71
+            <if test="remark != null">remark,</if>
72
+            <if test="checkTerm != null">check_term,</if>
73
+            <if test="warranty != null">warranty,</if>
74
+            <if test="checkTime != null">check_time,</if>
75
+            <if test="manageDept != null">manage_dept,</if>
76
+         </trim>
77
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
78
+            <if test="supplyNumber != null">#{supplyNumber},</if>
79
+            <if test="code != null">#{code},</if>
80
+            <if test="name != null">#{name},</if>
81
+            <if test="type != null">#{type},</if>
82
+            <if test="acquisitionTime != null">#{acquisitionTime},</if>
83
+            <if test="cost != null">#{cost},</if>
84
+            <if test="expectLife != null">#{expectLife},</if>
85
+            <if test="series != null">#{series},</if>
86
+            <if test="brand != null">#{brand},</if>
87
+            <if test="dayCost != null">#{dayCost},</if>
88
+            <if test="place != null">#{place},</if>
89
+            <if test="remark != null">#{remark},</if>
90
+            <if test="checkTerm != null">#{checkTerm},</if>
91
+            <if test="warranty != null">#{warranty},</if>
92
+            <if test="checkTime != null">#{checkTime},</if>
93
+            <if test="manageDept != null">#{manageDept},</if>
94
+         </trim>
95
+    </insert>
96
+
97
+    <update id="updateCmcSupply" parameterType="CmcSupply">
98
+        update cmc_supply
99
+        <trim prefix="SET" suffixOverrides=",">
100
+            <if test="supplyNumber != null">supply_number = #{supplyNumber},</if>
101
+            <if test="code != null">code = #{code},</if>
102
+            <if test="name != null">name = #{name},</if>
103
+            <if test="type != null">type = #{type},</if>
104
+            <if test="acquisitionTime != null">acquisition_time = #{acquisitionTime},</if>
105
+            <if test="cost != null">cost = #{cost},</if>
106
+            <if test="expectLife != null">expect_life = #{expectLife},</if>
107
+            <if test="series != null">series = #{series},</if>
108
+            <if test="brand != null">brand = #{brand},</if>
109
+            <if test="dayCost != null">day_cost = #{dayCost},</if>
110
+            <if test="place != null">place = #{place},</if>
111
+            <if test="remark != null">remark = #{remark},</if>
112
+            <if test="checkTerm != null">check_term = #{checkTerm},</if>
113
+            <if test="warranty != null">warranty = #{warranty},</if>
114
+            <if test="checkTime != null">check_time = #{checkTime},</if>
115
+            <if test="manageDept != null">manage_dept = #{manageDept},</if>
116
+        </trim>
117
+        where supply_id = #{supplyId}
118
+    </update>
119
+
120
+    <delete id="deleteCmcSupplyBySupplyId" parameterType="Long">
121
+        delete from cmc_supply where supply_id = #{supplyId}
122
+    </delete>
123
+
124
+    <delete id="deleteCmcSupplyBySupplyIds" parameterType="String">
125
+        delete from cmc_supply where supply_id in 
126
+        <foreach item="supplyId" collection="array" open="(" separator="," close=")">
127
+            #{supplyId}
128
+        </foreach>
129
+    </delete>
130
+</mapper>

+ 391
- 363
oa-back/sql/sql.sql
文件差異過大導致無法顯示
查看文件


+ 44
- 0
oa-ui/src/api/oa/supply/supply.js 查看文件

@@ -0,0 +1,44 @@
1
+import request from '@/utils/request'
2
+
3
+// 查询cmc用品信息列表
4
+export function listSupply(query) {
5
+  return request({
6
+    url: '/oa/supply/list',
7
+    method: 'get',
8
+    params: query
9
+  })
10
+}
11
+
12
+// 查询cmc用品信息详细
13
+export function getSupply(supplyId) {
14
+  return request({
15
+    url: '/oa/supply/' + supplyId,
16
+    method: 'get'
17
+  })
18
+}
19
+
20
+// 新增cmc用品信息
21
+export function addSupply(data) {
22
+  return request({
23
+    url: '/oa/supply',
24
+    method: 'post',
25
+    data: data
26
+  })
27
+}
28
+
29
+// 修改cmc用品信息
30
+export function updateSupply(data) {
31
+  return request({
32
+    url: '/oa/supply',
33
+    method: 'put',
34
+    data: data
35
+  })
36
+}
37
+
38
+// 删除cmc用品信息
39
+export function delSupply(supplyId) {
40
+  return request({
41
+    url: '/oa/supply/' + supplyId,
42
+    method: 'delete'
43
+  })
44
+}

+ 1
- 0
oa-ui/src/assets/icons/svg/desktop.svg 查看文件

@@ -0,0 +1 @@
1
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1714012227825" class="icon" viewBox="0 0 4257 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2057" xmlns:xlink="http://www.w3.org/1999/xlink" width="831.4453125" height="200"><path d="M1633.307598 735.652979h-256.530279c-5.739491-0.124772-11.229438 1.996345-15.346899 5.989034-4.117461 3.992689-6.363348 9.482637-6.363348 15.222127v161.953455c0 5.739491 2.370659 11.229438 6.363348 15.222127 4.117461 3.992689 9.607408 6.113805 15.346899 5.989034H1633.307598c5.739491 0.124772 11.229438-1.996345 15.346899-5.989034 4.117461-3.992689 6.363348-9.482637 6.363349-15.222127V756.739369c0-5.739491-2.370659-11.229438-6.363349-15.222128-4.117461-3.992689-9.607408-6.113805-15.346899-5.864262z m0-258.651395h-256.530279c-11.603753 0-21.08639 9.482637-21.086389 21.08639V660.041428c0 5.739491 2.370659 11.229438 6.363348 15.222128 4.117461 3.992689 9.607408 6.113805 15.346899 5.989033H1633.307598c5.739491 0.124772 11.229438-1.996345 15.346899-5.989033 4.117461-3.992689 6.363348-9.482637 6.363349-15.222128V498.087974c0-5.739491-2.370659-11.229438-6.363349-15.222128-4.117461-3.867918-9.607408-5.989034-15.346899-5.864262z m0 0" fill="#2c2c2c" p-id="2058"></path><path d="M2215.865902 308.934324H1928.641825l-43.545266-26.576337V254.533934h126.518338c10.605581-0.124772 20.836847-4.616547 28.198367-12.22761 7.361521-7.611064 11.478981-17.967101 11.229438-28.572682v-172.18472c0.124772-10.605581-3.867918-20.961618-11.229438-28.572682-7.361521-7.611064-17.592787-12.102839-28.198367-12.227611h-315.671987c-10.605581 0.124772-20.836847 4.616547-28.198368 12.227611-7.361521 7.611064-11.478981 17.967101-11.229438 28.572682v172.18472c-0.124772 10.605581 3.867918 20.961618 11.229438 28.572682 7.361521 7.611064 17.592787 12.102839 28.198368 12.22761h127.890825v28.572682l-43.545267 26.576338H1444.777807v-4.117461l-5.489948-18.341416c-4.367004-15.845985-4.367004-32.565371 0-48.286585l9.482637-26.576337c5.240405-15.721214 7.361521-32.440599 6.113805-49.035214v-25.827708c-2.495431-14.972584-16.2203-25.453393-31.317656-23.831363h-68.000487c-13.974412 0.623858-25.578165 11.229438-27.200195 25.20385v25.827708c-1.247715 16.594614 0.873401 33.189229 6.113805 49.035214l9.482637 26.576337c4.367004 15.845985 4.367004 32.565371 0 48.286585l-5.489947 18.341416v4.11746h-162.702084c-13.101011 0.374315-23.831363 10.730352-24.455221 23.831364v68.000487c0 13.600097 10.855124 24.829536 24.455221 25.203851h24.455221c13.600097 0.374315 24.455221 11.478981 24.455221 25.20385v544.378214c0 13.600097 10.855124 24.829536 24.455221 25.20385h24.455222c13.600097-0.374315 24.455221-11.478981 24.455221-25.20385V453.170221c0-13.600097 10.855124-24.829536 24.455221-25.203851h745.135616c13.600097 0.374315 24.455221 11.478981 24.455221 25.203851v544.378213c0 13.600097 10.855124 24.829536 24.455221 25.203851h24.455221c13.600097-0.374315 24.455221-11.478981 24.455221-25.203851V453.170221c0-13.600097 10.855124-24.829536 24.455222-25.203851h24.455221c6.987206 0 13.724869-2.869745 18.590959-8.11015 4.741318-5.115633 7.236749-12.102839 6.612891-19.090045v-68.000487c0.124772-13.101011-10.605581-23.457049-23.706592-23.831364z m0 0" fill="#2c2c2c" p-id="2059"></path><path d="M2049.794987 498.087974c0-5.739491-2.370659-11.229438-6.363348-15.222128-4.117461-3.992689-9.607408-6.113805-15.346899-5.989034H1772.178318c-5.739491-0.124772-11.229438 1.996345-15.346899 5.989034-4.117461 3.992689-6.363348 9.482637-6.363348 15.222128v420.604849c0 5.739491 2.370659 11.229438 6.363348 15.222128 4.117461 3.992689 9.607408 6.113805 15.346899 5.989033h255.906422c5.739491 0.124772 11.229438-1.996345 15.346899-5.989033 4.117461-3.992689 6.363348-9.482637 6.363348-15.222128V498.087974z m0 0" fill="#2c2c2c" p-id="2060"></path></svg>

+ 4
- 4
oa-ui/src/views/flowable/form/contractForm.vue 查看文件

@@ -817,10 +817,10 @@ export default {
817 817
               }
818 818
               else if (this.commentOpen == true && this.meetingOpen == false) {
819 819
                 let approvalList = [];
820
-                for (let commment of this.commentList) {
821
-                  commment.contractId = this.form.contractId
822
-                  addContractComment(commment);
823
-                  approvalList.push(commment.userId)
820
+                for (let comment of this.commentList) {
821
+                  comment.contractId = this.form.contractId
822
+                  addContractComment(comment);
823
+                  approvalList.push(comment.userId)
824 824
                 }
825 825
                 this.$set(this.taskForm.variables, "approvalList", approvalList);
826 826
                 this.$set(this.taskForm.variables, "commentType", '2');

+ 453
- 0
oa-ui/src/views/oa/supply/index.vue 查看文件

@@ -0,0 +1,453 @@
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 label="办公用品编码" prop="supplyNumber">
5
+        <el-input
6
+          v-model="queryParams.supplyNumber"
7
+          placeholder="请输入办公用品编码"
8
+          clearable
9
+          @keyup.enter.native="handleQuery"
10
+        />
11
+      </el-form-item>
12
+      <el-form-item label="出厂编号" prop="code">
13
+        <el-input
14
+          v-model="queryParams.code"
15
+          placeholder="请输入出厂编号"
16
+          clearable
17
+          @keyup.enter.native="handleQuery"
18
+        />
19
+      </el-form-item>
20
+      <el-form-item label="用品名称" prop="name">
21
+        <el-input
22
+          v-model="queryParams.name"
23
+          placeholder="请输入用品名称"
24
+          clearable
25
+          @keyup.enter.native="handleQuery"
26
+        />
27
+      </el-form-item>
28
+      <el-form-item label="购置时间" prop="acquisitionTime">
29
+        <el-date-picker clearable
30
+          v-model="queryParams.acquisitionTime"
31
+          type="date"
32
+          value-format="yyyy-MM-dd"
33
+          placeholder="请选择购置时间">
34
+        </el-date-picker>
35
+      </el-form-item>
36
+      <el-form-item label="购买价格" prop="cost">
37
+        <el-input
38
+          v-model="queryParams.cost"
39
+          placeholder="请输入购买价格"
40
+          clearable
41
+          @keyup.enter.native="handleQuery"
42
+        />
43
+      </el-form-item>
44
+      <el-form-item label="预计使用年限" prop="expectLife">
45
+        <el-input
46
+          v-model="queryParams.expectLife"
47
+          placeholder="请输入预计使用年限"
48
+          clearable
49
+          @keyup.enter.native="handleQuery"
50
+        />
51
+      </el-form-item>
52
+      <el-form-item label="规格型号" prop="series">
53
+        <el-input
54
+          v-model="queryParams.series"
55
+          placeholder="请输入规格型号"
56
+          clearable
57
+          @keyup.enter.native="handleQuery"
58
+        />
59
+      </el-form-item>
60
+      <el-form-item label="用品品牌" prop="brand">
61
+        <el-input
62
+          v-model="queryParams.brand"
63
+          placeholder="请输入用品品牌"
64
+          clearable
65
+          @keyup.enter.native="handleQuery"
66
+        />
67
+      </el-form-item>
68
+      <el-form-item label="单日成本" prop="dayCost">
69
+        <el-input
70
+          v-model="queryParams.dayCost"
71
+          placeholder="请输入单日成本"
72
+          clearable
73
+          @keyup.enter.native="handleQuery"
74
+        />
75
+      </el-form-item>
76
+      <el-form-item label="存放地点" prop="place">
77
+        <el-input
78
+          v-model="queryParams.place"
79
+          placeholder="请输入存放地点"
80
+          clearable
81
+          @keyup.enter.native="handleQuery"
82
+        />
83
+      </el-form-item>
84
+      <el-form-item label="校验周期" prop="checkTerm">
85
+        <el-input
86
+          v-model="queryParams.checkTerm"
87
+          placeholder="请输入校验周期"
88
+          clearable
89
+          @keyup.enter.native="handleQuery"
90
+        />
91
+      </el-form-item>
92
+      <el-form-item label="保修期" prop="warranty">
93
+        <el-input
94
+          v-model="queryParams.warranty"
95
+          placeholder="请输入保修期"
96
+          clearable
97
+          @keyup.enter.native="handleQuery"
98
+        />
99
+      </el-form-item>
100
+      <el-form-item label="校验日期" prop="checkTime">
101
+        <el-date-picker clearable
102
+          v-model="queryParams.checkTime"
103
+          type="date"
104
+          value-format="yyyy-MM-dd"
105
+          placeholder="请选择校验日期">
106
+        </el-date-picker>
107
+      </el-form-item>
108
+      <el-form-item label="管理部门" prop="manageDept">
109
+        <el-input
110
+          v-model="queryParams.manageDept"
111
+          placeholder="请输入管理部门"
112
+          clearable
113
+          @keyup.enter.native="handleQuery"
114
+        />
115
+      </el-form-item>
116
+      <el-form-item>
117
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
118
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
119
+      </el-form-item>
120
+    </el-form>
121
+
122
+    <el-row :gutter="10" class="mb8">
123
+      <el-col :span="1.5">
124
+        <el-button
125
+          type="primary"
126
+          plain
127
+          icon="el-icon-plus"
128
+          size="mini"
129
+          @click="handleAdd"
130
+          v-hasPermi="['oa:supply:add']"
131
+        >新增</el-button>
132
+      </el-col>
133
+      <el-col :span="1.5">
134
+        <el-button
135
+          type="success"
136
+          plain
137
+          icon="el-icon-edit"
138
+          size="mini"
139
+          :disabled="single"
140
+          @click="handleUpdate"
141
+          v-hasPermi="['oa:supply:edit']"
142
+        >修改</el-button>
143
+      </el-col>
144
+      <el-col :span="1.5">
145
+        <el-button
146
+          type="danger"
147
+          plain
148
+          icon="el-icon-delete"
149
+          size="mini"
150
+          :disabled="multiple"
151
+          @click="handleDelete"
152
+          v-hasPermi="['oa:supply:remove']"
153
+        >删除</el-button>
154
+      </el-col>
155
+      <el-col :span="1.5">
156
+        <el-button
157
+          type="warning"
158
+          plain
159
+          icon="el-icon-download"
160
+          size="mini"
161
+          @click="handleExport"
162
+          v-hasPermi="['oa:supply:export']"
163
+        >导出</el-button>
164
+      </el-col>
165
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
166
+    </el-row>
167
+
168
+    <el-table v-loading="loading" :data="supplyList" @selection-change="handleSelectionChange">
169
+      <el-table-column type="selection" width="55" align="center" />
170
+      <el-table-column label="办公用品id" align="center" prop="supplyId" />
171
+      <el-table-column label="办公用品编码" align="center" prop="supplyNumber" />
172
+      <el-table-column label="出厂编号" align="center" prop="code" />
173
+      <el-table-column label="用品名称" align="center" prop="name" />
174
+      <el-table-column label="用品类别" align="center" prop="type" />
175
+      <el-table-column label="购置时间" align="center" prop="acquisitionTime" width="180">
176
+        <template slot-scope="scope">
177
+          <span>{{ parseTime(scope.row.acquisitionTime, '{y}-{m}-{d}') }}</span>
178
+        </template>
179
+      </el-table-column>
180
+      <el-table-column label="购买价格" align="center" prop="cost" />
181
+      <el-table-column label="预计使用年限" align="center" prop="expectLife" />
182
+      <el-table-column label="规格型号" align="center" prop="series" />
183
+      <el-table-column label="用品品牌" align="center" prop="brand" />
184
+      <el-table-column label="单日成本" align="center" prop="dayCost" />
185
+      <el-table-column label="存放地点" align="center" prop="place" />
186
+      <el-table-column label="备注" align="center" prop="remark" />
187
+      <el-table-column label="校验周期" align="center" prop="checkTerm" />
188
+      <el-table-column label="保修期" align="center" prop="warranty" />
189
+      <el-table-column label="校验日期" align="center" prop="checkTime" width="180">
190
+        <template slot-scope="scope">
191
+          <span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d}') }}</span>
192
+        </template>
193
+      </el-table-column>
194
+      <el-table-column label="管理部门" align="center" prop="manageDept" />
195
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
196
+        <template slot-scope="scope">
197
+          <el-button
198
+            size="mini"
199
+            type="text"
200
+            icon="el-icon-edit"
201
+            @click="handleUpdate(scope.row)"
202
+            v-hasPermi="['oa:supply:edit']"
203
+          >修改</el-button>
204
+          <el-button
205
+            size="mini"
206
+            type="text"
207
+            icon="el-icon-delete"
208
+            @click="handleDelete(scope.row)"
209
+            v-hasPermi="['oa:supply:remove']"
210
+          >删除</el-button>
211
+        </template>
212
+      </el-table-column>
213
+    </el-table>
214
+    
215
+    <pagination
216
+      v-show="total>0"
217
+      :total="total"
218
+      :page.sync="queryParams.pageNum"
219
+      :limit.sync="queryParams.pageSize"
220
+      @pagination="getList"
221
+    />
222
+
223
+    <!-- 添加或修改cmc用品信息对话框 -->
224
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
225
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
226
+        <el-form-item label="办公用品编码" prop="supplyNumber">
227
+          <el-input v-model="form.supplyNumber" placeholder="请输入办公用品编码" />
228
+        </el-form-item>
229
+        <el-form-item label="出厂编号" prop="code">
230
+          <el-input v-model="form.code" placeholder="请输入出厂编号" />
231
+        </el-form-item>
232
+        <el-form-item label="用品名称" prop="name">
233
+          <el-input v-model="form.name" placeholder="请输入用品名称" />
234
+        </el-form-item>
235
+        <el-form-item label="购置时间" prop="acquisitionTime">
236
+          <el-date-picker clearable
237
+            v-model="form.acquisitionTime"
238
+            type="date"
239
+            value-format="yyyy-MM-dd"
240
+            placeholder="请选择购置时间">
241
+          </el-date-picker>
242
+        </el-form-item>
243
+        <el-form-item label="购买价格" prop="cost">
244
+          <el-input v-model="form.cost" placeholder="请输入购买价格" />
245
+        </el-form-item>
246
+        <el-form-item label="预计使用年限" prop="expectLife">
247
+          <el-input v-model="form.expectLife" placeholder="请输入预计使用年限" />
248
+        </el-form-item>
249
+        <el-form-item label="规格型号" prop="series">
250
+          <el-input v-model="form.series" placeholder="请输入规格型号" />
251
+        </el-form-item>
252
+        <el-form-item label="用品品牌" prop="brand">
253
+          <el-input v-model="form.brand" placeholder="请输入用品品牌" />
254
+        </el-form-item>
255
+        <el-form-item label="单日成本" prop="dayCost">
256
+          <el-input v-model="form.dayCost" placeholder="请输入单日成本" />
257
+        </el-form-item>
258
+        <el-form-item label="存放地点" prop="place">
259
+          <el-input v-model="form.place" placeholder="请输入存放地点" />
260
+        </el-form-item>
261
+        <el-form-item label="备注" prop="remark">
262
+          <el-input v-model="form.remark" placeholder="请输入备注" />
263
+        </el-form-item>
264
+        <el-form-item label="校验周期" prop="checkTerm">
265
+          <el-input v-model="form.checkTerm" placeholder="请输入校验周期" />
266
+        </el-form-item>
267
+        <el-form-item label="保修期" prop="warranty">
268
+          <el-input v-model="form.warranty" placeholder="请输入保修期" />
269
+        </el-form-item>
270
+        <el-form-item label="校验日期" prop="checkTime">
271
+          <el-date-picker clearable
272
+            v-model="form.checkTime"
273
+            type="date"
274
+            value-format="yyyy-MM-dd"
275
+            placeholder="请选择校验日期">
276
+          </el-date-picker>
277
+        </el-form-item>
278
+        <el-form-item label="管理部门" prop="manageDept">
279
+          <el-input v-model="form.manageDept" placeholder="请输入管理部门" />
280
+        </el-form-item>
281
+      </el-form>
282
+      <div slot="footer" class="dialog-footer">
283
+        <el-button type="primary" @click="submitForm">确 定</el-button>
284
+        <el-button @click="cancel">取 消</el-button>
285
+      </div>
286
+    </el-dialog>
287
+  </div>
288
+</template>
289
+
290
+<script>
291
+import { listSupply, getSupply, delSupply, addSupply, updateSupply } from "@/api/oa/supply/supply";
292
+
293
+export default {
294
+  name: "Supply",
295
+  data() {
296
+    return {
297
+      // 遮罩层
298
+      loading: true,
299
+      // 选中数组
300
+      ids: [],
301
+      // 非单个禁用
302
+      single: true,
303
+      // 非多个禁用
304
+      multiple: true,
305
+      // 显示搜索条件
306
+      showSearch: true,
307
+      // 总条数
308
+      total: 0,
309
+      // cmc用品信息表格数据
310
+      supplyList: [],
311
+      // 弹出层标题
312
+      title: "",
313
+      // 是否显示弹出层
314
+      open: false,
315
+      // 查询参数
316
+      queryParams: {
317
+        pageNum: 1,
318
+        pageSize: 10,
319
+        supplyNumber: null,
320
+        code: null,
321
+        name: null,
322
+        type: null,
323
+        acquisitionTime: null,
324
+        cost: null,
325
+        expectLife: null,
326
+        series: null,
327
+        brand: null,
328
+        dayCost: null,
329
+        place: null,
330
+        checkTerm: null,
331
+        warranty: null,
332
+        checkTime: null,
333
+        manageDept: null
334
+      },
335
+      // 表单参数
336
+      form: {},
337
+      // 表单校验
338
+      rules: {
339
+      }
340
+    };
341
+  },
342
+  created() {
343
+    this.getList();
344
+  },
345
+  methods: {
346
+    /** 查询cmc用品信息列表 */
347
+    getList() {
348
+      this.loading = true;
349
+      listSupply(this.queryParams).then(response => {
350
+        this.supplyList = response.rows;
351
+        this.total = response.total;
352
+        this.loading = false;
353
+      });
354
+    },
355
+    // 取消按钮
356
+    cancel() {
357
+      this.open = false;
358
+      this.reset();
359
+    },
360
+    // 表单重置
361
+    reset() {
362
+      this.form = {
363
+        supplyId: null,
364
+        supplyNumber: null,
365
+        code: null,
366
+        name: null,
367
+        type: null,
368
+        acquisitionTime: null,
369
+        cost: null,
370
+        expectLife: null,
371
+        series: null,
372
+        brand: null,
373
+        dayCost: null,
374
+        place: null,
375
+        remark: null,
376
+        checkTerm: null,
377
+        warranty: null,
378
+        checkTime: null,
379
+        manageDept: null
380
+      };
381
+      this.resetForm("form");
382
+    },
383
+    /** 搜索按钮操作 */
384
+    handleQuery() {
385
+      this.queryParams.pageNum = 1;
386
+      this.getList();
387
+    },
388
+    /** 重置按钮操作 */
389
+    resetQuery() {
390
+      this.resetForm("queryForm");
391
+      this.handleQuery();
392
+    },
393
+    // 多选框选中数据
394
+    handleSelectionChange(selection) {
395
+      this.ids = selection.map(item => item.supplyId)
396
+      this.single = selection.length!==1
397
+      this.multiple = !selection.length
398
+    },
399
+    /** 新增按钮操作 */
400
+    handleAdd() {
401
+      this.reset();
402
+      this.open = true;
403
+      this.title = "添加cmc用品信息";
404
+    },
405
+    /** 修改按钮操作 */
406
+    handleUpdate(row) {
407
+      this.reset();
408
+      const supplyId = row.supplyId || this.ids
409
+      getSupply(supplyId).then(response => {
410
+        this.form = response.data;
411
+        this.open = true;
412
+        this.title = "修改cmc用品信息";
413
+      });
414
+    },
415
+    /** 提交按钮 */
416
+    submitForm() {
417
+      this.$refs["form"].validate(valid => {
418
+        if (valid) {
419
+          if (this.form.supplyId != null) {
420
+            updateSupply(this.form).then(response => {
421
+              this.$modal.msgSuccess("修改成功");
422
+              this.open = false;
423
+              this.getList();
424
+            });
425
+          } else {
426
+            addSupply(this.form).then(response => {
427
+              this.$modal.msgSuccess("新增成功");
428
+              this.open = false;
429
+              this.getList();
430
+            });
431
+          }
432
+        }
433
+      });
434
+    },
435
+    /** 删除按钮操作 */
436
+    handleDelete(row) {
437
+      const supplyIds = row.supplyId || this.ids;
438
+      this.$modal.confirm('是否确认删除cmc用品信息编号为"' + supplyIds + '"的数据项?').then(function() {
439
+        return delSupply(supplyIds);
440
+      }).then(() => {
441
+        this.getList();
442
+        this.$modal.msgSuccess("删除成功");
443
+      }).catch(() => {});
444
+    },
445
+    /** 导出按钮操作 */
446
+    handleExport() {
447
+      this.download('oa/supply/export', {
448
+        ...this.queryParams
449
+      }, `supply_${new Date().getTime()}.xlsx`)
450
+    }
451
+  }
452
+};
453
+</script>

Loading…
取消
儲存