Browse Source

设备使用记录

lamphua 1 year ago
parent
commit
a7b3e128a3

+ 1
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceApprovalController.java View File

117
         cmcDeviceApproval.setApplier(getLoginUser().getUserId());
117
         cmcDeviceApproval.setApplier(getLoginUser().getUserId());
118
         cmcDeviceApproval.setDept(getLoginUser().getDeptId());
118
         cmcDeviceApproval.setDept(getLoginUser().getDeptId());
119
         cmcDeviceApproval.setApplyDate(DateUtils.getNowDate());
119
         cmcDeviceApproval.setApplyDate(DateUtils.getNowDate());
120
-        cmcDeviceApproval.setProjectId(formDataJson.getString("projectNumber"));
120
+        cmcDeviceApproval.setProjectId(formDataJson.getInteger("projectId"));
121
         cmcDeviceApproval.setApplyReason(formDataJson.getString("applyReason"));
121
         cmcDeviceApproval.setApplyReason(formDataJson.getString("applyReason"));
122
         cmcDeviceApproval.setBeginDate(formDataJson.getDate("beginDate"));
122
         cmcDeviceApproval.setBeginDate(formDataJson.getDate("beginDate"));
123
         cmcDeviceApproval.setEndDate(formDataJson.getDate("endDate"));
123
         cmcDeviceApproval.setEndDate(formDataJson.getDate("endDate"));

+ 13
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDevice.java View File

83
     @Excel(name = "管理部门")
83
     @Excel(name = "管理部门")
84
     private Long manageDept;
84
     private Long manageDept;
85
 
85
 
86
+    /** 管理部门 */
87
+    @Excel(name = "管理部门")
88
+    private String manageDeptName;
89
+
86
     public void setDeviceId(Integer deviceId)
90
     public void setDeviceId(Integer deviceId)
87
     {
91
     {
88
         this.deviceId = deviceId;
92
         this.deviceId = deviceId;
227
     {
231
     {
228
         return manageDept;
232
         return manageDept;
229
     }
233
     }
234
+    public void setManageDeptName(String manageDeptName)
235
+    {
236
+        this.manageDeptName = manageDeptName;
237
+    }
238
+
239
+    public String getManageDeptName()
240
+    {
241
+        return manageDeptName;
242
+    }
230
 
243
 
231
     @Override
244
     @Override
232
     public String toString() {
245
     public String toString() {

+ 29
- 3
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceApproval.java View File

33
     @Excel(name = "设备id")
33
     @Excel(name = "设备id")
34
     private String devices;
34
     private String devices;
35
 
35
 
36
+    /** 项目id */
37
+    @Excel(name = "项目id")
38
+    private Integer projectId;
39
+
36
     /** 项目编号 */
40
     /** 项目编号 */
37
     @Excel(name = "项目编号")
41
     @Excel(name = "项目编号")
38
-    private String projectId;
42
+    private String projectNumber;
43
+
44
+    /** 项目名称 */
45
+    @Excel(name = "项目名称")
46
+    private String projectName;
39
 
47
 
40
     /** 申领事由 */
48
     /** 申领事由 */
41
     @Excel(name = "申领事由")
49
     @Excel(name = "申领事由")
137
     {
145
     {
138
         return devices;
146
         return devices;
139
     }
147
     }
140
-    public void setProjectId(String projectId) 
148
+    public void setProjectId(Integer projectId)
141
     {
149
     {
142
         this.projectId = projectId;
150
         this.projectId = projectId;
143
     }
151
     }
144
 
152
 
145
-    public String getProjectId() 
153
+    public Integer getProjectId()
146
     {
154
     {
147
         return projectId;
155
         return projectId;
148
     }
156
     }
157
+    public void setProjectNumber(String projectNumber)
158
+    {
159
+        this.projectNumber = projectNumber;
160
+    }
161
+
162
+    public String getProjectNumber()
163
+    {
164
+        return projectNumber;
165
+    }
166
+    public void setProjectName(String projectName)
167
+    {
168
+        this.projectName = projectName;
169
+    }
170
+
171
+    public String getProjectName()
172
+    {
173
+        return projectName;
174
+    }
149
     public void setApplyReason(String applyReason) 
175
     public void setApplyReason(String applyReason) 
150
     {
176
     {
151
         this.applyReason = applyReason;
177
         this.applyReason = applyReason;

+ 25
- 21
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml View File

10
         <result property="dept"    column="dept"    />
10
         <result property="dept"    column="dept"    />
11
         <result property="devices"    column="devices"    />
11
         <result property="devices"    column="devices"    />
12
         <result property="projectId"    column="project_id"    />
12
         <result property="projectId"    column="project_id"    />
13
+        <result property="projectNumber"    column="project_number"    />
14
+        <result property="projectName"    column="project_name"    />
13
         <result property="applyReason"    column="apply_reason"    />
15
         <result property="applyReason"    column="apply_reason"    />
14
         <result property="applyDate"    column="apply_date"    />
16
         <result property="applyDate"    column="apply_date"    />
15
         <result property="returnDate"    column="return_date"    />
17
         <result property="returnDate"    column="return_date"    />
28
     </resultMap>
30
     </resultMap>
29
 
31
 
30
     <sql id="selectCmcDeviceApprovalVo">
32
     <sql id="selectCmcDeviceApprovalVo">
31
-        select device_apply_id, applier, dept, devices, project_id, apply_reason, apply_date, return_date, begin_date, begin_halfday, end_date, end_halfday, days, dept_user_id, dept_comment, manager_user_id, manager_comment, dispatcher, dispatch_comment, estimate_cost from cmc_device_approval
33
+        select da.device_apply_id, da.applier, da.dept, da.devices, da.project_id, p.project_number, p.project_name, da.apply_reason, da.apply_date, da.return_date, da.begin_date, da.begin_halfday, da.end_date, da.end_halfday, da.days, da.dept_user_id, da.dept_comment, da.manager_user_id, da.manager_comment, da.dispatcher, da.dispatch_comment, da.estimate_cost from cmc_device_approval as da left join cmc_project as p
32
     </sql>
34
     </sql>
33
 
35
 
34
     <select id="selectCmcDeviceApprovalList" parameterType="CmcDeviceApproval" resultMap="CmcDeviceApprovalResult">
36
     <select id="selectCmcDeviceApprovalList" parameterType="CmcDeviceApproval" resultMap="CmcDeviceApprovalResult">
35
         <include refid="selectCmcDeviceApprovalVo"/>
37
         <include refid="selectCmcDeviceApprovalVo"/>
38
+        on da.project_id = p.project_id
36
         <where>  
39
         <where>  
37
-            <if test="applier != null "> and applier = #{applier}</if>
38
-            <if test="dept != null "> and dept = #{dept}</if>
39
-            <if test="devices != null  and devices != ''"> and devices = #{devices}</if>
40
-            <if test="projectId != null  and projectId != ''"> and project_id = #{projectId}</if>
41
-            <if test="applyReason != null  and applyReason != ''"> and apply_reason = #{applyReason}</if>
42
-            <if test="applyDate != null "> and apply_date = #{applyDate}</if>
43
-            <if test="returnDate != null "> and return_date = #{returnDate}</if>
44
-            <if test="beginDate != null "> and begin_date = #{beginDate}</if>
45
-            <if test="beginHalfday != null  and beginHalfday != ''"> and begin_halfday = #{beginHalfday}</if>
46
-            <if test="endDate != null "> and end_date = #{endDate}</if>
47
-            <if test="endHalfday != null  and endHalfday != ''"> and end_halfday = #{endHalfday}</if>
48
-            <if test="days != null "> and days = #{days}</if>
49
-            <if test="deptUserId != null "> and dept_user_id = #{deptUserId}</if>
50
-            <if test="deptComment != null  and deptComment != ''"> and dept_comment = #{deptComment}</if>
51
-            <if test="managerUserId != null "> and manager_user_id = #{managerUserId}</if>
52
-            <if test="managerComment != null  and managerComment != ''"> and manager_comment = #{managerComment}</if>
53
-            <if test="dispatcher != null "> and dispatcher = #{dispatcher}</if>
54
-            <if test="dispatchComment != null  and dispatchComment != ''"> and dispatch_comment = #{dispatchComment}</if>
55
-            <if test="estimateCost != null "> and estimate_cost = #{estimateCost}</if>
40
+            <if test="applier != null "> and da.applier = #{applier}</if>
41
+            <if test="dept != null "> and da.dept = #{dept}</if>
42
+            <if test="devices != null  and devices != ''"> and da.devices = #{devices}</if>
43
+            <if test="projectId != null  and projectId != ''"> and da.project_id = #{projectId}</if>
44
+            <if test="applyReason != null  and applyReason != ''"> and da.apply_reason = #{applyReason}</if>
45
+            <if test="applyDate != null "> and da.apply_date = #{applyDate}</if>
46
+            <if test="returnDate != null "> and da.return_date = #{returnDate}</if>
47
+            <if test="beginDate != null "> and da.begin_date = #{beginDate}</if>
48
+            <if test="beginHalfday != null  and beginHalfday != ''"> and da.begin_halfday = #{beginHalfday}</if>
49
+            <if test="endDate != null "> and da.end_date = #{endDate}</if>
50
+            <if test="endHalfday != null  and endHalfday != ''"> and da.end_halfday = #{endHalfday}</if>
51
+            <if test="days != null "> and da.days = #{days}</if>
52
+            <if test="deptUserId != null "> and da.dept_user_id = #{deptUserId}</if>
53
+            <if test="deptComment != null  and deptComment != ''"> and da.dept_comment = #{deptComment}</if>
54
+            <if test="managerUserId != null "> and da.manager_user_id = #{managerUserId}</if>
55
+            <if test="managerComment != null  and managerComment != ''"> and da.manager_comment = #{managerComment}</if>
56
+            <if test="dispatcher != null "> and da.dispatcher = #{dispatcher}</if>
57
+            <if test="dispatchComment != null  and dispatchComment != ''"> and da.dispatch_comment = #{dispatchComment}</if>
58
+            <if test="estimateCost != null "> and da.estimate_cost = #{estimateCost}</if>
56
         </where>
59
         </where>
57
     </select>
60
     </select>
58
     
61
     
59
     <select id="selectCmcDeviceApprovalByDeviceApplyId" parameterType="String" resultMap="CmcDeviceApprovalResult">
62
     <select id="selectCmcDeviceApprovalByDeviceApplyId" parameterType="String" resultMap="CmcDeviceApprovalResult">
60
         <include refid="selectCmcDeviceApprovalVo"/>
63
         <include refid="selectCmcDeviceApprovalVo"/>
61
-        where device_apply_id = #{deviceApplyId}
64
+        on da.project_id = p.project_id
65
+        where da.device_apply_id = #{deviceApplyId}
62
     </select>
66
     </select>
63
         
67
         
64
     <insert id="insertCmcDeviceApproval" parameterType="CmcDeviceApproval">
68
     <insert id="insertCmcDeviceApproval" parameterType="CmcDeviceApproval">

+ 20
- 17
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceMapper.xml View File

22
         <result property="checkTime"    column="check_time"    />
22
         <result property="checkTime"    column="check_time"    />
23
         <result property="warranty"    column="warranty"    />
23
         <result property="warranty"    column="warranty"    />
24
         <result property="manageDept"    column="manage_dept"    />
24
         <result property="manageDept"    column="manage_dept"    />
25
+        <result property="manageDeptName"    column="dept_name"    />
25
     </resultMap>
26
     </resultMap>
26
 
27
 
27
     <sql id="selectCmcDeviceVo">
28
     <sql id="selectCmcDeviceVo">
28
-        select device_id, device_number, code, name, type, acquisition_time, cost, expect_life, series, brand, day_cost, place, remark, check_term, check_time, warranty, manage_dept from cmc_device
29
+        select d.device_id, d.device_number, d.code, d.name, d.type, d.acquisition_time, d.cost, d.expect_life, d.series, d.brand, d.day_cost, d.place, d.remark, d.check_term, d.check_time, d.warranty, d.manage_dept, dept.dept_name from cmc_device as d left join sys_dept as dept
29
     </sql>
30
     </sql>
30
 
31
 
31
     <select id="selectCmcDeviceList" parameterType="CmcDevice" resultMap="CmcDeviceResult">
32
     <select id="selectCmcDeviceList" parameterType="CmcDevice" resultMap="CmcDeviceResult">
32
         <include refid="selectCmcDeviceVo"/>
33
         <include refid="selectCmcDeviceVo"/>
34
+        on dept.dept_id = d.manage_dept
33
         <where>
35
         <where>
34
-            <if test="deviceNumber != null  and deviceNumber != ''"> and device_number like concat('%', #{deviceNumber}, '%')</if>
35
-            <if test="code != null  and code != ''"> and code like concat('%', #{code}, '%')</if>
36
-            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
37
-            <if test="type != null  and type != ''"> and type like concat('%', #{type}, '%')</if>
38
-            <if test="acquisitionTime != null "> and acquisition_time = #{acquisitionTime}</if>
39
-            <if test="cost != null "> and cost = #{cost}</if>
40
-            <if test="expectLife != null "> and expect_life = #{expectLife}</if>
41
-            <if test="series != null  and series != ''"> and series like concat('%', #{series}, '%')</if>
42
-            <if test="brand != null  and brand != ''"> and brand like concat('%', #{brand}, '%')</if>
43
-            <if test="dayCost != null "> and day_cost = #{dayCost}</if>
44
-            <if test="place != null  and place != ''"> and place like concat('%', #{place}, '%')</if>
45
-            <if test="checkTerm != null "> and check_term = #{checkTerm}</if>
46
-            <if test="checkTime != null "> and check_time = #{checkTime}</if>
47
-            <if test="warranty != null "> and warranty = #{warranty}</if>
48
-            <if test="manageDept != null "> and manage_dept = #{manageDept}</if>
36
+            <if test="deviceNumber != null  and deviceNumber != ''"> and d.device_number like concat('%', #{deviceNumber}, '%')</if>
37
+            <if test="code != null  and code != ''"> and d.code like concat('%', #{code}, '%')</if>
38
+            <if test="name != null  and name != ''"> and d.name like concat('%', #{name}, '%')</if>
39
+            <if test="type != null  and type != ''"> and d.type like concat('%', #{type}, '%')</if>
40
+            <if test="acquisitionTime != null "> and d.acquisition_time = #{acquisitionTime}</if>
41
+            <if test="cost != null "> and d.cost = #{cost}</if>
42
+            <if test="expectLife != null "> and d.expect_life = #{expectLife}</if>
43
+            <if test="series != null  and series != ''"> and d.series like concat('%', #{series}, '%')</if>
44
+            <if test="brand != null  and brand != ''"> and d.brand like concat('%', #{brand}, '%')</if>
45
+            <if test="dayCost != null "> and d.day_cost = #{dayCost}</if>
46
+            <if test="place != null  and place != ''"> and d.place like concat('%', #{place}, '%')</if>
47
+            <if test="checkTerm != null "> and d.check_term = #{checkTerm}</if>
48
+            <if test="checkTime != null "> and d.check_time = #{checkTime}</if>
49
+            <if test="warranty != null "> and d.warranty = #{warranty}</if>
50
+            <if test="manageDept != null "> and d.manage_dept = #{manageDept}</if>
49
         </where>
51
         </where>
50
     </select>
52
     </select>
51
 
53
 
52
     <select id="selectCmcDeviceByDeviceId" parameterType="Integer" resultMap="CmcDeviceResult">
54
     <select id="selectCmcDeviceByDeviceId" parameterType="Integer" resultMap="CmcDeviceResult">
53
         <include refid="selectCmcDeviceVo"/>
55
         <include refid="selectCmcDeviceVo"/>
54
-        where device_id = #{deviceId}
56
+        on dept.dept_id = d.manage_dept
57
+        where d.device_id = #{deviceId}
55
     </select>
58
     </select>
56
 
59
 
57
     <insert id="insertCmcDevice" parameterType="CmcDevice" useGeneratedKeys="true" keyProperty="deviceId">
60
     <insert id="insertCmcDevice" parameterType="CmcDevice" useGeneratedKeys="true" keyProperty="deviceId">

+ 594
- 593
oa-back/sql/sql.sql
File diff suppressed because it is too large
View File


+ 2
- 2
oa-ui/src/views/oa/car/index.vue View File

48
       </el-table-column>
48
       </el-table-column>
49
       <el-table-column label="总价" align="center" prop="cost">
49
       <el-table-column label="总价" align="center" prop="cost">
50
         <template slot-scope="scope">
50
         <template slot-scope="scope">
51
-          {{ scope.row.cost + '元' }}
51
+          {{ scope.row.cost + '元' }}
52
         </template>
52
         </template>
53
       </el-table-column>
53
       </el-table-column>
54
       <el-table-column label="预计使用年限" align="center" prop="expectLife">
54
       <el-table-column label="预计使用年限" align="center" prop="expectLife">
98
         </el-form-item>
98
         </el-form-item>
99
         <el-form-item label="总价" prop="cost">
99
         <el-form-item label="总价" prop="cost">
100
           <el-input style="width:130px;margin-right:10px;" v-model="form.cost" placeholder="请输入金额" />
100
           <el-input style="width:130px;margin-right:10px;" v-model="form.cost" placeholder="请输入金额" />
101
-          <span>元</span>
101
+          <span>元</span>
102
         </el-form-item>
102
         </el-form-item>
103
         <el-form-item label="预计使用年限" prop="expectLife">
103
         <el-form-item label="预计使用年限" prop="expectLife">
104
           <el-input v-model="form.expectLife" placeholder="请输入年限" style="width:130px;margin-right:10px;" />
104
           <el-input v-model="form.expectLife" placeholder="请输入年限" style="width:130px;margin-right:10px;" />

+ 30
- 34
oa-ui/src/views/oa/device/expense.vue View File

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

+ 5
- 5
oa-ui/src/views/oa/device/index.vue View File

49
       <el-table-column label="购买价格" align="center" prop="cost">
49
       <el-table-column label="购买价格" align="center" prop="cost">
50
 
50
 
51
         <template slot-scope="scope">
51
         <template slot-scope="scope">
52
-          {{ scope.row.cost + '元' }}
52
+          {{ scope.row.cost + '元' }}
53
         </template>
53
         </template>
54
       </el-table-column>
54
       </el-table-column>
55
       <el-table-column label="预计使用年限" align="center" prop="expectLife" />
55
       <el-table-column label="预计使用年限" align="center" prop="expectLife" />
59
       <el-table-column label="校验周期(年)" align="center" prop="checkTerm" />
59
       <el-table-column label="校验周期(年)" align="center" prop="checkTerm" />
60
       <el-table-column label="保修期(月)" align="center" prop="warranty" />
60
       <el-table-column label="保修期(月)" align="center" prop="warranty" />
61
       <el-table-column label="校验日期" align="center" prop="checkTime" />
61
       <el-table-column label="校验日期" align="center" prop="checkTime" />
62
-      <el-table-column label="管理部门" align="center" prop="manageDept" />
62
+      <el-table-column label="管理部门" align="center" prop="manageDeptName" />
63
       <el-table-column label="备注" align="center" prop="remark" />
63
       <el-table-column label="备注" align="center" prop="remark" />
64
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
64
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
65
 
65
 
116
           <el-col :span="12">
116
           <el-col :span="12">
117
             <el-form-item label="购买价格" prop="cost">
117
             <el-form-item label="购买价格" prop="cost">
118
               <el-input style="width:130px;margin-right:10px;" v-model="form.cost" placeholder="请输入金额" />
118
               <el-input style="width:130px;margin-right:10px;" v-model="form.cost" placeholder="请输入金额" />
119
-              <span>元</span>
119
+              <span>元</span>
120
             </el-form-item>
120
             </el-form-item>
121
           </el-col>
121
           </el-col>
122
         </el-row>
122
         </el-row>
166
             </el-form-item>
166
             </el-form-item>
167
           </el-col>
167
           </el-col>
168
           <el-col :span="12">
168
           <el-col :span="12">
169
-            <el-form-item label="管理部门" prop="manageDept">
170
-              <el-input v-model="form.manageDept" placeholder="请输入管理部门" />
169
+            <el-form-item label="管理部门" prop="manageDeptName">
170
+              <el-input v-model="form.manageDeptName" placeholder="请输入管理部门" />
171
             </el-form-item>
171
             </el-form-item>
172
           </el-col>
172
           </el-col>
173
         </el-row>
173
         </el-row>

Loading…
Cancel
Save