瀏覽代碼

设备名称列表

lamphua 1 年之前
父節點
當前提交
c1f303ea4c

+ 1
- 22
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCarApprovalController.java 查看文件

@@ -73,30 +73,9 @@ public class CmcCarApprovalController extends BaseController
73 73
     @PostMapping
74 74
     public AjaxResult add(@RequestBody CmcCarApproval cmcCarApproval)
75 75
     {
76
-        return toAjax(cmcCarApprovalService.insertCmcCarApproval(cmcCarApproval));
77
-    }
78
-
79
-    /**
80
-     * 提交用车审批表
81
-     */
82
-    @Log(title = "用车审批表", businessType = BusinessType.INSERT)
83
-    @PostMapping( "/submit")
84
-    public AjaxResult submit(@RequestParam("form")String formData)
85
-    {
86
-        JSONObject formDataJson = JSONObject.parse(formData);
87
-        CmcCarApproval cmcCarApproval = new CmcCarApproval();
88
-        cmcCarApproval.setCarApplyId(formDataJson.getString("formId"));
89 76
         cmcCarApproval.setApplier(getLoginUser().getUserId());
90 77
         cmcCarApproval.setUseDept(getLoginUser().getDeptId());
91
-        cmcCarApproval.setApplyDate(DateUtils.getNowDate());
92
-        cmcCarApproval.setProjectId(formDataJson.getString("projectId"));
93
-        cmcCarApproval.setApplyReason(formDataJson.getString("applyReason"));
94
-        cmcCarApproval.setPassengers(formDataJson.getInteger("passengers"));
95
-        cmcCarApproval.setBeginDate(formDataJson.getDate("beginDate"));
96
-        cmcCarApproval.setEndDate(formDataJson.getDate("endDate"));
97
-        cmcCarApproval.setDays(formDataJson.getLong("days"));
98
-        cmcCarApprovalService.insertCmcCarApproval(cmcCarApproval);
99
-        return AjaxResult.success("提交用车审批表成功");
78
+        return toAjax(cmcCarApprovalService.insertCmcCarApproval(cmcCarApproval));
100 79
     }
101 80
 
102 81
     /**

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

@@ -3,6 +3,7 @@ package com.ruoyi.web.controller.oa;
3 3
 import java.math.BigDecimal;
4 4
 import java.text.SimpleDateFormat;
5 5
 import java.util.List;
6
+import java.util.Map;
6 7
 import javax.servlet.http.HttpServletResponse;
7 8
 
8 9
 import com.ruoyi.common.utils.DateUtils;
@@ -48,6 +49,16 @@ public class CmcDeviceController extends BaseController
48 49
         return getDataTable(list);
49 50
     }
50 51
 
52
+    /**
53
+     * 查询cmc设备名称列表
54
+     */
55
+    @GetMapping("/nameList")
56
+    public AjaxResult getNameList()
57
+    {
58
+        List<Map<String, Object>> list = cmcDeviceService.selectCmcDeviceNameList();
59
+        return success(list);
60
+    }
61
+
51 62
     /**
52 63
      * 导出cmc设备信息列表
53 64
      */

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

@@ -126,13 +126,13 @@ public class CmcPriceController extends BaseController
126 126
      * 根据比例等级查询出单位、一般地类、复杂地类
127 127
      */
128 128
     @GetMapping( "/price")
129
-    public AjaxResult getPriceInfo(@Param("workItem")String workItem, @Param("subItem")String subItem, @Param("scaleGrade")String scaleGrade, @Param("priceType")String priceType)
129
+    public AjaxResult getPriceInfo(@Param("workItem")String workItem, @Param("subItem")String subItem, @Param("scaleGrade")String scaleGrade, @Param("groundType")String groundType)
130 130
     {
131 131
         List<CmcPrice> cmcPriceList = cmcPriceService.selectCmcPriceByScaleGrade(workItem, subItem, scaleGrade);
132 132
         JSONObject price = new JSONObject();
133 133
         price.put("id", cmcPriceList.get(0).getId());
134 134
         price.put("unit", cmcPriceList.get(0).getUnit());
135
-        if (priceType.equals("一般地类"))
135
+        if (groundType.equals("0"))
136 136
             price.put("price", cmcPriceList.get(0).getCommonPrice());
137 137
         else
138 138
             price.put("price", cmcPriceList.get(0).getComplexPrice());

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

@@ -95,6 +95,10 @@ public class CmcCarApproval extends BaseEntity
95 95
     @Excel(name = "分管审批意见")
96 96
     private String managerComment;
97 97
 
98
+    /** 申请用途 */
99
+    @Excel(name = "申请用途")
100
+    private String carUsage;
101
+
98 102
     /** 工会审批人 */
99 103
     @Excel(name = "工会审批人")
100 104
     private Long unionUserId;
@@ -308,6 +312,15 @@ public class CmcCarApproval extends BaseEntity
308 312
     {
309 313
         return managerComment;
310 314
     }
315
+    public void setCarUsage(String carUsage)
316
+    {
317
+        this.carUsage = carUsage;
318
+    }
319
+
320
+    public String getCarUsage()
321
+    {
322
+        return carUsage;
323
+    }
311 324
     public void setUnionUserId(Long unionUserId)
312 325
     {
313 326
         this.unionUserId = unionUserId;

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

@@ -1,6 +1,8 @@
1 1
 package com.ruoyi.oa.mapper;
2 2
 
3 3
 import java.util.List;
4
+import java.util.Map;
5
+
4 6
 import com.ruoyi.oa.domain.CmcDevice;
5 7
 
6 8
 /**
@@ -27,6 +29,13 @@ public interface CmcDeviceMapper
27 29
      */
28 30
     public List<CmcDevice> selectCmcDeviceList(CmcDevice cmcDevice);
29 31
 
32
+    /**
33
+     * 查询cmc设备名称集合
34
+     *
35
+     * @return cmc设备名称集合
36
+     */
37
+    public List<Map<String,Object>> selectCmcDeviceNameList();
38
+
30 39
     /**
31 40
      * 新增cmc设备信息
32 41
      * 

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

@@ -1,6 +1,8 @@
1 1
 package com.ruoyi.oa.service;
2 2
 
3 3
 import java.util.List;
4
+import java.util.Map;
5
+
4 6
 import com.ruoyi.oa.domain.CmcDevice;
5 7
 
6 8
 /**
@@ -27,6 +29,13 @@ public interface ICmcDeviceService
27 29
      */
28 30
     public List<CmcDevice> selectCmcDeviceList(CmcDevice cmcDevice);
29 31
 
32
+    /**
33
+     * 查询cmc设备名称集合
34
+     *
35
+     * @return cmc设备名称集合
36
+     */
37
+    public List<Map<String,Object>> selectCmcDeviceNameList();
38
+
30 39
     /**
31 40
      * 新增cmc设备信息
32 41
      * 

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

@@ -1,6 +1,8 @@
1 1
 package com.ruoyi.oa.service.impl;
2 2
 
3 3
 import java.util.List;
4
+import java.util.Map;
5
+
4 6
 import org.springframework.beans.factory.annotation.Autowired;
5 7
 import org.springframework.stereotype.Service;
6 8
 import com.ruoyi.oa.mapper.CmcDeviceMapper;
@@ -43,6 +45,16 @@ public class CmcDeviceServiceImpl implements ICmcDeviceService
43 45
         return cmcDeviceMapper.selectCmcDeviceList(cmcDevice);
44 46
     }
45 47
 
48
+    /**
49
+     * 查询cmc设备名称集合
50
+     *
51
+     * @return cmc设备名称集合
52
+     */
53
+    public List<Map<String,Object>> selectCmcDeviceNameList()
54
+    {
55
+        return cmcDeviceMapper.selectCmcDeviceNameList();
56
+    }
57
+
46 58
     /**
47 59
      * 新增cmc设备信息
48 60
      * 

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarApprovalMapper.xml 查看文件

@@ -23,6 +23,7 @@
23 23
         <result property="deptComment"    column="dept_comment"    />
24 24
         <result property="managerUserId"    column="manager_user_id"    />
25 25
         <result property="managerComment"    column="manager_comment"    />
26
+        <result property="carUsage"    column="car_usage"    />
26 27
         <result property="unionUserId"    column="union_user_id"    />
27 28
         <result property="unionComment"    column="union_comment"    />
28 29
         <result property="gmUserId"    column="gm_user_id"    />
@@ -52,7 +53,7 @@
52 53
     </resultMap>
53 54
 
54 55
     <sql id="selectCmcCarApprovalVo">
55
-        select ca.car_apply_id, ca.applier, u.nick_name, ca.use_dept, d.dept_name, ca.cars, ca.drivers, ca.project_id, p.project_number, p.project_name, ca.apply_reason, ca.passengers, ca.apply_date, ca.begin_date, ca.begin_halfday, ca.end_date, ca.end_halfday, ca.days, ca.dept_user_id, ca.dept_comment, ca.manager_user_id, ca.manager_comment, ca.union_user_id, ca.union_comment, ca.gm_user_id, ca.gm_comment, ca.dispatcher, ca.dispatch_comment, ca.estimate_cost from cmc_car_approval as ca
56
+        select ca.car_apply_id, ca.applier, u.nick_name, ca.use_dept, d.dept_name, ca.cars, ca.drivers, ca.project_id, p.project_number, p.project_name, ca.apply_reason, ca.passengers, ca.apply_date, ca.begin_date, ca.begin_halfday, ca.end_date, ca.end_halfday, ca.days, ca.dept_user_id, ca.dept_comment, ca.manager_user_id, ca.manager_comment, ca.car_usage, ca.union_user_id, ca.union_comment, ca.gm_user_id, ca.gm_comment, ca.dispatcher, ca.dispatch_comment, ca.estimate_cost from cmc_car_approval as ca
56 57
             left join sys_user as u on u.user_id = ca.applier
57 58
             left join sys_dept as d on d.dept_id = ca.use_dept
58 59
             left join cmc_project as p on ca.project_id = p.project_id
@@ -78,6 +79,7 @@
78 79
             <if test="deptComment != null  and deptComment != ''"> and ca.dept_comment = #{deptComment}</if>
79 80
             <if test="managerUserId != null "> and ca.manager_user_id = #{managerUserId}</if>
80 81
             <if test="managerComment != null  and managerComment != ''"> and ca.manager_comment = #{managerComment}</if>
82
+            <if test="carUsage != null  and carUsage != ''"> and ca.car_usage = #{carUsage}</if>
81 83
             <if test="unionUserId != null "> and ca.union_user_id = #{unionUserId}</if>
82 84
             <if test="unionComment != null  and unionComment != ''"> and ca.union_comment = #{unionComment}</if>
83 85
             <if test="gmUserId != null "> and ca.gm_user_id = #{gmUserId}</if>
@@ -114,6 +116,7 @@
114 116
             <if test="deptComment != null">dept_comment,</if>
115 117
             <if test="managerUserId != null">manager_user_id,</if>
116 118
             <if test="managerComment != null">manager_comment,</if>
119
+            <if test="carUsage != null">car_usage,</if>
117 120
             <if test="unionUserId != null">union_user_id,</if>
118 121
             <if test="unionComment != null">union_comment,</if>
119 122
             <if test="gmUserId != null">gm_user_id,</if>
@@ -141,6 +144,7 @@
141 144
             <if test="deptComment != null">#{deptComment},</if>
142 145
             <if test="managerUserId != null">#{managerUserId},</if>
143 146
             <if test="managerComment != null">#{managerComment},</if>
147
+            <if test="carUsage != null">#{carUsage},</if>
144 148
             <if test="unionUserId != null">#{unionUserId},</if>
145 149
             <if test="unionComment != null">#{unionComment},</if>
146 150
             <if test="gmUserId != null">#{gmUserId},</if>
@@ -171,6 +175,7 @@
171 175
             <if test="deptComment != null">dept_comment = #{deptComment},</if>
172 176
             <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
173 177
             <if test="managerComment != null">manager_comment = #{managerComment},</if>
178
+            <if test="carUsage != null">car_usage = #{carUsage},</if>
174 179
             <if test="unionUserId != null">union_user_id = #{unionUserId},</if>
175 180
             <if test="unionComment != null">union_comment = #{unionComment},</if>
176 181
             <if test="gmUserId != null">gm_user_id = #{gmUserId},</if>

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

@@ -62,6 +62,10 @@
62 62
         where d.device_id = #{deviceId}
63 63
     </select>
64 64
 
65
+    <select id="selectCmcDeviceNameList" resultType="java.util.Map">
66
+        select distinct name from cmc_device
67
+    </select>
68
+
65 69
     <insert id="insertCmcDevice" parameterType="CmcDevice" useGeneratedKeys="true" keyProperty="deviceId">
66 70
         insert into cmc_device
67 71
         <trim prefix="(" suffix=")" suffixOverrides=",">

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


+ 0
- 9
oa-ui/src/api/oa/car/carApproval.js 查看文件

@@ -32,15 +32,6 @@ export function addCarApproval(data) {
32 32
   })
33 33
 }
34 34
 
35
-// 新增cmc用车审批
36
-export function submitCarApproval(data) {
37
-  return request({
38
-    url: '/oa/carApproval/submit',
39
-    method: 'post',
40
-    data: data
41
-  })
42
-}
43
-
44 35
 // 修改cmc用车审批
45 36
 export function updateCarApproval(data) {
46 37
   return request({

+ 14
- 0
oa-ui/src/api/oa/device/device.js 查看文件

@@ -1,3 +1,9 @@
1
+/*
2
+ * @Author: wrh
3
+ * @Date: 2024-03-05 17:18:12
4
+ * @LastEditors: wrh
5
+ * @LastEditTime: 2024-04-09 16:41:10
6
+ */
1 7
 import request from '@/utils/request'
2 8
 
3 9
 // 查询cmc设备信息列表
@@ -9,6 +15,14 @@ export function listDevice(query) {
9 15
   })
10 16
 }
11 17
 
18
+// 查询cmc设备名称列表
19
+export function listDeviceName() {
20
+  return request({
21
+    url: '/oa/device/nameList',
22
+    method: 'get'
23
+  })
24
+}
25
+
12 26
 // 查询cmc设备信息详细
13 27
 export function getDevice(deviceId) {
14 28
   return request({

+ 37
- 22
oa-ui/src/views/flowable/form/carForm.vue 查看文件

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-02-29 11:44:28
4 4
  * @LastEditors: wrh
5
- * @LastEditTime: 2024-04-09 14:17:41
5
+ * @LastEditTime: 2024-04-10 10:16:05
6 6
 -->
7 7
 
8 8
 <template>
@@ -34,11 +34,15 @@
34 34
                     </el-date-picker>
35 35
                   </el-form-item>
36 36
                 </el-col>
37
+                <el-col :span="6" :xs="24">
38
+                  <el-form-item label="申请用途:" prop="carUsage">
39
+                    <el-radio-group v-model="form.carUsage" @change="useChange" size="small">
40
+                      <el-radio-button label="1">工会用车</el-radio-button>
41
+                      <el-radio-button label="0">非工会用车</el-radio-button>
42
+                    </el-radio-group>
43
+                  </el-form-item>
44
+                </el-col>
37 45
               </el-row>
38
-              <el-radio-group v-model="isUnion" v-if="taskName == '用车申请'">
39
-                <el-radio-button label="工会用车"></el-radio-button>
40
-                <el-radio-button label="非工会用车"></el-radio-button>
41
-              </el-radio-group>
42 46
               <el-form-item label="项目编号:" prop="projectId">
43 47
                 <el-select v-model="form.projectId" filterable placeholder="请选择" @change="handleSelectProject"
44 48
                   :disabled="taskName != '用车申请'" clearable>
@@ -61,15 +65,17 @@
61 65
                   }}</el-descriptions-item>
62 66
                 </el-descriptions>
63 67
               </el-form-item>
64
-              <el-form-item label="乘车人数:" prop="passengers">
65
-                <el-input-number v-model="form.passengers" :min="1" :disabled="taskName != '用车申请'"></el-input-number>
66
-              </el-form-item>
67 68
               <el-form-item label="用车事由:" prop="applyReason">
68 69
                 <el-input type="textarea" :rows="2" placeholder="请输入用车事由" v-model="form.applyReason"
69 70
                   :disabled="taskName != '用车申请'">
70 71
                 </el-input>
71 72
               </el-form-item>
72 73
               <el-row>
74
+                <el-col :span="6" :xs="24">
75
+                  <el-form-item label="乘车人数:" prop="passengers">
76
+                    <el-input-number v-model="form.passengers" :min="1" :disabled="taskName != '用车申请'"></el-input-number>
77
+                  </el-form-item>
78
+                </el-col>
73 79
                 <el-col :span="6" :xs="24">
74 80
                   <el-form-item label="开始日期:" prop="beginDate">
75 81
                     <el-date-picker style="width:140px;" v-model="form.beginDate" value-format="yyyy-MM-dd" type="date"
@@ -84,7 +90,7 @@
84 90
                     </el-date-picker>
85 91
                   </el-form-item>
86 92
                 </el-col>
87
-                <el-col :span="8" :xs="24">
93
+                <el-col :span="6" :xs="24">
88 94
                   <el-form-item label="共计:">
89 95
                     {{ form.days + '天' }}
90 96
                   </el-form-item>
@@ -92,25 +98,25 @@
92 98
               </el-row>
93 99
               <el-divider></el-divider>
94 100
               <!-- 部门审核意见 -->
95
-              <el-form-item label="部门审核意见:" prop="deptComment" label-width="120px" v-if="form.dept.deptId > 102">
101
+              <el-form-item label="部门审核意见:" prop="deptComment" label-width="120px" v-if="dept > 102">
96 102
                 <el-input type="textarea" :rows="2" placeholder="请输入部门审核意见" v-model="form.deptComment"
97 103
                   :disabled="taskName != '部门审核'">
98 104
                 </el-input>
99 105
               </el-form-item>
100 106
               <!-- 分管审核意见 -->
101
-              <el-form-item label="分管审核意见:" prop="managerComment" label-width="120px" v-if="form.dept.deptId > 102">
107
+              <el-form-item label="分管审核意见:" prop="managerComment" label-width="120px" v-if="dept > 102">
102 108
                 <el-input type="textarea" :rows="2" placeholder="请输入分管审核意见" v-model="form.managerComment"
103 109
                   :disabled="taskName != '分管审核'">
104 110
                 </el-input>
105 111
               </el-form-item>
106 112
               <!-- 工会审核意见 -->
107
-              <el-form-item label="工会审核意见:" prop="unionComment" label-width="120px" v-if="form.dept.deptId == 0">
113
+              <el-form-item label="工会审核意见:" prop="unionComment" label-width="120px" v-if="dept == 101">
108 114
                 <el-input type="textarea" :rows="2" placeholder="请输入工会审核意见" v-model="form.unionComment"
109 115
                   :disabled="taskName != '工会审核'">
110 116
                 </el-input>
111 117
               </el-form-item>
112 118
               <!-- 总经理审核意见 -->
113
-              <el-form-item label="总经理审核意见" prop="gmComment" label-width="120px" v-if="form.dept.deptId == 102">
119
+              <el-form-item label="总经理审核意见" prop="gmComment" label-width="120px" v-if="dept == 102">
114 120
                 <el-input type="textarea" :rows="2" placeholder="请输入总经理审核意见" v-model="form.gmComment"
115 121
                   :disabled="taskName != '总经理审核'">
116 122
                 </el-input>
@@ -163,7 +169,7 @@
163 169
 <script>
164 170
 import { listProject, getProject } from "@/api/oa/project/project";
165 171
 import { listCar, getCar } from "@/api/oa/car/car";
166
-import { listCarApproval, getCarApproval, updateCarApproval, submitCarApproval, modifyCarApproval } from '@/api/oa/car/carApproval'
172
+import { listCarApproval, getCarApproval, updateCarApproval, addCarApproval, modifyCarApproval } from '@/api/oa/car/carApproval'
167 173
 import { listDriver } from "@/api/system/post";
168 174
 import {
169 175
   complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm,
@@ -187,8 +193,8 @@ export default {
187 193
   },
188 194
   created() {
189 195
     this.form.user.nickName = this.$store.getters.name;
190
-    this.form.dept.deptId = this.$store.getters.deptId;
191
-    console.log(this.form.dept.deptId)
196
+    this.dept = this.$store.getters.deptId;
197
+    console.log(this.dept)
192 198
     this.form.dept.deptName = this.$store.getters.deptName;
193 199
     this.getProjectList();
194 200
     this.getCarList();
@@ -200,6 +206,7 @@ export default {
200 206
   data() {
201 207
     return {
202 208
       form: {
209
+        carUsage: '0',
203 210
         days: '',
204 211
         drivers: [],
205 212
         user: {
@@ -235,9 +242,9 @@ export default {
235 242
       driverList: [],
236 243
       chooseProject: {},
237 244
       isSelect: false,
238
-      isUnion: '非工会用车',
239 245
       formTotal: 0,
240
-      flowData: {}
246
+      flowData: {},
247
+      dept: 0,
241 248
     }
242 249
   },
243 250
   mounted() {
@@ -251,7 +258,7 @@ export default {
251 258
           this.formTotal = 0;
252 259
           this.form.user.nickName = this.$store.getters.name;
253 260
           this.form.applier = this.$store.getters.userId;
254
-          this.form.dept.deptId = this.$store.getters.deptId;
261
+          this.dept = this.$store.getters.deptId;
255 262
           this.form.dept.deptName = this.$store.getters.deptName;
256 263
           this.form.applyDate = new Date();
257 264
         }
@@ -289,7 +296,7 @@ export default {
289 296
     submit() {
290 297
       this.$refs['carForm'].validate((valid) => {
291 298
         if (valid) {
292
-          this.form.formId = this.taskForm.formId;
299
+          this.form.carApplyId = this.taskForm.formId;
293 300
           let formData = new FormData();
294 301
           let jsonForm = JSON.stringify(this.form);
295 302
           formData.append("form", jsonForm);
@@ -297,7 +304,9 @@ export default {
297 304
           if (this.formTotal != 0) {
298 305
             modifyCarApproval(formData);
299 306
           } else {
300
-            submitCarApproval(formData);
307
+            this.form.cars = '';
308
+            this.form.drivers = '';
309
+            addCarApproval(this.form);
301 310
           }
302 311
           // 获取下一个流程节点
303 312
           getNextFlowNode(params).then(res => {
@@ -328,7 +337,7 @@ export default {
328 337
       if (this.taskName == '用车申请') {
329 338
         getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
330 339
           let userId = res.data.userId;
331
-          if (this.isUnion == '非工会用车')
340
+          if (this.form.carUsage == '0')
332 341
             this.$set(this.taskForm.variables, "dept", this.form.dept.deptId);
333 342
           else
334 343
             this.$set(this.taskForm.variables, "dept", 0);
@@ -425,6 +434,12 @@ export default {
425 434
         }
426 435
       }
427 436
       return true;
437
+    },
438
+    useChange(val) {
439
+      if (val == '1')
440
+        this.dept = 101;
441
+      else
442
+        this.dept = this.$store.getters.deptId;
428 443
     }
429 444
   },
430 445
 }

Loading…
取消
儲存