Ver código fonte

新增车辆明细界面

余思翰 1 ano atrás
pai
commit
790966d331

+ 1
- 0
oa-ui/src/assets/icons/svg/ArrowLeft.svg Ver arquivo

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M17.59 18L19 16.59L14.42 12L19 7.41L17.59 6l-6 6z"/><path fill="currentColor" d="m11 18l1.41-1.41L7.83 12l4.58-4.59L11 6l-6 6z"/></svg>

+ 1
- 0
oa-ui/src/assets/icons/svg/Branding.svg Ver arquivo

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M11 17h7q.425 0 .713-.288T19 16v-4q0-.425-.288-.712T18 11h-7q-.425 0-.712.288T10 12v4q0 .425.288.713T11 17m-7 3q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20z"/></svg>

+ 1
- 0
oa-ui/src/assets/icons/svg/JamYelpSquare.svg Ver arquivo

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-2 -2 24 24"><g fill="currentColor"><path d="m9.2 12.095l-1.382 1.682a.451.451 0 0 0 .183.707l1.351.531a.451.451 0 0 0 .616-.408l.059-2.203a.467.467 0 0 0-.828-.309zm-.23-1.672l-2.05-.736a.451.451 0 0 0-.603.41l-.046 1.451c-.01.313.294.54.591.443l2.095-.685a.467.467 0 0 0 .013-.883m2.348.236l2.099-.579a.451.451 0 0 0 .257-.683l-.797-1.213a.451.451 0 0 0-.74-.021L10.82 9.93a.467.467 0 0 0 .498.729m-1.52-5.043a.535.535 0 0 0-.676-.541l-1.661.453a.535.535 0 0 0-.296.826L9.07 9.656a.513.513 0 0 0 .053.077a.555.555 0 0 0 .943-.18a.547.547 0 0 0 .024-.217zm3.633 6.552l-2.107-.647a.467.467 0 0 0-.52.715l1.25 1.782c.177.25.546.257.73.012l.875-1.158a.451.451 0 0 0-.228-.704"/><path d="M4 2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0-2h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4"/></g></svg>

+ 1
- 0
oa-ui/src/assets/icons/svg/PhAppStoreLogoFill.svg Ver arquivo

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path fill="currentColor" d="M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24M83.66 180.12l-4.8 8a8 8 0 1 1-13.72-8.24l4.8-8a8 8 0 0 1 13.72 8.24M128 152H56a8 8 0 0 1 0-16h35.47l27.2-45.33l-13.53-22.55a8 8 0 0 1 13.72-8.24L128 75.12l9.14-15.24a8 8 0 0 1 13.72 8.24L110.13 136H128a8 8 0 0 1 0 16m72 0h-25.87l16.73 27.88a8 8 0 0 1-13.72 8.24l-38.4-64a8 8 0 0 1 13.72-8.24L164.53 136H200a8 8 0 0 1 0 16"/></svg>

+ 1
- 0
oa-ui/src/assets/icons/svg/TeenyiconsYenSolid.svg Ver arquivo

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 15 15"><path fill="currentColor" fill-rule="evenodd" d="M6.528 7H3v1h4v3H3v1h4v3h1v-3h4v-1H8V8h4V7H8.472L12.907.79l-.814-.58L7.5 6.64L2.907.21l-.814.58z" clip-rule="evenodd"/></svg>

+ 1
- 0
oa-ui/src/assets/icons/svg/cost.svg Ver arquivo

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M3.005 3.003h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-18a1 1 0 0 1-1-1v-16a1 1 0 0 1 1-1m10 10v-1h3v-2h-2.586L15.54 7.88l-1.414-1.414l-2.121 2.122l-2.121-2.122L8.469 7.88l2.122 2.122H8.005v2h3v1h-3v2h3v2h2v-2h3v-2z"/></svg>

+ 1
- 0
oa-ui/src/assets/icons/svg/remark.svg Ver arquivo

@@ -0,0 +1 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M5.95 19q-2.5-.125-3.725-1.05T1 15.275q0-1.625 1.338-2.638t3.712-1.212q.975-.075 1.463-.313T8 10.45q0-.65-.738-.975T4.825 9L5 7q2.575.2 3.788 1.038T10 10.45q0 1.325-.963 2.075t-2.837.9q-1.6.125-2.4.588T3 15.275q0 .875.7 1.263T6.05 17l-.1 2Zm7.925-.75L9.75 14.125L18.375 5.5q.5-.5 1.188-.5t1.187.5l1.75 1.75q.5.5.5 1.188t-.5 1.187l-8.625 8.625ZM8.975 20q-.425.1-.75-.225T8 19.025l.775-3.775l3.95 3.95l-3.75.8Z"/></svg>

+ 20
- 0
oa-ui/src/router/index.js Ver arquivo

@@ -1,3 +1,9 @@
1
+/*
2
+ * @Author: ysh
3
+ * @Date: 2024-01-03 09:23:11
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-03-13 10:38:15
6
+ */
1 7
 import Vue from 'vue'
2 8
 import Router from 'vue-router'
3 9
 
@@ -166,6 +172,20 @@ export const constantRoutes = [
166 172
       }
167 173
     ]
168 174
   },
175
+  {
176
+    path: '/car/expense',
177
+    component: Layout,
178
+    hidden: true,
179
+    children: [
180
+      {
181
+        path: '',
182
+        component: () => import('@/views/oa/car/expense'),
183
+        name: 'carExpense',
184
+        meta: { title: '车辆明细', icon: '' }
185
+
186
+      }
187
+    ]
188
+  },
169 189
 ]
170 190
 
171 191
 // 动态路由,基于用户权限动态去加载

+ 29
- 17
oa-ui/src/views/index.vue Ver arquivo

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-01-03 09:23:11
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-03-12 15:59:04
5
+ * @LastEditTime: 2024-03-12 17:28:04
6 6
 -->
7 7
 
8 8
 <template>
@@ -15,10 +15,18 @@
15 15
             <img :src="avatar" class="user-avatar" />
16 16
           </div>
17 17
           <div class="username">
18
-            {{ user.nickName }}
18
+            <div>{{ user.nickName }}</div>
19
+            <div style="font-size: 14px;color:#bbb;font-weight:lighter;">
20
+              <el-tag type="warning">{{ user.postLevel == null ? '未设置职位': user.postLevel}}</el-tag>
21
+            </div>
19 22
           </div>
20 23
           <div class="user-info">
21
-            
24
+            <table>
25
+              <tr>
26
+                <td>部门</td>
27
+                <td></td>
28
+              </tr>
29
+            </table>
22 30
           </div>
23 31
         </div>
24 32
       </el-col>
@@ -35,7 +43,7 @@
35 43
           </div>
36 44
         </div>
37 45
       </el-col>
38
-      
46
+
39 47
     </el-row>
40 48
     <el-row :gutter="20">
41 49
       <el-col :span="8">
@@ -49,13 +57,13 @@
49 57
       <el-col :span="8">
50 58
         <div class="header">公告</div>
51 59
         <div class="notice-content">
52
-          
60
+
53 61
         </div>
54 62
       </el-col>
55 63
       <el-col :span="8">
56 64
         <div class="header">项目流转</div>
57 65
         <div class="project-content">
58
-          
66
+
59 67
         </div>
60 68
       </el-col>
61 69
     </el-row>
@@ -272,7 +280,7 @@ export default {
272 280
 
273 281
   .avatar {
274 282
     text-align: center;
275
-    padding: 10px 0;
283
+    // padding: 10px 0;
276 284
 
277 285
     .user-avatar {
278 286
       width: 100px;
@@ -287,12 +295,11 @@ export default {
287 295
     font-weight: bold;
288 296
     font-family: '微软雅黑';
289 297
   }
290
-  .user-info{
291
-    display: grid;
292
-    
293
-  }
298
+
299
+  .user-info {}
294 300
 }
295
-.notice-content{
301
+
302
+.notice-content {
296 303
   width: 100%;
297 304
   height: 400px;
298 305
   background-color: #ffffff;
@@ -305,7 +312,8 @@ export default {
305 312
   background-color: #ffffff;
306 313
   border-radius: 15px;
307 314
 }
308
-.project-content{
315
+
316
+.project-content {
309 317
   width: 100%;
310 318
   height: 400px;
311 319
   background-color: #ffffff;
@@ -317,17 +325,21 @@ export default {
317 325
   text-align: center;
318 326
   line-height: 22px;
319 327
 }
320
-::v-deep .el-calendar__body{
328
+
329
+::v-deep .el-calendar__body {
321 330
   padding: 15px 31px 10px;
322 331
 }
323
-::v-deep .el-calendar__header{
332
+
333
+::v-deep .el-calendar__header {
324 334
   padding: 20px;
325 335
 }
326
-::v-deep .el-calendar-table td.is-today{
336
+
337
+::v-deep .el-calendar-table td.is-today {
327 338
   background-color: #1890ff;
328 339
   color: #ffffff;
329 340
 }
330
-::v-deep .el-calendar-table td.is-selected{
341
+
342
+::v-deep .el-calendar-table td.is-selected {
331 343
   color: #242d42;
332 344
 }
333 345
 </style>

+ 368
- 0
oa-ui/src/views/oa/car/expense.vue Ver arquivo

@@ -0,0 +1,368 @@
1
+<template>
2
+  <div class="app-container">
3
+    <div class="header">
4
+      <el-button icon="el-icon-d-arrow-left" plain type="primary" class="back" @click="goBack">返回</el-button>
5
+      <h1>{{ '【' + carInfo.licensePlate + '】' }}车辆明细</h1>
6
+    </div>
7
+    <el-divider></el-divider>
8
+    <el-descriptions class="descriptions" :column="column" border style="text-align: center;">
9
+      <el-descriptions-item>
10
+        <template slot="label">
11
+          <svg-icon slot="prefix" icon-class="car" class="el-input__icon input-icon" />
12
+          车牌号
13
+        </template>
14
+        {{ carInfo.licensePlate }}
15
+      </el-descriptions-item>
16
+      <el-descriptions-item>
17
+        <template slot="label">
18
+          <svg-icon slot="prefix" icon-class="Branding" class="el-input__icon input-icon" />
19
+          品牌
20
+        </template>
21
+        {{ carInfo.brand }}
22
+      </el-descriptions-item>
23
+      <el-descriptions-item>
24
+        <template slot="label">
25
+          <svg-icon slot="prefix" icon-class="PhAppStoreLogoFill" class="el-input__icon input-icon" />
26
+          系列
27
+        </template>
28
+        {{ carInfo.series }}
29
+      </el-descriptions-item>
30
+      <el-descriptions-item>
31
+        <template slot="label">
32
+          <svg-icon slot="prefix" icon-class="cost" class="el-input__icon input-icon" />
33
+          总价
34
+        </template>
35
+        {{ carInfo.cost }}
36
+      </el-descriptions-item>
37
+      <el-descriptions-item>
38
+        <template slot="label">
39
+          <svg-icon slot="prefix" icon-class="date" class="el-input__icon input-icon" />
40
+          上牌时间
41
+        </template>
42
+        {{ parseTime(carInfo.acquisitionTime, '{y}-{m}-{d}') }}
43
+      </el-descriptions-item>
44
+      <el-descriptions-item>
45
+        <template slot="label">
46
+          <i class="el-icon-user-solid"></i>
47
+          驾驶员
48
+        </template>
49
+        {{ carInfo.driver }}
50
+      </el-descriptions-item>
51
+      <el-descriptions-item>
52
+        <template slot="label">
53
+          <svg-icon slot="prefix" icon-class="date" class="el-input__icon input-icon" />
54
+          预计使用年限
55
+        </template>
56
+        {{ carInfo.expectLife }}
57
+      </el-descriptions-item>
58
+      <el-descriptions-item>
59
+        <template slot="label">
60
+          <svg-icon slot="prefix" icon-class="car" class="el-input__icon input-icon" />
61
+          预计行驶里程(万千米)
62
+        </template>
63
+        {{ carInfo.expectKm }}
64
+      </el-descriptions-item>
65
+      <el-descriptions-item>
66
+        <template slot="label">
67
+          <svg-icon slot="prefix" icon-class="JamYelpSquare" class="el-input__icon input-icon" />
68
+          是否为租车
69
+        </template>
70
+        {{ carInfo.isRent == '0' ? '否' : '是' }}
71
+      </el-descriptions-item>
72
+      <el-descriptions-item>
73
+        <template slot="label">
74
+          <svg-icon slot="prefix" icon-class="TeenyiconsYenSolid" class="el-input__icon input-icon" />
75
+          单日成本
76
+        </template>
77
+        {{ carInfo.dayCost }}
78
+      </el-descriptions-item>
79
+      <el-descriptions-item>
80
+        <template slot="label">
81
+          <svg-icon slot="prefix" icon-class="remark" class="el-input__icon input-icon" />
82
+          备注
83
+        </template>
84
+        {{ carInfo.remark }}
85
+      </el-descriptions-item>
86
+    </el-descriptions>
87
+    <!-- 费用明细 -->
88
+    <el-divider></el-divider>
89
+    
90
+    <el-card>
91
+      <el-row :gutter="10" class="mb8">
92
+        <el-col :span="1.5">
93
+          <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
94
+        </el-col>
95
+        <el-col :span="1.5">
96
+          <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
97
+            @click="handleUpdate">修改</el-button>
98
+        </el-col>
99
+        <el-col :span="1.5">
100
+          <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
101
+            @click="handleDelete">删除</el-button>
102
+        </el-col>
103
+        <el-col :span="1.5">
104
+          <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
105
+        </el-col>
106
+      </el-row>
107
+      <el-table v-loading="loading" :data="expenseList" @selection-change="handleSelectionChange">
108
+        <el-table-column type="selection" width="55" align="center" />
109
+        <el-table-column type="index" width="55" align="center" label="序号" />
110
+        <el-table-column label="费用类型" align="center" prop="expenseType">
111
+          <template slot-scope="scope">
112
+            <el-tag :type="typeStyle(scope.row.expenseType)">{{ expenseTypeText(scope.row.expenseType) }}</el-tag>
113
+          </template>
114
+        </el-table-column>
115
+        <el-table-column label="费用金额" align="center" prop="expense">
116
+          <template slot-scope="scope">
117
+            {{ scope.row.expense + '元' }}
118
+          </template>
119
+        </el-table-column>
120
+        <el-table-column label="发生日期" align="center" prop="occurDate" width="180">
121
+          <template slot-scope="scope">
122
+            {{ scope.row.occurDate }}
123
+          </template>
124
+        </el-table-column>
125
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
126
+          <template slot-scope="scope">
127
+            <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
128
+              v-hasPermi="['oa:carExpense:edit']">修改</el-button>
129
+            <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
130
+              v-hasPermi="['oa:carExpense:remove']">删除</el-button>
131
+          </template>
132
+        </el-table-column>
133
+      </el-table>
134
+      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
135
+        @pagination="getList" />
136
+    </el-card>
137
+    <!-- 添加明细 -->
138
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
139
+      <el-form ref="expenseForm" :model="form" :rules="rules" label-width="100px">
140
+        <el-form-item label="费用类型" prop="expenseType">
141
+          <el-select v-model="form.expenseType" placeholder="请选择" clearable>
142
+            <el-option label="保险费" value="0"></el-option>
143
+            <el-option label="维修/保养费" value="1"></el-option>
144
+            <el-option label="轮胎费" value="2"></el-option>
145
+          </el-select>
146
+        </el-form-item>
147
+        <el-form-item label="费用金额" prop="expense">
148
+          <el-input v-model="form.expense" placeholder="请输入费用金额" />
149
+        </el-form-item>
150
+        <el-form-item label="发生日期" prop="occurDate">
151
+          <el-date-picker clearable v-model="form.occurDate" type="date" value-format="yyyy-MM-dd"
152
+            placeholder="请选择发生日期">
153
+          </el-date-picker>
154
+        </el-form-item>
155
+      </el-form>
156
+      <div slot="footer" class="dialog-footer">
157
+        <el-button type="primary" @click="submitForm">确 定</el-button>
158
+        <el-button @click="cancel">取 消</el-button>
159
+      </div>
160
+    </el-dialog>
161
+  </div>
162
+</template>
163
+
164
+<script>
165
+import { getCar } from '@/api/oa/car/car.js'
166
+import { listCarExpense, getCarExpense, delCarExpense, addCarExpense, updateCarExpense } from "@/api/oa/car/carExpense";
167
+export default {
168
+  data() {
169
+    let validateExpense = (rule, value, callback) => {
170
+      setTimeout(() => {
171
+        if (!value) {
172
+          return callback(new Error('请输入金额'));
173
+        }
174
+        if (!this.isNumber(Number(value))) {
175
+          callback(new Error('请输入数字值'));
176
+        } else {
177
+          callback();
178
+        }
179
+      }, 100)
180
+    }
181
+    return {
182
+      column: 4,
183
+      carInfo: {},
184
+      expenseList: [],
185
+      queryParams: {
186
+        pageNum: 1,
187
+        pageSize: 10,
188
+      },
189
+      total: 0,
190
+      multiple: true,
191
+      // 选中数组
192
+      ids: [],
193
+      // 非单个禁用
194
+      single: true,
195
+      title: '',
196
+      open: false,
197
+      form: {},
198
+      rules: {
199
+        expenseType: [
200
+          { required: true, message: '请选择费用类型', trigger: 'change' }
201
+        ],
202
+        expense: [
203
+          { validator: validateExpense, required: true, trigger: 'blur' },
204
+        ],
205
+        occurDate: [
206
+          { required: true, message: '请选择发生日期', trigger: 'change' },
207
+        ],
208
+      },
209
+      loading: false
210
+    }
211
+  },
212
+  created() {
213
+    if (this.$route.query) {
214
+      getCar(this.$route.query.carId).then(res => {
215
+        console.log(res);
216
+        this.carInfo = res.data;
217
+      })
218
+      this.getList();
219
+    }
220
+    if (this.$store.state.app.device == 'desktop') {
221
+
222
+    } else {
223
+      this.column = 1
224
+    }
225
+  },
226
+  methods: {
227
+    getList() {
228
+      this.queryParams.carId = this.$route.query.carId
229
+      listCarExpense(this.queryParams).then(res => {
230
+        console.log(res);
231
+        this.expenseList = res.rows;
232
+        this.total = res.total;
233
+      })
234
+    },
235
+    goBack() {
236
+      this.$router.push({ path: '/car' });
237
+    },
238
+    /** 搜索按钮操作 */
239
+    handleQuery() {
240
+      this.queryParams.pageNum = 1;
241
+      this.getList();
242
+    },
243
+    // 多选框选中数据
244
+    handleSelectionChange(selection) {
245
+      this.ids = selection.map(item => item.carExpenseId)
246
+      this.single = selection.length !== 1
247
+      this.multiple = !selection.length
248
+    },
249
+    handleAdd() {
250
+      this.reset();
251
+      this.open = true;
252
+      this.title = "添加车辆明细";
253
+    },
254
+    handleUpdate(row) {
255
+      this.reset();
256
+      const carExpenseId = row.carExpenseId || this.ids
257
+      getCarExpense(carExpenseId).then(response => {
258
+        this.form = response.data;
259
+        this.open = true;
260
+        this.title = "修改车辆明细";
261
+      });
262
+    },
263
+    handleDelete(row) {
264
+      debugger
265
+      const carExpenseIds = row.carExpenseId || this.ids;
266
+      this.$modal.confirm('是否确认删除车辆费用编号为"' + carExpenseIds + '"的数据项?').then(function () {
267
+        return delCarExpense(carExpenseIds);
268
+      }).then(() => {
269
+        this.getList();
270
+        this.$modal.msgSuccess("删除成功");
271
+      }).catch(() => { });
272
+    },
273
+    handleExport() {
274
+      this.download('oa/carExpense/export', {
275
+        ...this.queryParams
276
+      }, `carExpense_${new Date().getTime()}.xlsx`)
277
+    },
278
+    // 表单重置
279
+    reset() {
280
+      this.form = {
281
+        carExpenseId: null,
282
+        carId: null,
283
+        expenseType: null,
284
+        expense: null,
285
+        occurDate: null
286
+      };
287
+      this.resetForm("expenseForm");
288
+    },
289
+    submitForm() {
290
+      this.$refs["expenseForm"].validate(valid => {
291
+        if (valid) {
292
+          this.form.carId = this.$route.query.carId
293
+          if (this.form.carExpenseId != null) {
294
+            updateCarExpense(this.form).then(response => {
295
+              this.$modal.msgSuccess("修改成功");
296
+              this.open = false;
297
+              this.getList();
298
+            });
299
+          } else {
300
+            addCarExpense(this.form).then(response => {
301
+              this.$modal.msgSuccess("新增成功");
302
+              this.open = false;
303
+              this.getList();
304
+            });
305
+          }
306
+        }
307
+      });
308
+    },
309
+    cancel() {
310
+      this.open = false;
311
+      this.reset();
312
+    },
313
+    isNumber(value) {
314
+      return typeof value === 'number' && /^\d+(\.\d+)?$/.test(value);
315
+    },
316
+    expenseTypeText(row) {
317
+      if (row == '0') {
318
+        return '保险费'
319
+      }
320
+      if (row == '1') {
321
+        return '维修/保养费'
322
+      }
323
+      if (row == '2') {
324
+        return '轮胎费'
325
+      }
326
+    },
327
+    typeStyle(row) {
328
+      if (row == '0') {
329
+        return 'primary'
330
+      }
331
+      if (row == '1') {
332
+        return 'warning'
333
+      }
334
+      if (row == '2') {
335
+        return 'success'
336
+      }
337
+    }
338
+  },
339
+}
340
+</script>
341
+
342
+<style lang="scss" scoped>
343
+.header {
344
+  position: relative;
345
+  text-align: center;
346
+
347
+  .back {
348
+    position: absolute;
349
+    left: 12px;
350
+    top: -10px;
351
+  }
352
+}
353
+
354
+.descriptions {
355
+  padding: 20px 50px;
356
+}
357
+
358
+
359
+::v-deep .el-descriptions-item__label.is-bordered-label {
360
+  color: #121212;
361
+  background: rgba($color: #46a6ff, $alpha: 0.1);
362
+  width: 200px;
363
+}
364
+
365
+::v-deep .el-descriptions .is-bordered .el-descriptions-item__cell {
366
+  border: 1px solid #2d3f62;
367
+}
368
+</style>

+ 18
- 5
oa-ui/src/views/oa/car/index.vue Ver arquivo

@@ -41,7 +41,7 @@
41 41
       <el-table-column label="品牌" align="center" prop="brand" />
42 42
       <el-table-column label="车型" align="center" prop="series" />
43 43
       <el-table-column label="购置时间" align="center" prop="acquisitionTime" />
44
-      <el-table-column label="是否为租车" align="center" prop="isRent" >
44
+      <el-table-column label="是否为租车" align="center" prop="isRent">
45 45
         <template slot-scope="scope">
46 46
           {{ scope.row.isRent == "0" ? "否" : "是" }}
47 47
         </template>
@@ -51,20 +51,22 @@
51 51
           {{ scope.row.cost + '万元' }}
52 52
         </template>
53 53
       </el-table-column>
54
-      <el-table-column label="预计使用年限" align="center" prop="expectLife" >        
54
+      <el-table-column label="预计使用年限" align="center" prop="expectLife">
55 55
         <template slot-scope="scope">
56 56
           {{ scope.row.expectLife + '年' }}
57 57
         </template>
58 58
       </el-table-column>
59
-      <el-table-column label="预计行驶里程" align="center" prop="expectKm" >        
59
+      <el-table-column label="预计行驶里程" align="center" prop="expectKm">
60 60
         <template slot-scope="scope">
61 61
           {{ scope.row.expectKm + '万千米' }}
62 62
         </template>
63 63
       </el-table-column>
64 64
       <el-table-column label="单日成本" align="center" prop="dayCost" />
65
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
65
+      <el-table-column label="操作" align="center" width="200px">
66 66
 
67 67
         <template slot-scope="scope">
68
+          <el-button size="mini" type="text" icon="el-icon-plus" @click="handleAddDetail(scope.row)"
69
+            v-hasPermi="['oa:car:edit']">添加明细</el-button>
68 70
           <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
69 71
             v-hasPermi="['oa:car:edit']">修改</el-button>
70 72
           <el-button size="mini" type="text" icon="el-icon-delete" style="color: #fc0000;"
@@ -168,7 +170,8 @@ export default {
168 170
       // 表单校验
169 171
       rules: {
170 172
       },
171
-      driverList: []
173
+      driverList: [],
174
+      detailOpen: false
172 175
     };
173 176
   },
174 177
   created() {
@@ -240,6 +243,16 @@ export default {
240 243
         this.title = "修改车辆信息";
241 244
       });
242 245
     },
246
+    // 新增明细按钮
247
+    handleAddDetail(row) {
248
+      console.log(row);
249
+      this.$router.push({
250
+        path: '/car/expense',
251
+        query: {
252
+          carId: row.carId,
253
+        }
254
+      })
255
+    },
243 256
     /** 提交按钮 */
244 257
     submitForm() {
245 258
       this.$refs["form"].validate(valid => {

+ 0
- 285
oa-ui/src/views/oa/carExpense/index.vue Ver arquivo

@@ -1,285 +0,0 @@
1
-<template>
2
-  <div class="app-container">
3
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
4
-      <el-form-item label="车辆id" prop="carId">
5
-        <el-input
6
-          v-model="queryParams.carId"
7
-          placeholder="请输入车辆id"
8
-          clearable
9
-          @keyup.enter.native="handleQuery"
10
-        />
11
-      </el-form-item>
12
-      <el-form-item label="费用金额" prop="expense">
13
-        <el-input
14
-          v-model="queryParams.expense"
15
-          placeholder="请输入费用金额"
16
-          clearable
17
-          @keyup.enter.native="handleQuery"
18
-        />
19
-      </el-form-item>
20
-      <el-form-item label="发生日期" prop="occurrDate">
21
-        <el-date-picker clearable
22
-          v-model="queryParams.occurrDate"
23
-          type="date"
24
-          value-format="yyyy-MM-dd"
25
-          placeholder="请选择发生日期">
26
-        </el-date-picker>
27
-      </el-form-item>
28
-      <el-form-item>
29
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
30
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
31
-      </el-form-item>
32
-    </el-form>
33
-
34
-    <el-row :gutter="10" class="mb8">
35
-      <el-col :span="1.5">
36
-        <el-button
37
-          type="primary"
38
-          plain
39
-          icon="el-icon-plus"
40
-          size="mini"
41
-          @click="handleAdd"
42
-          v-hasPermi="['oa:carExpense:add']"
43
-        >新增</el-button>
44
-      </el-col>
45
-      <el-col :span="1.5">
46
-        <el-button
47
-          type="success"
48
-          plain
49
-          icon="el-icon-edit"
50
-          size="mini"
51
-          :disabled="single"
52
-          @click="handleUpdate"
53
-          v-hasPermi="['oa:carExpense:edit']"
54
-        >修改</el-button>
55
-      </el-col>
56
-      <el-col :span="1.5">
57
-        <el-button
58
-          type="danger"
59
-          plain
60
-          icon="el-icon-delete"
61
-          size="mini"
62
-          :disabled="multiple"
63
-          @click="handleDelete"
64
-          v-hasPermi="['oa:carExpense:remove']"
65
-        >删除</el-button>
66
-      </el-col>
67
-      <el-col :span="1.5">
68
-        <el-button
69
-          type="warning"
70
-          plain
71
-          icon="el-icon-download"
72
-          size="mini"
73
-          @click="handleExport"
74
-          v-hasPermi="['oa:carExpense:export']"
75
-        >导出</el-button>
76
-      </el-col>
77
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
78
-    </el-row>
79
-
80
-    <el-table v-loading="loading" :data="carExpenseList" @selection-change="handleSelectionChange">
81
-      <el-table-column type="selection" width="55" align="center" />
82
-      <el-table-column label="车辆费用id" align="center" prop="carExpenseId" />
83
-      <el-table-column label="车辆id" align="center" prop="carId" />
84
-      <el-table-column label="费用类型" align="center" prop="expenseType" />
85
-      <el-table-column label="费用金额" align="center" prop="expense" />
86
-      <el-table-column label="发生日期" align="center" prop="occurrDate" width="180">
87
-        <template slot-scope="scope">
88
-          <span>{{ parseTime(scope.row.occurrDate, '{y}-{m}-{d}') }}</span>
89
-        </template>
90
-      </el-table-column>
91
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
92
-        <template slot-scope="scope">
93
-          <el-button
94
-            size="mini"
95
-            type="text"
96
-            icon="el-icon-edit"
97
-            @click="handleUpdate(scope.row)"
98
-            v-hasPermi="['oa:carExpense:edit']"
99
-          >修改</el-button>
100
-          <el-button
101
-            size="mini"
102
-            type="text"
103
-            icon="el-icon-delete"
104
-            @click="handleDelete(scope.row)"
105
-            v-hasPermi="['oa:carExpense:remove']"
106
-          >删除</el-button>
107
-        </template>
108
-      </el-table-column>
109
-    </el-table>
110
-    
111
-    <pagination
112
-      v-show="total>0"
113
-      :total="total"
114
-      :page.sync="queryParams.pageNum"
115
-      :limit.sync="queryParams.pageSize"
116
-      @pagination="getList"
117
-    />
118
-
119
-    <!-- 添加或修改cmc车辆费用对话框 -->
120
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
121
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
122
-        <el-form-item label="车辆id" prop="carId">
123
-          <el-input v-model="form.carId" placeholder="请输入车辆id" />
124
-        </el-form-item>
125
-        <el-form-item label="费用金额" prop="expense">
126
-          <el-input v-model="form.expense" placeholder="请输入费用金额" />
127
-        </el-form-item>
128
-        <el-form-item label="发生日期" prop="occurrDate">
129
-          <el-date-picker clearable
130
-            v-model="form.occurrDate"
131
-            type="date"
132
-            value-format="yyyy-MM-dd"
133
-            placeholder="请选择发生日期">
134
-          </el-date-picker>
135
-        </el-form-item>
136
-      </el-form>
137
-      <div slot="footer" class="dialog-footer">
138
-        <el-button type="primary" @click="submitForm">确 定</el-button>
139
-        <el-button @click="cancel">取 消</el-button>
140
-      </div>
141
-    </el-dialog>
142
-  </div>
143
-</template>
144
-
145
-<script>
146
-import { listCarExpense, getCarExpense, delCarExpense, addCarExpense, updateCarExpense } from "@/api/oa/car/carExpense";
147
-
148
-export default {
149
-  name: "CarExpense",
150
-  data() {
151
-    return {
152
-      // 遮罩层
153
-      loading: true,
154
-      // 选中数组
155
-      ids: [],
156
-      // 非单个禁用
157
-      single: true,
158
-      // 非多个禁用
159
-      multiple: true,
160
-      // 显示搜索条件
161
-      showSearch: true,
162
-      // 总条数
163
-      total: 0,
164
-      // cmc车辆费用表格数据
165
-      carExpenseList: [],
166
-      // 弹出层标题
167
-      title: "",
168
-      // 是否显示弹出层
169
-      open: false,
170
-      // 查询参数
171
-      queryParams: {
172
-        pageNum: 1,
173
-        pageSize: 10,
174
-        carId: null,
175
-        expenseType: null,
176
-        expense: null,
177
-        occurrDate: null
178
-      },
179
-      // 表单参数
180
-      form: {},
181
-      // 表单校验
182
-      rules: {
183
-      }
184
-    };
185
-  },
186
-  created() {
187
-    this.getList();
188
-  },
189
-  methods: {
190
-    /** 查询cmc车辆费用列表 */
191
-    getList() {
192
-      this.loading = true;
193
-      listCarExpense(this.queryParams).then(response => {
194
-        this.carExpenseList = response.rows;
195
-        this.total = response.total;
196
-        this.loading = false;
197
-      });
198
-    },
199
-    // 取消按钮
200
-    cancel() {
201
-      this.open = false;
202
-      this.reset();
203
-    },
204
-    // 表单重置
205
-    reset() {
206
-      this.form = {
207
-        carExpenseId: null,
208
-        carId: null,
209
-        expenseType: null,
210
-        expense: null,
211
-        occurrDate: null
212
-      };
213
-      this.resetForm("form");
214
-    },
215
-    /** 搜索按钮操作 */
216
-    handleQuery() {
217
-      this.queryParams.pageNum = 1;
218
-      this.getList();
219
-    },
220
-    /** 重置按钮操作 */
221
-    resetQuery() {
222
-      this.resetForm("queryForm");
223
-      this.handleQuery();
224
-    },
225
-    // 多选框选中数据
226
-    handleSelectionChange(selection) {
227
-      this.ids = selection.map(item => item.carExpenseId)
228
-      this.single = selection.length!==1
229
-      this.multiple = !selection.length
230
-    },
231
-    /** 新增按钮操作 */
232
-    handleAdd() {
233
-      this.reset();
234
-      this.open = true;
235
-      this.title = "添加cmc车辆费用";
236
-    },
237
-    /** 修改按钮操作 */
238
-    handleUpdate(row) {
239
-      this.reset();
240
-      const carExpenseId = row.carExpenseId || this.ids
241
-      getCarExpense(carExpenseId).then(response => {
242
-        this.form = response.data;
243
-        this.open = true;
244
-        this.title = "修改cmc车辆费用";
245
-      });
246
-    },
247
-    /** 提交按钮 */
248
-    submitForm() {
249
-      this.$refs["form"].validate(valid => {
250
-        if (valid) {
251
-          if (this.form.carExpenseId != null) {
252
-            updateCarExpense(this.form).then(response => {
253
-              this.$modal.msgSuccess("修改成功");
254
-              this.open = false;
255
-              this.getList();
256
-            });
257
-          } else {
258
-            addCarExpense(this.form).then(response => {
259
-              this.$modal.msgSuccess("新增成功");
260
-              this.open = false;
261
-              this.getList();
262
-            });
263
-          }
264
-        }
265
-      });
266
-    },
267
-    /** 删除按钮操作 */
268
-    handleDelete(row) {
269
-      const carExpenseIds = row.carExpenseId || this.ids;
270
-      this.$modal.confirm('是否确认删除cmc车辆费用编号为"' + carExpenseIds + '"的数据项?').then(function() {
271
-        return delCarExpense(carExpenseIds);
272
-      }).then(() => {
273
-        this.getList();
274
-        this.$modal.msgSuccess("删除成功");
275
-      }).catch(() => {});
276
-    },
277
-    /** 导出按钮操作 */
278
-    handleExport() {
279
-      this.download('oa/carExpense/export', {
280
-        ...this.queryParams
281
-      }, `carExpense_${new Date().getTime()}.xlsx`)
282
-    }
283
-  }
284
-};
285
-</script>

Carregando…
Cancelar
Salvar