瀏覽代碼

设备申请 增加修改后设备

lamphua 1 年之前
父節點
當前提交
098b9efb79

+ 2
- 2
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceApprovalController.java 查看文件

@@ -153,9 +153,9 @@ public class CmcDeviceApprovalController extends BaseController
153 153
             cmcDeviceApproval.setDispatchComment(formDataJson.getString("dispatchComment"));
154 154
             cmcDeviceApproval.setDispatchTime(new Date());
155 155
         }
156
-        if (formDataJson.getJSONArray("devices").size() > 0) {
156
+        if (formDataJson.getJSONArray("modifyDevices").size() > 0) {
157 157
             cmcDeviceApproval.setDispatcher(getLoginUser().getUserId());
158
-            String deviceString = formDataJson.getString("devices").substring(1, formDataJson.getString("devices").length() - 1);
158
+            String deviceString = formDataJson.getString("modifyDevices").substring(1, formDataJson.getString("modifyDevices").length() - 1);
159 159
             cmcDeviceApproval.setDevices(deviceString);
160 160
             String[] devices = deviceString.split(",");
161 161
             BigDecimal estimateCost = new BigDecimal(0);

+ 5
- 2
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcTechnicalController.java 查看文件

@@ -84,13 +84,16 @@ public class CmcTechnicalController extends BaseController
84 84
     @PutMapping
85 85
     public AjaxResult edit(@RequestBody CmcTechnical cmcTechnical)
86 86
     {
87
-        if (cmcTechnical.getTechnicalDocument() != null) {
87
+        if (cmcTechnical.getTechnicalDocument() != null && cmcTechnical.getTechnicalComment() == null) {
88
+            cmcTechnical.setTechnicalDesigner(getLoginUser().getUserId());
88 89
             cmcTechnical.setTechnicalUploadTime(new Date());
89 90
         }
90
-        if (cmcTechnical.getTechnicalComment() != null) {
91
+        if (cmcTechnical.getModifyDocument() != null && cmcTechnical.getManageComment() == null) {
92
+            cmcTechnical.setTechnicalPlanner(getLoginUser().getUserId());
91 93
             cmcTechnical.setTechApprovalTime(new Date());
92 94
         }
93 95
         if (cmcTechnical.getManageComment() != null) {
96
+            cmcTechnical.setManagerUserId(getLoginUser().getUserId());
94 97
             cmcTechnical.setManageApprovalTime(new Date());
95 98
         }
96 99
         return toAjax(cmcTechnicalService.updateCmcTechnical(cmcTechnical));

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

@@ -44,6 +44,10 @@ public class CmcDeviceApproval extends BaseEntity
44 44
     @Excel(name = "设备id")
45 45
     private String devices;
46 46
 
47
+    /** 修改后设备id */
48
+    @Excel(name = "修改后设备id")
49
+    private String modifyDevices;
50
+
47 51
     /** 项目id */
48 52
     @Excel(name = "项目id")
49 53
     private String projectId;
@@ -190,6 +194,15 @@ public class CmcDeviceApproval extends BaseEntity
190 194
     {
191 195
         return devices;
192 196
     }
197
+    public void setModifyDevices(String modifyDevices)
198
+    {
199
+        this.modifyDevices = modifyDevices;
200
+    }
201
+
202
+    public String getModifyDevices()
203
+    {
204
+        return modifyDevices;
205
+    }
193 206
     public void setProjectId(String projectId)
194 207
     {
195 208
         this.projectId = projectId;
@@ -350,6 +363,7 @@ public class CmcDeviceApproval extends BaseEntity
350 363
             .append("deviceApplyId", getDeviceApplyId())
351 364
             .append("applier", getApplier())
352 365
             .append("devices", getDevices())
366
+            .append("modifyDevices", getModifyDevices())
353 367
             .append("projectId", getProjectId())
354 368
             .append("applyReason", getApplyReason())
355 369
             .append("beginDate", getBeginDate())

+ 8
- 3
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml 查看文件

@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
9 9
         <result property="applier"    column="applier"    />
10 10
         <result property="useDept"    column="use_dept"    />
11 11
         <result property="devices"    column="devices"    />
12
+        <result property="modifyDevices"    column="modify_devices"    />
12 13
         <result property="projectId"    column="project_id"    />
13 14
         <result property="applyReason"    column="apply_reason"    />
14 15
         <result property="applyDate"    column="apply_date"    />
@@ -59,9 +60,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
59 60
     </resultMap>
60 61
 
61 62
     <sql id="selectCmcDeviceApprovalVo">
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,
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
63
+        select da.device_apply_id, da.applier, u.nick_name as applier_nick_name, da.use_dept, d.dept_name, da.devices, da.modify_devices, da.project_id, p.project_number, p.project_name,
64
+               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, da.manager_comment,
65
+               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
65 66
             left join sys_user as u on u.user_id = da.applier
66 67
             left join sys_user as u1 on u1.user_id = da.manager_user_id
67 68
             left join sys_user as u2 on u2.user_id = da.dispatcher
@@ -75,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
75 76
             <if test="applier != null "> and da.applier = #{applier}</if>
76 77
             <if test="useDept != null "> and da.use_dept = #{useDept}</if>
77 78
             <if test="devices != null  and devices != ''"> and da.devices like concat('%', #{devices}, '%')</if>
79
+            <if test="modifyDevices != null  and modifyDevices != ''"> and da.modify_devices like concat('%', #{modifyDevices}, '%')</if>
78 80
             <if test="projectId != null  and projectId != ''"> and da.project_id = #{projectId}</if>
79 81
             <if test="applyReason != null  and applyReason != ''"> and da.apply_reason = #{applyReason}</if>
80 82
             <if test="applyDate != null "> and da.apply_date = #{applyDate}</if>
@@ -104,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
104 106
             <if test="applier != null">applier,</if>
105 107
             <if test="useDept != null">use_dept,</if>
106 108
             <if test="devices != null">devices,</if>
109
+            <if test="modifyDevices != null">modify_devices,</if>
107 110
             <if test="projectId != null">project_id,</if>
108 111
             <if test="applyReason != null">apply_reason,</if>
109 112
             <if test="applyDate != null">apply_date,</if>
@@ -126,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
126 129
             <if test="applier != null">#{applier},</if>
127 130
             <if test="useDept != null">#{useDept},</if>
128 131
             <if test="devices != null">#{devices},</if>
132
+            <if test="modifyDevices != null">#{modifyDevices},</if>
129 133
             <if test="projectId != null">#{projectId},</if>
130 134
             <if test="applyReason != null">#{applyReason},</if>
131 135
             <if test="applyDate != null">#{applyDate},</if>
@@ -151,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
151 155
             <if test="applier != null">applier = #{applier},</if>
152 156
             <if test="useDept != null">use_dept = #{useDept},</if>
153 157
             <if test="devices != null">devices = #{devices},</if>
158
+            <if test="modifyDevices != null">modify_devices = #{modifyDevices},</if>
154 159
             <if test="projectId != null">project_id = #{projectId},</if>
155 160
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
156 161
             <if test="applyDate != null">apply_date = #{applyDate},</if>

+ 26
- 16
oa-back/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml 查看文件

@@ -95,31 +95,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
95 95
 	</select>
96 96
 
97 97
 	<select id="selectDeptLeaderByUserId" parameterType="String" resultMap="SysUserResult">
98
-		select u.user_id, u.nick_name from sys_user as u
99
-		left join sys_user_post as up on u.user_id = up.user_id
100
-		left join sys_post as p on up.post_id = p.post_id
101
-		where p.post_name = '主任' and u.user_id = #{param}
98
+		select r.user_id, r.nick_name from
99
+		(select u1.user_id, u1.nick_name, u.dept_id from
100
+		sys_user as u, sys_user as u1 where u.user_id = #{param} and u1.dept_id = u.dept_id) as r
101
+		left join sys_user_post as up on r.user_id = up.user_id
102
+		left join sys_post as p on p.post_id = up.post_id
103
+		where p.post_name = '主任'
102 104
 	</select>
103 105
 
104 106
 	<select id="selectViceDeptLeaderByUserId" parameterType="String" resultMap="SysUserResult">
105
-		select u.user_id, u.nick_name from sys_user as u
106
-		left join sys_user_post as up on u.user_id = up.user_id
107
-		left join sys_post as p on up.post_id = p.post_id
108
-		where p.post_name = '副主任' and u.user_id = #{param} order by u.user_id desc limit 1
107
+		select r.user_id, r.nick_name from
108
+		(select u1.user_id, u1.nick_name, u.dept_id from
109
+		sys_user as u, sys_user as u1 where u.user_id = #{param} and u1.dept_id = u.dept_id) as r
110
+		left join sys_user_post as up on r.user_id = up.user_id
111
+		left join sys_post as p on p.post_id = up.post_id
112
+		where p.post_name = '副主任'
113
+		order by u.user_id desc limit 1
109 114
 	</select>
110 115
 
111 116
 	<select id="selectDeptLeaderByDeptId" parameterType="String" resultMap="SysUserResult">
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
114
-		left join sys_post as p on up.post_id = p.post_id
115
-		where p.post_name = '主任' and u.dept_id = #{param}
117
+		select r.user_id, r.nick_name from
118
+		(select user_id, nick_name, dept_id from
119
+		sys_user where dept_id = #{param}) as r
120
+		left join sys_user_post as up on r.user_id = up.user_id
121
+		left join sys_post as p on p.post_id = up.post_id
122
+		where p.post_name = '主任'
116 123
 	</select>
117 124
 
118 125
 	<select id="selectViceDeptLeaderByDeptId" parameterType="String" resultMap="SysUserResult">
119
-		select u.user_id, u.nick_name from sys_user as u
120
-		left join sys_user_post as up on u.user_id = up.user_id
121
-		left join sys_post as p on up.post_id = p.post_id
122
-		where p.post_name = '副主任' and u.dept_id = #{param} order by u.user_id desc limit 1
126
+		select r.user_id, r.nick_name from
127
+		(select user_id, nick_name, dept_id from
128
+		sys_user where dept_id = #{param}) as r
129
+		left join sys_user_post as up on r.user_id = up.user_id
130
+		left join sys_post as p on p.post_id = up.post_id
131
+		where p.post_name = '副主任'
132
+		order by u.user_id desc limit 1
123 133
 	</select>
124 134
 
125 135
 	<delete id="deleteUserPostByUserId" parameterType="Long">

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


+ 28
- 6
oa-ui/src/views/flowable/form/oa/deviceForm.vue 查看文件

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-03-07 13:44:39
4 4
  * @LastEditors: wrh
5
- * @LastEditTime: 2024-05-23 14:46:21
5
+ * @LastEditTime: 2024-05-23 15:53:29
6 6
 -->
7 7
 
8 8
 <template>
@@ -58,6 +58,15 @@
58 58
                   }}</el-descriptions-item>
59 59
                 </el-descriptions>
60 60
               </el-form-item>
61
+              <el-form-item label="设备选择:">
62
+                <el-select style="width: 100%;" v-model="form.devices" filterable multiple placeholder="请选择"
63
+                  clearable :disabled="taskName != '设备申请'">
64
+                  <el-option v-for="item in deviceList" :key="item.deviceId" 
65
+                    :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
66
+                     + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
67
+                  </el-option>
68
+                </el-select>
69
+              </el-form-item>
61 70
               <el-form-item label="申领事由:" prop="applyReason">
62 71
                 <el-input type="textarea" :rows="2" placeholder="请输入申领事由" v-model="form.applyReason"
63 72
                   :disabled="taskName != '设备申请'">
@@ -86,10 +95,10 @@
86 95
               </el-row>
87 96
               <!-- 安排设备意见 -->
88 97
               <el-divider></el-divider>
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'"
98
+              <el-form-item label-width="120px" label="拟发放设备:">
99
+                <el-select style="width: 100%;" v-model="form.modifyDevices" filterable multiple placeholder="请选择"
100
+                  clearable :disabled="taskName != '安排设备'">
101
+                  <el-option v-for="item in deviceList" :key="item.deviceId" 
93 102
                     :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
94 103
                      + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
95 104
                   </el-option>
@@ -115,6 +124,7 @@
115 124
                 </el-col>
116 125
               </el-row>
117 126
               <!-- 分管审核意见 -->
127
+              <el-divider></el-divider>
118 128
               <el-form-item label="分管审核意见:" prop="managerComment" label-width="120px" v-if="showFormItem('分管审核')">
119 129
                 <el-input type="textarea" :rows="2" placeholder="请输入分管审核意见" v-model="form.managerComment"
120 130
                   :disabled="taskName != '分管审核'">
@@ -233,7 +243,8 @@ export default {
233 243
         },
234 244
         applyDate: new Date(),
235 245
         days: "",
236
-        devices: []
246
+        devices: [],
247
+        modifyDevices: [],
237 248
       },
238 249
       projectList: [],
239 250
       chooseProject: {},
@@ -280,6 +291,16 @@ export default {
280 291
             }
281 292
             data.devices = arr;
282 293
           }
294
+          if (res.data.modifyDevices == null || res.data.modifyDevices == undefined || res.data.modifyDevices == "") {
295
+            data.modifyDevices = []
296
+          } else {
297
+            data.modifyDevices = data.modifyDevices.split(',');
298
+            let arr = []
299
+            for (let d of data.modifyDevices) {
300
+              arr.push(parseInt(d))
301
+            }
302
+            data.modifyDevices = arr;
303
+          }
283 304
           this.form = data;
284 305
           if (data.projectId) {
285 306
             getProject(data.projectId).then(response => {
@@ -391,6 +412,7 @@ export default {
391 412
     // 获取设备列表
392 413
     getDeviceList() {
393 414
       listDevice({
415
+        status: "1",
394 416
         pageNum: 1,
395 417
         pageSize: 99999999,
396 418
         type: '仪器设备'

+ 1
- 1
oa-ui/src/views/oa/device/detail.vue 查看文件

@@ -346,7 +346,7 @@ export default {
346 346
   },
347 347
   methods: {
348 348
     getList() {
349
-      this.queryParams.devices = this.$route.query.deviceId
349
+      this.queryParams.modifyDevices = this.$route.query.deviceId
350 350
       listDeviceApproval(this.queryParams).then(res => {
351 351
         this.approvalList = res.rows;
352 352
         this.total = res.total;

Loading…
取消
儲存