Przeglądaj źródła

设备名称列表

lamphua 1 rok temu
rodzic
commit
c1f303ea4c

+ 1
- 22
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCarApprovalController.java Wyświetl plik

73
     @PostMapping
73
     @PostMapping
74
     public AjaxResult add(@RequestBody CmcCarApproval cmcCarApproval)
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
         cmcCarApproval.setApplier(getLoginUser().getUserId());
76
         cmcCarApproval.setApplier(getLoginUser().getUserId());
90
         cmcCarApproval.setUseDept(getLoginUser().getDeptId());
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 Wyświetl plik

3
 import java.math.BigDecimal;
3
 import java.math.BigDecimal;
4
 import java.text.SimpleDateFormat;
4
 import java.text.SimpleDateFormat;
5
 import java.util.List;
5
 import java.util.List;
6
+import java.util.Map;
6
 import javax.servlet.http.HttpServletResponse;
7
 import javax.servlet.http.HttpServletResponse;
7
 
8
 
8
 import com.ruoyi.common.utils.DateUtils;
9
 import com.ruoyi.common.utils.DateUtils;
48
         return getDataTable(list);
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
      * 导出cmc设备信息列表
63
      * 导出cmc设备信息列表
53
      */
64
      */

+ 2
- 2
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcPriceController.java Wyświetl plik

126
      * 根据比例等级查询出单位、一般地类、复杂地类
126
      * 根据比例等级查询出单位、一般地类、复杂地类
127
      */
127
      */
128
     @GetMapping( "/price")
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
         List<CmcPrice> cmcPriceList = cmcPriceService.selectCmcPriceByScaleGrade(workItem, subItem, scaleGrade);
131
         List<CmcPrice> cmcPriceList = cmcPriceService.selectCmcPriceByScaleGrade(workItem, subItem, scaleGrade);
132
         JSONObject price = new JSONObject();
132
         JSONObject price = new JSONObject();
133
         price.put("id", cmcPriceList.get(0).getId());
133
         price.put("id", cmcPriceList.get(0).getId());
134
         price.put("unit", cmcPriceList.get(0).getUnit());
134
         price.put("unit", cmcPriceList.get(0).getUnit());
135
-        if (priceType.equals("一般地类"))
135
+        if (groundType.equals("0"))
136
             price.put("price", cmcPriceList.get(0).getCommonPrice());
136
             price.put("price", cmcPriceList.get(0).getCommonPrice());
137
         else
137
         else
138
             price.put("price", cmcPriceList.get(0).getComplexPrice());
138
             price.put("price", cmcPriceList.get(0).getComplexPrice());

+ 13
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcCarApproval.java Wyświetl plik

95
     @Excel(name = "分管审批意见")
95
     @Excel(name = "分管审批意见")
96
     private String managerComment;
96
     private String managerComment;
97
 
97
 
98
+    /** 申请用途 */
99
+    @Excel(name = "申请用途")
100
+    private String carUsage;
101
+
98
     /** 工会审批人 */
102
     /** 工会审批人 */
99
     @Excel(name = "工会审批人")
103
     @Excel(name = "工会审批人")
100
     private Long unionUserId;
104
     private Long unionUserId;
308
     {
312
     {
309
         return managerComment;
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
     public void setUnionUserId(Long unionUserId)
324
     public void setUnionUserId(Long unionUserId)
312
     {
325
     {
313
         this.unionUserId = unionUserId;
326
         this.unionUserId = unionUserId;

+ 9
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcDeviceMapper.java Wyświetl plik

1
 package com.ruoyi.oa.mapper;
1
 package com.ruoyi.oa.mapper;
2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
+import java.util.Map;
5
+
4
 import com.ruoyi.oa.domain.CmcDevice;
6
 import com.ruoyi.oa.domain.CmcDevice;
5
 
7
 
6
 /**
8
 /**
27
      */
29
      */
28
     public List<CmcDevice> selectCmcDeviceList(CmcDevice cmcDevice);
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
      * 新增cmc设备信息
40
      * 新增cmc设备信息
32
      * 
41
      * 

+ 9
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcDeviceService.java Wyświetl plik

1
 package com.ruoyi.oa.service;
1
 package com.ruoyi.oa.service;
2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
+import java.util.Map;
5
+
4
 import com.ruoyi.oa.domain.CmcDevice;
6
 import com.ruoyi.oa.domain.CmcDevice;
5
 
7
 
6
 /**
8
 /**
27
      */
29
      */
28
     public List<CmcDevice> selectCmcDeviceList(CmcDevice cmcDevice);
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
      * 新增cmc设备信息
40
      * 新增cmc设备信息
32
      * 
41
      * 

+ 12
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcDeviceServiceImpl.java Wyświetl plik

1
 package com.ruoyi.oa.service.impl;
1
 package com.ruoyi.oa.service.impl;
2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
+import java.util.Map;
5
+
4
 import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.stereotype.Service;
7
 import org.springframework.stereotype.Service;
6
 import com.ruoyi.oa.mapper.CmcDeviceMapper;
8
 import com.ruoyi.oa.mapper.CmcDeviceMapper;
43
         return cmcDeviceMapper.selectCmcDeviceList(cmcDevice);
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
      * 新增cmc设备信息
59
      * 新增cmc设备信息
48
      * 
60
      * 

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarApprovalMapper.xml Wyświetl plik

23
         <result property="deptComment"    column="dept_comment"    />
23
         <result property="deptComment"    column="dept_comment"    />
24
         <result property="managerUserId"    column="manager_user_id"    />
24
         <result property="managerUserId"    column="manager_user_id"    />
25
         <result property="managerComment"    column="manager_comment"    />
25
         <result property="managerComment"    column="manager_comment"    />
26
+        <result property="carUsage"    column="car_usage"    />
26
         <result property="unionUserId"    column="union_user_id"    />
27
         <result property="unionUserId"    column="union_user_id"    />
27
         <result property="unionComment"    column="union_comment"    />
28
         <result property="unionComment"    column="union_comment"    />
28
         <result property="gmUserId"    column="gm_user_id"    />
29
         <result property="gmUserId"    column="gm_user_id"    />
52
     </resultMap>
53
     </resultMap>
53
 
54
 
54
     <sql id="selectCmcCarApprovalVo">
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
             left join sys_user as u on u.user_id = ca.applier
57
             left join sys_user as u on u.user_id = ca.applier
57
             left join sys_dept as d on d.dept_id = ca.use_dept
58
             left join sys_dept as d on d.dept_id = ca.use_dept
58
             left join cmc_project as p on ca.project_id = p.project_id
59
             left join cmc_project as p on ca.project_id = p.project_id
78
             <if test="deptComment != null  and deptComment != ''"> and ca.dept_comment = #{deptComment}</if>
79
             <if test="deptComment != null  and deptComment != ''"> and ca.dept_comment = #{deptComment}</if>
79
             <if test="managerUserId != null "> and ca.manager_user_id = #{managerUserId}</if>
80
             <if test="managerUserId != null "> and ca.manager_user_id = #{managerUserId}</if>
80
             <if test="managerComment != null  and managerComment != ''"> and ca.manager_comment = #{managerComment}</if>
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
             <if test="unionUserId != null "> and ca.union_user_id = #{unionUserId}</if>
83
             <if test="unionUserId != null "> and ca.union_user_id = #{unionUserId}</if>
82
             <if test="unionComment != null  and unionComment != ''"> and ca.union_comment = #{unionComment}</if>
84
             <if test="unionComment != null  and unionComment != ''"> and ca.union_comment = #{unionComment}</if>
83
             <if test="gmUserId != null "> and ca.gm_user_id = #{gmUserId}</if>
85
             <if test="gmUserId != null "> and ca.gm_user_id = #{gmUserId}</if>
114
             <if test="deptComment != null">dept_comment,</if>
116
             <if test="deptComment != null">dept_comment,</if>
115
             <if test="managerUserId != null">manager_user_id,</if>
117
             <if test="managerUserId != null">manager_user_id,</if>
116
             <if test="managerComment != null">manager_comment,</if>
118
             <if test="managerComment != null">manager_comment,</if>
119
+            <if test="carUsage != null">car_usage,</if>
117
             <if test="unionUserId != null">union_user_id,</if>
120
             <if test="unionUserId != null">union_user_id,</if>
118
             <if test="unionComment != null">union_comment,</if>
121
             <if test="unionComment != null">union_comment,</if>
119
             <if test="gmUserId != null">gm_user_id,</if>
122
             <if test="gmUserId != null">gm_user_id,</if>
141
             <if test="deptComment != null">#{deptComment},</if>
144
             <if test="deptComment != null">#{deptComment},</if>
142
             <if test="managerUserId != null">#{managerUserId},</if>
145
             <if test="managerUserId != null">#{managerUserId},</if>
143
             <if test="managerComment != null">#{managerComment},</if>
146
             <if test="managerComment != null">#{managerComment},</if>
147
+            <if test="carUsage != null">#{carUsage},</if>
144
             <if test="unionUserId != null">#{unionUserId},</if>
148
             <if test="unionUserId != null">#{unionUserId},</if>
145
             <if test="unionComment != null">#{unionComment},</if>
149
             <if test="unionComment != null">#{unionComment},</if>
146
             <if test="gmUserId != null">#{gmUserId},</if>
150
             <if test="gmUserId != null">#{gmUserId},</if>
171
             <if test="deptComment != null">dept_comment = #{deptComment},</if>
175
             <if test="deptComment != null">dept_comment = #{deptComment},</if>
172
             <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
176
             <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
173
             <if test="managerComment != null">manager_comment = #{managerComment},</if>
177
             <if test="managerComment != null">manager_comment = #{managerComment},</if>
178
+            <if test="carUsage != null">car_usage = #{carUsage},</if>
174
             <if test="unionUserId != null">union_user_id = #{unionUserId},</if>
179
             <if test="unionUserId != null">union_user_id = #{unionUserId},</if>
175
             <if test="unionComment != null">union_comment = #{unionComment},</if>
180
             <if test="unionComment != null">union_comment = #{unionComment},</if>
176
             <if test="gmUserId != null">gm_user_id = #{gmUserId},</if>
181
             <if test="gmUserId != null">gm_user_id = #{gmUserId},</if>

+ 4
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceMapper.xml Wyświetl plik

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

+ 9
- 6
oa-back/sql/sql.sql
Plik diff jest za duży
Wyświetl plik


+ 0
- 9
oa-ui/src/api/oa/car/carApproval.js Wyświetl plik

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
 // 修改cmc用车审批
35
 // 修改cmc用车审批
45
 export function updateCarApproval(data) {
36
 export function updateCarApproval(data) {
46
   return request({
37
   return request({

+ 14
- 0
oa-ui/src/api/oa/device/device.js Wyświetl plik

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
 import request from '@/utils/request'
7
 import request from '@/utils/request'
2
 
8
 
3
 // 查询cmc设备信息列表
9
 // 查询cmc设备信息列表
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
 // 查询cmc设备信息详细
26
 // 查询cmc设备信息详细
13
 export function getDevice(deviceId) {
27
 export function getDevice(deviceId) {
14
   return request({
28
   return request({

+ 37
- 22
oa-ui/src/views/flowable/form/carForm.vue Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz