|
@@ -32,7 +32,7 @@
|
32
|
32
|
<svg-icon slot="prefix" icon-class="TeenyiconsYenSolid" class="el-input__icon input-icon" />
|
33
|
33
|
购买价格
|
34
|
34
|
</template>
|
35
|
|
- {{ deviceInfo.cost }}
|
|
35
|
+ {{ deviceInfo.cost }} 元
|
36
|
36
|
</el-descriptions-item>
|
37
|
37
|
<el-descriptions-item>
|
38
|
38
|
<template slot="label">
|
|
@@ -95,7 +95,7 @@
|
95
|
95
|
<svg-icon slot="prefix" icon-class="dept" class="el-input__icon input-icon" />
|
96
|
96
|
管理部门
|
97
|
97
|
</template>
|
98
|
|
- {{ deviceInfo.manageDept }}
|
|
98
|
+ {{ deviceInfo.manageDeptName }}
|
99
|
99
|
</el-descriptions-item>
|
100
|
100
|
<el-descriptions-item>
|
101
|
101
|
<template slot="label">
|
|
@@ -108,7 +108,7 @@
|
108
|
108
|
<!-- 费用明细 -->
|
109
|
109
|
<el-divider></el-divider>
|
110
|
110
|
|
111
|
|
- <el-card>
|
|
111
|
+ <el-deviced>
|
112
|
112
|
<div slot="header" class="clearfix">
|
113
|
113
|
<h3>设备使用记录</h3>
|
114
|
114
|
</div>
|
|
@@ -133,37 +133,34 @@
|
133
|
133
|
<el-table-column type="selection" width="55" align="center" />
|
134
|
134
|
<el-table-column type="index" width="55" align="center" label="序号" />
|
135
|
135
|
<el-table-column label="项目编号" align="center" prop="projectNumber">
|
136
|
|
- <template slot-scope="scope">
|
137
|
|
- <el-tag :type="typeStyle(scope.row.expenseType)">{{ expenseTypeText(scope.row.expenseType) }}</el-tag>
|
138
|
|
- </template>
|
139
|
136
|
</el-table-column>
|
140
|
137
|
<el-table-column label="项目名称" align="center" prop="projectName">
|
141
|
138
|
<template slot-scope="scope">
|
142
|
|
- {{ scope.row.expense }}
|
|
139
|
+ {{ scope.row.projectName }}
|
143
|
140
|
</template>
|
144
|
141
|
</el-table-column>
|
145
|
|
- <el-table-column label="申请时间" align="center" prop="expense">
|
|
142
|
+ <el-table-column label="申请时间" align="center" prop="beginDate">
|
146
|
143
|
<template slot-scope="scope">
|
147
|
|
- {{ scope.row.expense }}
|
|
144
|
+ {{ scope.row.beginDate }}
|
148
|
145
|
</template>
|
149
|
146
|
</el-table-column>
|
150
|
|
- <el-table-column label="归还时间" align="center" prop="occurDate" width="180">
|
|
147
|
+ <el-table-column label="归还时间" align="center" prop="returnDate" width="180">
|
151
|
148
|
<template slot-scope="scope">
|
152
|
|
- {{ scope.row.occurDate }}
|
|
149
|
+ {{ scope.row.returnDate }}
|
153
|
150
|
</template>
|
154
|
151
|
</el-table-column>
|
155
|
152
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
156
|
153
|
<template slot-scope="scope">
|
157
|
154
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
158
|
|
- v-hasPermi="['oa:carExpense:edit']">修改</el-button>
|
|
155
|
+ v-hasPermi="['oa:deviceApproval:edit']">修改</el-button>
|
159
|
156
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
160
|
|
- v-hasPermi="['oa:carExpense:remove']">删除</el-button>
|
|
157
|
+ v-hasPermi="['oa:deviceApproval:remove']">删除</el-button>
|
161
|
158
|
</template>
|
162
|
159
|
</el-table-column>
|
163
|
160
|
</el-table>
|
164
|
161
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
165
|
162
|
@pagination="getList" />
|
166
|
|
- </el-card>
|
|
163
|
+ </el-deviced>
|
167
|
164
|
<!-- 添加明细 -->
|
168
|
165
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
169
|
166
|
<el-form ref="expenseForm" :model="form" :rules="rules" label-width="100px">
|
|
@@ -192,12 +189,11 @@
|
192
|
189
|
</template>
|
193
|
190
|
|
194
|
191
|
<script>
|
195
|
|
-import { getCar } from '@/api/oa/car/car.js'
|
196
|
192
|
import { getDevice } from '@/api/oa/device/device.js'
|
197
|
|
-import { listCarExpense, getCarExpense, delCarExpense, addCarExpense, updateCarExpense } from "@/api/oa/car/carExpense";
|
|
193
|
+import { listDeviceApproval, getDeviceApproval, delDeviceApproval, addDeviceApproval, updateDeviceApproval } from "@/api/oa/device/deviceApproval";
|
198
|
194
|
export default {
|
199
|
195
|
data() {
|
200
|
|
- let validateExpense = (rule, value, callback) => {
|
|
196
|
+ let validateApproval = (rule, value, callback) => {
|
201
|
197
|
setTimeout(() => {
|
202
|
198
|
if (!value) {
|
203
|
199
|
return callback(new Error('请输入金额'));
|
|
@@ -231,7 +227,7 @@ export default {
|
231
|
227
|
{ required: true, message: '请选择费用类型', trigger: 'change' }
|
232
|
228
|
],
|
233
|
229
|
expense: [
|
234
|
|
- { validator: validateExpense, required: true, trigger: 'blur' },
|
|
230
|
+ { validator: validateApproval, required: true, trigger: 'blur' },
|
235
|
231
|
],
|
236
|
232
|
occurDate: [
|
237
|
233
|
{ required: true, message: '请选择发生日期', trigger: 'change' },
|
|
@@ -256,8 +252,8 @@ export default {
|
256
|
252
|
},
|
257
|
253
|
methods: {
|
258
|
254
|
getList() {
|
259
|
|
- this.queryParams.carId = this.$route.query.carId
|
260
|
|
- listCarExpense(this.queryParams).then(res => {
|
|
255
|
+ this.queryParams.devices = this.$route.query.deviceId
|
|
256
|
+ listDeviceApproval(this.queryParams).then(res => {
|
261
|
257
|
console.log(res);
|
262
|
258
|
this.expenseList = res.rows;
|
263
|
259
|
this.total = res.total;
|
|
@@ -275,7 +271,7 @@ export default {
|
275
|
271
|
},
|
276
|
272
|
// 多选框选中数据
|
277
|
273
|
handleSelectionChange(selection) {
|
278
|
|
- this.ids = selection.map(item => item.carExpenseId)
|
|
274
|
+ this.ids = selection.map(item => item.deviceApprovalId)
|
279
|
275
|
this.single = selection.length !== 1
|
280
|
276
|
this.multiple = !selection.length
|
281
|
277
|
},
|
|
@@ -286,8 +282,8 @@ export default {
|
286
|
282
|
},
|
287
|
283
|
handleUpdate(row) {
|
288
|
284
|
this.reset();
|
289
|
|
- const carExpenseId = row.carExpenseId || this.ids
|
290
|
|
- getCarExpense(carExpenseId).then(response => {
|
|
285
|
+ const deviceApprovalId = row.deviceApprovalId || this.ids
|
|
286
|
+ getDeviceApproval(deviceApprovalId).then(response => {
|
291
|
287
|
this.form = response.data;
|
292
|
288
|
this.open = true;
|
293
|
289
|
this.title = "修改车辆明细";
|
|
@@ -295,24 +291,24 @@ export default {
|
295
|
291
|
},
|
296
|
292
|
handleDelete(row) {
|
297
|
293
|
debugger
|
298
|
|
- const carExpenseIds = row.carExpenseId || this.ids;
|
299
|
|
- this.$modal.confirm('是否确认删除车辆费用编号为"' + carExpenseIds + '"的数据项?').then(function () {
|
300
|
|
- return delCarExpense(carExpenseIds);
|
|
294
|
+ const deviceApprovalIds = row.deviceApprovalId || this.ids;
|
|
295
|
+ this.$modal.confirm('是否确认删除车辆费用编号为"' + deviceApprovalIds + '"的数据项?').then(function () {
|
|
296
|
+ return delDeviceApproval(deviceApprovalIds);
|
301
|
297
|
}).then(() => {
|
302
|
298
|
this.getList();
|
303
|
299
|
this.$modal.msgSuccess("删除成功");
|
304
|
300
|
}).catch(() => { });
|
305
|
301
|
},
|
306
|
302
|
handleExport() {
|
307
|
|
- this.download('oa/carExpense/export', {
|
|
303
|
+ this.download('oa/deviceApproval/export', {
|
308
|
304
|
...this.queryParams
|
309
|
|
- }, `carExpense_${new Date().getTime()}.xlsx`)
|
|
305
|
+ }, `deviceApproval_${new Date().getTime()}.xlsx`)
|
310
|
306
|
},
|
311
|
307
|
// 表单重置
|
312
|
308
|
reset() {
|
313
|
309
|
this.form = {
|
314
|
|
- carExpenseId: null,
|
315
|
|
- carId: null,
|
|
310
|
+ deviceApprovalId: null,
|
|
311
|
+ deviceId: null,
|
316
|
312
|
expenseType: null,
|
317
|
313
|
expense: null,
|
318
|
314
|
occurDate: null
|
|
@@ -322,15 +318,15 @@ export default {
|
322
|
318
|
submitForm() {
|
323
|
319
|
this.$refs["expenseForm"].validate(valid => {
|
324
|
320
|
if (valid) {
|
325
|
|
- this.form.carId = this.$route.query.carId
|
326
|
|
- if (this.form.carExpenseId != null) {
|
327
|
|
- updateCarExpense(this.form).then(response => {
|
|
321
|
+ this.form.deviceId = this.$route.query.deviceId
|
|
322
|
+ if (this.form.deviceApprovalId != null) {
|
|
323
|
+ updateDeviceApproval(this.form).then(response => {
|
328
|
324
|
this.$modal.msgSuccess("修改成功");
|
329
|
325
|
this.open = false;
|
330
|
326
|
this.getList();
|
331
|
327
|
});
|
332
|
328
|
} else {
|
333
|
|
- addCarExpense(this.form).then(response => {
|
|
329
|
+ addDeviceApproval(this.form).then(response => {
|
334
|
330
|
this.$modal.msgSuccess("新增成功");
|
335
|
331
|
this.open = false;
|
336
|
332
|
this.getList();
|