Selaa lähdekoodia

设备报废、费用上传附件

lamphua 1 vuosi sitten
vanhempi
commit
fd9d6aef53

+ 12
- 12
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java Näytä tiedosto

@@ -305,18 +305,18 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
305 305
             runtimeService.createChangeActivityStateBuilder()
306 306
                     .processInstanceId(task.getProcessInstanceId())
307 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 320
         } catch (FlowableObjectNotFoundException e) {
321 321
             throw new CustomException("未找到流程实例,流程可能已发生变化");
322 322
         } catch (FlowableException e) {

+ 23
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcCarExpense.java Näytä tiedosto

@@ -40,6 +40,10 @@ public class CmcCarExpense extends BaseEntity
40 40
     @Excel(name = "发生日期", width = 30, dateFormat = "yyyy-MM-dd")
41 41
     private Date occurDate;
42 42
 
43
+    /** 附件 */
44
+    @Excel(name = "附件")
45
+    private String document;
46
+
43 47
     public void setCarExpenseId(String carExpenseId) 
44 48
     {
45 49
         this.carExpenseId = carExpenseId;
@@ -58,6 +62,16 @@ public class CmcCarExpense extends BaseEntity
58 62
     {
59 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 75
     public void setExpenseType(String expenseType) 
62 76
     {
63 77
         this.expenseType = expenseType;
@@ -85,6 +99,15 @@ public class CmcCarExpense extends BaseEntity
85 99
     {
86 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 112
     @Override
90 113
     public String toString() {

+ 17
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcProject.java Näytä tiedosto

@@ -149,6 +149,10 @@ public class CmcProject extends BaseEntity
149 149
     @Excel(name = "项目参与人员")
150 150
     private String participates;
151 151
 
152
+    /** 项目任务书 */
153
+    @Excel(name = "项目任务书")
154
+    private String taskDocument;
155
+
152 156
     public void setProjectId(String projectId)
153 157
     {
154 158
         this.projectId = projectId;
@@ -275,6 +279,15 @@ public class CmcProject extends BaseEntity
275 279
     {
276 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 291
     public void setUndertakingDeptName(String undertakingDeptName)
279 292
     {
280 293
         this.undertakingDeptName = undertakingDeptName;
@@ -419,6 +432,10 @@ public class CmcProject extends BaseEntity
419 432
     {
420 433
         return kmlLat;
421 434
     }
435
+    public void setCars(String cars)
436
+    {
437
+        this.cars = cars;
438
+    }
422 439
 
423 440
     public String getCars()
424 441
     {

+ 39
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcSettle.java Näytä tiedosto

@@ -132,6 +132,18 @@ public class CmcSettle extends BaseEntity
132 132
     @Excel(name = "总经理审核意见")
133 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 147
     public void setSettleId(String settleId) 
136 148
     {
137 149
         this.settleId = settleId;
@@ -375,6 +387,33 @@ public class CmcSettle extends BaseEntity
375 387
     {
376 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 418
     @Override
380 419
     public String toString() {

+ 17
- 6
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarExpenseMapper.xml Näytä tiedosto

@@ -11,25 +11,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
11 11
         <result property="expense"    column="expense"    />
12 12
         <result property="occurDate"    column="occur_date"    />
13 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 21
     </resultMap>
15 22
 
16 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 26
     </sql>
19 27
 
20 28
     <select id="selectCmcCarExpenseList" parameterType="CmcCarExpense" resultMap="CmcCarExpenseResult">
21 29
         <include refid="selectCmcCarExpenseVo"/>
22 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 35
         </where>
28 36
     </select>
29 37
     
30 38
     <select id="selectCmcCarExpenseByCarExpenseId" parameterType="String" resultMap="CmcCarExpenseResult">
31 39
         <include refid="selectCmcCarExpenseVo"/>
32
-        where car_expense_id = #{carExpenseId}
40
+        where ce.car_expense_id = #{carExpenseId}
33 41
     </select>
34 42
         
35 43
     <insert id="insertCmcCarExpense" parameterType="CmcCarExpense">
@@ -41,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
41 49
             <if test="expense != null">expense,</if>
42 50
             <if test="occurDate != null">occur_date,</if>
43 51
             <if test="remark != null">remark,</if>
52
+            <if test="document != null">document,</if>
44 53
          </trim>
45 54
         <trim prefix="values (" suffix=")" suffixOverrides=",">
46 55
             <if test="carExpenseId != null">#{carExpenseId},</if>
@@ -49,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
49 58
             <if test="expense != null">#{expense},</if>
50 59
             <if test="occurDate != null">#{occurDate},</if>
51 60
             <if test="remark != null">#{remark},</if>
61
+            <if test="document != null">#{document},</if>
52 62
          </trim>
53 63
     </insert>
54 64
 
@@ -60,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
60 70
             <if test="expense != null">expense = #{expense},</if>
61 71
             <if test="occurDate != null">occur_date = #{occurDate},</if>
62 72
             <if test="remark != null">remark = #{remark},</if>
73
+            <if test="document != null">document = #{document},</if>
63 74
         </trim>
64 75
         where car_expense_id = #{carExpenseId}
65 76
     </update>

+ 5
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcProjectMapper.xml Näytä tiedosto

@@ -35,6 +35,7 @@
35 35
         <result property="drivers"    column="drivers"    />
36 36
         <result property="devices"    column="devices"    />
37 37
         <result property="participates"    column="participates"    />
38
+        <result property="taskDocument"    column="task_document"    />
38 39
         <association property="projectLeaderUser"    javaType="SysUser"         resultMap="ProjectLeaderResult" />
39 40
         <association property="projectRegistrantUser"    javaType="SysUser"         resultMap="ProjectRegistrantResult" />
40 41
         <association property="technicalDirectorUser"    javaType="SysUser"         resultMap="TechnicalDirectorResult" />
@@ -65,7 +66,7 @@
65 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 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 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 70
         left join sys_user as u on u.user_id = p.project_leader
70 71
         left join sys_user as u1 on u1.user_id = p.project_registrant
71 72
         left join cmc_technical as c on c.project_id = p.project_id
@@ -139,6 +140,7 @@
139 140
             <if test="drivers != null">drivers,</if>
140 141
             <if test="devices != null">devices,</if>
141 142
             <if test="participates != null">participates,</if>
143
+            <if test="taskDocument != null">task_document,</if>
142 144
         </trim>
143 145
         <trim prefix="values (" suffix=")" suffixOverrides=",">
144 146
             <if test="projectId != null">#{projectId},</if>
@@ -171,6 +173,7 @@
171 173
             <if test="drivers != null">#{drivers},</if>
172 174
             <if test="devices != null">#{devices},</if>
173 175
             <if test="participates != null">#{participates},</if>
176
+            <if test="taskDocument != null">#{taskDocument},</if>
174 177
         </trim>
175 178
     </insert>
176 179
 
@@ -206,6 +209,7 @@
206 209
             <if test="drivers != null">drivers = #{drivers},</if>
207 210
             <if test="devices != null">devices = #{devices},</if>
208 211
             <if test="participates != null">participates = #{participates},</if>
212
+            <if test="taskDocument != null">task_document = #{taskDocument},</if>
209 213
         </trim>
210 214
         where project_id = #{projectId}
211 215
     </update>

+ 13
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcSettleMapper.xml Näytä tiedosto

@@ -32,10 +32,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
32 32
         <result property="gmUserId"    column="gm_user_id"    />
33 33
         <result property="gmTime"    column="gm_time"    />
34 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 38
     </resultMap>
36 39
 
37 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 42
     </sql>
40 43
 
41 44
     <select id="selectCmcSettleList" parameterType="CmcSettle" resultMap="CmcSettleResult">
@@ -106,6 +109,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
106 109
             <if test="gmUserId != null">gm_user_id,</if>
107 110
             <if test="gmTime != null">gm_time,</if>
108 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 115
          </trim>
110 116
         <trim prefix="values (" suffix=")" suffixOverrides=",">
111 117
             <if test="settleId != null">#{settleId},</if>
@@ -135,6 +141,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
135 141
             <if test="gmUserId != null">#{gmUserId},</if>
136 142
             <if test="gmTime != null">#{gmTime},</if>
137 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 147
          </trim>
139 148
     </insert>
140 149
 
@@ -167,6 +176,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
167 176
             <if test="gmUserId != null">gm_user_id = #{gmUserId},</if>
168 177
             <if test="gmTime != null">gm_time = #{gmTime},</if>
169 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 182
         </trim>
171 183
         where settle_id = #{settleId}
172 184
     </update>

+ 3970
- 3961
oa-back/sql/sql.sql
File diff suppressed because it is too large
Näytä tiedosto


+ 3
- 0
oa-ui/src/components/FileUpload/index.vue Näytä tiedosto

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

+ 88
- 8
oa-ui/src/views/oa/car/detail.vue Näytä tiedosto

@@ -115,7 +115,8 @@
115 115
               <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
116 116
             </el-col>
117 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 120
             </el-col>
120 121
           </el-row>
121 122
           <el-table v-loading="loading" :data="expenseList" @selection-change="handleSelectionChange">
@@ -137,6 +138,7 @@
137 138
               </template>
138 139
             </el-table-column>
139 140
             <el-table-column width="55" align="center" label="备注" prop="remark" />
141
+            <el-table-column label="附件" align="center" prop="document" />
140 142
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
141 143
               <template slot-scope="scope">
142 144
                 <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
@@ -198,7 +200,7 @@
198 200
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
199 201
       <el-form ref="expenseForm" :model="form" :rules="rules" label-width="100px">
200 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 204
             <el-option label="保险费" value="0"></el-option>
203 205
             <el-option label="维修/保养费" value="1"></el-option>
204 206
             <el-option label="轮胎费" value="2"></el-option>
@@ -214,6 +216,22 @@
214 216
         <el-form-item label="备注说明" prop="remark">
215 217
           <el-input type="textarea" v-model="form.remark" placeholder="请输入备注说明" style="width:220px" />
216 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 235
       </el-form>
218 236
       <div slot="footer" class="dialog-footer">
219 237
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -241,7 +259,20 @@
241 259
           <el-input v-model="scrapForm.remark" placeholder="请输入备注" />
242 260
         </el-form-item>
243 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 276
         </el-form-item>
246 277
       </el-form>
247 278
       <div slot="footer" class="dialog-footer">
@@ -272,6 +303,7 @@ export default {
272 303
       }, 100)
273 304
     }
274 305
     return {
306
+      baseUrl: process.env.VUE_APP_BASE_API,
275 307
       column: 4,
276 308
       carInfo: {},
277 309
       expenseList: [],
@@ -289,10 +321,13 @@ export default {
289 321
       single: true,
290 322
       title: '',
291 323
       open: false,
324
+      modifyOpen: false,
292 325
       scrapOpen: false,
326
+      scrapModifyOpen: false,
293 327
       form: {},
294 328
       scrapForm: {},
295 329
       scrapButtonName: '',
330
+      expenseName: '',
296 331
       rules: {
297 332
         expenseType: [
298 333
           { required: true, message: '请选择费用类型', trigger: 'change' }
@@ -340,7 +375,7 @@ export default {
340 375
       this.$router.push({ path: '/car' });
341 376
     },
342 377
     getScrapStatus() {
343
-      this.queryParams.deviceId = this.$route.query.deviceId
378
+      this.queryParams.carId = this.$route.query.carId
344 379
       listDeviceScrap(this.queryParams).then(res => {
345 380
         if (res.total > 0)
346 381
           this.scrapButtonName = '查看报废信息';
@@ -369,6 +404,7 @@ export default {
369 404
       const carExpenseId = row.carExpenseId || this.ids
370 405
       getCarExpense(carExpenseId).then(response => {
371 406
         this.form = response.data;
407
+        this.modifyOpen = true;
372 408
         this.open = true;
373 409
         this.title = "修改车辆明细";
374 410
       });
@@ -407,6 +443,7 @@ export default {
407 443
             updateCarExpense(this.form).then(response => {
408 444
               this.$modal.msgSuccess("修改成功");
409 445
               this.open = false;
446
+              this.modifyOpen = false;
410 447
               this.getList();
411 448
             });
412 449
           } else {
@@ -421,14 +458,37 @@ export default {
421 458
     },
422 459
     cancel() {
423 460
       this.open = false;
461
+      this.modifyOpen = false;
424 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 487
     handleScrap() {
428 488
       if (this.scrapButtonName == '查看报废信息')
429
-        this.handleUpdateScrap();      
489
+        this.handleUpdateScrap();
430 490
       else
431
-        this.handleAddScrap();  
491
+        this.handleAddScrap();
432 492
     },
433 493
     handleAddScrap() {
434 494
       this.resetScrap();
@@ -441,6 +501,7 @@ export default {
441 501
       listDeviceScrap(this.scrapForm).then(response => {
442 502
         this.scrapForm = response.rows[0];
443 503
         this.scrapOpen = true;
504
+        this.scrapModifyOpen = true;
444 505
         this.title = "修改设备报废信息";
445 506
       });
446 507
     },
@@ -459,13 +520,20 @@ export default {
459 520
             updateDeviceScrap(this.scrapForm).then(response => {
460 521
               this.$modal.msgSuccess("修改成功");
461 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 529
           } else {
465 530
             addDeviceScrap(this.scrapForm).then(response => {
466 531
               this.$modal.msgSuccess("新增成功");
467 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,11 +541,23 @@ export default {
473 541
     },
474 542
     scrapCancel() {
475 543
       this.scrapOpen = false;
544
+      this.scrapModifyOpen = false;
476 545
       this.resetScrap();
477 546
     },
478 547
     isNumber(value) {
479 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 561
     statusTypeText(row) {
482 562
       if (row == '0') {
483 563
         return '被领用'

+ 84
- 10
oa-ui/src/views/oa/device/detail.vue Näytä tiedosto

@@ -271,7 +271,7 @@
271 271
           </el-select>
272 272
         </el-form-item>
273 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 275
             <el-option label="保险费" value="0"></el-option>
276 276
             <el-option label="维修/保养费" value="1"></el-option>
277 277
             <el-option label="检定费" value="2"></el-option>
@@ -289,7 +289,21 @@
289 289
           <el-input v-model="expenseForm.remark" placeholder="请输入备注" />
290 290
         </el-form-item>
291 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 307
         </el-form-item>
294 308
       </el-form>
295 309
       <div slot="footer" class="dialog-footer">
@@ -381,7 +395,20 @@
381 395
           <el-input v-model="scrapForm.remark" placeholder="请输入备注" />
382 396
         </el-form-item>
383 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 412
         </el-form-item>
386 413
       </el-form>
387 414
       <div slot="footer" class="dialog-footer">
@@ -415,6 +442,7 @@ export default {
415 442
       }, 100)
416 443
     }
417 444
     return {
445
+      baseUrl: process.env.VUE_APP_BASE_API,
418 446
       // 遮罩层
419 447
       loading: true,
420 448
       // 选中数组
@@ -443,8 +471,10 @@ export default {
443 471
       title: "",
444 472
       // 是否显示弹出层
445 473
       expenseOpen: false,
474
+      expenseModifyOpen: false,
446 475
       handoverOpen: false,
447 476
       scrapOpen: false,
477
+      scrapModifyOpen: false,
448 478
       // 查询参数
449 479
       queryParams: {
450 480
         pageNum: 1,
@@ -461,7 +491,8 @@ export default {
461 491
       },
462 492
       loading: false,
463 493
       routeType: '',
464
-      scrapButtonName: ''
494
+      scrapButtonName: '',
495
+      expenseName: ''
465 496
     }
466 497
   },
467 498
   created() {
@@ -540,6 +571,28 @@ export default {
540 571
       this.$tab.closeOpenPage(obj);
541 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 597
     handleExpenseQuery() {
545 598
       this.queryParams.pageNum = 1;
@@ -553,16 +606,15 @@ export default {
553 606
       this.multiple = !selection.length
554 607
     },
555 608
     handleAddExpense() {
556
-      this.resetExpense();
557 609
       this.expenseOpen = true;
558 610
       this.title = "添加设备费用明细";
559 611
     },
560 612
     handleUpdateExpense(row) {
561
-      this.resetExpense();
562 613
       const deviceExpenseId = row.deviceExpenseId || this.expenseIds
563 614
       getDeviceExpense(deviceExpenseId).then(response => {
564 615
         this.expenseForm = response.data;
565 616
         this.expenseOpen = true;
617
+        this.expenseModifyOpen = true;
566 618
         this.title = "修改设备费用明细";
567 619
       });
568 620
     },
@@ -595,6 +647,7 @@ export default {
595 647
             updateDeviceExpense(this.expenseForm).then(response => {
596 648
               this.$modal.msgSuccess("修改成功");
597 649
               this.expenseOpen = false;
650
+              this.expenseModifyOpen = false;
598 651
               this.getExpenseList();
599 652
             });
600 653
           } else {
@@ -609,6 +662,7 @@ export default {
609 662
     },
610 663
     expenseCancel() {
611 664
       this.expenseOpen = false;
665
+      this.expenseModifyOpen = false;
612 666
       this.resetExpense();
613 667
     },
614 668
 
@@ -700,9 +754,9 @@ export default {
700 754
     /* 报废记录 */
701 755
     handleScrap() {
702 756
       if (this.scrapButtonName == '查看报废信息')
703
-        this.handleUpdateScrap();      
757
+        this.handleUpdateScrap();
704 758
       else
705
-        this.handleAddScrap();  
759
+        this.handleAddScrap();
706 760
     },
707 761
     handleAddScrap() {
708 762
       this.resetScrap();
@@ -715,6 +769,7 @@ export default {
715 769
       listDeviceScrap(this.scrapForm).then(response => {
716 770
         this.scrapForm = response.rows[0];
717 771
         this.scrapOpen = true;
772
+        this.scrapModifyOpen = true;
718 773
         this.title = "修改设备报废信息";
719 774
       });
720 775
     },
@@ -733,13 +788,20 @@ export default {
733 788
             updateDeviceScrap(this.scrapForm).then(response => {
734 789
               this.$modal.msgSuccess("修改成功");
735 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 797
           } else {
739 798
             addDeviceScrap(this.scrapForm).then(response => {
740 799
               this.$modal.msgSuccess("新增成功");
741 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,11 +809,23 @@ export default {
747 809
     },
748 810
     scrapCancel() {
749 811
       this.scrapOpen = false;
812
+      this.scrapModifyOpen = false;
750 813
       this.resetScrap();
751 814
     },
752 815
     isNumber(value) {
753 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 829
     expenseTypeText(row) {
756 830
       if (row == '0') {
757 831
         return '保险费'

Loading…
Peruuta
Tallenna