浏览代码

设备报废、费用上传附件

lamphua 1年前
父节点
当前提交
fd9d6aef53

+ 12
- 12
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java 查看文件

305
             runtimeService.createChangeActivityStateBuilder()
305
             runtimeService.createChangeActivityStateBuilder()
306
                     .processInstanceId(task.getProcessInstanceId())
306
                     .processInstanceId(task.getProcessInstanceId())
307
                     .moveActivityIdsToSingleActivityId(currentIds, flowTaskVo.getTargetKey()).changeState();
307
                     .moveActivityIdsToSingleActivityId(currentIds, flowTaskVo.getTargetKey()).changeState();
308
-            String currentTaskId = taskService.createTaskQuery().singleResult().getId();
309
-            List<HistoricTaskInstance> htiList = historyService.createHistoricTaskInstanceQuery()
310
-                    .processInstanceId(task.getProcessInstanceId()).taskDefinitionKey(flowTaskVo.getTargetKey())
311
-                    .list();
312
-            String taskAssignee = "";
313
-            for (HistoricTaskInstance hti: htiList) {
314
-                if (!hti.getId().equals(currentTaskId)) {
315
-                    taskAssignee = hti.getAssignee();
316
-                    break;
317
-                }
318
-            }
319
-            taskService.setAssignee(currentTaskId, taskAssignee);
308
+//            String currentTaskId = taskService.createTaskQuery().singleResult().getId();
309
+//            List<HistoricTaskInstance> htiList = historyService.createHistoricTaskInstanceQuery()
310
+//                    .processInstanceId(task.getProcessInstanceId()).taskDefinitionKey(flowTaskVo.getTargetKey())
311
+//                    .list();
312
+//            String taskAssignee = "";
313
+//            for (HistoricTaskInstance hti: htiList) {
314
+//                if (!hti.getId().equals(currentTaskId)) {
315
+//                    taskAssignee = hti.getAssignee();
316
+//                    break;
317
+//                }
318
+//            }
319
+//            taskService.setAssignee(currentTaskId, taskAssignee);
320
         } catch (FlowableObjectNotFoundException e) {
320
         } catch (FlowableObjectNotFoundException e) {
321
             throw new CustomException("未找到流程实例,流程可能已发生变化");
321
             throw new CustomException("未找到流程实例,流程可能已发生变化");
322
         } catch (FlowableException e) {
322
         } catch (FlowableException e) {

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

40
     @Excel(name = "发生日期", width = 30, dateFormat = "yyyy-MM-dd")
40
     @Excel(name = "发生日期", width = 30, dateFormat = "yyyy-MM-dd")
41
     private Date occurDate;
41
     private Date occurDate;
42
 
42
 
43
+    /** 附件 */
44
+    @Excel(name = "附件")
45
+    private String document;
46
+
43
     public void setCarExpenseId(String carExpenseId) 
47
     public void setCarExpenseId(String carExpenseId) 
44
     {
48
     {
45
         this.carExpenseId = carExpenseId;
49
         this.carExpenseId = carExpenseId;
58
     {
62
     {
59
         return carId;
63
         return carId;
60
     }
64
     }
65
+    public void setCar(CmcCar car)
66
+    {
67
+        this.car = car;
68
+        this.licensePlate = car.getLicensePlate();
69
+    }
70
+
71
+    public CmcCar getCar()
72
+    {
73
+        return car;
74
+    }
61
     public void setExpenseType(String expenseType) 
75
     public void setExpenseType(String expenseType) 
62
     {
76
     {
63
         this.expenseType = expenseType;
77
         this.expenseType = expenseType;
85
     {
99
     {
86
         return occurDate;
100
         return occurDate;
87
     }
101
     }
102
+    public void setDocument(String document)
103
+    {
104
+        this.document = document;
105
+    }
106
+
107
+    public String getDocument()
108
+    {
109
+        return document;
110
+    }
88
 
111
 
89
     @Override
112
     @Override
90
     public String toString() {
113
     public String toString() {

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

149
     @Excel(name = "项目参与人员")
149
     @Excel(name = "项目参与人员")
150
     private String participates;
150
     private String participates;
151
 
151
 
152
+    /** 项目任务书 */
153
+    @Excel(name = "项目任务书")
154
+    private String taskDocument;
155
+
152
     public void setProjectId(String projectId)
156
     public void setProjectId(String projectId)
153
     {
157
     {
154
         this.projectId = projectId;
158
         this.projectId = projectId;
275
     {
279
     {
276
         return organizeDocument;
280
         return organizeDocument;
277
     }
281
     }
282
+    public void setTaskDocument(String taskDocument)
283
+    {
284
+        this.taskDocument = taskDocument;
285
+    }
286
+
287
+    public String getTaskDocument()
288
+    {
289
+        return taskDocument;
290
+    }
278
     public void setUndertakingDeptName(String undertakingDeptName)
291
     public void setUndertakingDeptName(String undertakingDeptName)
279
     {
292
     {
280
         this.undertakingDeptName = undertakingDeptName;
293
         this.undertakingDeptName = undertakingDeptName;
419
     {
432
     {
420
         return kmlLat;
433
         return kmlLat;
421
     }
434
     }
435
+    public void setCars(String cars)
436
+    {
437
+        this.cars = cars;
438
+    }
422
 
439
 
423
     public String getCars()
440
     public String getCars()
424
     {
441
     {

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

132
     @Excel(name = "总经理审核意见")
132
     @Excel(name = "总经理审核意见")
133
     private String gmComment;
133
     private String gmComment;
134
 
134
 
135
+    /** 原始结算表 */
136
+    @Excel(name = "原始结算表")
137
+    private String settleDocument;
138
+
139
+    /** 修改结算表 */
140
+    @Excel(name = "修改结算表")
141
+    private String modifyDocument;
142
+
143
+    /** 最终算表 */
144
+    @Excel(name = "最终算表")
145
+    private String finalDocument;
146
+
135
     public void setSettleId(String settleId) 
147
     public void setSettleId(String settleId) 
136
     {
148
     {
137
         this.settleId = settleId;
149
         this.settleId = settleId;
375
     {
387
     {
376
         return gmComment;
388
         return gmComment;
377
     }
389
     }
390
+    public void setSettleDocument(String settleDocument)
391
+    {
392
+        this.settleDocument = settleDocument;
393
+    }
394
+
395
+    public String getSettleDocument()
396
+    {
397
+        return settleDocument;
398
+    }
399
+    public void setModifyDocument(String modifyDocument)
400
+    {
401
+        this.modifyDocument = modifyDocument;
402
+    }
403
+
404
+    public String getModifyDocument()
405
+    {
406
+        return modifyDocument;
407
+    }
408
+    public void setFinalDocument(String finalDocument)
409
+    {
410
+        this.finalDocument = finalDocument;
411
+    }
412
+
413
+    public String getFinalDocument()
414
+    {
415
+        return finalDocument;
416
+    }
378
 
417
 
379
     @Override
418
     @Override
380
     public String toString() {
419
     public String toString() {

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

11
         <result property="expense"    column="expense"    />
11
         <result property="expense"    column="expense"    />
12
         <result property="occurDate"    column="occur_date"    />
12
         <result property="occurDate"    column="occur_date"    />
13
         <result property="remark"    column="remark"    />
13
         <result property="remark"    column="remark"    />
14
+        <result property="document"    column="document"    />
15
+        <association property="car"    javaType="CmcCar"         resultMap="CmcCarResult" />
16
+    </resultMap>
17
+
18
+    <resultMap type="CmcCar" id="CmcCarResult">
19
+        <result property="carId"    column="car_id"    />
20
+        <result property="licensePlate"    column="license_plate"    />
14
     </resultMap>
21
     </resultMap>
15
 
22
 
16
     <sql id="selectCmcCarExpenseVo">
23
     <sql id="selectCmcCarExpenseVo">
17
-        select car_expense_id, car_id, expense_type, expense, occur_date, remark from cmc_car_expense
24
+        select ce.car_expense_id, ce.car_id, c.license_plate, ce.expense_type, ce.expense, ce.occur_date, ce.remark, ce.document from cmc_car_expense as ce
25
+        left join cmc_car as c on c.car_id = ce.car_id
18
     </sql>
26
     </sql>
19
 
27
 
20
     <select id="selectCmcCarExpenseList" parameterType="CmcCarExpense" resultMap="CmcCarExpenseResult">
28
     <select id="selectCmcCarExpenseList" parameterType="CmcCarExpense" resultMap="CmcCarExpenseResult">
21
         <include refid="selectCmcCarExpenseVo"/>
29
         <include refid="selectCmcCarExpenseVo"/>
22
         <where>  
30
         <where>  
23
-            <if test="carId != null "> and car_id = #{carId}</if>
24
-            <if test="expenseType != null  and expenseType != ''"> and expense_type = #{expenseType}</if>
25
-            <if test="expense != null "> and expense = #{expense}</if>
26
-            <if test="occurDate != null "> and occur_date = #{occurDate}</if>
31
+            <if test="carId != null "> and ce.car_id = #{carId}</if>
32
+            <if test="expenseType != null  and expenseType != ''"> and ce.expense_type = #{expenseType}</if>
33
+            <if test="expense != null "> and ce.expense = #{expense}</if>
34
+            <if test="occurDate != null "> and ce.occur_date = #{occurDate}</if>
27
         </where>
35
         </where>
28
     </select>
36
     </select>
29
     
37
     
30
     <select id="selectCmcCarExpenseByCarExpenseId" parameterType="String" resultMap="CmcCarExpenseResult">
38
     <select id="selectCmcCarExpenseByCarExpenseId" parameterType="String" resultMap="CmcCarExpenseResult">
31
         <include refid="selectCmcCarExpenseVo"/>
39
         <include refid="selectCmcCarExpenseVo"/>
32
-        where car_expense_id = #{carExpenseId}
40
+        where ce.car_expense_id = #{carExpenseId}
33
     </select>
41
     </select>
34
         
42
         
35
     <insert id="insertCmcCarExpense" parameterType="CmcCarExpense">
43
     <insert id="insertCmcCarExpense" parameterType="CmcCarExpense">
41
             <if test="expense != null">expense,</if>
49
             <if test="expense != null">expense,</if>
42
             <if test="occurDate != null">occur_date,</if>
50
             <if test="occurDate != null">occur_date,</if>
43
             <if test="remark != null">remark,</if>
51
             <if test="remark != null">remark,</if>
52
+            <if test="document != null">document,</if>
44
          </trim>
53
          </trim>
45
         <trim prefix="values (" suffix=")" suffixOverrides=",">
54
         <trim prefix="values (" suffix=")" suffixOverrides=",">
46
             <if test="carExpenseId != null">#{carExpenseId},</if>
55
             <if test="carExpenseId != null">#{carExpenseId},</if>
49
             <if test="expense != null">#{expense},</if>
58
             <if test="expense != null">#{expense},</if>
50
             <if test="occurDate != null">#{occurDate},</if>
59
             <if test="occurDate != null">#{occurDate},</if>
51
             <if test="remark != null">#{remark},</if>
60
             <if test="remark != null">#{remark},</if>
61
+            <if test="document != null">#{document},</if>
52
          </trim>
62
          </trim>
53
     </insert>
63
     </insert>
54
 
64
 
60
             <if test="expense != null">expense = #{expense},</if>
70
             <if test="expense != null">expense = #{expense},</if>
61
             <if test="occurDate != null">occur_date = #{occurDate},</if>
71
             <if test="occurDate != null">occur_date = #{occurDate},</if>
62
             <if test="remark != null">remark = #{remark},</if>
72
             <if test="remark != null">remark = #{remark},</if>
73
+            <if test="document != null">document = #{document},</if>
63
         </trim>
74
         </trim>
64
         where car_expense_id = #{carExpenseId}
75
         where car_expense_id = #{carExpenseId}
65
     </update>
76
     </update>

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

35
         <result property="drivers"    column="drivers"    />
35
         <result property="drivers"    column="drivers"    />
36
         <result property="devices"    column="devices"    />
36
         <result property="devices"    column="devices"    />
37
         <result property="participates"    column="participates"    />
37
         <result property="participates"    column="participates"    />
38
+        <result property="taskDocument"    column="task_document"    />
38
         <association property="projectLeaderUser"    javaType="SysUser"         resultMap="ProjectLeaderResult" />
39
         <association property="projectLeaderUser"    javaType="SysUser"         resultMap="ProjectLeaderResult" />
39
         <association property="projectRegistrantUser"    javaType="SysUser"         resultMap="ProjectRegistrantResult" />
40
         <association property="projectRegistrantUser"    javaType="SysUser"         resultMap="ProjectRegistrantResult" />
40
         <association property="technicalDirectorUser"    javaType="SysUser"         resultMap="TechnicalDirectorResult" />
41
         <association property="technicalDirectorUser"    javaType="SysUser"         resultMap="TechnicalDirectorResult" />
65
         select p.project_id, p.project_number, p.project_name, p.project_leader, u.nick_name as leader_nick_name, p.is_finished, p.project_source, p.party_a, p.contact_person, p.telephone,
66
         select p.project_id, p.project_number, p.project_name, p.project_leader, u.nick_name as leader_nick_name, p.is_finished, p.project_source, p.party_a, p.contact_person, p.telephone,
66
                p.project_type, p.project_level, p.project_registrant, u1.nick_name as registrant_nick_name, p.undertaking_dept, p.project_planner, p.site_leader, p.organize_document, p.organize_time,
67
                p.project_type, p.project_level, p.project_registrant, u1.nick_name as registrant_nick_name, p.undertaking_dept, p.project_planner, p.site_leader, p.organize_document, p.organize_time,
67
                p.register_time, p.plan_time, p.entry_time, p.exit_time, p.remark, c.technical_director, u2.nick_name as director_nick_name, c.quality_inspector, u3.nick_name as inspector_nick_name,
68
                p.register_time, p.plan_time, p.entry_time, p.exit_time, p.remark, c.technical_director, u2.nick_name as director_nick_name, c.quality_inspector, u3.nick_name as inspector_nick_name,
68
-               u3.user_id as inspector_user_id, p.project_kml, p.project_cp, p.kml_lng, p.kml_lat, p.cars, p.drivers, p.devices, p.participates from cmc_project as p
69
+               u3.user_id as inspector_user_id, p.project_kml, p.project_cp, p.kml_lng, p.kml_lat, p.cars, p.drivers, p.devices, p.participates, p.task_document from cmc_project as p
69
         left join sys_user as u on u.user_id = p.project_leader
70
         left join sys_user as u on u.user_id = p.project_leader
70
         left join sys_user as u1 on u1.user_id = p.project_registrant
71
         left join sys_user as u1 on u1.user_id = p.project_registrant
71
         left join cmc_technical as c on c.project_id = p.project_id
72
         left join cmc_technical as c on c.project_id = p.project_id
139
             <if test="drivers != null">drivers,</if>
140
             <if test="drivers != null">drivers,</if>
140
             <if test="devices != null">devices,</if>
141
             <if test="devices != null">devices,</if>
141
             <if test="participates != null">participates,</if>
142
             <if test="participates != null">participates,</if>
143
+            <if test="taskDocument != null">task_document,</if>
142
         </trim>
144
         </trim>
143
         <trim prefix="values (" suffix=")" suffixOverrides=",">
145
         <trim prefix="values (" suffix=")" suffixOverrides=",">
144
             <if test="projectId != null">#{projectId},</if>
146
             <if test="projectId != null">#{projectId},</if>
171
             <if test="drivers != null">#{drivers},</if>
173
             <if test="drivers != null">#{drivers},</if>
172
             <if test="devices != null">#{devices},</if>
174
             <if test="devices != null">#{devices},</if>
173
             <if test="participates != null">#{participates},</if>
175
             <if test="participates != null">#{participates},</if>
176
+            <if test="taskDocument != null">#{taskDocument},</if>
174
         </trim>
177
         </trim>
175
     </insert>
178
     </insert>
176
 
179
 
206
             <if test="drivers != null">drivers = #{drivers},</if>
209
             <if test="drivers != null">drivers = #{drivers},</if>
207
             <if test="devices != null">devices = #{devices},</if>
210
             <if test="devices != null">devices = #{devices},</if>
208
             <if test="participates != null">participates = #{participates},</if>
211
             <if test="participates != null">participates = #{participates},</if>
212
+            <if test="taskDocument != null">task_document = #{taskDocument},</if>
209
         </trim>
213
         </trim>
210
         where project_id = #{projectId}
214
         where project_id = #{projectId}
211
     </update>
215
     </update>

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

32
         <result property="gmUserId"    column="gm_user_id"    />
32
         <result property="gmUserId"    column="gm_user_id"    />
33
         <result property="gmTime"    column="gm_time"    />
33
         <result property="gmTime"    column="gm_time"    />
34
         <result property="gmComment"    column="gm_comment"    />
34
         <result property="gmComment"    column="gm_comment"    />
35
+        <result property="settleDocument"    column="settle_document"    />
36
+        <result property="modifyDocument"    column="modify_document"    />
37
+        <result property="finalDocument"    column="final_document"    />
35
     </resultMap>
38
     </resultMap>
36
 
39
 
37
     <sql id="selectCmcSettleVo">
40
     <sql id="selectCmcSettleVo">
38
-        select settle_id, project_id, workload_report, reporter, report_time, settle_comment, zh_user_id, zh_time, zh_comment, js_user_id, js_time, js_comment, xm_user_id, xm_time, xm_comment, dept_user_id, dept_time, dept_comment, jy_user_id, jy_time, jy_comment, manager_user_id, manager_time, manager_comment, gm_user_id, gm_time, gm_comment from cmc_settle
41
+        select settle_id, project_id, workload_report, reporter, report_time, settle_comment, zh_user_id, zh_time, zh_comment, js_user_id, js_time, js_comment, xm_user_id, xm_time, xm_comment, dept_user_id, dept_time, dept_comment, jy_user_id, jy_time, jy_comment, manager_user_id, manager_time, manager_comment, gm_user_id, gm_time, gm_comment, settle_document, modify_document, final_document from cmc_settle
39
     </sql>
42
     </sql>
40
 
43
 
41
     <select id="selectCmcSettleList" parameterType="CmcSettle" resultMap="CmcSettleResult">
44
     <select id="selectCmcSettleList" parameterType="CmcSettle" resultMap="CmcSettleResult">
106
             <if test="gmUserId != null">gm_user_id,</if>
109
             <if test="gmUserId != null">gm_user_id,</if>
107
             <if test="gmTime != null">gm_time,</if>
110
             <if test="gmTime != null">gm_time,</if>
108
             <if test="gmComment != null">gm_comment,</if>
111
             <if test="gmComment != null">gm_comment,</if>
112
+            <if test="settleDocument != null">settle_document,</if>
113
+            <if test="modifyDocument != null">modify_document,</if>
114
+            <if test="finalDocument != null">final_document,</if>
109
          </trim>
115
          </trim>
110
         <trim prefix="values (" suffix=")" suffixOverrides=",">
116
         <trim prefix="values (" suffix=")" suffixOverrides=",">
111
             <if test="settleId != null">#{settleId},</if>
117
             <if test="settleId != null">#{settleId},</if>
135
             <if test="gmUserId != null">#{gmUserId},</if>
141
             <if test="gmUserId != null">#{gmUserId},</if>
136
             <if test="gmTime != null">#{gmTime},</if>
142
             <if test="gmTime != null">#{gmTime},</if>
137
             <if test="gmComment != null">#{gmComment},</if>
143
             <if test="gmComment != null">#{gmComment},</if>
144
+            <if test="settleDocument != null">#{settleDocument},</if>
145
+            <if test="modifyDocument != null">#{modifyDocument},</if>
146
+            <if test="finalDocument != null">#{finalDocument},</if>
138
          </trim>
147
          </trim>
139
     </insert>
148
     </insert>
140
 
149
 
167
             <if test="gmUserId != null">gm_user_id = #{gmUserId},</if>
176
             <if test="gmUserId != null">gm_user_id = #{gmUserId},</if>
168
             <if test="gmTime != null">gm_time = #{gmTime},</if>
177
             <if test="gmTime != null">gm_time = #{gmTime},</if>
169
             <if test="gmComment != null">gm_comment = #{gmComment},</if>
178
             <if test="gmComment != null">gm_comment = #{gmComment},</if>
179
+            <if test="settleDocument != null">settle_document = #{settleDocument},</if>
180
+            <if test="modifyDocument != null">modify_document = #{modifyDocument},</if>
181
+            <if test="finalDocument != null">final_document = #{finalDocument},</if>
170
         </trim>
182
         </trim>
171
         where settle_id = #{settleId}
183
         where settle_id = #{settleId}
172
     </update>
184
     </update>

+ 3970
- 3961
oa-back/sql/sql.sql
文件差异内容过多而无法显示
查看文件


+ 3
- 0
oa-ui/src/components/FileUpload/index.vue 查看文件

119
       deep: true,
119
       deep: true,
120
       immediate: true,
120
       immediate: true,
121
     },
121
     },
122
+    filePathName(newVal){
123
+      this.additionalData.fileType = newVal
124
+    }
122
   },
125
   },
123
   computed: {
126
   computed: {
124
     // 是否显示提示
127
     // 是否显示提示

+ 88
- 8
oa-ui/src/views/oa/car/detail.vue 查看文件

115
               <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
115
               <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
116
             </el-col>
116
             </el-col>
117
             <el-col :span="1.5">
117
             <el-col :span="1.5">
118
-              <el-button type="info" plain icon="el-icon-s-release" size="mini"@click="handleScrap">{{ scrapButtonName }}</el-button>
118
+              <el-button type="info" plain icon="el-icon-s-release" size="mini" @click="handleScrap">{{ scrapButtonName
119
+              }}</el-button>
119
             </el-col>
120
             </el-col>
120
           </el-row>
121
           </el-row>
121
           <el-table v-loading="loading" :data="expenseList" @selection-change="handleSelectionChange">
122
           <el-table v-loading="loading" :data="expenseList" @selection-change="handleSelectionChange">
137
               </template>
138
               </template>
138
             </el-table-column>
139
             </el-table-column>
139
             <el-table-column width="55" align="center" label="备注" prop="remark" />
140
             <el-table-column width="55" align="center" label="备注" prop="remark" />
141
+            <el-table-column label="附件" align="center" prop="document" />
140
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
142
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
141
               <template slot-scope="scope">
143
               <template slot-scope="scope">
142
                 <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
144
                 <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
198
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
200
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
199
       <el-form ref="expenseForm" :model="form" :rules="rules" label-width="100px">
201
       <el-form ref="expenseForm" :model="form" :rules="rules" label-width="100px">
200
         <el-form-item label="费用类型" prop="expenseType">
202
         <el-form-item label="费用类型" prop="expenseType">
201
-          <el-select v-model="form.expenseType" placeholder="请选择" clearable>
203
+          <el-select v-model="form.expenseType" placeholder="请选择" clearable @change="expenseTypePath">
202
             <el-option label="保险费" value="0"></el-option>
204
             <el-option label="保险费" value="0"></el-option>
203
             <el-option label="维修/保养费" value="1"></el-option>
205
             <el-option label="维修/保养费" value="1"></el-option>
204
             <el-option label="轮胎费" value="2"></el-option>
206
             <el-option label="轮胎费" value="2"></el-option>
214
         <el-form-item label="备注说明" prop="remark">
216
         <el-form-item label="备注说明" prop="remark">
215
           <el-input type="textarea" v-model="form.remark" placeholder="请输入备注说明" style="width:220px" />
217
           <el-input type="textarea" v-model="form.remark" placeholder="请输入备注说明" style="width:220px" />
216
         </el-form-item>
218
         </el-form-item>
219
+        <el-form-item label="附件" prop="document">
220
+          <FileUpload :limit="1" :filePathName="expenseName" :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']"
221
+            @input="getExpensePath"></FileUpload>
222
+          <div v-if="modifyOpen">
223
+            <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear"
224
+              tag="ul">
225
+              <li key="li01" class="el-upload-list__item ele-upload-list__item-content">
226
+                <el-link :href="`${baseUrl}${'/profile/upload' + form.document}`" :underline="false" target="_blank">
227
+                  <span class="el-icon-document" style="color:#0011ff;text-decoration: underline;">
228
+                    {{ getFileName(form.document) }}
229
+                  </span>
230
+                </el-link>
231
+              </li>
232
+            </transition-group>
233
+          </div>
234
+        </el-form-item>
217
       </el-form>
235
       </el-form>
218
       <div slot="footer" class="dialog-footer">
236
       <div slot="footer" class="dialog-footer">
219
         <el-button type="primary" @click="submitForm">确 定</el-button>
237
         <el-button type="primary" @click="submitForm">确 定</el-button>
241
           <el-input v-model="scrapForm.remark" placeholder="请输入备注" />
259
           <el-input v-model="scrapForm.remark" placeholder="请输入备注" />
242
         </el-form-item>
260
         </el-form-item>
243
         <el-form-item label="附件" prop="document">
261
         <el-form-item label="附件" prop="document">
244
-          <el-input v-model="scrapForm.document" placeholder="请输入附件" />
262
+          <FileUpload :limit="1" :filePathName="'车辆/报废'" :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']"
263
+            @input="getScrapPath"></FileUpload>
264
+          <div v-if="scrapModifyOpen">
265
+            <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear"
266
+              tag="ul">
267
+              <li key="li01" class="el-upload-list__item ele-upload-list__item-content">
268
+                <el-link :href="`${baseUrl}${'/profile/upload' + scrapForm.document}`" :underline="false" target="_blank">
269
+                  <span class="el-icon-document" style="color:#0011ff;text-decoration: underline;">
270
+                    {{ getFileName(scrapForm.document) }}
271
+                  </span>
272
+                </el-link>
273
+              </li>
274
+            </transition-group>
275
+          </div>
245
         </el-form-item>
276
         </el-form-item>
246
       </el-form>
277
       </el-form>
247
       <div slot="footer" class="dialog-footer">
278
       <div slot="footer" class="dialog-footer">
272
       }, 100)
303
       }, 100)
273
     }
304
     }
274
     return {
305
     return {
306
+      baseUrl: process.env.VUE_APP_BASE_API,
275
       column: 4,
307
       column: 4,
276
       carInfo: {},
308
       carInfo: {},
277
       expenseList: [],
309
       expenseList: [],
289
       single: true,
321
       single: true,
290
       title: '',
322
       title: '',
291
       open: false,
323
       open: false,
324
+      modifyOpen: false,
292
       scrapOpen: false,
325
       scrapOpen: false,
326
+      scrapModifyOpen: false,
293
       form: {},
327
       form: {},
294
       scrapForm: {},
328
       scrapForm: {},
295
       scrapButtonName: '',
329
       scrapButtonName: '',
330
+      expenseName: '',
296
       rules: {
331
       rules: {
297
         expenseType: [
332
         expenseType: [
298
           { required: true, message: '请选择费用类型', trigger: 'change' }
333
           { required: true, message: '请选择费用类型', trigger: 'change' }
340
       this.$router.push({ path: '/car' });
375
       this.$router.push({ path: '/car' });
341
     },
376
     },
342
     getScrapStatus() {
377
     getScrapStatus() {
343
-      this.queryParams.deviceId = this.$route.query.deviceId
378
+      this.queryParams.carId = this.$route.query.carId
344
       listDeviceScrap(this.queryParams).then(res => {
379
       listDeviceScrap(this.queryParams).then(res => {
345
         if (res.total > 0)
380
         if (res.total > 0)
346
           this.scrapButtonName = '查看报废信息';
381
           this.scrapButtonName = '查看报废信息';
369
       const carExpenseId = row.carExpenseId || this.ids
404
       const carExpenseId = row.carExpenseId || this.ids
370
       getCarExpense(carExpenseId).then(response => {
405
       getCarExpense(carExpenseId).then(response => {
371
         this.form = response.data;
406
         this.form = response.data;
407
+        this.modifyOpen = true;
372
         this.open = true;
408
         this.open = true;
373
         this.title = "修改车辆明细";
409
         this.title = "修改车辆明细";
374
       });
410
       });
407
             updateCarExpense(this.form).then(response => {
443
             updateCarExpense(this.form).then(response => {
408
               this.$modal.msgSuccess("修改成功");
444
               this.$modal.msgSuccess("修改成功");
409
               this.open = false;
445
               this.open = false;
446
+              this.modifyOpen = false;
410
               this.getList();
447
               this.getList();
411
             });
448
             });
412
           } else {
449
           } else {
421
     },
458
     },
422
     cancel() {
459
     cancel() {
423
       this.open = false;
460
       this.open = false;
461
+      this.modifyOpen = false;
424
       this.reset();
462
       this.reset();
425
     },
463
     },
464
+    //费用附件路径
465
+    getExpensePath(val) {
466
+      let arr = val.split('/upload')
467
+      this.form.document = arr[1]
468
+      if (val == "") {
469
+        this.form.document = ""
470
+      }
471
+    },
472
+    //报废附件路径
473
+    getScrapPath(val) {
474
+      let arr = val.split('/upload')
475
+      this.scrapForm.document = arr[1]
476
+      if (val == "") {
477
+        this.scrapForm.document = ""
478
+      }
479
+    },
480
+    getFileName(name) {
481
+      if (name) {
482
+        let arr = name.split('/')
483
+        return arr[arr.length - 1];
484
+      }
485
+    },
426
     /* 报废记录 */
486
     /* 报废记录 */
427
     handleScrap() {
487
     handleScrap() {
428
       if (this.scrapButtonName == '查看报废信息')
488
       if (this.scrapButtonName == '查看报废信息')
429
-        this.handleUpdateScrap();      
489
+        this.handleUpdateScrap();
430
       else
490
       else
431
-        this.handleAddScrap();  
491
+        this.handleAddScrap();
432
     },
492
     },
433
     handleAddScrap() {
493
     handleAddScrap() {
434
       this.resetScrap();
494
       this.resetScrap();
441
       listDeviceScrap(this.scrapForm).then(response => {
501
       listDeviceScrap(this.scrapForm).then(response => {
442
         this.scrapForm = response.rows[0];
502
         this.scrapForm = response.rows[0];
443
         this.scrapOpen = true;
503
         this.scrapOpen = true;
504
+        this.scrapModifyOpen = true;
444
         this.title = "修改设备报废信息";
505
         this.title = "修改设备报废信息";
445
       });
506
       });
446
     },
507
     },
459
             updateDeviceScrap(this.scrapForm).then(response => {
520
             updateDeviceScrap(this.scrapForm).then(response => {
460
               this.$modal.msgSuccess("修改成功");
521
               this.$modal.msgSuccess("修改成功");
461
               this.scrapOpen = false;
522
               this.scrapOpen = false;
462
-              this.getScrapList();
523
+              this.scrapModifyOpen = false;
524
+              getCar(this.$route.query.carId).then(res => {
525
+                this.carInfo = res.data;
526
+              });
527
+              this.getScrapStatus();
463
             });
528
             });
464
           } else {
529
           } else {
465
             addDeviceScrap(this.scrapForm).then(response => {
530
             addDeviceScrap(this.scrapForm).then(response => {
466
               this.$modal.msgSuccess("新增成功");
531
               this.$modal.msgSuccess("新增成功");
467
               this.scrapOpen = false;
532
               this.scrapOpen = false;
468
-              this.getScrapList();
533
+              getCar(this.$route.query.carId).then(res => {
534
+                this.carInfo = res.data;
535
+              });
536
+              this.getScrapStatus();
469
             });
537
             });
470
           }
538
           }
471
         }
539
         }
473
     },
541
     },
474
     scrapCancel() {
542
     scrapCancel() {
475
       this.scrapOpen = false;
543
       this.scrapOpen = false;
544
+      this.scrapModifyOpen = false;
476
       this.resetScrap();
545
       this.resetScrap();
477
     },
546
     },
478
     isNumber(value) {
547
     isNumber(value) {
479
       return typeof value === 'number' && /^\d+(\.\d+)?$/.test(value);
548
       return typeof value === 'number' && /^\d+(\.\d+)?$/.test(value);
480
     },
549
     },
550
+    expenseTypePath(val) {
551
+      if (val == '0') {
552
+        this.expenseName = '车辆/费用/保险费'
553
+      }
554
+      if (val == '1') {
555
+        this.expenseName = '车辆/费用/维修保养费'
556
+      }
557
+      if (val == '2') {
558
+        this.expenseName = '车辆/费用/轮胎费'
559
+      }
560
+    },
481
     statusTypeText(row) {
561
     statusTypeText(row) {
482
       if (row == '0') {
562
       if (row == '0') {
483
         return '被领用'
563
         return '被领用'

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

271
           </el-select>
271
           </el-select>
272
         </el-form-item>
272
         </el-form-item>
273
         <el-form-item label="费用类型" prop="expenseType">
273
         <el-form-item label="费用类型" prop="expenseType">
274
-          <el-select v-model="expenseForm.expenseType" placeholder="请选择" clearable>
274
+          <el-select v-model="expenseForm.expenseType" placeholder="请选择" clearable @change="expenseTypePath">
275
             <el-option label="保险费" value="0"></el-option>
275
             <el-option label="保险费" value="0"></el-option>
276
             <el-option label="维修/保养费" value="1"></el-option>
276
             <el-option label="维修/保养费" value="1"></el-option>
277
             <el-option label="检定费" value="2"></el-option>
277
             <el-option label="检定费" value="2"></el-option>
289
           <el-input v-model="expenseForm.remark" placeholder="请输入备注" />
289
           <el-input v-model="expenseForm.remark" placeholder="请输入备注" />
290
         </el-form-item>
290
         </el-form-item>
291
         <el-form-item label="附件" prop="document">
291
         <el-form-item label="附件" prop="document">
292
-          <el-input v-model="expenseForm.document" placeholder="请输入附件" />
292
+          <FileUpload :limit="1" :filePathName="expenseName" :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']"
293
+            @input="getExpensePath"></FileUpload>
294
+          <div v-if="expenseModifyOpen">
295
+            <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear"
296
+              tag="ul">
297
+              <li key="li01" class="el-upload-list__item ele-upload-list__item-content">
298
+                <el-link :href="`${baseUrl}${'/profile/upload' + expenseForm.document}`" :underline="false"
299
+                  target="_blank">
300
+                  <span class="el-icon-document" style="color:#0011ff;text-decoration: underline;">
301
+                    {{ getFileName(expenseForm.document) }}
302
+                  </span>
303
+                </el-link>
304
+              </li>
305
+            </transition-group>
306
+          </div>
293
         </el-form-item>
307
         </el-form-item>
294
       </el-form>
308
       </el-form>
295
       <div slot="footer" class="dialog-footer">
309
       <div slot="footer" class="dialog-footer">
381
           <el-input v-model="scrapForm.remark" placeholder="请输入备注" />
395
           <el-input v-model="scrapForm.remark" placeholder="请输入备注" />
382
         </el-form-item>
396
         </el-form-item>
383
         <el-form-item label="附件" prop="document">
397
         <el-form-item label="附件" prop="document">
384
-          <el-input v-model="scrapForm.document" placeholder="请输入附件" />
398
+          <FileUpload :limit="1" :filePathName="'设备/报废'" :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']"
399
+            @input="getScrapPath"></FileUpload>
400
+          <div v-if="scrapModifyOpen">
401
+            <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear"
402
+              tag="ul">
403
+              <li key="li01" class="el-upload-list__item ele-upload-list__item-content">
404
+                <el-link :href="`${baseUrl}${'/profile/upload' + scrapForm.document}`" :underline="false" target="_blank">
405
+                  <span class="el-icon-document" style="color:#0011ff;text-decoration: underline;">
406
+                    {{ getFileName(scrapForm.document) }}
407
+                  </span>
408
+                </el-link>
409
+              </li>
410
+            </transition-group>
411
+          </div>
385
         </el-form-item>
412
         </el-form-item>
386
       </el-form>
413
       </el-form>
387
       <div slot="footer" class="dialog-footer">
414
       <div slot="footer" class="dialog-footer">
415
       }, 100)
442
       }, 100)
416
     }
443
     }
417
     return {
444
     return {
445
+      baseUrl: process.env.VUE_APP_BASE_API,
418
       // 遮罩层
446
       // 遮罩层
419
       loading: true,
447
       loading: true,
420
       // 选中数组
448
       // 选中数组
443
       title: "",
471
       title: "",
444
       // 是否显示弹出层
472
       // 是否显示弹出层
445
       expenseOpen: false,
473
       expenseOpen: false,
474
+      expenseModifyOpen: false,
446
       handoverOpen: false,
475
       handoverOpen: false,
447
       scrapOpen: false,
476
       scrapOpen: false,
477
+      scrapModifyOpen: false,
448
       // 查询参数
478
       // 查询参数
449
       queryParams: {
479
       queryParams: {
450
         pageNum: 1,
480
         pageNum: 1,
461
       },
491
       },
462
       loading: false,
492
       loading: false,
463
       routeType: '',
493
       routeType: '',
464
-      scrapButtonName: ''
494
+      scrapButtonName: '',
495
+      expenseName: ''
465
     }
496
     }
466
   },
497
   },
467
   created() {
498
   created() {
540
       this.$tab.closeOpenPage(obj);
571
       this.$tab.closeOpenPage(obj);
541
       this.$router.push({ path: '/device/' + this.routeType });
572
       this.$router.push({ path: '/device/' + this.routeType });
542
     },
573
     },
574
+    //费用附件路径
575
+    getExpensePath(val) {
576
+      let arr = val.split('/upload')
577
+      this.expenseForm.document = arr[1]
578
+      if (val == "") {
579
+        this.expenseForm.document = ""
580
+      }
581
+    },
582
+    //报废附件路径
583
+    getScrapPath(val) {
584
+      let arr = val.split('/upload')
585
+      this.scrapForm.document = arr[1]
586
+      if (val == "") {
587
+        this.scrapForm.document = ""
588
+      }
589
+    },
590
+    getFileName(name) {
591
+      if (name) {
592
+        let arr = name.split('/')
593
+        return arr[arr.length - 1];
594
+      }
595
+    },
543
     /** 搜索按钮操作 */
596
     /** 搜索按钮操作 */
544
     handleExpenseQuery() {
597
     handleExpenseQuery() {
545
       this.queryParams.pageNum = 1;
598
       this.queryParams.pageNum = 1;
553
       this.multiple = !selection.length
606
       this.multiple = !selection.length
554
     },
607
     },
555
     handleAddExpense() {
608
     handleAddExpense() {
556
-      this.resetExpense();
557
       this.expenseOpen = true;
609
       this.expenseOpen = true;
558
       this.title = "添加设备费用明细";
610
       this.title = "添加设备费用明细";
559
     },
611
     },
560
     handleUpdateExpense(row) {
612
     handleUpdateExpense(row) {
561
-      this.resetExpense();
562
       const deviceExpenseId = row.deviceExpenseId || this.expenseIds
613
       const deviceExpenseId = row.deviceExpenseId || this.expenseIds
563
       getDeviceExpense(deviceExpenseId).then(response => {
614
       getDeviceExpense(deviceExpenseId).then(response => {
564
         this.expenseForm = response.data;
615
         this.expenseForm = response.data;
565
         this.expenseOpen = true;
616
         this.expenseOpen = true;
617
+        this.expenseModifyOpen = true;
566
         this.title = "修改设备费用明细";
618
         this.title = "修改设备费用明细";
567
       });
619
       });
568
     },
620
     },
595
             updateDeviceExpense(this.expenseForm).then(response => {
647
             updateDeviceExpense(this.expenseForm).then(response => {
596
               this.$modal.msgSuccess("修改成功");
648
               this.$modal.msgSuccess("修改成功");
597
               this.expenseOpen = false;
649
               this.expenseOpen = false;
650
+              this.expenseModifyOpen = false;
598
               this.getExpenseList();
651
               this.getExpenseList();
599
             });
652
             });
600
           } else {
653
           } else {
609
     },
662
     },
610
     expenseCancel() {
663
     expenseCancel() {
611
       this.expenseOpen = false;
664
       this.expenseOpen = false;
665
+      this.expenseModifyOpen = false;
612
       this.resetExpense();
666
       this.resetExpense();
613
     },
667
     },
614
 
668
 
700
     /* 报废记录 */
754
     /* 报废记录 */
701
     handleScrap() {
755
     handleScrap() {
702
       if (this.scrapButtonName == '查看报废信息')
756
       if (this.scrapButtonName == '查看报废信息')
703
-        this.handleUpdateScrap();      
757
+        this.handleUpdateScrap();
704
       else
758
       else
705
-        this.handleAddScrap();  
759
+        this.handleAddScrap();
706
     },
760
     },
707
     handleAddScrap() {
761
     handleAddScrap() {
708
       this.resetScrap();
762
       this.resetScrap();
715
       listDeviceScrap(this.scrapForm).then(response => {
769
       listDeviceScrap(this.scrapForm).then(response => {
716
         this.scrapForm = response.rows[0];
770
         this.scrapForm = response.rows[0];
717
         this.scrapOpen = true;
771
         this.scrapOpen = true;
772
+        this.scrapModifyOpen = true;
718
         this.title = "修改设备报废信息";
773
         this.title = "修改设备报废信息";
719
       });
774
       });
720
     },
775
     },
733
             updateDeviceScrap(this.scrapForm).then(response => {
788
             updateDeviceScrap(this.scrapForm).then(response => {
734
               this.$modal.msgSuccess("修改成功");
789
               this.$modal.msgSuccess("修改成功");
735
               this.scrapOpen = false;
790
               this.scrapOpen = false;
736
-              this.getScrapList();
791
+              this.scrapModifyOpen = false;
792
+              getDevice(this.$route.query.deviceId).then(res => {
793
+                this.deviceInfo = res.data;
794
+              });
795
+              this.getScrapStatus();
737
             });
796
             });
738
           } else {
797
           } else {
739
             addDeviceScrap(this.scrapForm).then(response => {
798
             addDeviceScrap(this.scrapForm).then(response => {
740
               this.$modal.msgSuccess("新增成功");
799
               this.$modal.msgSuccess("新增成功");
741
               this.scrapOpen = false;
800
               this.scrapOpen = false;
742
-              this.getScrapList();
801
+              getDevice(this.$route.query.deviceId).then(res => {
802
+                this.deviceInfo = res.data;
803
+              });
804
+              this.getScrapStatus();
743
             });
805
             });
744
           }
806
           }
745
         }
807
         }
747
     },
809
     },
748
     scrapCancel() {
810
     scrapCancel() {
749
       this.scrapOpen = false;
811
       this.scrapOpen = false;
812
+      this.scrapModifyOpen = false;
750
       this.resetScrap();
813
       this.resetScrap();
751
     },
814
     },
752
     isNumber(value) {
815
     isNumber(value) {
753
       return typeof value === 'number' && /^\d+(\.\d+)?$/.test(value);
816
       return typeof value === 'number' && /^\d+(\.\d+)?$/.test(value);
754
     },
817
     },
818
+    expenseTypePath(val) {
819
+      if (val == '0') {
820
+        this.expenseName = '设备/保险费'
821
+      }
822
+      if (val == '1') {
823
+        this.expenseName = '设备/维修保养费'
824
+      }
825
+      if (val == '2') {
826
+        this.expenseName = '设备/检定费'
827
+      }
828
+    },
755
     expenseTypeText(row) {
829
     expenseTypeText(row) {
756
       if (row == '0') {
830
       if (row == '0') {
757
         return '保险费'
831
         return '保险费'

正在加载...
取消
保存