Sfoglia il codice sorgente

设备审批流程更新

lamphua 1 anno fa
parent
commit
8cc2e9303f

+ 22
- 5
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceApprovalController.java Vedi File

96
         cmcDeviceApproval.setBeginDate(formDataJson.getDate("beginDate"));
96
         cmcDeviceApproval.setBeginDate(formDataJson.getDate("beginDate"));
97
         cmcDeviceApproval.setEndDate(formDataJson.getDate("endDate"));
97
         cmcDeviceApproval.setEndDate(formDataJson.getDate("endDate"));
98
         cmcDeviceApproval.setDays(formDataJson.getLong("days"));
98
         cmcDeviceApproval.setDays(formDataJson.getLong("days"));
99
+        cmcDeviceApproval.setState("0");
100
+        if (formDataJson.getJSONArray("devices").size() > 0) {
101
+            String deviceString = formDataJson.getString("devices").substring(1, formDataJson.getString("devices").length() - 1);
102
+            cmcDeviceApproval.setDevices(deviceString);
103
+            String[] devices = deviceString.split(",");
104
+            BigDecimal estimateCost = new BigDecimal(0);
105
+            for (String device : devices) {
106
+                CmcDevice cmcDevice = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(device));
107
+                cmcDevice.setStatus("0");
108
+                cmcDeviceService.updateCmcDevice(cmcDevice);
109
+                if (cmcDevice.getDayCost() != null)
110
+                    estimateCost = estimateCost.add(cmcDevice.getDayCost().multiply(new BigDecimal(cmcDeviceApproval.getDays())));
111
+            }
112
+            cmcDeviceApproval.setEstimateCost(estimateCost);
113
+        }
99
         cmcDeviceApprovalService.insertCmcDeviceApproval(cmcDeviceApproval);
114
         cmcDeviceApprovalService.insertCmcDeviceApproval(cmcDeviceApproval);
100
         return AjaxResult.success("提交设备审批表成功");
115
         return AjaxResult.success("提交设备审批表成功");
101
     }
116
     }
119
     {
134
     {
120
         JSONObject formDataJson = JSONObject.parse(formData);
135
         JSONObject formDataJson = JSONObject.parse(formData);
121
         CmcDeviceApproval cmcDeviceApproval = cmcDeviceApprovalService.selectCmcDeviceApprovalByDeviceApplyId(formDataJson.getString("deviceApplyId"));
136
         CmcDeviceApproval cmcDeviceApproval = cmcDeviceApprovalService.selectCmcDeviceApprovalByDeviceApplyId(formDataJson.getString("deviceApplyId"));
122
-        if (formDataJson.getString("deptComment") != null && formDataJson.getString("managerComment") == null) {
123
-            cmcDeviceApproval.setDeptUserId(getLoginUser().getUserId());
124
-            cmcDeviceApproval.setDeptComment(formDataJson.getString("deptComment"));
125
-            cmcDeviceApproval.setDeptTime(new Date());
126
-        }
127
         if (formDataJson.getString("managerComment") != null && formDataJson.getString("dispatchComment") == null) {
137
         if (formDataJson.getString("managerComment") != null && formDataJson.getString("dispatchComment") == null) {
128
             cmcDeviceApproval.setManagerUserId(getLoginUser().getUserId());
138
             cmcDeviceApproval.setManagerUserId(getLoginUser().getUserId());
129
             cmcDeviceApproval.setManagerComment(formDataJson.getString("managerComment"));
139
             cmcDeviceApproval.setManagerComment(formDataJson.getString("managerComment"));
130
             cmcDeviceApproval.setManagerTime(new Date());
140
             cmcDeviceApproval.setManagerTime(new Date());
131
         }
141
         }
142
+        if (formDataJson.getDate("confirmDate") != null) {
143
+            cmcDeviceApproval.setState("1");
144
+            cmcDeviceApproval.setConfirmDate(formDataJson.getDate("confirmDate"));
145
+        }
132
         if (formDataJson.getDate("returnDate") != null) {
146
         if (formDataJson.getDate("returnDate") != null) {
133
             cmcDeviceApproval.setRemark(formDataJson.getString("remark"));
147
             cmcDeviceApproval.setRemark(formDataJson.getString("remark"));
148
+            cmcDeviceApproval.setState(formDataJson.getString("state"));
134
             cmcDeviceApproval.setReturnDate(formDataJson.getDate("returnDate"));
149
             cmcDeviceApproval.setReturnDate(formDataJson.getDate("returnDate"));
135
         }
150
         }
136
         if (formDataJson.getString("dispatchComment") != null) {
151
         if (formDataJson.getString("dispatchComment") != null) {
146
             BigDecimal estimateCost = new BigDecimal(0);
161
             BigDecimal estimateCost = new BigDecimal(0);
147
             for (String device : devices) {
162
             for (String device : devices) {
148
                 CmcDevice cmcDevice = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(device));
163
                 CmcDevice cmcDevice = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(device));
164
+                cmcDevice.setStatus("1");
165
+                cmcDeviceService.updateCmcDevice(cmcDevice);
149
                 if (cmcDevice.getDayCost() != null)
166
                 if (cmcDevice.getDayCost() != null)
150
                     estimateCost = estimateCost.add(cmcDevice.getDayCost().multiply(new BigDecimal(cmcDeviceApproval.getDays())));
167
                     estimateCost = estimateCost.add(cmcDevice.getDayCost().multiply(new BigDecimal(cmcDeviceApproval.getDays())));
151
             }
168
             }

+ 14
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDevice.java Vedi File

75
     @Excel(name = "管理部门")
75
     @Excel(name = "管理部门")
76
     private SysDept dept;
76
     private SysDept dept;
77
 
77
 
78
+    /** 状态 */
79
+    @Excel(name = "状态")
80
+    private String status;
81
+
78
     public void setDeviceId(Integer deviceId)
82
     public void setDeviceId(Integer deviceId)
79
     {
83
     {
80
         this.deviceId = deviceId;
84
         this.deviceId = deviceId;
201
     {
205
     {
202
         return dept;
206
         return dept;
203
     }
207
     }
208
+    public void setStatus(String status)
209
+    {
210
+        this.status = status;
211
+    }
212
+
213
+    public String getStatus()
214
+    {
215
+        return status;
216
+    }
204
 
217
 
205
     @Override
218
     @Override
206
     public String toString() {
219
     public String toString() {
219
                 .append("place", getPlace())
232
                 .append("place", getPlace())
220
                 .append("remark", getRemark())
233
                 .append("remark", getRemark())
221
                 .append("manageDept", getManageDept())
234
                 .append("manageDept", getManageDept())
235
+                .append("status", getStatus())
222
                 .toString();
236
                 .toString();
223
     }
237
     }
224
 }
238
 }

+ 14
- 52
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceApproval.java Vedi File

30
 
30
 
31
     private SysUser applierUser;
31
     private SysUser applierUser;
32
 
32
 
33
-    private SysUser deptUser;
34
-
35
     private SysUser managerUser;
33
     private SysUser managerUser;
36
 
34
 
37
     private SysUser dispatchUser;
35
     private SysUser dispatchUser;
70
     @Excel(name = "天数")
68
     @Excel(name = "天数")
71
     private Long days;
69
     private Long days;
72
 
70
 
73
-    /** 部门审批人 */
74
-    @Excel(name = "部门审批人")
75
-    private Long deptUserId;
76
-
77
-    /** 部门审批意见 */
78
-    @Excel(name = "部门审批意见")
79
-    private String deptComment;
80
-
81
     /** 分管审批人 */
71
     /** 分管审批人 */
82
     @Excel(name = "分管审批人")
72
     @Excel(name = "分管审批人")
83
     private Long managerUserId;
73
     private Long managerUserId;
103
     @Excel(name = "申请日期", width = 30, dateFormat = "yyyy-MM-dd")
93
     @Excel(name = "申请日期", width = 30, dateFormat = "yyyy-MM-dd")
104
     private Date applyDate;
94
     private Date applyDate;
105
 
95
 
96
+    /** 确认日期 */
97
+    @JsonFormat(pattern = "yyyy-MM-dd")
98
+    @Excel(name = "确认日期", width = 30, dateFormat = "yyyy-MM-dd")
99
+    private Date confirmDate;
100
+
106
     /** 归还日期 */
101
     /** 归还日期 */
107
     @JsonFormat(pattern = "yyyy-MM-dd")
102
     @JsonFormat(pattern = "yyyy-MM-dd")
108
     @Excel(name = "归还日期", width = 30, dateFormat = "yyyy-MM-dd")
103
     @Excel(name = "归还日期", width = 30, dateFormat = "yyyy-MM-dd")
109
     private Date returnDate;
104
     private Date returnDate;
110
 
105
 
111
-    /** 部门审批时间 */
112
-    @JsonFormat(pattern = "yyyy-MM-dd")
113
-    @Excel(name = "部门审批时间", width = 30, dateFormat = "yyyy-MM-dd")
114
-    private Date deptTime;
115
-
116
     /** 分管审批时间 */
106
     /** 分管审批时间 */
117
     @JsonFormat(pattern = "yyyy-MM-dd")
107
     @JsonFormat(pattern = "yyyy-MM-dd")
118
     @Excel(name = "分管审批时间", width = 30, dateFormat = "yyyy-MM-dd")
108
     @Excel(name = "分管审批时间", width = 30, dateFormat = "yyyy-MM-dd")
155
     {
145
     {
156
         return applierUser;
146
         return applierUser;
157
     }
147
     }
158
-    public void setDeptUser(SysUser deptUser)
159
-    {
160
-        this.deptUser = deptUser;
161
-    }
162
-
163
-    public SysUser getDeptUser()
164
-    {
165
-        return deptUser;
166
-    }
167
     public void setManagerUser(SysUser managerUser)
148
     public void setManagerUser(SysUser managerUser)
168
     {
149
     {
169
         this.managerUser = managerUser;
150
         this.managerUser = managerUser;
263
     {
244
     {
264
         return days;
245
         return days;
265
     }
246
     }
266
-    public void setDeptUserId(Long deptUserId) 
267
-    {
268
-        this.deptUserId = deptUserId;
269
-    }
270
-
271
-    public Long getDeptUserId() 
272
-    {
273
-        return deptUserId;
274
-    }
275
-    public void setDeptComment(String deptComment) 
276
-    {
277
-        this.deptComment = deptComment;
278
-    }
279
-
280
-    public String getDeptComment() 
281
-    {
282
-        return deptComment;
283
-    }
284
     public void setManagerUserId(Long managerUserId) 
247
     public void setManagerUserId(Long managerUserId) 
285
     {
248
     {
286
         this.managerUserId = managerUserId;
249
         this.managerUserId = managerUserId;
335
     {
298
     {
336
         return applyDate;
299
         return applyDate;
337
     }
300
     }
338
-    public void setReturnDate(Date returnDate)
301
+    public void setConfirmDate(Date confirmDate)
339
     {
302
     {
340
-        this.returnDate = returnDate;
303
+        this.confirmDate = confirmDate;
341
     }
304
     }
342
 
305
 
343
-    public Date getReturnDate()
306
+    public Date getConfirmDate()
344
     {
307
     {
345
-        return returnDate;
308
+        return confirmDate;
346
     }
309
     }
347
-    public void setDeptTime(Date deptTime)
310
+    public void setReturnDate(Date returnDate)
348
     {
311
     {
349
-        this.deptTime = deptTime;
312
+        this.returnDate = returnDate;
350
     }
313
     }
351
 
314
 
352
-    public Date getDeptTime()
315
+    public Date getReturnDate()
353
     {
316
     {
354
-        return deptTime;
317
+        return returnDate;
355
     }
318
     }
356
     public void setManagerTime(Date managerTime)
319
     public void setManagerTime(Date managerTime)
357
     {
320
     {
392
             .append("beginDate", getBeginDate())
355
             .append("beginDate", getBeginDate())
393
             .append("endDate", getEndDate())
356
             .append("endDate", getEndDate())
394
             .append("days", getDays())
357
             .append("days", getDays())
395
-            .append("deptUserId", getDeptUserId())
396
-            .append("deptComment", getDeptComment())
397
             .append("managerUserId", getManagerUserId())
358
             .append("managerUserId", getManagerUserId())
398
             .append("managerComment", getManagerComment())
359
             .append("managerComment", getManagerComment())
399
             .append("dispatcher", getDispatcher())
360
             .append("dispatcher", getDispatcher())
400
             .append("dispatchComment", getDispatchComment())
361
             .append("dispatchComment", getDispatchComment())
401
             .append("estimateCost", getEstimateCost())
362
             .append("estimateCost", getEstimateCost())
402
             .append("applyDate", getApplyDate())
363
             .append("applyDate", getApplyDate())
364
+            .append("confirmDate", getConfirmDate())
403
             .append("returnDate", getReturnDate())
365
             .append("returnDate", getReturnDate())
404
             .toString();
366
             .toString();
405
     }
367
     }

+ 23
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcTechnical.java Vedi File

76
     @Excel(name = "技术审核意见")
76
     @Excel(name = "技术审核意见")
77
     private String technicalComment;
77
     private String technicalComment;
78
 
78
 
79
+    /** 总工审批人 */
80
+    @Excel(name = "总工审批人")
81
+    private Long managerUserId;
82
+
79
     /** 总工审核意见 */
83
     /** 总工审核意见 */
80
     @Excel(name = "总工审核意见")
84
     @Excel(name = "总工审核意见")
81
     private String manageComment;
85
     private String manageComment;
158
     {
162
     {
159
         return designUser;
163
         return designUser;
160
     }
164
     }
165
+    public void setManagerUser(SysUser managerUser)
166
+    {
167
+        this.managerUser = managerUser;
168
+    }
169
+
170
+    public SysUser getManagerUser()
171
+    {
172
+        return managerUser;
173
+    }
161
     public void setPlanComment(String planComment)
174
     public void setPlanComment(String planComment)
162
     {
175
     {
163
         this.planComment = planComment;
176
         this.planComment = planComment;
230
     {
243
     {
231
         return technicalComment;
244
         return technicalComment;
232
     }
245
     }
246
+    public void setManagerUserId(Long managerUserId)
247
+    {
248
+        this.managerUserId = managerUserId;
249
+    }
250
+
251
+    public Long getManagerUserId()
252
+    {
253
+        return managerUserId;
254
+    }
233
     public void setManageComment(String manageComment)
255
     public void setManageComment(String manageComment)
234
     {
256
     {
235
         this.manageComment = manageComment;
257
         this.manageComment = manageComment;
281
                 .append("technicalDocument", getTechnicalDocument())
303
                 .append("technicalDocument", getTechnicalDocument())
282
                 .append("designDescription", getDesignDescription())
304
                 .append("designDescription", getDesignDescription())
283
                 .append("technicalComment", getTechnicalComment())
305
                 .append("technicalComment", getTechnicalComment())
306
+                .append("managerUserId", getManagerUserId())
284
                 .append("manageComment", getManageComment())
307
                 .append("manageComment", getManageComment())
285
                 .append("technicalUploadTime", getTechnicalUploadTime())
308
                 .append("technicalUploadTime", getTechnicalUploadTime())
286
                 .append("techApprovalTime", getTechApprovalTime())
309
                 .append("techApprovalTime", getTechApprovalTime())

+ 4
- 27
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml Vedi File

16
         <result property="beginDate"    column="begin_date"    />
16
         <result property="beginDate"    column="begin_date"    />
17
         <result property="endDate"    column="end_date"    />
17
         <result property="endDate"    column="end_date"    />
18
         <result property="days"    column="days"    />
18
         <result property="days"    column="days"    />
19
-        <result property="deptUserId"    column="dept_user_id"    />
20
-        <result property="deptComment"    column="dept_comment"    />
21
         <result property="managerUserId"    column="manager_user_id"    />
19
         <result property="managerUserId"    column="manager_user_id"    />
22
         <result property="managerComment"    column="manager_comment"    />
20
         <result property="managerComment"    column="manager_comment"    />
23
         <result property="dispatcher"    column="dispatcher"    />
21
         <result property="dispatcher"    column="dispatcher"    />
25
         <result property="estimateCost"    column="estimate_cost"    />
23
         <result property="estimateCost"    column="estimate_cost"    />
26
         <result property="remark"    column="remark"    />
24
         <result property="remark"    column="remark"    />
27
         <result property="state"    column="state"    />
25
         <result property="state"    column="state"    />
28
-        <result property="deptTime"    column="dept_time"    />
29
         <result property="managerTime"    column="manager_time"    />
26
         <result property="managerTime"    column="manager_time"    />
30
         <result property="dispatchTime"    column="dispatch_time"    />
27
         <result property="dispatchTime"    column="dispatch_time"    />
31
         <association property="applierUser"    javaType="SysUser"         resultMap="SysUserResult" />
28
         <association property="applierUser"    javaType="SysUser"         resultMap="SysUserResult" />
32
         <association property="dept"    javaType="SysDept"         resultMap="SysDeptResult" />
29
         <association property="dept"    javaType="SysDept"         resultMap="SysDeptResult" />
33
         <association property="project"    javaType="CmcProject"         resultMap="CmcProjectResult" />
30
         <association property="project"    javaType="CmcProject"         resultMap="CmcProjectResult" />
34
-        <association property="deptUser"    javaType="SysUser"         resultMap="DeptUserResult" />
35
         <association property="managerUser"    javaType="SysUser"         resultMap="ManagerUserResult" />
31
         <association property="managerUser"    javaType="SysUser"         resultMap="ManagerUserResult" />
36
         <association property="dispatchUser"    javaType="SysUser"         resultMap="DispatchUserResult" />
32
         <association property="dispatchUser"    javaType="SysUser"         resultMap="DispatchUserResult" />
37
     </resultMap>
33
     </resultMap>
41
         <result property="nickName"    column="applier_nick_name"    />
37
         <result property="nickName"    column="applier_nick_name"    />
42
     </resultMap>
38
     </resultMap>
43
 
39
 
44
-    <resultMap type="SysUser" id="DeptUserResult">
45
-        <result property="userId"    column="user_id"    />
46
-        <result property="nickName"    column="dept_nick_name"    />
47
-    </resultMap>
48
-
49
     <resultMap type="SysUser" id="ManagerUserResult">
40
     <resultMap type="SysUser" id="ManagerUserResult">
50
         <result property="userId"    column="user_id"    />
41
         <result property="userId"    column="user_id"    />
51
         <result property="nickName"    column="manager_nick_name"    />
42
         <result property="nickName"    column="manager_nick_name"    />
69
 
60
 
70
     <sql id="selectCmcDeviceApprovalVo">
61
     <sql id="selectCmcDeviceApprovalVo">
71
         select da.device_apply_id, da.applier, u.nick_name as applier_nick_name, da.use_dept, d.dept_name, da.devices, da.project_id, p.project_number, p.project_name,
62
         select da.device_apply_id, da.applier, u.nick_name as applier_nick_name, da.use_dept, d.dept_name, da.devices, da.project_id, p.project_number, p.project_name,
72
-               da.apply_reason, da.apply_date, da.return_date, da.begin_date, da.end_date, da.days, da.dept_user_id, u1.nick_name as dept_nick_name, da.state,
73
-               da.dept_comment, da.manager_user_id, u2.nick_name as manager_nick_name, da.manager_comment, da.dispatcher, u3.nick_name as dispatch_nick_name, da.dispatch_comment,
74
-               da.estimate_cost, da.remark, da.dept_time, da.manager_time, da.dispatch_time from cmc_device_approval as da
63
+               da.apply_reason, da.apply_date, da.return_date, da.begin_date, da.end_date, da.days, da.state, da.manager_user_id, u1.nick_name as manager_nick_name,
64
+               da.manager_comment, da.dispatcher, u2.nick_name as dispatch_nick_name, da.dispatch_comment, da.estimate_cost, da.remark, da.manager_time, da.dispatch_time from cmc_device_approval as da
75
             left join sys_user as u on u.user_id = da.applier
65
             left join sys_user as u on u.user_id = da.applier
76
-            left join sys_user as u1 on u1.user_id = da.dept_user_id
77
-            left join sys_user as u2 on u2.user_id = da.manager_user_id
78
-            left join sys_user as u3 on u3.user_id = da.dispatcher
66
+            left join sys_user as u1 on u1.user_id = da.manager_user_id
67
+            left join sys_user as u2 on u2.user_id = da.dispatcher
79
             left join sys_dept as d on d.dept_id = da.use_dept
68
             left join sys_dept as d on d.dept_id = da.use_dept
80
             left join cmc_project as p on da.project_id = p.project_id
69
             left join cmc_project as p on da.project_id = p.project_id
81
     </sql>
70
     </sql>
93
             <if test="beginDate != null "> and da.begin_date = #{beginDate}</if>
82
             <if test="beginDate != null "> and da.begin_date = #{beginDate}</if>
94
             <if test="endDate != null "> and da.end_date = #{endDate}</if>
83
             <if test="endDate != null "> and da.end_date = #{endDate}</if>
95
             <if test="days != null "> and da.days = #{days}</if>
84
             <if test="days != null "> and da.days = #{days}</if>
96
-            <if test="deptUserId != null "> and da.dept_user_id = #{deptUserId}</if>
97
-            <if test="deptComment != null  and deptComment != ''"> and da.dept_comment = #{deptComment}</if>
98
             <if test="managerUserId != null "> and da.manager_user_id = #{managerUserId}</if>
85
             <if test="managerUserId != null "> and da.manager_user_id = #{managerUserId}</if>
99
             <if test="managerComment != null  and managerComment != ''"> and da.manager_comment = #{managerComment}</if>
86
             <if test="managerComment != null  and managerComment != ''"> and da.manager_comment = #{managerComment}</if>
100
             <if test="dispatcher != null "> and da.dispatcher = #{dispatcher}</if>
87
             <if test="dispatcher != null "> and da.dispatcher = #{dispatcher}</if>
101
             <if test="dispatchComment != null  and dispatchComment != ''"> and da.dispatch_comment = #{dispatchComment}</if>
88
             <if test="dispatchComment != null  and dispatchComment != ''"> and da.dispatch_comment = #{dispatchComment}</if>
102
             <if test="estimateCost != null "> and da.estimate_cost = #{estimateCost}</if>
89
             <if test="estimateCost != null "> and da.estimate_cost = #{estimateCost}</if>
103
-            <if test="deptTime != null "> and da.dept_time = #{deptTime}</if>
104
             <if test="managerTime != null "> and da.manager_time = #{managerTime}</if>
90
             <if test="managerTime != null "> and da.manager_time = #{managerTime}</if>
105
             <if test="dispatchTime != null "> and da.dispatch_time = #{dispatchTime}</if>
91
             <if test="dispatchTime != null "> and da.dispatch_time = #{dispatchTime}</if>
106
         </where>
92
         </where>
125
             <if test="beginDate != null">begin_date,</if>
111
             <if test="beginDate != null">begin_date,</if>
126
             <if test="endDate != null">end_date,</if>
112
             <if test="endDate != null">end_date,</if>
127
             <if test="days != null">days,</if>
113
             <if test="days != null">days,</if>
128
-            <if test="deptUserId != null">dept_user_id,</if>
129
-            <if test="deptComment != null">dept_comment,</if>
130
             <if test="managerUserId != null">manager_user_id,</if>
114
             <if test="managerUserId != null">manager_user_id,</if>
131
             <if test="managerComment != null">manager_comment,</if>
115
             <if test="managerComment != null">manager_comment,</if>
132
             <if test="dispatcher != null">dispatcher,</if>
116
             <if test="dispatcher != null">dispatcher,</if>
134
             <if test="estimateCost != null">estimate_cost,</if>
118
             <if test="estimateCost != null">estimate_cost,</if>
135
             <if test="remark != null">remark,</if>
119
             <if test="remark != null">remark,</if>
136
             <if test="state != null">state,</if>
120
             <if test="state != null">state,</if>
137
-            <if test="deptTime != null">dept_time,</if>
138
             <if test="managerTime != null">manager_time,</if>
121
             <if test="managerTime != null">manager_time,</if>
139
             <if test="dispatchTime != null">dispatch_time,</if>
122
             <if test="dispatchTime != null">dispatch_time,</if>
140
          </trim>
123
          </trim>
150
             <if test="beginDate != null">#{beginDate},</if>
133
             <if test="beginDate != null">#{beginDate},</if>
151
             <if test="endDate != null">#{endDate},</if>
134
             <if test="endDate != null">#{endDate},</if>
152
             <if test="days != null">#{days},</if>
135
             <if test="days != null">#{days},</if>
153
-            <if test="deptUserId != null">#{deptUserId},</if>
154
-            <if test="deptComment != null">#{deptComment},</if>
155
             <if test="managerUserId != null">#{managerUserId},</if>
136
             <if test="managerUserId != null">#{managerUserId},</if>
156
             <if test="managerComment != null">#{managerComment},</if>
137
             <if test="managerComment != null">#{managerComment},</if>
157
             <if test="dispatcher != null">#{dispatcher},</if>
138
             <if test="dispatcher != null">#{dispatcher},</if>
159
             <if test="estimateCost != null">#{estimateCost},</if>
140
             <if test="estimateCost != null">#{estimateCost},</if>
160
             <if test="remark != null">#{remark},</if>
141
             <if test="remark != null">#{remark},</if>
161
             <if test="state != null">#{state},</if>
142
             <if test="state != null">#{state},</if>
162
-            <if test="deptTime != null">#{deptTime},</if>
163
             <if test="managerTime != null">#{managerTime},</if>
143
             <if test="managerTime != null">#{managerTime},</if>
164
             <if test="dispatchTime != null">#{dispatchTime},</if>
144
             <if test="dispatchTime != null">#{dispatchTime},</if>
165
          </trim>
145
          </trim>
178
             <if test="beginDate != null">begin_date = #{beginDate},</if>
158
             <if test="beginDate != null">begin_date = #{beginDate},</if>
179
             <if test="endDate != null">end_date = #{endDate},</if>
159
             <if test="endDate != null">end_date = #{endDate},</if>
180
             <if test="days != null">days = #{days},</if>
160
             <if test="days != null">days = #{days},</if>
181
-            <if test="deptUserId != null">dept_user_id = #{deptUserId},</if>
182
-            <if test="deptComment != null">dept_comment = #{deptComment},</if>
183
             <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
161
             <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
184
             <if test="managerComment != null">manager_comment = #{managerComment},</if>
162
             <if test="managerComment != null">manager_comment = #{managerComment},</if>
185
             <if test="dispatcher != null">dispatcher = #{dispatcher},</if>
163
             <if test="dispatcher != null">dispatcher = #{dispatcher},</if>
187
             <if test="estimateCost != null">estimate_cost = #{estimateCost},</if>
165
             <if test="estimateCost != null">estimate_cost = #{estimateCost},</if>
188
             <if test="remark != null">remark = #{remark},</if>
166
             <if test="remark != null">remark = #{remark},</if>
189
             <if test="state != null">state = #{state},</if>
167
             <if test="state != null">state = #{state},</if>
190
-            <if test="deptTime != null">dept_time = #{deptTime},</if>
191
             <if test="managerTime != null">manager_time = #{managerTime},</if>
168
             <if test="managerTime != null">manager_time = #{managerTime},</if>
192
             <if test="dispatchTime != null">dispatch_time = #{dispatchTime},</if>
169
             <if test="dispatchTime != null">dispatch_time = #{dispatchTime},</if>
193
         </trim>
170
         </trim>

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceMapper.xml Vedi File

19
         <result property="place"    column="place"    />
19
         <result property="place"    column="place"    />
20
         <result property="remark"    column="remark"    />
20
         <result property="remark"    column="remark"    />
21
         <result property="manageDept"    column="manage_dept"    />
21
         <result property="manageDept"    column="manage_dept"    />
22
+        <result property="status"    column="status"    />
22
         <association property="dept"    javaType="SysDept"         resultMap="deptResult" />
23
         <association property="dept"    javaType="SysDept"         resultMap="deptResult" />
23
     </resultMap>
24
     </resultMap>
24
 
25
 
28
     </resultMap>
29
     </resultMap>
29
 
30
 
30
     <sql id="selectCmcDeviceVo">
31
     <sql id="selectCmcDeviceVo">
31
-        select d.device_id, d.device_number, d.code, d.name, d.type, d.acquisition_time, d.cost, d.expect_life, d.series, d.brand, d.day_cost, d.place, d.remark, d.manage_dept, dept.dept_name from cmc_device as d left join sys_dept as dept
32
+        select d.device_id, d.device_number, d.code, d.name, d.type, d.acquisition_time, d.cost, d.expect_life, d.series, d.brand, d.day_cost, d.place, d.remark, d.manage_dept, d.status, dept.dept_name from cmc_device as d left join sys_dept as dept
32
     </sql>
33
     </sql>
33
 
34
 
34
     <select id="selectCmcDeviceList" parameterType="CmcDevice" resultMap="CmcDeviceResult">
35
     <select id="selectCmcDeviceList" parameterType="CmcDevice" resultMap="CmcDeviceResult">
47
             <if test="dayCost != null "> and d.day_cost = #{dayCost}</if>
48
             <if test="dayCost != null "> and d.day_cost = #{dayCost}</if>
48
             <if test="place != null  and place != ''"> and d.place like concat('%', #{place}, '%')</if>
49
             <if test="place != null  and place != ''"> and d.place like concat('%', #{place}, '%')</if>
49
             <if test="manageDept != null "> and d.manage_dept = #{manageDept}</if>
50
             <if test="manageDept != null "> and d.manage_dept = #{manageDept}</if>
51
+            <if test="status != null "> and d.status = #{status}</if>
50
         </where>
52
         </where>
51
     </select>
53
     </select>
52
 
54
 
76
             <if test="place != null">place,</if>
78
             <if test="place != null">place,</if>
77
             <if test="remark != null">remark,</if>
79
             <if test="remark != null">remark,</if>
78
             <if test="manageDept != null">manage_dept,</if>
80
             <if test="manageDept != null">manage_dept,</if>
81
+            <if test="status != null">status,</if>
79
         </trim>
82
         </trim>
80
         <trim prefix="values (" suffix=")" suffixOverrides=",">
83
         <trim prefix="values (" suffix=")" suffixOverrides=",">
81
             <if test="deviceNumber != null">#{deviceNumber},</if>
84
             <if test="deviceNumber != null">#{deviceNumber},</if>
91
             <if test="place != null">#{place},</if>
94
             <if test="place != null">#{place},</if>
92
             <if test="remark != null">#{remark},</if>
95
             <if test="remark != null">#{remark},</if>
93
             <if test="manageDept != null">#{manageDept},</if>
96
             <if test="manageDept != null">#{manageDept},</if>
97
+            <if test="status != null">#{status},</if>
94
         </trim>
98
         </trim>
95
     </insert>
99
     </insert>
96
 
100
 
110
             <if test="place != null">place = #{place},</if>
114
             <if test="place != null">place = #{place},</if>
111
             <if test="remark != null">remark = #{remark},</if>
115
             <if test="remark != null">remark = #{remark},</if>
112
             <if test="manageDept != null">manage_dept = #{manageDept},</if>
116
             <if test="manageDept != null">manage_dept = #{manageDept},</if>
117
+            <if test="status != null">status = #{status},</if>
113
         </trim>
118
         </trim>
114
         where device_id = #{deviceId}
119
         where device_id = #{deviceId}
115
     </update>
120
     </update>

+ 12
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcTechnicalMapper.xml Vedi File

24
         <result property="manageApprovalTime"    column="manage_approval_time"    />
24
         <result property="manageApprovalTime"    column="manage_approval_time"    />
25
         <association property="planUser"    javaType="SysUser"         resultMap="PlanUserResult" />
25
         <association property="planUser"    javaType="SysUser"         resultMap="PlanUserResult" />
26
         <association property="designUser"    javaType="SysUser"         resultMap="DesignUserResult" />
26
         <association property="designUser"    javaType="SysUser"         resultMap="DesignUserResult" />
27
+        <association property="managerUser"    javaType="SysUser"         resultMap="ManagerUserResult" />
27
     </resultMap>
28
     </resultMap>
28
 
29
 
29
     <resultMap type="SysUser" id="PlanUserResult">
30
     <resultMap type="SysUser" id="PlanUserResult">
36
         <result property="nickName"    column="design_nick_name"    />
37
         <result property="nickName"    column="design_nick_name"    />
37
     </resultMap>
38
     </resultMap>
38
 
39
 
40
+    <resultMap type="SysUser" id="ManagerUserResult">
41
+        <result property="userId"    column="user_id"    />
42
+        <result property="nickName"    column="manager_nick_name"    />
43
+    </resultMap>
44
+
39
     <sql id="selectCmcTechnicalVo">
45
     <sql id="selectCmcTechnicalVo">
40
         select t.technical_id, t.project_id, t.technical_director, t.technical_designer, u.nick_name as design_nick_name, t.technical_planner, u1.nick_name as plan_nick_name,
46
         select t.technical_id, t.project_id, t.technical_director, t.technical_designer, u.nick_name as design_nick_name, t.technical_planner, u1.nick_name as plan_nick_name,
41
                t.plan_comment, t.quality_inspector, t.technical_time, t.technical_document, t.modify_document, t.final_document, t.design_description, t.technical_comment,
47
                t.plan_comment, t.quality_inspector, t.technical_time, t.technical_document, t.modify_document, t.final_document, t.design_description, t.technical_comment,
48
+               t.manager_user_id, u2.nick_name as manager_nick_name,
42
                t.manage_comment, t.technical_upload_time, t.tech_approval_time, t.manage_approval_time from cmc_technical as t
49
                t.manage_comment, t.technical_upload_time, t.tech_approval_time, t.manage_approval_time from cmc_technical as t
43
          left join sys_user as u on u.user_id = t.technical_designer
50
          left join sys_user as u on u.user_id = t.technical_designer
44
          left join sys_user as u1 on u1.user_id = t.technical_planner
51
          left join sys_user as u1 on u1.user_id = t.technical_planner
52
+         left join sys_user as u2 on u2.user_id = t.manager_user_id
45
     </sql>
53
     </sql>
46
 
54
 
47
     <select id="selectCmcTechnicalList" parameterType="CmcTechnical" resultMap="CmcTechnicalResult">
55
     <select id="selectCmcTechnicalList" parameterType="CmcTechnical" resultMap="CmcTechnicalResult">
57
             <if test="technicalDocument != null  and technicalDocument != ''"> and t.technical_document = #{technicalDocument}</if>
65
             <if test="technicalDocument != null  and technicalDocument != ''"> and t.technical_document = #{technicalDocument}</if>
58
             <if test="designDescription != null  and designDescription != ''"> and t.design_description = #{designDescription}</if>
66
             <if test="designDescription != null  and designDescription != ''"> and t.design_description = #{designDescription}</if>
59
             <if test="technicalComment != null  and technicalComment != ''"> and t.technical_comment = #{technicalComment}</if>
67
             <if test="technicalComment != null  and technicalComment != ''"> and t.technical_comment = #{technicalComment}</if>
68
+            <if test="managerUserId != null "> and t.manager_user_id = #{managerUserId}</if>
60
             <if test="manageComment != null  and manageComment != ''"> and t.manage_comment = #{manageComment}</if>
69
             <if test="manageComment != null  and manageComment != ''"> and t.manage_comment = #{manageComment}</if>
61
             <if test="technicalUploadTime != null "> and t.technical_upload_time = #{technicalUploadTime}</if>
70
             <if test="technicalUploadTime != null "> and t.technical_upload_time = #{technicalUploadTime}</if>
62
             <if test="techApprovalTime != null "> and t.tech_approval_time = #{techApprovalTime}</if>
71
             <if test="techApprovalTime != null "> and t.tech_approval_time = #{techApprovalTime}</if>
85
             <if test="finalDocument != null">final_document,</if>
94
             <if test="finalDocument != null">final_document,</if>
86
             <if test="designDescription != null">design_description,</if>
95
             <if test="designDescription != null">design_description,</if>
87
             <if test="technicalComment != null">technical_comment,</if>
96
             <if test="technicalComment != null">technical_comment,</if>
97
+            <if test="managerUserId != null">manager_user_id,</if>
88
             <if test="manageComment != null">manage_comment,</if>
98
             <if test="manageComment != null">manage_comment,</if>
89
             <if test="technicalUploadTime != null">technical_upload_time,</if>
99
             <if test="technicalUploadTime != null">technical_upload_time,</if>
90
             <if test="techApprovalTime != null">tech_approval_time,</if>
100
             <if test="techApprovalTime != null">tech_approval_time,</if>
104
             <if test="finalDocument != null">#{finalDocument},</if>
114
             <if test="finalDocument != null">#{finalDocument},</if>
105
             <if test="designDescription != null">#{designDescription},</if>
115
             <if test="designDescription != null">#{designDescription},</if>
106
             <if test="technicalComment != null">#{technicalComment},</if>
116
             <if test="technicalComment != null">#{technicalComment},</if>
117
+            <if test="managerUserId != null">#{managerUserId},</if>
107
             <if test="manageComment != null">#{manageComment},</if>
118
             <if test="manageComment != null">#{manageComment},</if>
108
             <if test="technicalUploadTime != null">#{technicalUploadTime},</if>
119
             <if test="technicalUploadTime != null">#{technicalUploadTime},</if>
109
             <if test="techApprovalTime != null">#{techApprovalTime},</if>
120
             <if test="techApprovalTime != null">#{techApprovalTime},</if>
126
             <if test="finalDocument != null">final_document = #{finalDocument},</if>
137
             <if test="finalDocument != null">final_document = #{finalDocument},</if>
127
             <if test="designDescription != null">design_description = #{designDescription},</if>
138
             <if test="designDescription != null">design_description = #{designDescription},</if>
128
             <if test="technicalComment != null">technical_comment = #{technicalComment},</if>
139
             <if test="technicalComment != null">technical_comment = #{technicalComment},</if>
140
+            <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
129
             <if test="manageComment != null">manage_comment = #{manageComment},</if>
141
             <if test="manageComment != null">manage_comment = #{manageComment},</if>
130
             <if test="technicalUploadTime != null">technical_upload_time = #{technicalUploadTime},</if>
142
             <if test="technicalUploadTime != null">technical_upload_time = #{technicalUploadTime},</if>
131
             <if test="techApprovalTime != null">tech_approval_time = #{techApprovalTime},</if>
143
             <if test="techApprovalTime != null">tech_approval_time = #{techApprovalTime},</if>

+ 1
- 1
oa-back/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml Vedi File

112
 		select u.user_id, u.nick_name from sys_user as u
112
 		select u.user_id, u.nick_name from sys_user as u
113
 		left join sys_user_post as up on u.user_id = up.user_id
113
 		left join sys_user_post as up on u.user_id = up.user_id
114
 		left join sys_post as p on up.post_id = p.post_id
114
 		left join sys_post as p on up.post_id = p.post_id
115
-		where p.post_name = '主任' and u.dept_id = #{param}
115
+		where p.post_name = '主任' and u.dept_id = #{param}
116
 	</select>
116
 	</select>
117
 
117
 
118
 	<select id="selectViceDeptLeaderByDeptId" parameterType="String" resultMap="SysUserResult">
118
 	<select id="selectViceDeptLeaderByDeptId" parameterType="String" resultMap="SysUserResult">

+ 603
- 602
oa-back/sql/sql.sql
File diff soppresso perché troppo grande
Vedi File


+ 31
- 94
oa-ui/src/views/flowable/form/oa/deviceForm.vue Vedi File

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-03-07 13:44:39
3
  * @Date: 2024-03-07 13:44:39
4
  * @LastEditors: wrh
4
  * @LastEditors: wrh
5
- * @LastEditTime: 2024-05-22 19:15:50
5
+ * @LastEditTime: 2024-05-23 14:46:21
6
 -->
6
 -->
7
 
7
 
8
 <template>
8
 <template>
84
                   </el-form-item>
84
                   </el-form-item>
85
                 </el-col>
85
                 </el-col>
86
               </el-row>
86
               </el-row>
87
+              <!-- 安排设备意见 -->
87
               <el-divider></el-divider>
88
               <el-divider></el-divider>
88
-
89
-              <!-- 部门审核意见 -->
90
-              <el-form-item label="部门审核意见:" prop="deptComment" label-width="120px" v-if="showFormItem('部门审核')">
91
-                <el-input type="textarea" :rows="2" placeholder="请输入部门审核意见" v-model="form.deptComment"
92
-                  :disabled="taskName != '部门审核'">
89
+              <el-form-item label-width="120px" label="设备选择:">
90
+                <el-select style="width: 100%;" v-model="form.devices" filterable multiple placeholder="请选择"
91
+                  clearable :disabled="taskName != '安排设备' && taskName != '设备申请'">
92
+                  <el-option v-for="item in deviceList" :key="item.deviceId" :disabled="item.status || item.status != '1'"
93
+                    :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
94
+                     + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
95
+                  </el-option>
96
+                </el-select>
97
+              </el-form-item>
98
+              <el-form-item label="安排设备意见:" prop="dispatchComment" label-width="120px">
99
+                <el-input type="textarea" :rows="2" placeholder="请输入安排设备意见" v-model="form.dispatchComment"
100
+                  :disabled="taskName != '安排设备'">
93
                 </el-input>
101
                 </el-input>
94
               </el-form-item>
102
               </el-form-item>
95
               <el-row>
103
               <el-row>
96
                 <el-col :span="6" :xs="24" :offset="12">
104
                 <el-col :span="6" :xs="24" :offset="12">
97
-                  <el-form-item label="签名:" label-width="120px" v-if="showFormItem('部门审核签名')">
98
-                    <span class="auditor"> {{ form.deptUser ? form.deptUser.nickName : deptUser }} </span>
105
+                  <el-form-item label="签名:" label-width="120px"
106
+                    v-if="taskName == '安排设备' || taskName == '申请确认' || taskName == '归还确认'">
107
+                    <span class="auditor"> {{ form.dispatchUser ? form.dispatchUser.nickName : dispatchUser }} </span>
99
                   </el-form-item>
108
                   </el-form-item>
100
                 </el-col>
109
                 </el-col>
101
                 <el-col :span="6">
110
                 <el-col :span="6">
102
-                  <el-form-item label="日期:" label-width="120px" v-if="showFormItem('部门审核签名')">
103
-                    <span> {{ form.deptTime ? form.deptTime : deptTime }} </span>
111
+                  <el-form-item label="日期:" label-width="120px"
112
+                    v-if="taskName == '安排设备' || taskName == '申请确认' || taskName == '归还确认'">
113
+                    <span> {{ form.dispatchTime ? form.dispatchTime : dispatchTime }} </span>
104
                   </el-form-item>
114
                   </el-form-item>
105
                 </el-col>
115
                 </el-col>
106
               </el-row>
116
               </el-row>
122
                   </el-form-item>
132
                   </el-form-item>
123
                 </el-col>
133
                 </el-col>
124
               </el-row>
134
               </el-row>
125
-              <!-- 安排设备意见 -->
126
-              <el-divider></el-divider>
127
-              <el-form-item label="安排设备意见:" prop="dispatchComment" label-width="120px">
128
-                <el-input type="textarea" :rows="2" placeholder="请输入安排设备意见" v-model="form.dispatchComment"
129
-                  :disabled="taskName != '安排设备'">
130
-                </el-input>
131
-              </el-form-item>
132
-              <el-row>
133
-                <el-col :span="6" :xs="24" :offset="12">
134
-                  <el-form-item label="签名:" label-width="120px"
135
-                    v-if="taskName == '安排设备' || taskName == '申请确认' || taskName == '归还确认'">
136
-                    <span class="auditor"> {{ form.dispatchUser ? form.dispatchUser.nickName : dispatchUser }} </span>
137
-                  </el-form-item>
138
-                </el-col>
139
-                <el-col :span="6">
140
-                  <el-form-item label="日期:" label-width="120px"
141
-                    v-if="taskName == '安排设备' || taskName == '申请确认' || taskName == '归还确认'">
142
-                    <span> {{ form.dispatchTime ? form.dispatchTime : dispatchTime }} </span>
143
-                  </el-form-item>
144
-                </el-col>
145
-              </el-row>
146
-              <!-- 设备安排 -->
147
-              <el-form-item label-width="120px" label="设备选择:">
148
-                <el-select style="width: 300px;" v-model="form.devices" filterable multiple placeholder="请选择"
149
-                  @change="handleSelectDevice" clearable :disabled="taskName != '安排设备'">
150
-                  <el-option v-for="item in deviceList" :key="item.deviceId"
151
-                    :label="item.brand + item.series + item.name + item.code" :value="item.deviceId">
152
-                  </el-option>
153
-                </el-select>
154
-                <el-descriptions border v-if="isDeviceSelect" style="margin-top: 10px;" :column="1">
155
-                  <el-descriptions-item label="出厂编号" label-class-name="my-label">{{ chooseDevice.code
156
-                  }}</el-descriptions-item>
157
-                  <el-descriptions-item label="设备名称" label-class-name="my-label">{{ chooseDevice.name
158
-                  }}</el-descriptions-item>
159
-                  <el-descriptions-item label="设备品牌" label-class-name="my-label">{{ chooseDevice.brand
160
-                  }}</el-descriptions-item>
161
-                  <el-descriptions-item label="规格型号" label-class-name="my-label">{{ chooseDevice.series
162
-                  }}</el-descriptions-item>
163
-                  <el-descriptions-item label="存放地点" label-class-name="my-label">{{ chooseDevice.place
164
-                  }}</el-descriptions-item>
165
-                </el-descriptions>
166
-              </el-form-item>
135
+              <!-- 归还确认 -->
167
               <el-divider></el-divider>
136
               <el-divider></el-divider>
168
               <el-form-item label="设备状况:" prop="state" label-width="120px">                
137
               <el-form-item label="设备状况:" prop="state" label-width="120px">                
169
                 <el-radio-group v-model="form.state" size="small" :disabled="taskName != '归还确认'">
138
                 <el-radio-group v-model="form.state" size="small" :disabled="taskName != '归还确认'">
170
-                  <el-radio label="0">完好</el-radio>
171
-                  <el-radio label="1">需维修</el-radio>
139
+                  <el-radio label="2">完好</el-radio>
140
+                  <el-radio label="3">需维修</el-radio>
172
                 </el-radio-group>
141
                 </el-radio-group>
173
               </el-form-item>
142
               </el-form-item>
174
               <el-form-item label="备注:" prop="remark" label-width="120px">
143
               <el-form-item label="备注:" prop="remark" label-width="120px">
214
 import {
183
 import {
215
   complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm,
184
   complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm,
216
 } from "@/api/flowable/todo";
185
 } from "@/api/flowable/todo";
217
-import { getUsersDeptLeader, getUsersManageLeader } from '@/api/system/post.js'
186
+import { getUsersManageLeader } from '@/api/system/post.js'
218
 import flow from '@/views/flowable/task/todo/detail/flow'
187
 import flow from '@/views/flowable/task/todo/detail/flow'
219
 import { flowXmlAndNode } from "@/api/flowable/definition";
188
 import { flowXmlAndNode } from "@/api/flowable/definition";
220
 import { getUserByRole } from "@/api/system/role";
189
 import { getUserByRole } from "@/api/system/role";
233
     }
202
     }
234
   },
203
   },
235
   created() {
204
   created() {
236
-    if (this.taskName == '部门审核') {
237
-      this.deptUser = this.$store.getters.name;
238
-      this.deptTime = parseTime(new Date(), '{y}-{m}-{d}')
239
-    }
240
     if (this.taskName == '分管审核') {
205
     if (this.taskName == '分管审核') {
241
       this.managerUser = this.$store.getters.name;
206
       this.managerUser = this.$store.getters.name;
242
       this.managerTime = parseTime(new Date(), '{y}-{m}-{d}')
207
       this.managerTime = parseTime(new Date(), '{y}-{m}-{d}')
255
   },
220
   },
256
   data() {
221
   data() {
257
     return {
222
     return {
258
-      deptUser: '',
259
       managerUser: '',
223
       managerUser: '',
260
       dispatchUser: '',
224
       dispatchUser: '',
261
-      deptTime: undefined,
262
       managerTime: undefined,
225
       managerTime: undefined,
263
       dispatchTime: undefined,
226
       dispatchTime: undefined,
264
       form: {
227
       form: {
288
         ],
251
         ],
289
       },
252
       },
290
       deviceList: [],
253
       deviceList: [],
291
-      chooseDevice: {},
292
-      isDeviceSelect: false,
293
       formTotal: 0
254
       formTotal: 0
294
     }
255
     }
295
   },
256
   },
368
     },
329
     },
369
     // 获取下一个审批人
330
     // 获取下一个审批人
370
     getNextFlowNodeApproval() {
331
     getNextFlowNodeApproval() {
371
-      if (this.taskName == '设备申请') {
372
-        getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
373
-          let userId = res.data.userId;
374
-          this.$set(this.taskForm.variables, "approval", userId);
332
+      if (this.taskName == '设备申请') {        
333
+        getUserByRole({ roleId: 5 }).then(result => {
334
+          this.$set(this.taskForm.variables, "approval", result.data[0]);
375
           complete(this.taskForm).then(response => {
335
           complete(this.taskForm).then(response => {
376
             this.$modal.msgSuccess(response.msg);
336
             this.$modal.msgSuccess(response.msg);
377
             this.$emit('goBack')
337
             this.$emit('goBack')
378
           });
338
           });
379
-        })
380
-      } else if (this.taskName == '部门审核') {
381
-        getUsersManageLeader({ userId: this.$store.getters.userId }).then(res => {
339
+        });
340
+      } else if (this.taskName == '安排设备') {
341
+        getUsersManageLeader({ userId: this.form.applier }).then(res => {
382
           let userId = res.data.userId;
342
           let userId = res.data.userId;
383
           this.$set(this.taskForm.variables, "approval", userId);
343
           this.$set(this.taskForm.variables, "approval", userId);
384
           complete(this.taskForm).then(response => {
344
           complete(this.taskForm).then(response => {
387
           });
347
           });
388
         })
348
         })
389
       } else if (this.taskName == '分管审核') {
349
       } else if (this.taskName == '分管审核') {
390
-        getUserByRole({ roleId: 5 }).then(result => {
391
-          this.$set(this.taskForm.variables, "approval", result.data[0]);
392
-          complete(this.taskForm).then(response => {
393
-            this.$modal.msgSuccess(response.msg);
394
-            this.$emit('goBack')
395
-          });
396
-        });
397
-      } else if (this.taskName == '安排设备') {
398
         complete(this.taskForm).then(response => {
350
         complete(this.taskForm).then(response => {
399
           this.$modal.msgSuccess(response.msg);
351
           this.$modal.msgSuccess(response.msg);
400
           this.$emit('goBack')
352
           this.$emit('goBack')
446
         this.deviceList = res.rows
398
         this.deviceList = res.rows
447
       })
399
       })
448
     },
400
     },
449
-    // 选择设备
450
-    handleSelectDevice(val) {
451
-      if (val != "" && val != undefined && val != null) {
452
-        getDevice(val[val.length - 1]).then(res => {
453
-          this.chooseDevice = res.data;
454
-          this.isDeviceSelect = true
455
-        })
456
-      } else {
457
-        this.isDeviceSelect = false
458
-      }
459
-    },
460
     // 计算天数
401
     // 计算天数
461
     calculateDay() {
402
     calculateDay() {
462
       if (this.form.beginDate && this.form.endDate) {
403
       if (this.form.beginDate && this.form.endDate) {
483
     },
424
     },
484
     showFormItem(name) {
425
     showFormItem(name) {
485
       let isShow = false;
426
       let isShow = false;
486
-      if (name == '部门审核')
487
-        isShow = (this.taskName == '设备申请' || this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排设备' || this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.deptUserId != null);
488
-      else if (name == '分管审核')
427
+      if (name == '分管审核')
489
         isShow = (this.taskName == '设备申请' || this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排设备' || this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.managerUserId != null);
428
         isShow = (this.taskName == '设备申请' || this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排设备' || this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.managerUserId != null);
490
-      else if (name == '部门审核签名')
491
-        isShow = (this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排设备' || this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.deptUserId != null);
492
       else if (name == '分管审核签名')
429
       else if (name == '分管审核签名')
493
         isShow = this.taskName == '分管审核' || ((this.taskName == '安排设备' || this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.managerUserId != null);
430
         isShow = this.taskName == '分管审核' || ((this.taskName == '安排设备' || this.taskName == '申请确认' || this.taskName == '归还确认') && this.form.managerUserId != null);
494
       return isShow;
431
       return isShow;

+ 37
- 3
oa-ui/src/views/oa/device/detail.vue Vedi File

117
             <el-table-column type="index" width="55" align="center" label="序号" />
117
             <el-table-column type="index" width="55" align="center" label="序号" />
118
             <el-table-column label="费用类型" align="center" prop="expenseType">
118
             <el-table-column label="费用类型" align="center" prop="expenseType">
119
               <template slot-scope="scope">
119
               <template slot-scope="scope">
120
-                <el-tag :type="typeStyle(scope.row.expenseType)">{{ expenseTypeText(scope.row.expenseType) }}</el-tag>
120
+                <el-tag :type="expenseTypeStyle(scope.row.expenseType)">{{ expenseTypeText(scope.row.expenseType) }}</el-tag>
121
               </template>
121
               </template>
122
             </el-table-column>
122
             </el-table-column>
123
             <el-table-column label="费用金额" align="center" prop="expense">
123
             <el-table-column label="费用金额" align="center" prop="expense">
200
                 {{ scope.row.beginDate }}
200
                 {{ scope.row.beginDate }}
201
               </template>
201
               </template>
202
             </el-table-column>
202
             </el-table-column>
203
-            <el-table-column label="归还时间" align="center" prop="returnDate" width="180">
203
+            <el-table-column label="归还时间" align="center" prop="returnDate">
204
               <template slot-scope="scope">
204
               <template slot-scope="scope">
205
                 {{ scope.row.returnDate }}
205
                 {{ scope.row.returnDate }}
206
               </template>
206
               </template>
207
+            </el-table-column>            
208
+            <el-table-column label="设备状况" align="center" prop="state">
209
+              <template slot-scope="scope">
210
+                <el-tag :type="stateTypeStyle(scope.row.state)">{{ stateTypeText(scope.row.state) }}</el-tag>
211
+                {{ scope.row.state ? (scope.row.state == '0' ? '完好' : '需维修') : '使用中' }}
212
+              </template>
207
             </el-table-column>
213
             </el-table-column>
208
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
214
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
209
               <template slot-scope="scope">
215
               <template slot-scope="scope">
454
         return '检定费'
460
         return '检定费'
455
       }
461
       }
456
     },
462
     },
457
-    typeStyle(row) {
463
+    expenseTypeStyle(row) {
458
       if (row == '0') {
464
       if (row == '0') {
459
         return 'primary'
465
         return 'primary'
460
       }
466
       }
464
       if (row == '2') {
470
       if (row == '2') {
465
         return 'success'
471
         return 'success'
466
       }
472
       }
473
+    },
474
+    stateTypeText(row) {
475
+      if (row == '0') {
476
+        return '申领中'
477
+      }
478
+      if (row == '1') {
479
+        return '被领取'
480
+      }
481
+      if (row == '2') {
482
+        return '完好'
483
+      }
484
+      if (row == '3') {
485
+        return '需维修'
486
+      }
487
+    },
488
+    stateTypeStyle(row) {
489
+      if (row == '0') {
490
+        return 'primary'
491
+      }
492
+      if (row == '1') {
493
+        return 'warning'
494
+      }
495
+      if (row == '2') {
496
+        return 'success'
497
+      }
498
+      if (row == '3') {
499
+        return 'danger'
500
+      }
467
     }
501
     }
468
   },
502
   },
469
 }
503
 }

+ 27
- 0
oa-ui/src/views/oa/device/index.vue Vedi File

37
     <el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
37
     <el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
38
       <el-table-column type="selection" width="55" align="center" />
38
       <el-table-column type="selection" width="55" align="center" />
39
       <!-- <el-table-column label="设备id" align="center" prop="deviceId" /> -->
39
       <!-- <el-table-column label="设备id" align="center" prop="deviceId" /> -->
40
+      <el-table-column label="设备状态" align="center" prop="status" >
41
+        <template slot-scope="scope">
42
+                <el-tag :type="stateTypeStyle(scope.row.status)">{{ stateTypeText(scope.row.status) }}</el-tag>
43
+              </template>
44
+      </el-table-column>
40
       <el-table-column label="出厂编号" align="center" prop="code" />
45
       <el-table-column label="出厂编号" align="center" prop="code" />
41
       <el-table-column label="设备名称" align="center" prop="name" />
46
       <el-table-column label="设备名称" align="center" prop="name" />
42
       <el-table-column label="设备类别" align="center" prop="type" />
47
       <el-table-column label="设备类别" align="center" prop="type" />
308
       this.download('oa/device/export', {
313
       this.download('oa/device/export', {
309
         ...this.queryParams
314
         ...this.queryParams
310
       }, `device_${new Date().getTime()}.xlsx`)
315
       }, `device_${new Date().getTime()}.xlsx`)
316
+    },
317
+    stateTypeText(row) {
318
+      if (row == '0') {
319
+        return '被领用'
320
+      }
321
+      if (row == '1') {
322
+        return '可领用'
323
+      }
324
+      if (row == '2') {
325
+        return '已停用'
326
+      }
327
+    },
328
+    stateTypeStyle(row) {
329
+      if (row == '0') {
330
+        return 'warning'
331
+      }
332
+      if (row == '1') {
333
+        return 'success'
334
+      }
335
+      if (row == '2') {
336
+        return 'info'
337
+      }
311
     }
338
     }
312
   }
339
   }
313
 };
340
 };

Loading…
Annulla
Salva