Browse Source

新增设备作业记录表

lamphua 1 day ago
parent
commit
ab88b65fbd

+ 97
- 0
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceLogController.java View File

@@ -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.CmcDeviceLog;
19
+import com.ruoyi.oa.service.ICmcDeviceLogService;
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 2025-06-10
28
+ */
29
+@RestController
30
+@RequestMapping("/oa/deviceLog")
31
+public class CmcDeviceLogController extends BaseController
32
+{
33
+    @Autowired
34
+    private ICmcDeviceLogService cmcDeviceLogService;
35
+
36
+    /**
37
+     * 查询cmc仪器记录列表
38
+     */
39
+    @GetMapping("/list")
40
+    public TableDataInfo list(CmcDeviceLog cmcDeviceLog)
41
+    {
42
+        startPage();
43
+        List<CmcDeviceLog> list = cmcDeviceLogService.selectCmcDeviceLogList(cmcDeviceLog);
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, CmcDeviceLog cmcDeviceLog)
53
+    {
54
+        List<CmcDeviceLog> list = cmcDeviceLogService.selectCmcDeviceLogList(cmcDeviceLog);
55
+        ExcelUtil<CmcDeviceLog> util = new ExcelUtil<CmcDeviceLog>(CmcDeviceLog.class);
56
+        util.exportExcel(response, list, "cmc仪器记录数据");
57
+    }
58
+
59
+    /**
60
+     * 获取cmc仪器记录详细信息
61
+     */
62
+    @GetMapping(value = "/{logId}")
63
+    public AjaxResult getInfo(@PathVariable("logId") Integer logId)
64
+    {
65
+        return success(cmcDeviceLogService.selectCmcDeviceLogByLogId(logId));
66
+    }
67
+
68
+    /**
69
+     * 新增cmc仪器记录
70
+     */
71
+    @Log(title = "cmc仪器记录", businessType = BusinessType.INSERT)
72
+    @PostMapping
73
+    public AjaxResult add(@RequestBody CmcDeviceLog cmcDeviceLog)
74
+    {
75
+        return toAjax(cmcDeviceLogService.insertCmcDeviceLog(cmcDeviceLog));
76
+    }
77
+
78
+    /**
79
+     * 修改cmc仪器记录
80
+     */
81
+    @Log(title = "cmc仪器记录", businessType = BusinessType.UPDATE)
82
+    @PutMapping
83
+    public AjaxResult edit(@RequestBody CmcDeviceLog cmcDeviceLog)
84
+    {
85
+        return toAjax(cmcDeviceLogService.updateCmcDeviceLog(cmcDeviceLog));
86
+    }
87
+
88
+    /**
89
+     * 删除cmc仪器记录
90
+     */
91
+    @Log(title = "cmc仪器记录", businessType = BusinessType.DELETE)
92
+	@DeleteMapping("/{logIds}")
93
+    public AjaxResult remove(@PathVariable Integer[] logIds)
94
+    {
95
+        return success(cmcDeviceLogService.deleteCmcDeviceLogByLogIds(logIds));
96
+    }
97
+}

+ 0
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceApproval.java View File

@@ -35,7 +35,6 @@ public class CmcDeviceApproval extends BaseEntity
35 35
     private Long useDept;
36 36
 
37 37
     /** 项目id */
38
-    @Excel(name = "项目id")
39 38
     private String projectId;
40 39
     @Excel(name = "项目编号")
41 40
     private String projectNumber;

+ 281
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceLog.java View File

@@ -0,0 +1,281 @@
1
+package com.ruoyi.oa.domain;
2
+
3
+import java.util.Date;
4
+import com.fasterxml.jackson.annotation.JsonFormat;
5
+import com.ruoyi.common.core.domain.entity.SysUser;
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_device_log
13
+ * 
14
+ * @author cmc
15
+ * @date 2025-06-10
16
+ */
17
+public class CmcDeviceLog extends BaseEntity
18
+{
19
+    private static final long serialVersionUID = 1L;
20
+
21
+    /** 使用记录id */
22
+    private Integer logId;
23
+
24
+    /** 设备id */
25
+    @Excel(name = "设备编码")
26
+    private String deviceNumber;
27
+    @Excel(name = "设备名称")
28
+    private String name;
29
+    @Excel(name = "出厂编号")
30
+    private String code;
31
+    @Excel(name = "品牌")
32
+    private String brand;
33
+    @Excel(name = "系列")
34
+    private String series;
35
+    private Integer deviceId;
36
+
37
+    /** 项目id */
38
+    @Excel(name = "项目编号")
39
+    private String projectNumber;
40
+    @Excel(name = "项目名称")
41
+    private String projectName;
42
+    private String projectId;
43
+
44
+    /** 用途类型 */
45
+    @Excel(name = "用途类型")
46
+    private String usageType;
47
+
48
+    /** 使用日期 */
49
+    @JsonFormat(pattern = "yyyy-MM-dd")
50
+    @Excel(name = "使用日期", width = 30, dateFormat = "yyyy-MM-dd")
51
+    private Date useDate;
52
+
53
+    /** 天气 */
54
+    @Excel(name = "天气")
55
+    private String weather;
56
+
57
+    /** 点号 */
58
+    @Excel(name = "点号")
59
+    private String position;
60
+
61
+    /** 高值类型 */
62
+    @Excel(name = "高值类型")
63
+    private String heightType;
64
+
65
+    /** 干温 */
66
+    @Excel(name = "干温")
67
+    private String dryTemperature;
68
+
69
+    /** 湿温 */
70
+    @Excel(name = "湿温")
71
+    private String wetTemperature;
72
+
73
+    /** 气压 */
74
+    @Excel(name = "气压")
75
+    private String airPressure;
76
+
77
+    /** 开机时间 */
78
+    @JsonFormat(pattern = "yyyy-MM-dd")
79
+    @Excel(name = "开机时间", width = 30, dateFormat = "yyyy-MM-dd")
80
+    private Date powerOn;
81
+
82
+    /** 关机时间 */
83
+    @JsonFormat(pattern = "yyyy-MM-dd")
84
+    @Excel(name = "关机时间", width = 30, dateFormat = "yyyy-MM-dd")
85
+    private Date powerOff;
86
+
87
+    /** 记录员 */
88
+    @Excel(name = "记录员")
89
+    private String nickName;
90
+    private Long userId;
91
+
92
+    private SysUser user;
93
+
94
+    private CmcProject project;
95
+
96
+    private CmcDevice device;
97
+
98
+    public void setLogId(Integer logId) 
99
+    {
100
+        this.logId = logId;
101
+    }
102
+
103
+    public Integer getLogId() 
104
+    {
105
+        return logId;
106
+    }
107
+    public void setDeviceId(Integer deviceId) 
108
+    {
109
+        this.deviceId = deviceId;
110
+    }
111
+
112
+    public Integer getDeviceId() 
113
+    {
114
+        return deviceId;
115
+    }
116
+    public void setDevice(CmcDevice device)
117
+    {
118
+        this.device = device;
119
+        if (device != null) {
120
+            this.deviceNumber = device.getDeviceNumber();
121
+            this.brand = device.getBrand();
122
+            this.series = device.getSeries();
123
+            this.name = device.getName();
124
+            this.code = device.getCode();
125
+        }
126
+    }
127
+
128
+    public CmcDevice getDevice()
129
+    {
130
+        return device;
131
+    }
132
+    public void setProjectId(String projectId) 
133
+    {
134
+        this.projectId = projectId;
135
+    }
136
+
137
+    public String getProjectId() 
138
+    {
139
+        return projectId;
140
+    }
141
+    public void setProject(CmcProject project)
142
+    {
143
+        this.project = project;
144
+        this.projectNumber = project == null ? "" : project.getProjectNumber();
145
+        this.projectName = project == null ? "" : project.getProjectName();
146
+    }
147
+
148
+    public CmcProject getProject()
149
+    {
150
+        return project;
151
+    }
152
+    public void setUsageType(String usageType) 
153
+    {
154
+        this.usageType = usageType;
155
+    }
156
+
157
+    public String getUsageType() 
158
+    {
159
+        return usageType;
160
+    }
161
+    public void setUseDate(Date useDate) 
162
+    {
163
+        this.useDate = useDate;
164
+    }
165
+
166
+    public Date getUseDate() 
167
+    {
168
+        return useDate;
169
+    }
170
+    public void setWeather(String weather) 
171
+    {
172
+        this.weather = weather;
173
+    }
174
+
175
+    public String getWeather() 
176
+    {
177
+        return weather;
178
+    }
179
+    public void setPosition(String position) 
180
+    {
181
+        this.position = position;
182
+    }
183
+
184
+    public String getPosition() 
185
+    {
186
+        return position;
187
+    }
188
+    public void setHeightType(String heightType) 
189
+    {
190
+        this.heightType = heightType;
191
+    }
192
+
193
+    public String getHeightType() 
194
+    {
195
+        return heightType;
196
+    }
197
+    public void setDryTemperature(String dryTemperature) 
198
+    {
199
+        this.dryTemperature = dryTemperature;
200
+    }
201
+
202
+    public String getDryTemperature() 
203
+    {
204
+        return dryTemperature;
205
+    }
206
+    public void setWetTemperature(String wetTemperature) 
207
+    {
208
+        this.wetTemperature = wetTemperature;
209
+    }
210
+
211
+    public String getWetTemperature() 
212
+    {
213
+        return wetTemperature;
214
+    }
215
+    public void setAirPressure(String airPressure) 
216
+    {
217
+        this.airPressure = airPressure;
218
+    }
219
+
220
+    public String getAirPressure() 
221
+    {
222
+        return airPressure;
223
+    }
224
+    public void setPowerOn(Date powerOn) 
225
+    {
226
+        this.powerOn = powerOn;
227
+    }
228
+
229
+    public Date getPowerOn() 
230
+    {
231
+        return powerOn;
232
+    }
233
+    public void setPowerOff(Date powerOff) 
234
+    {
235
+        this.powerOff = powerOff;
236
+    }
237
+
238
+    public Date getPowerOff() 
239
+    {
240
+        return powerOff;
241
+    }
242
+    public void setUserId(Long userId) 
243
+    {
244
+        this.userId = userId;
245
+    }
246
+
247
+    public Long getUserId() 
248
+    {
249
+        return userId;
250
+    }
251
+    public void setUser(SysUser user)
252
+    {
253
+        this.user = user;
254
+        this.nickName = user != null ? user.getNickName() : "";
255
+    }
256
+
257
+    public SysUser getUser()
258
+    {
259
+        return user;
260
+    }
261
+
262
+    @Override
263
+    public String toString() {
264
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
265
+            .append("logId", getLogId())
266
+            .append("deviceId", getDeviceId())
267
+            .append("projectId", getProjectId())
268
+            .append("usageType", getUsageType())
269
+            .append("useDate", getUseDate())
270
+            .append("weather", getWeather())
271
+            .append("position", getPosition())
272
+            .append("heightType", getHeightType())
273
+            .append("dryTemperature", getDryTemperature())
274
+            .append("wetTemperature", getWetTemperature())
275
+            .append("airPressure", getAirPressure())
276
+            .append("powerOn", getPowerOn())
277
+            .append("powerOff", getPowerOff())
278
+            .append("userId", getUserId())
279
+            .toString();
280
+    }
281
+}

+ 61
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcDeviceLogMapper.java View File

@@ -0,0 +1,61 @@
1
+package com.ruoyi.oa.mapper;
2
+
3
+import java.util.List;
4
+import com.ruoyi.oa.domain.CmcDeviceLog;
5
+
6
+/**
7
+ * cmc仪器记录Mapper接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2025-06-10
11
+ */
12
+public interface CmcDeviceLogMapper 
13
+{
14
+    /**
15
+     * 查询cmc仪器记录
16
+     * 
17
+     * @param logId cmc仪器记录主键
18
+     * @return cmc仪器记录
19
+     */
20
+    public CmcDeviceLog selectCmcDeviceLogByLogId(Integer logId);
21
+
22
+    /**
23
+     * 查询cmc仪器记录列表
24
+     * 
25
+     * @param cmcDeviceLog cmc仪器记录
26
+     * @return cmc仪器记录集合
27
+     */
28
+    public List<CmcDeviceLog> selectCmcDeviceLogList(CmcDeviceLog cmcDeviceLog);
29
+
30
+    /**
31
+     * 新增cmc仪器记录
32
+     * 
33
+     * @param cmcDeviceLog cmc仪器记录
34
+     * @return 结果
35
+     */
36
+    public int insertCmcDeviceLog(CmcDeviceLog cmcDeviceLog);
37
+
38
+    /**
39
+     * 修改cmc仪器记录
40
+     * 
41
+     * @param cmcDeviceLog cmc仪器记录
42
+     * @return 结果
43
+     */
44
+    public int updateCmcDeviceLog(CmcDeviceLog cmcDeviceLog);
45
+
46
+    /**
47
+     * 删除cmc仪器记录
48
+     * 
49
+     * @param logId cmc仪器记录主键
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcDeviceLogByLogId(Integer logId);
53
+
54
+    /**
55
+     * 批量删除cmc仪器记录
56
+     * 
57
+     * @param logIds 需要删除的数据主键集合
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcDeviceLogByLogIds(Integer[] logIds);
61
+}

+ 61
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcDeviceLogService.java View File

@@ -0,0 +1,61 @@
1
+package com.ruoyi.oa.service;
2
+
3
+import java.util.List;
4
+import com.ruoyi.oa.domain.CmcDeviceLog;
5
+
6
+/**
7
+ * cmc仪器记录Service接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2025-06-10
11
+ */
12
+public interface ICmcDeviceLogService 
13
+{
14
+    /**
15
+     * 查询cmc仪器记录
16
+     * 
17
+     * @param logId cmc仪器记录主键
18
+     * @return cmc仪器记录
19
+     */
20
+    public CmcDeviceLog selectCmcDeviceLogByLogId(Integer logId);
21
+
22
+    /**
23
+     * 查询cmc仪器记录列表
24
+     * 
25
+     * @param cmcDeviceLog cmc仪器记录
26
+     * @return cmc仪器记录集合
27
+     */
28
+    public List<CmcDeviceLog> selectCmcDeviceLogList(CmcDeviceLog cmcDeviceLog);
29
+
30
+    /**
31
+     * 新增cmc仪器记录
32
+     * 
33
+     * @param cmcDeviceLog cmc仪器记录
34
+     * @return 结果
35
+     */
36
+    public int insertCmcDeviceLog(CmcDeviceLog cmcDeviceLog);
37
+
38
+    /**
39
+     * 修改cmc仪器记录
40
+     * 
41
+     * @param cmcDeviceLog cmc仪器记录
42
+     * @return 结果
43
+     */
44
+    public int updateCmcDeviceLog(CmcDeviceLog cmcDeviceLog);
45
+
46
+    /**
47
+     * 批量删除cmc仪器记录
48
+     * 
49
+     * @param logIds 需要删除的cmc仪器记录主键集合
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcDeviceLogByLogIds(Integer[] logIds);
53
+
54
+    /**
55
+     * 删除cmc仪器记录信息
56
+     * 
57
+     * @param logId cmc仪器记录主键
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcDeviceLogByLogId(Integer logId);
61
+}

+ 93
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcDeviceLogServiceImpl.java View File

@@ -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.CmcDeviceLogMapper;
7
+import com.ruoyi.oa.domain.CmcDeviceLog;
8
+import com.ruoyi.oa.service.ICmcDeviceLogService;
9
+
10
+/**
11
+ * cmc仪器记录Service业务层处理
12
+ * 
13
+ * @author cmc
14
+ * @date 2025-06-10
15
+ */
16
+@Service
17
+public class CmcDeviceLogServiceImpl implements ICmcDeviceLogService 
18
+{
19
+    @Autowired
20
+    private CmcDeviceLogMapper cmcDeviceLogMapper;
21
+
22
+    /**
23
+     * 查询cmc仪器记录
24
+     * 
25
+     * @param logId cmc仪器记录主键
26
+     * @return cmc仪器记录
27
+     */
28
+    @Override
29
+    public CmcDeviceLog selectCmcDeviceLogByLogId(Integer logId)
30
+    {
31
+        return cmcDeviceLogMapper.selectCmcDeviceLogByLogId(logId);
32
+    }
33
+
34
+    /**
35
+     * 查询cmc仪器记录列表
36
+     * 
37
+     * @param cmcDeviceLog cmc仪器记录
38
+     * @return cmc仪器记录
39
+     */
40
+    @Override
41
+    public List<CmcDeviceLog> selectCmcDeviceLogList(CmcDeviceLog cmcDeviceLog)
42
+    {
43
+        return cmcDeviceLogMapper.selectCmcDeviceLogList(cmcDeviceLog);
44
+    }
45
+
46
+    /**
47
+     * 新增cmc仪器记录
48
+     * 
49
+     * @param cmcDeviceLog cmc仪器记录
50
+     * @return 结果
51
+     */
52
+    @Override
53
+    public int insertCmcDeviceLog(CmcDeviceLog cmcDeviceLog)
54
+    {
55
+        return cmcDeviceLogMapper.insertCmcDeviceLog(cmcDeviceLog);
56
+    }
57
+
58
+    /**
59
+     * 修改cmc仪器记录
60
+     * 
61
+     * @param cmcDeviceLog cmc仪器记录
62
+     * @return 结果
63
+     */
64
+    @Override
65
+    public int updateCmcDeviceLog(CmcDeviceLog cmcDeviceLog)
66
+    {
67
+        return cmcDeviceLogMapper.updateCmcDeviceLog(cmcDeviceLog);
68
+    }
69
+
70
+    /**
71
+     * 批量删除cmc仪器记录
72
+     * 
73
+     * @param logIds 需要删除的cmc仪器记录主键
74
+     * @return 结果
75
+     */
76
+    @Override
77
+    public int deleteCmcDeviceLogByLogIds(Integer[] logIds)
78
+    {
79
+        return cmcDeviceLogMapper.deleteCmcDeviceLogByLogIds(logIds);
80
+    }
81
+
82
+    /**
83
+     * 删除cmc仪器记录信息
84
+     * 
85
+     * @param logId cmc仪器记录主键
86
+     * @return 结果
87
+     */
88
+    @Override
89
+    public int deleteCmcDeviceLogByLogId(Integer logId)
90
+    {
91
+        return cmcDeviceLogMapper.deleteCmcDeviceLogByLogId(logId);
92
+    }
93
+}

+ 142
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceLogMapper.xml View File

@@ -0,0 +1,142 @@
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.CmcDeviceLogMapper">
6
+    
7
+    <resultMap type="CmcDeviceLog" id="CmcDeviceLogResult">
8
+        <result property="logId"    column="log_id"    />
9
+        <result property="deviceId"    column="device_id"    />
10
+        <result property="projectId"    column="project_id"    />
11
+        <result property="usageType"    column="usage_type"    />
12
+        <result property="useDate"    column="use_date"    />
13
+        <result property="weather"    column="weather"    />
14
+        <result property="position"    column="position"    />
15
+        <result property="heightType"    column="height_type"    />
16
+        <result property="dryTemperature"    column="dry_temperature"    />
17
+        <result property="wetTemperature"    column="wet_temperature"    />
18
+        <result property="airPressure"    column="air_pressure"    />
19
+        <result property="powerOn"    column="power_on"    />
20
+        <result property="powerOff"    column="power_off"    />
21
+        <result property="userId"    column="user_id"    />
22
+        <association property="user"    javaType="SysUser"         resultMap="SysUserResult" />
23
+        <association property="device"    javaType="CmcDevice"         resultMap="CmcDeviceResult" />
24
+        <association property="project"    javaType="CmcProject"         resultMap="CmcProjectResult" />
25
+    </resultMap>
26
+
27
+    <resultMap type="SysUser" id="SysUserResult">
28
+        <result property="userId"    column="user_id"    />
29
+        <result property="nickName"    column="nick_name"    />
30
+    </resultMap>
31
+
32
+    <resultMap type="CmcDevice" id="CmcDeviceResult">
33
+        <result property="deviceId"    column="device_id"    />
34
+        <result property="deviceNumber"    column="device_number"    />
35
+        <result property="code"    column="code"    />
36
+        <result property="name"    column="name"    />
37
+        <result property="series"    column="series"    />
38
+        <result property="brand"    column="brand"    />
39
+    </resultMap>
40
+
41
+    <resultMap type="CmcProject" id="CmcProjectResult">
42
+        <result property="projectId"    column="project_id"    />
43
+        <result property="projectNumber"    column="project_number"    />
44
+        <result property="projectName"    column="project_name"    />
45
+    </resultMap>
46
+
47
+    <sql id="selectCmcDeviceLogVo">
48
+        select dl.log_id, dl.device_id, dl.project_id, dl.usage_type, dl.use_date, dl.weather, dl.position, dl.height_type, dl.dry_temperature, dl.wet_temperature, dl.air_pressure, dl.power_on, dl.power_off, dl.user_id from cmc_device_log as dl
49
+        left join sys_user as u on u.user_id = dl.user_id
50
+        left join cmc_device as d on d.device_id = dl.device_id
51
+        left join cmc_project as p on p.project_id = dl.project_id
52
+    </sql>
53
+
54
+    <select id="selectCmcDeviceLogList" parameterType="CmcDeviceLog" resultMap="CmcDeviceLogResult">
55
+        <include refid="selectCmcDeviceLogVo"/>
56
+        <where>  
57
+            <if test="deviceId != null "> and dl.device_id = #{deviceId}</if>
58
+            <if test="projectId != null  and projectId != ''"> and dl.project_id = #{projectId}</if>
59
+            <if test="usageType != null  and usageType != ''"> and dl.usage_type = #{usageType}</if>
60
+            <if test="useDate != null "> and dl.use_date = #{useDate}</if>
61
+            <if test="weather != null  and weather != ''"> and dl.weather = #{weather}</if>
62
+            <if test="position != null  and position != ''"> and dl.position = #{position}</if>
63
+            <if test="heightType != null  and heightType != ''"> and dl.height_type = #{heightType}</if>
64
+            <if test="dryTemperature != null  and dryTemperature != ''"> and dl.dry_temperature = #{dryTemperature}</if>
65
+            <if test="wetTemperature != null  and wetTemperature != ''"> and dl.wet_temperature = #{wetTemperature}</if>
66
+            <if test="airPressure != null  and airPressure != ''"> and dl.air_pressure = #{airPressure}</if>
67
+            <if test="powerOn != null "> and dl.power_on = #{powerOn}</if>
68
+            <if test="powerOff != null "> and dl.power_off = #{powerOff}</if>
69
+            <if test="userId != null "> and dl.user_id = #{userId}</if>
70
+        </where>
71
+    </select>
72
+    
73
+    <select id="selectCmcDeviceLogByLogId" parameterType="Integer" resultMap="CmcDeviceLogResult">
74
+        <include refid="selectCmcDeviceLogVo"/>
75
+        where log_id = #{logId}
76
+    </select>
77
+        
78
+    <insert id="insertCmcDeviceLog" parameterType="CmcDeviceLog" useGeneratedKeys="true" keyProperty="logId">
79
+        insert into cmc_device_log
80
+        <trim prefix="(" suffix=")" suffixOverrides=",">
81
+            <if test="deviceId != null">device_id,</if>
82
+            <if test="projectId != null">project_id,</if>
83
+            <if test="usageType != null">usage_type,</if>
84
+            <if test="useDate != null">use_date,</if>
85
+            <if test="weather != null">weather,</if>
86
+            <if test="position != null">position,</if>
87
+            <if test="heightType != null">height_type,</if>
88
+            <if test="dryTemperature != null">dry_temperature,</if>
89
+            <if test="wetTemperature != null">wet_temperature,</if>
90
+            <if test="airPressure != null">air_pressure,</if>
91
+            <if test="powerOn != null">power_on,</if>
92
+            <if test="powerOff != null">power_off,</if>
93
+            <if test="userId != null">user_id,</if>
94
+         </trim>
95
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
96
+            <if test="deviceId != null">#{deviceId},</if>
97
+            <if test="projectId != null">#{projectId},</if>
98
+            <if test="usageType != null">#{usageType},</if>
99
+            <if test="useDate != null">#{useDate},</if>
100
+            <if test="weather != null">#{weather},</if>
101
+            <if test="position != null">#{position},</if>
102
+            <if test="heightType != null">#{heightType},</if>
103
+            <if test="dryTemperature != null">#{dryTemperature},</if>
104
+            <if test="wetTemperature != null">#{wetTemperature},</if>
105
+            <if test="airPressure != null">#{airPressure},</if>
106
+            <if test="powerOn != null">#{powerOn},</if>
107
+            <if test="powerOff != null">#{powerOff},</if>
108
+            <if test="userId != null">#{userId},</if>
109
+         </trim>
110
+    </insert>
111
+
112
+    <update id="updateCmcDeviceLog" parameterType="CmcDeviceLog">
113
+        update cmc_device_log
114
+        <trim prefix="SET" suffixOverrides=",">
115
+            <if test="deviceId != null">device_id = #{deviceId},</if>
116
+            <if test="projectId != null">project_id = #{projectId},</if>
117
+            <if test="usageType != null">usage_type = #{usageType},</if>
118
+            <if test="useDate != null">use_date = #{useDate},</if>
119
+            <if test="weather != null">weather = #{weather},</if>
120
+            <if test="position != null">position = #{position},</if>
121
+            <if test="heightType != null">height_type = #{heightType},</if>
122
+            <if test="dryTemperature != null">dry_temperature = #{dryTemperature},</if>
123
+            <if test="wetTemperature != null">wet_temperature = #{wetTemperature},</if>
124
+            <if test="airPressure != null">air_pressure = #{airPressure},</if>
125
+            <if test="powerOn != null">power_on = #{powerOn},</if>
126
+            <if test="powerOff != null">power_off = #{powerOff},</if>
127
+            <if test="userId != null">user_id = #{userId},</if>
128
+        </trim>
129
+        where log_id = #{logId}
130
+    </update>
131
+
132
+    <delete id="deleteCmcDeviceLogByLogId" parameterType="Integer">
133
+        delete from cmc_device_log where log_id = #{logId}
134
+    </delete>
135
+
136
+    <delete id="deleteCmcDeviceLogByLogIds" parameterType="String">
137
+        delete from cmc_device_log where log_id in 
138
+        <foreach item="logId" collection="array" open="(" separator="," close=")">
139
+            #{logId}
140
+        </foreach>
141
+    </delete>
142
+</mapper>

+ 21
- 19
oa-back/sql/sq.sql View File

@@ -1,19 +1,21 @@
1
-DROP TABLE IF EXISTS `cmc_performance_staff`;
2
-CREATE TABLE `cmc_performance_staff`  (
3
-  `performance_staff_id` int NOT NULL AUTO_INCREMENT COMMENT '员工绩效id',
4
-  `performance_id` char(19)DEFAULT NULL COMMENT '绩效审批id',
5
-  `project_id` char(19)DEFAULT NULL COMMENT '项目id',
6
-  `user_id` bigint NULL COMMENT '员工id',
7
-  `work_type` char(2)DEFAULT NULL COMMENT '作业类别',
8
-  `content` varchar(255)DEFAULT NULL COMMENT '工作内容',
9
-  `scale_grade` varchar(20)DEFAULT NULL COMMENT '比例尺',
10
-  `workload` double NULL COMMENT '工作量',
11
-  `unit` varchar(10)DEFAULT NULL COMMENT '单位',
12
-  `price` decimal(10, 2)NULL COMMENT '单价',
13
-  `coefficient` double NULL COMMENT '系数',
14
-  `manage_performance` decimal(10, 2)NULL COMMENT '管理绩效',
15
-  `produce_performance` decimal(10, 2)NULL COMMENT '生产绩效',
16
-  `performance_month` date NULL COMMENT '月份',
17
-  `remark` varchar(255)DEFAULT NULL COMMENT '备注',
18
-  PRIMARY KEY (`performance_staff_id`) USING BTREE
19
-) ENGINE = InnoDB comment 'cmc员工绩效表'; 
1
+DROP TABLE IF EXISTS `cmc_device_log`;
2
+CREATE TABLE `cmc_device_log`  (
3
+  `log_id` int NOT NULL AUTO_INCREMENT COMMENT '使用记录id',
4
+  `device_id` int DEFAULT NULL COMMENT '设备id',
5
+  `project_id` char(19) DEFAULT NULL COMMENT '项目id',
6
+  `usage_type` varchar(10) DEFAULT NULL COMMENT '用途类型',
7
+  `use_date` datetime DEFAULT NULL COMMENT '使用日期',
8
+  `weather` varchar(5) DEFAULT NULL COMMENT '天气',
9
+  `position` varchar(30) DEFAULT NULL COMMENT '点号',
10
+  `height_type` varchar(10) DEFAULT NULL COMMENT '高值类型',
11
+  `dry_temperature` varchar(5) DEFAULT NULL COMMENT '干温',
12
+  `wet_temperature` varchar(5) DEFAULT NULL COMMENT '湿温',
13
+  `air_pressure` varchar(10) DEFAULT NULL COMMENT '气压',
14
+  `power_on` datetime DEFAULT NULL COMMENT '开机时间',
15
+  `power_off` datetime DEFAULT NULL COMMENT '关机时间',
16
+  `user_id` bigint DEFAULT NULL COMMENT '记录员',
17
+  PRIMARY KEY (`log_id`)
18
+) ENGINE = InnoDB comment 'cmc仪器记录表';
19
+INSERT INTO `cmc_oa`.`sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (176, '作业记录', 8, 7, 'deviceLog', 'oa/device/log', NULL, 1, 0, 'C', '0', '0', 'oa:deviceLog:list', 'form', 'admin', '2025-06-10 10:30:41', '', NULL, '作业记录菜单');
20
+INSERT INTO `cmc_oa`.`sys_role_menu` values (2,176);
21
+INSERT INTO `cmc_oa`.`sys_role_menu` values (2,8);

+ 44
- 0
oa-ui/src/api/oa/device/deviceLog.js View File

@@ -0,0 +1,44 @@
1
+import request from '@/utils/request'
2
+
3
+// 查询cmc仪器记录列表
4
+export function listDeviceLog(query) {
5
+  return request({
6
+    url: '/oa/deviceLog/list',
7
+    method: 'get',
8
+    params: query
9
+  })
10
+}
11
+
12
+// 查询cmc仪器记录详细
13
+export function getDeviceLog(logId) {
14
+  return request({
15
+    url: '/oa/deviceLog/' + logId,
16
+    method: 'get'
17
+  })
18
+}
19
+
20
+// 新增cmc仪器记录
21
+export function addDeviceLog(data) {
22
+  return request({
23
+    url: '/oa/deviceLog',
24
+    method: 'post',
25
+    data: data
26
+  })
27
+}
28
+
29
+// 修改cmc仪器记录
30
+export function updateDeviceLog(data) {
31
+  return request({
32
+    url: '/oa/deviceLog',
33
+    method: 'put',
34
+    data: data
35
+  })
36
+}
37
+
38
+// 删除cmc仪器记录
39
+export function delDeviceLog(logId) {
40
+  return request({
41
+    url: '/oa/deviceLog/' + logId,
42
+    method: 'delete'
43
+  })
44
+}

+ 1
- 1
oa-ui/src/views/flowable/form/performance/performanceForm.vue View File

@@ -569,7 +569,7 @@ export default {
569 569
     },
570 570
     /* 下载模板 */
571 571
     importTemplate() {
572
-      const path = '/profile/upload/template/绩效模版.xlsx'
572
+      const path = '/profile/upload/template/performance.xlsx'
573 573
       downloadTemplate(path).then(res => {
574 574
         const blob = new Blob([res])
575 575
         saveAs(blob, '绩效模版.xlsx');

+ 418
- 0
oa-ui/src/views/oa/device/log.vue View File

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

Loading…
Cancel
Save