Browse Source

设备移交、费用、报废

lamphua 1 year ago
parent
commit
cf7bc09b67
20 changed files with 1039 additions and 295 deletions
  1. 1
    0
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCarApprovalController.java
  2. 26
    14
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceApprovalController.java
  3. 3
    0
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceExpenseController.java
  4. 3
    0
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceHandoverController.java
  5. 23
    0
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceScrapController.java
  6. 14
    0
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcCar.java
  7. 5
    3
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcCarExpense.java
  8. 8
    7
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceApproval.java
  9. 50
    7
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceExpense.java
  10. 114
    30
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceHandover.java
  11. 6
    6
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceScrap.java
  12. 6
    1
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarMapper.xml
  13. 6
    5
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml
  14. 26
    8
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceExpenseMapper.xml
  15. 66
    26
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceHandoverMapper.xml
  16. 24
    24
      oa-back/sql/sql.sql
  17. 16
    9
      oa-ui/src/views/flowable/form/oa/deviceForm.vue
  18. 120
    1
      oa-ui/src/views/oa/car/detail.vue
  19. 484
    146
      oa-ui/src/views/oa/device/detail.vue
  20. 38
    8
      oa-ui/src/views/oa/device/index.vue

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

132
             BigDecimal estimateCost = new BigDecimal(0);
132
             BigDecimal estimateCost = new BigDecimal(0);
133
             for (String car : cars) {
133
             for (String car : cars) {
134
                 CmcCar cmcCar = cmcCarService.selectCmcCarByCarId(Integer.parseInt(car));
134
                 CmcCar cmcCar = cmcCarService.selectCmcCarByCarId(Integer.parseInt(car));
135
+                cmcCar.setStatus("0");
135
                 if (cmcCar.getDayCost() != null)
136
                 if (cmcCar.getDayCost() != null)
136
                     estimateCost = estimateCost.add(cmcCar.getDayCost().multiply(new BigDecimal(cmcCarApproval.getDays())));
137
                     estimateCost = estimateCost.add(cmcCar.getDayCost().multiply(new BigDecimal(cmcCarApproval.getDays())));
137
             }
138
             }

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

131
     {
131
     {
132
         JSONObject formDataJson = JSONObject.parse(formData);
132
         JSONObject formDataJson = JSONObject.parse(formData);
133
         CmcDeviceApproval cmcDeviceApproval = cmcDeviceApprovalService.selectCmcDeviceApprovalByDeviceApplyId(formDataJson.getString("deviceApplyId"));
133
         CmcDeviceApproval cmcDeviceApproval = cmcDeviceApprovalService.selectCmcDeviceApprovalByDeviceApplyId(formDataJson.getString("deviceApplyId"));
134
-        if (formDataJson.getString("managerComment") != null && formDataJson.getString("dispatchComment") == null) {
135
-            cmcDeviceApproval.setManagerUserId(getLoginUser().getUserId());
136
-            cmcDeviceApproval.setManagerComment(formDataJson.getString("managerComment"));
137
-            cmcDeviceApproval.setManagerTime(new Date());
138
-        }
139
-        if (formDataJson.getDate("confirmDate") != null) {
140
-            cmcDeviceApproval.setConfirmDate(formDataJson.getDate("confirmDate"));
141
-        }
142
-        if (formDataJson.getDate("returnDate") != null) {
143
-            cmcDeviceApproval.setRemark(formDataJson.getString("remark"));
144
-            cmcDeviceApproval.setState(formDataJson.getString("state"));
145
-            cmcDeviceApproval.setReturnDate(formDataJson.getDate("returnDate"));
146
-        }
147
-        if (formDataJson.getString("dispatchComment") != null) {
134
+        if (formDataJson.getString("modifyDevices") != null && formDataJson.getString("managerComment") == null) {
148
             cmcDeviceApproval.setDispatcher(getLoginUser().getUserId());
135
             cmcDeviceApproval.setDispatcher(getLoginUser().getUserId());
149
             cmcDeviceApproval.setDispatchComment(formDataJson.getString("dispatchComment"));
136
             cmcDeviceApproval.setDispatchComment(formDataJson.getString("dispatchComment"));
150
             cmcDeviceApproval.setDispatchTime(new Date());
137
             cmcDeviceApproval.setDispatchTime(new Date());
162
             }
149
             }
163
             cmcDeviceApproval.setEstimateCost(estimateCost);
150
             cmcDeviceApproval.setEstimateCost(estimateCost);
164
         }
151
         }
152
+        if (formDataJson.getString("managerComment") != null && formDataJson.getString("confirmDate") == null) {
153
+            cmcDeviceApproval.setManagerUserId(getLoginUser().getUserId());
154
+            cmcDeviceApproval.setManagerComment(formDataJson.getString("managerComment"));
155
+            cmcDeviceApproval.setManagerTime(new Date());
156
+        }
157
+        if (formDataJson.getDate("confirmDate") != null && formDataJson.getDate("returnDate") == null) {
158
+            cmcDeviceApproval.setConfirmDate(new Date());
159
+            CmcDevice cmcDevice = new CmcDevice();
160
+            cmcDevice.setStatus("0"); //确认被领用
161
+            cmcDeviceService.updateCmcDevice(cmcDevice);
162
+        }
163
+        if (formDataJson.getDate("returnDate") != null) {
164
+            cmcDeviceApproval.setRemark(formDataJson.getString("remark"));
165
+            if (formDataJson.getJSONArray("repairDevices").size() > 0) {
166
+                String deviceString = formDataJson.getString("repairDevices").substring(1, formDataJson.getString("repairDevices").length() - 1);
167
+                cmcDeviceApproval.setRepairDevices(deviceString);
168
+                String[] devices = deviceString.split(",");
169
+                for (String device : devices) {
170
+                    CmcDevice cmcDevice = cmcDeviceService.selectCmcDeviceByDeviceId(Integer.parseInt(device));
171
+                    cmcDevice.setStatus("2"); //需维修
172
+                    cmcDeviceService.updateCmcDevice(cmcDevice);
173
+                }
174
+            }
175
+            cmcDeviceApproval.setReturnDate(formDataJson.getDate("returnDate"));
176
+        }
165
         cmcDeviceApprovalService.updateCmcDeviceApproval(cmcDeviceApproval);
177
         cmcDeviceApprovalService.updateCmcDeviceApproval(cmcDeviceApproval);
166
         return AjaxResult.success("修改设备审批表成功");
178
         return AjaxResult.success("修改设备审批表成功");
167
     }
179
     }

+ 3
- 0
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceExpenseController.java View File

2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
5
+
6
+import com.ruoyi.common.utils.SnowFlake;
5
 import org.springframework.beans.factory.annotation.Autowired;
7
 import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.web.bind.annotation.GetMapping;
8
 import org.springframework.web.bind.annotation.GetMapping;
7
 import org.springframework.web.bind.annotation.PostMapping;
9
 import org.springframework.web.bind.annotation.PostMapping;
72
     @PostMapping
74
     @PostMapping
73
     public AjaxResult add(@RequestBody CmcDeviceExpense cmcDeviceExpense)
75
     public AjaxResult add(@RequestBody CmcDeviceExpense cmcDeviceExpense)
74
     {
76
     {
77
+        cmcDeviceExpense.setDeviceExpenseId(new SnowFlake().generateId());
75
         return toAjax(cmcDeviceExpenseService.insertCmcDeviceExpense(cmcDeviceExpense));
78
         return toAjax(cmcDeviceExpenseService.insertCmcDeviceExpense(cmcDeviceExpense));
76
     }
79
     }
77
 
80
 

+ 3
- 0
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceHandoverController.java View File

2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
5
+
6
+import com.ruoyi.common.utils.SnowFlake;
5
 import org.springframework.beans.factory.annotation.Autowired;
7
 import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.web.bind.annotation.GetMapping;
8
 import org.springframework.web.bind.annotation.GetMapping;
7
 import org.springframework.web.bind.annotation.PostMapping;
9
 import org.springframework.web.bind.annotation.PostMapping;
72
     @PostMapping
74
     @PostMapping
73
     public AjaxResult add(@RequestBody CmcDeviceHandover cmcDeviceHandover)
75
     public AjaxResult add(@RequestBody CmcDeviceHandover cmcDeviceHandover)
74
     {
76
     {
77
+        cmcDeviceHandover.setDeviceHandoverId(new SnowFlake().generateId());
75
         return toAjax(cmcDeviceHandoverService.insertCmcDeviceHandover(cmcDeviceHandover));
78
         return toAjax(cmcDeviceHandoverService.insertCmcDeviceHandover(cmcDeviceHandover));
76
     }
79
     }
77
 
80
 

+ 23
- 0
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceScrapController.java View File

2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
5
+
6
+import com.ruoyi.common.utils.SnowFlake;
7
+import com.ruoyi.oa.domain.CmcCar;
8
+import com.ruoyi.oa.domain.CmcDevice;
9
+import com.ruoyi.oa.service.ICmcCarService;
10
+import com.ruoyi.oa.service.ICmcDeviceService;
5
 import org.springframework.beans.factory.annotation.Autowired;
11
 import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.web.bind.annotation.GetMapping;
12
 import org.springframework.web.bind.annotation.GetMapping;
7
 import org.springframework.web.bind.annotation.PostMapping;
13
 import org.springframework.web.bind.annotation.PostMapping;
33
     @Autowired
39
     @Autowired
34
     private ICmcDeviceScrapService cmcDeviceScrapService;
40
     private ICmcDeviceScrapService cmcDeviceScrapService;
35
 
41
 
42
+    @Autowired
43
+    private ICmcDeviceService cmcDeviceService;
44
+
45
+    @Autowired
46
+    private ICmcCarService cmcCarService;
47
+
36
     /**
48
     /**
37
      * 查询cmc设备报废列表
49
      * 查询cmc设备报废列表
38
      */
50
      */
72
     @PostMapping
84
     @PostMapping
73
     public AjaxResult add(@RequestBody CmcDeviceScrap cmcDeviceScrap)
85
     public AjaxResult add(@RequestBody CmcDeviceScrap cmcDeviceScrap)
74
     {
86
     {
87
+        cmcDeviceScrap.setDeviceScrapId(new SnowFlake().generateId());
88
+        if (cmcDeviceScrap.getDeviceId() != null) {
89
+            CmcDevice cmcDevice = cmcDeviceService.selectCmcDeviceByDeviceId(cmcDeviceScrap.getDeviceId());
90
+            cmcDevice.setStatus("4");
91
+            cmcDeviceService.updateCmcDevice(cmcDevice);
92
+        }
93
+        if (cmcDeviceScrap.getCarId() != null) {
94
+            CmcCar cmcCar = cmcCarService.selectCmcCarByCarId(cmcDeviceScrap.getCarId());
95
+            cmcCar.setStatus("4");
96
+            cmcCarService.updateCmcCar(cmcCar);
97
+        }
75
         return toAjax(cmcDeviceScrapService.insertCmcDeviceScrap(cmcDeviceScrap));
98
         return toAjax(cmcDeviceScrapService.insertCmcDeviceScrap(cmcDeviceScrap));
76
     }
99
     }
77
 
100
 

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

65
     @Excel(name = "单日成本")
65
     @Excel(name = "单日成本")
66
     private BigDecimal dayCost;
66
     private BigDecimal dayCost;
67
 
67
 
68
+    /** 状态 */
69
+    @Excel(name = "状态")
70
+    private String status;
71
+
68
     public void setCarId(Integer carId)
72
     public void setCarId(Integer carId)
69
     {
73
     {
70
         this.carId = carId;
74
         this.carId = carId;
173
     {
177
     {
174
         return dayCost;
178
         return dayCost;
175
     }
179
     }
180
+    public void setStatus(String status)
181
+    {
182
+        this.status = status;
183
+    }
184
+
185
+    public String getStatus()
186
+    {
187
+        return status;
188
+    }
176
 
189
 
177
     @Override
190
     @Override
178
     public String toString() {
191
     public String toString() {
188
                 .append("brand", getBrand())
201
                 .append("brand", getBrand())
189
                 .append("isRent", getIsRent())
202
                 .append("isRent", getIsRent())
190
                 .append("dayCost", getDayCost())
203
                 .append("dayCost", getDayCost())
204
+                .append("status", getStatus())
191
                 .toString();
205
                 .toString();
192
     }
206
     }
193
 }
207
 }

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

22
     private String carExpenseId;
22
     private String carExpenseId;
23
 
23
 
24
     /** 车辆id */
24
     /** 车辆id */
25
-    @Excel(name = "车辆id")
25
+    @Excel(name = "车牌号")
26
+    private String licensePlate;
26
     private Integer carId;
27
     private Integer carId;
28
+    private CmcCar car;
27
 
29
 
28
-    /** 费用类型 */
29
-    @Excel(name = "费用类型")
30
+    /** 费用类型(0保险费,1维修保养费,2轮胎费) */
31
+    @Excel(name = "费用类型", readConverterExp = "0=保险费,1=维修/保养费,2=轮胎费")
30
     private String expenseType;
32
     private String expenseType;
31
 
33
 
32
     /** 费用金额 */
34
     /** 费用金额 */

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

117
     @Excel(name = "调度审批时间", width = 30, dateFormat = "yyyy-MM-dd")
117
     @Excel(name = "调度审批时间", width = 30, dateFormat = "yyyy-MM-dd")
118
     private Date dispatchTime;
118
     private Date dispatchTime;
119
 
119
 
120
-    /** 设备状况 */
121
-    @Excel(name = "设备状况")
122
-    private String state;
120
+    /** 需维修设备id */
121
+    @Excel(name = "需维修设备id")
122
+    private String repairDevices;
123
 
123
 
124
     public void setDeviceApplyId(String deviceApplyId)
124
     public void setDeviceApplyId(String deviceApplyId)
125
     {
125
     {
347
     {
347
     {
348
         return dispatchTime;
348
         return dispatchTime;
349
     }
349
     }
350
-    public void setState(String state)
350
+    public void setRepairDevices(String repairDevices)
351
     {
351
     {
352
-        this.state = state;
352
+        this.repairDevices = repairDevices;
353
     }
353
     }
354
 
354
 
355
-    public String getState()
355
+    public String getRepairDevices()
356
     {
356
     {
357
-        return state;
357
+        return repairDevices;
358
     }
358
     }
359
 
359
 
360
     @Override
360
     @Override
364
             .append("applier", getApplier())
364
             .append("applier", getApplier())
365
             .append("devices", getDevices())
365
             .append("devices", getDevices())
366
             .append("modifyDevices", getModifyDevices())
366
             .append("modifyDevices", getModifyDevices())
367
+            .append("repairDevices", getRepairDevices())
367
             .append("projectId", getProjectId())
368
             .append("projectId", getProjectId())
368
             .append("applyReason", getApplyReason())
369
             .append("applyReason", getApplyReason())
369
             .append("beginDate", getBeginDate())
370
             .append("beginDate", getBeginDate())

+ 50
- 7
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceExpense.java View File

3
 import java.math.BigDecimal;
3
 import java.math.BigDecimal;
4
 import java.util.Date;
4
 import java.util.Date;
5
 import com.fasterxml.jackson.annotation.JsonFormat;
5
 import com.fasterxml.jackson.annotation.JsonFormat;
6
+import com.ruoyi.common.core.domain.entity.SysUser;
6
 import org.apache.commons.lang3.builder.ToStringBuilder;
7
 import org.apache.commons.lang3.builder.ToStringBuilder;
7
 import org.apache.commons.lang3.builder.ToStringStyle;
8
 import org.apache.commons.lang3.builder.ToStringStyle;
8
 import com.ruoyi.common.annotation.Excel;
9
 import com.ruoyi.common.annotation.Excel;
22
     private String deviceExpenseId;
23
     private String deviceExpenseId;
23
 
24
 
24
     /** 设备id */
25
     /** 设备id */
25
-    @Excel(name = "设备id")
26
-    private Long deviceId;
26
+    private Integer deviceId;
27
+    private CmcDevice device;
28
+
29
+    @Excel(name = "设备编码")
30
+    private String deviceNumber;
31
+
32
+    @Excel(name = "设备名称")
33
+    private String name;
34
+
35
+    @Excel(name = "出厂编号")
36
+    private String code;
37
+
38
+    @Excel(name = "品牌")
39
+    private String brand;
40
+
41
+    @Excel(name = "系列")
42
+    private String series;
27
 
43
 
28
     /** 负责人id */
44
     /** 负责人id */
29
-    @Excel(name = "负责人id")
30
     private Long userId;
45
     private Long userId;
31
 
46
 
32
-    /** 费用类型(0检定费、1维修保养费) */
33
-    @Excel(name = "费用类型", readConverterExp = "0=检定费、1维修保养费")
47
+    @Excel(name = "负责人")
48
+    private String nickName;
49
+    private SysUser user;
50
+
51
+    /** 费用类型(0保险费,1维修保养费,2检定费) */
52
+    @Excel(name = "费用类型", readConverterExp = "0=保险费,1=维修/保养费,2=检定费")
34
     private String expenseType;
53
     private String expenseType;
35
 
54
 
36
     /** 费用金额 */
55
     /** 费用金额 */
55
     {
74
     {
56
         return deviceExpenseId;
75
         return deviceExpenseId;
57
     }
76
     }
58
-    public void setDeviceId(Long deviceId) 
77
+    public void setDeviceId(Integer deviceId)
59
     {
78
     {
60
         this.deviceId = deviceId;
79
         this.deviceId = deviceId;
61
     }
80
     }
62
 
81
 
63
-    public Long getDeviceId() 
82
+    public Integer getDeviceId()
64
     {
83
     {
65
         return deviceId;
84
         return deviceId;
66
     }
85
     }
86
+    public void setDevice(CmcDevice device)
87
+    {
88
+        this.device = device;
89
+        this.deviceNumber = device.getDeviceNumber();
90
+        this.brand = device.getBrand();
91
+        this.series = device.getSeries();
92
+        this.name = device.getName();
93
+        this.code = device.getCode();
94
+    }
95
+
96
+    public CmcDevice getDevice()
97
+    {
98
+        return device;
99
+    }
67
     public void setUserId(Long userId) 
100
     public void setUserId(Long userId) 
68
     {
101
     {
69
         this.userId = userId;
102
         this.userId = userId;
73
     {
106
     {
74
         return userId;
107
         return userId;
75
     }
108
     }
109
+    public void setUser(SysUser user)
110
+    {
111
+        this.user = user;
112
+        this.nickName = user.getNickName();
113
+    }
114
+
115
+    public SysUser getUser()
116
+    {
117
+        return user;
118
+    }
76
     public void setExpenseType(String expenseType) 
119
     public void setExpenseType(String expenseType) 
77
     {
120
     {
78
         this.expenseType = expenseType;
121
         this.expenseType = expenseType;

+ 114
- 30
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceHandover.java View File

2
 
2
 
3
 import java.util.Date;
3
 import java.util.Date;
4
 import com.fasterxml.jackson.annotation.JsonFormat;
4
 import com.fasterxml.jackson.annotation.JsonFormat;
5
+import com.ruoyi.common.core.domain.entity.SysDept;
6
+import com.ruoyi.common.core.domain.entity.SysUser;
5
 import org.apache.commons.lang3.builder.ToStringBuilder;
7
 import org.apache.commons.lang3.builder.ToStringBuilder;
6
 import org.apache.commons.lang3.builder.ToStringStyle;
8
 import org.apache.commons.lang3.builder.ToStringStyle;
7
 import com.ruoyi.common.annotation.Excel;
9
 import com.ruoyi.common.annotation.Excel;
21
     private String deviceHandoverId;
23
     private String deviceHandoverId;
22
 
24
 
23
     /** 设备id */
25
     /** 设备id */
24
-    @Excel(name = "设备id")
25
-    private Long deviceId;
26
+    private Integer deviceId;
27
+    private CmcDevice device;
28
+
29
+    @Excel(name = "设备编码")
30
+    private String deviceNumber;
31
+
32
+    @Excel(name = "设备名称")
33
+    private String name;
34
+
35
+    @Excel(name = "出厂编号")
36
+    private String code;
37
+
38
+    @Excel(name = "品牌")
39
+    private String brand;
40
+
41
+    @Excel(name = "系列")
42
+    private String series;
43
+
26
 
44
 
27
     /** 移交部门id */
45
     /** 移交部门id */
28
-    @Excel(name = "移交部门id")
29
-    private Long handoverDept;
46
+    @Excel(name = "移交部门")
47
+    private String handoverDeptName;
48
+    private Long handoverDeptId;
30
 
49
 
31
     /** 移交人id */
50
     /** 移交人id */
32
-    @Excel(name = "移交人id")
33
-    private Long handoverUser;
51
+    @Excel(name = "移交人")
52
+    private String handoverNickName;
53
+    private Long handoverUserId;
34
 
54
 
35
     /** 移交日期 */
55
     /** 移交日期 */
36
     @JsonFormat(pattern = "yyyy-MM-dd")
56
     @JsonFormat(pattern = "yyyy-MM-dd")
38
     private Date handoverDate;
58
     private Date handoverDate;
39
 
59
 
40
     /** 接收部门id */
60
     /** 接收部门id */
41
-    @Excel(name = "接收部门id")
42
-    private Long receiveDept;
61
+    @Excel(name = "接收部门")
62
+    private String receiveDeptName;
63
+    private Long receiveDeptId;
43
 
64
 
44
     /** 接收人id */
65
     /** 接收人id */
45
-    @Excel(name = "接收人id")
46
-    private Long receiveUser;
66
+    @Excel(name = "接收人")
67
+    private String receiveNickName;
68
+    private Long receiveUserId;
69
+
70
+    private SysUser handoverUser;
71
+
72
+    private SysUser receiveUser;
73
+
74
+    private SysDept handoverDept;
75
+
76
+    private SysDept receiveDept;
47
 
77
 
48
     /** 设备软件说明 */
78
     /** 设备软件说明 */
49
     @Excel(name = "设备软件说明")
79
     @Excel(name = "设备软件说明")
62
     {
92
     {
63
         return deviceHandoverId;
93
         return deviceHandoverId;
64
     }
94
     }
65
-    public void setDeviceId(Long deviceId) 
95
+    public void setDeviceId(Integer deviceId)
66
     {
96
     {
67
         this.deviceId = deviceId;
97
         this.deviceId = deviceId;
68
     }
98
     }
69
 
99
 
70
-    public Long getDeviceId() 
100
+    public Integer getDeviceId()
71
     {
101
     {
72
         return deviceId;
102
         return deviceId;
73
     }
103
     }
74
-    public void setHandoverDept(Long handoverDept) 
104
+    public void setDevice(CmcDevice device)
75
     {
105
     {
76
-        this.handoverDept = handoverDept;
106
+        this.device = device;
107
+        this.deviceNumber = device.getDeviceNumber();
108
+        this.brand = device.getBrand();
109
+        this.series = device.getSeries();
110
+        this.name = device.getName();
111
+        this.code = device.getCode();
77
     }
112
     }
78
 
113
 
79
-    public Long getHandoverDept() 
114
+    public CmcDevice getDevice()
80
     {
115
     {
81
-        return handoverDept;
116
+        return device;
82
     }
117
     }
83
-    public void setHandoverUser(Long handoverUser) 
118
+    public void setHandoverDeptId(Long handoverDeptId)
84
     {
119
     {
85
-        this.handoverUser = handoverUser;
120
+        this.handoverDeptId = handoverDeptId;
86
     }
121
     }
87
 
122
 
88
-    public Long getHandoverUser() 
123
+    public Long getHandoverDeptId()
89
     {
124
     {
90
-        return handoverUser;
125
+        return handoverDeptId;
126
+    }
127
+    public void setHandoverUserId(Long handoverUserId)
128
+    {
129
+        this.handoverUserId = handoverUserId;
130
+    }
131
+
132
+    public Long getHandoverUserId()
133
+    {
134
+        return handoverUserId;
91
     }
135
     }
92
     public void setHandoverDate(Date handoverDate) 
136
     public void setHandoverDate(Date handoverDate) 
93
     {
137
     {
98
     {
142
     {
99
         return handoverDate;
143
         return handoverDate;
100
     }
144
     }
101
-    public void setReceiveDept(Long receiveDept) 
145
+    public void setReceiveDeptId(Long receiveDeptId)
102
     {
146
     {
103
-        this.receiveDept = receiveDept;
147
+        this.receiveDeptId = receiveDeptId;
104
     }
148
     }
105
 
149
 
106
-    public Long getReceiveDept() 
150
+    public Long getReceiveDeptId()
107
     {
151
     {
108
-        return receiveDept;
152
+        return receiveDeptId;
109
     }
153
     }
110
-    public void setReceiveUser(Long receiveUser) 
154
+    public void setReceiveUserId(Long receiveUserId)
155
+    {
156
+        this.receiveUserId = receiveUserId;
157
+    }
158
+
159
+    public Long getReceiveUserId()
160
+    {
161
+        return receiveUserId;
162
+    }
163
+    public void setHandoverUser(SysUser handoverUser)
164
+    {
165
+        this.handoverUser = handoverUser;
166
+        this.handoverNickName = handoverUser.getNickName();
167
+    }
168
+
169
+    public SysUser getHandoverUser()
170
+    {
171
+        return handoverUser;
172
+    }
173
+    public void setReceiveUser(SysUser receiveUser)
111
     {
174
     {
112
         this.receiveUser = receiveUser;
175
         this.receiveUser = receiveUser;
176
+        this.receiveNickName = receiveUser.getNickName();
113
     }
177
     }
114
 
178
 
115
-    public Long getReceiveUser() 
179
+    public SysUser getReceiveUser()
116
     {
180
     {
117
         return receiveUser;
181
         return receiveUser;
118
     }
182
     }
183
+    public void setReceiveDept(SysDept receiveDept)
184
+    {
185
+        this.receiveDept = receiveDept;
186
+        this.receiveDeptName = receiveDept.getDeptName();
187
+    }
188
+
189
+    public SysDept getReceiveDept()
190
+    {
191
+        return receiveDept;
192
+    }
193
+    public void setHandoverDept(SysDept handoverDept)
194
+    {
195
+        this.handoverDept = handoverDept;
196
+        this.handoverDeptName = handoverDept.getDeptName();
197
+    }
198
+
199
+    public SysDept getHandoverDept()
200
+    {
201
+        return handoverDept;
202
+    }
119
     public void setDescription(String description) 
203
     public void setDescription(String description) 
120
     {
204
     {
121
         this.description = description;
205
         this.description = description;
140
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
224
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
141
             .append("deviceHandoverId", getDeviceHandoverId())
225
             .append("deviceHandoverId", getDeviceHandoverId())
142
             .append("deviceId", getDeviceId())
226
             .append("deviceId", getDeviceId())
143
-            .append("handoverDept", getHandoverDept())
144
-            .append("handoverUser", getHandoverUser())
227
+            .append("handoverDeptId", getHandoverDeptId())
228
+            .append("handoverUserId", getHandoverUserId())
145
             .append("handoverDate", getHandoverDate())
229
             .append("handoverDate", getHandoverDate())
146
-            .append("receiveDept", getReceiveDept())
147
-            .append("receiveUser", getReceiveUser())
230
+            .append("receiveDeptId", getReceiveDeptId())
231
+            .append("receiveUserId", getReceiveUserId())
148
             .append("description", getDescription())
232
             .append("description", getDescription())
149
             .append("reason", getReason())
233
             .append("reason", getReason())
150
             .append("remark", getRemark())
234
             .append("remark", getRemark())

+ 6
- 6
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceScrap.java View File

23
 
23
 
24
     /** 设备id */
24
     /** 设备id */
25
     @Excel(name = "设备id")
25
     @Excel(name = "设备id")
26
-    private Long deviceId;
26
+    private Integer deviceId;
27
 
27
 
28
     /** 车辆id */
28
     /** 车辆id */
29
     @Excel(name = "车辆id")
29
     @Excel(name = "车辆id")
30
-    private Long carId;
30
+    private Integer carId;
31
 
31
 
32
     /** 原价值 */
32
     /** 原价值 */
33
     @Excel(name = "原价值")
33
     @Excel(name = "原价值")
59
     {
59
     {
60
         return deviceScrapId;
60
         return deviceScrapId;
61
     }
61
     }
62
-    public void setDeviceId(Long deviceId) 
62
+    public void setDeviceId(Integer deviceId) 
63
     {
63
     {
64
         this.deviceId = deviceId;
64
         this.deviceId = deviceId;
65
     }
65
     }
66
 
66
 
67
-    public Long getDeviceId() 
67
+    public Integer getDeviceId() 
68
     {
68
     {
69
         return deviceId;
69
         return deviceId;
70
     }
70
     }
71
-    public void setCarId(Long carId)
71
+    public void setCarId(Integer carId)
72
     {
72
     {
73
         this.carId = carId;
73
         this.carId = carId;
74
     }
74
     }
75
 
75
 
76
-    public Long getCarId()
76
+    public Integer getCarId()
77
     {
77
     {
78
         return carId;
78
         return carId;
79
     }
79
     }

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarMapper.xml View File

17
         <result property="isRent"    column="is_rent"    />
17
         <result property="isRent"    column="is_rent"    />
18
         <result property="dayCost"    column="day_cost"    />
18
         <result property="dayCost"    column="day_cost"    />
19
         <result property="remark"    column="remark"    />
19
         <result property="remark"    column="remark"    />
20
+        <result property="status"    column="status"    />
20
         <association property="driverUser"    javaType="SysUser"         resultMap="SysUserResult" />
21
         <association property="driverUser"    javaType="SysUser"         resultMap="SysUserResult" />
21
     </resultMap>
22
     </resultMap>
22
 
23
 
26
     </resultMap>
27
     </resultMap>
27
 
28
 
28
     <sql id="selectCmcCarVo">
29
     <sql id="selectCmcCarVo">
29
-        select c.car_id, c.license_plate, c.driver, u.nick_name, c.acquisition_time, c.cost, c.expect_life, c.expect_km, c.series, c.brand, c.is_rent, c.day_cost, c.remark from cmc_car as c
30
+        select c.car_id, c.license_plate, c.driver, u.nick_name, c.acquisition_time, c.cost, c.expect_life, c.expect_km, c.series, c.brand, c.is_rent, c.day_cost, c.remark, c.status from cmc_car as c
30
         left join sys_user as u on u.user_id = c.driver
31
         left join sys_user as u on u.user_id = c.driver
31
     </sql>
32
     </sql>
32
 
33
 
44
             <if test="isRent != null  and isRent != ''"> and c.isRent = #{isRent}</if>
45
             <if test="isRent != null  and isRent != ''"> and c.isRent = #{isRent}</if>
45
             <if test="dayCost != null  and dayCost != ''"> and c.day_cost = #{dayCost}</if>
46
             <if test="dayCost != null  and dayCost != ''"> and c.day_cost = #{dayCost}</if>
46
             <if test="remark != null  and remark != ''"> and c.remark = #{remark}</if>
47
             <if test="remark != null  and remark != ''"> and c.remark = #{remark}</if>
48
+            <if test="status != null  and status != ''"> and c.status = #{status}</if>
47
         </where>
49
         </where>
48
     </select>
50
     </select>
49
 
51
 
66
             <if test="isRent != null">is_rent,</if>
68
             <if test="isRent != null">is_rent,</if>
67
             <if test="dayCost != null">day_cost,</if>
69
             <if test="dayCost != null">day_cost,</if>
68
             <if test="remark != null">remark,</if>
70
             <if test="remark != null">remark,</if>
71
+            <if test="status != null">status,</if>
69
         </trim>
72
         </trim>
70
         <trim prefix="values (" suffix=")" suffixOverrides=",">
73
         <trim prefix="values (" suffix=")" suffixOverrides=",">
71
             <if test="licensePlate != null">#{licensePlate},</if>
74
             <if test="licensePlate != null">#{licensePlate},</if>
79
             <if test="isRent != null">#{isRent},</if>
82
             <if test="isRent != null">#{isRent},</if>
80
             <if test="dayCost != null">#{dayCost},</if>
83
             <if test="dayCost != null">#{dayCost},</if>
81
             <if test="remark != null">#{remark},</if>
84
             <if test="remark != null">#{remark},</if>
85
+            <if test="status != null">#{status},</if>
82
         </trim>
86
         </trim>
83
     </insert>
87
     </insert>
84
 
88
 
96
             <if test="isRent != null">is_rent = #{isRent},</if>
100
             <if test="isRent != null">is_rent = #{isRent},</if>
97
             <if test="dayCost != null">day_cost = #{dayCost},</if>
101
             <if test="dayCost != null">day_cost = #{dayCost},</if>
98
             <if test="remark != null">remark = #{remark},</if>
102
             <if test="remark != null">remark = #{remark},</if>
103
+            <if test="status != null">status = #{status},</if>
99
         </trim>
104
         </trim>
100
         where car_id = #{carId}
105
         where car_id = #{carId}
101
     </update>
106
     </update>

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

10
         <result property="useDept"    column="use_dept"    />
10
         <result property="useDept"    column="use_dept"    />
11
         <result property="devices"    column="devices"    />
11
         <result property="devices"    column="devices"    />
12
         <result property="modifyDevices"    column="modify_devices"    />
12
         <result property="modifyDevices"    column="modify_devices"    />
13
+        <result property="repairDevices"    column="repair_devices"    />
13
         <result property="projectId"    column="project_id"    />
14
         <result property="projectId"    column="project_id"    />
14
         <result property="applyReason"    column="apply_reason"    />
15
         <result property="applyReason"    column="apply_reason"    />
15
         <result property="applyDate"    column="apply_date"    />
16
         <result property="applyDate"    column="apply_date"    />
23
         <result property="dispatchComment"    column="dispatch_comment"    />
24
         <result property="dispatchComment"    column="dispatch_comment"    />
24
         <result property="estimateCost"    column="estimate_cost"    />
25
         <result property="estimateCost"    column="estimate_cost"    />
25
         <result property="remark"    column="remark"    />
26
         <result property="remark"    column="remark"    />
26
-        <result property="state"    column="state"    />
27
         <result property="managerTime"    column="manager_time"    />
27
         <result property="managerTime"    column="manager_time"    />
28
         <result property="dispatchTime"    column="dispatch_time"    />
28
         <result property="dispatchTime"    column="dispatch_time"    />
29
         <association property="applierUser"    javaType="SysUser"         resultMap="SysUserResult" />
29
         <association property="applierUser"    javaType="SysUser"         resultMap="SysUserResult" />
61
 
61
 
62
     <sql id="selectCmcDeviceApprovalVo">
62
     <sql id="selectCmcDeviceApprovalVo">
63
         select da.device_apply_id, da.applier, u.nick_name as applier_nick_name, da.use_dept, d.dept_name, da.devices, da.modify_devices, da.project_id, p.project_number, p.project_name,
63
         select da.device_apply_id, da.applier, u.nick_name as applier_nick_name, da.use_dept, d.dept_name, da.devices, da.modify_devices, da.project_id, p.project_number, p.project_name,
64
-               da.apply_reason, da.apply_date, da.return_date, da.begin_date, da.end_date, da.days, da.state, da.manager_user_id, u1.nick_name as manager_nick_name, da.manager_comment,
64
+               da.apply_reason, da.apply_date, da.return_date, da.begin_date, da.end_date, da.days, da.repair_devices, da.manager_user_id, u1.nick_name as manager_nick_name, da.manager_comment,
65
                da.dispatcher, u2.nick_name as dispatch_nick_name, da.dispatch_comment, da.estimate_cost, da.remark, da.manager_time, da.dispatch_time from cmc_device_approval as da
65
                da.dispatcher, u2.nick_name as dispatch_nick_name, da.dispatch_comment, da.estimate_cost, da.remark, da.manager_time, da.dispatch_time from cmc_device_approval as da
66
             left join sys_user as u on u.user_id = da.applier
66
             left join sys_user as u on u.user_id = da.applier
67
             left join sys_user as u1 on u1.user_id = da.manager_user_id
67
             left join sys_user as u1 on u1.user_id = da.manager_user_id
77
             <if test="useDept != null "> and da.use_dept = #{useDept}</if>
77
             <if test="useDept != null "> and da.use_dept = #{useDept}</if>
78
             <if test="devices != null  and devices != ''"> and da.devices like concat('%', #{devices}, '%')</if>
78
             <if test="devices != null  and devices != ''"> and da.devices like concat('%', #{devices}, '%')</if>
79
             <if test="modifyDevices != null  and modifyDevices != ''"> and da.modify_devices like concat('%', #{modifyDevices}, '%')</if>
79
             <if test="modifyDevices != null  and modifyDevices != ''"> and da.modify_devices like concat('%', #{modifyDevices}, '%')</if>
80
+            <if test="repairDevices != null  and repairDevices != ''"> and da.repair_devices like concat('%', #{repairDevices}, '%')</if>
80
             <if test="projectId != null  and projectId != ''"> and da.project_id = #{projectId}</if>
81
             <if test="projectId != null  and projectId != ''"> and da.project_id = #{projectId}</if>
81
             <if test="applyReason != null  and applyReason != ''"> and da.apply_reason = #{applyReason}</if>
82
             <if test="applyReason != null  and applyReason != ''"> and da.apply_reason = #{applyReason}</if>
82
             <if test="applyDate != null "> and da.apply_date = #{applyDate}</if>
83
             <if test="applyDate != null "> and da.apply_date = #{applyDate}</if>
107
             <if test="useDept != null">use_dept,</if>
108
             <if test="useDept != null">use_dept,</if>
108
             <if test="devices != null">devices,</if>
109
             <if test="devices != null">devices,</if>
109
             <if test="modifyDevices != null">modify_devices,</if>
110
             <if test="modifyDevices != null">modify_devices,</if>
111
+            <if test="repairDevices != null">repair_devices,</if>
110
             <if test="projectId != null">project_id,</if>
112
             <if test="projectId != null">project_id,</if>
111
             <if test="applyReason != null">apply_reason,</if>
113
             <if test="applyReason != null">apply_reason,</if>
112
             <if test="applyDate != null">apply_date,</if>
114
             <if test="applyDate != null">apply_date,</if>
120
             <if test="dispatchComment != null">dispatch_comment,</if>
122
             <if test="dispatchComment != null">dispatch_comment,</if>
121
             <if test="estimateCost != null">estimate_cost,</if>
123
             <if test="estimateCost != null">estimate_cost,</if>
122
             <if test="remark != null">remark,</if>
124
             <if test="remark != null">remark,</if>
123
-            <if test="state != null">state,</if>
124
             <if test="managerTime != null">manager_time,</if>
125
             <if test="managerTime != null">manager_time,</if>
125
             <if test="dispatchTime != null">dispatch_time,</if>
126
             <if test="dispatchTime != null">dispatch_time,</if>
126
          </trim>
127
          </trim>
130
             <if test="useDept != null">#{useDept},</if>
131
             <if test="useDept != null">#{useDept},</if>
131
             <if test="devices != null">#{devices},</if>
132
             <if test="devices != null">#{devices},</if>
132
             <if test="modifyDevices != null">#{modifyDevices},</if>
133
             <if test="modifyDevices != null">#{modifyDevices},</if>
134
+            <if test="repairDevices != null">#{repairDevices},</if>
133
             <if test="projectId != null">#{projectId},</if>
135
             <if test="projectId != null">#{projectId},</if>
134
             <if test="applyReason != null">#{applyReason},</if>
136
             <if test="applyReason != null">#{applyReason},</if>
135
             <if test="applyDate != null">#{applyDate},</if>
137
             <if test="applyDate != null">#{applyDate},</if>
143
             <if test="dispatchComment != null">#{dispatchComment},</if>
145
             <if test="dispatchComment != null">#{dispatchComment},</if>
144
             <if test="estimateCost != null">#{estimateCost},</if>
146
             <if test="estimateCost != null">#{estimateCost},</if>
145
             <if test="remark != null">#{remark},</if>
147
             <if test="remark != null">#{remark},</if>
146
-            <if test="state != null">#{state},</if>
147
             <if test="managerTime != null">#{managerTime},</if>
148
             <if test="managerTime != null">#{managerTime},</if>
148
             <if test="dispatchTime != null">#{dispatchTime},</if>
149
             <if test="dispatchTime != null">#{dispatchTime},</if>
149
          </trim>
150
          </trim>
156
             <if test="useDept != null">use_dept = #{useDept},</if>
157
             <if test="useDept != null">use_dept = #{useDept},</if>
157
             <if test="devices != null">devices = #{devices},</if>
158
             <if test="devices != null">devices = #{devices},</if>
158
             <if test="modifyDevices != null">modify_devices = #{modifyDevices},</if>
159
             <if test="modifyDevices != null">modify_devices = #{modifyDevices},</if>
160
+            <if test="repairDevices != null">repair_devices = #{repairDevices},</if>
159
             <if test="projectId != null">project_id = #{projectId},</if>
161
             <if test="projectId != null">project_id = #{projectId},</if>
160
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
162
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
161
             <if test="applyDate != null">apply_date = #{applyDate},</if>
163
             <if test="applyDate != null">apply_date = #{applyDate},</if>
169
             <if test="dispatchComment != null">dispatch_comment = #{dispatchComment},</if>
171
             <if test="dispatchComment != null">dispatch_comment = #{dispatchComment},</if>
170
             <if test="estimateCost != null">estimate_cost = #{estimateCost},</if>
172
             <if test="estimateCost != null">estimate_cost = #{estimateCost},</if>
171
             <if test="remark != null">remark = #{remark},</if>
173
             <if test="remark != null">remark = #{remark},</if>
172
-            <if test="state != null">state = #{state},</if>
173
             <if test="managerTime != null">manager_time = #{managerTime},</if>
174
             <if test="managerTime != null">manager_time = #{managerTime},</if>
174
             <if test="dispatchTime != null">dispatch_time = #{dispatchTime},</if>
175
             <if test="dispatchTime != null">dispatch_time = #{dispatchTime},</if>
175
         </trim>
176
         </trim>

+ 26
- 8
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceExpenseMapper.xml View File

13
         <result property="occurDate"    column="occur_date"    />
13
         <result property="occurDate"    column="occur_date"    />
14
         <result property="remark"    column="remark"    />
14
         <result property="remark"    column="remark"    />
15
         <result property="document"    column="document"    />
15
         <result property="document"    column="document"    />
16
+        <association property="user"    javaType="SysUser"         resultMap="SysUserResult" />
17
+        <association property="device"    javaType="CmcDevice"         resultMap="CmcDeviceResult" />
18
+    </resultMap>
19
+
20
+    <resultMap type="SysUser" id="SysUserResult">
21
+        <result property="userId"    column="user_id"    />
22
+        <result property="nickName"    column="nick_name"    />
23
+    </resultMap>
24
+
25
+    <resultMap type="CmcDevice" id="CmcDeviceResult">
26
+        <result property="deviceId"    column="device_id"    />
27
+        <result property="deviceNumber"    column="device_number"    />
28
+        <result property="code"    column="code"    />
29
+        <result property="name"    column="name"    />
30
+        <result property="series"    column="series"    />
31
+        <result property="brand"    column="brand"    />
16
     </resultMap>
32
     </resultMap>
17
 
33
 
18
     <sql id="selectCmcDeviceExpenseVo">
34
     <sql id="selectCmcDeviceExpenseVo">
19
-        select device_expense_id, device_id, user_id, expense_type, expense, occur_date, remark, document from cmc_device_expense
35
+        select de.device_expense_id, de.device_id, d.device_number, d.code, d.name, d.brand, d.series, de.user_id, u.nick_name, de.expense_type, de.expense, de.occur_date, de.remark, de.document from cmc_device_expense as de
36
+        left join sys_user as u on u.user_id = de.user_id
37
+        left join cmc_device as d on d.device_id = de.device_id
20
     </sql>
38
     </sql>
21
 
39
 
22
     <select id="selectCmcDeviceExpenseList" parameterType="CmcDeviceExpense" resultMap="CmcDeviceExpenseResult">
40
     <select id="selectCmcDeviceExpenseList" parameterType="CmcDeviceExpense" resultMap="CmcDeviceExpenseResult">
23
         <include refid="selectCmcDeviceExpenseVo"/>
41
         <include refid="selectCmcDeviceExpenseVo"/>
24
         <where>  
42
         <where>  
25
-            <if test="deviceId != null "> and device_id = #{deviceId}</if>
26
-            <if test="userId != null "> and user_id = #{userId}</if>
27
-            <if test="expenseType != null  and expenseType != ''"> and expense_type = #{expenseType}</if>
28
-            <if test="expense != null "> and expense = #{expense}</if>
29
-            <if test="occurDate != null "> and occur_date = #{occurDate}</if>
30
-            <if test="document != null  and document != ''"> and document = #{document}</if>
43
+            <if test="deviceId != null "> and de.device_id = #{deviceId}</if>
44
+            <if test="userId != null "> and de.user_id = #{userId}</if>
45
+            <if test="expenseType != null  and expenseType != ''"> and de.expense_type = #{expenseType}</if>
46
+            <if test="expense != null "> and de.expense = #{expense}</if>
47
+            <if test="occurDate != null "> and de.occur_date = #{occurDate}</if>
48
+            <if test="document != null  and document != ''"> and de.document = #{document}</if>
31
         </where>
49
         </where>
32
     </select>
50
     </select>
33
     
51
     
34
     <select id="selectCmcDeviceExpenseByDeviceExpenseId" parameterType="String" resultMap="CmcDeviceExpenseResult">
52
     <select id="selectCmcDeviceExpenseByDeviceExpenseId" parameterType="String" resultMap="CmcDeviceExpenseResult">
35
         <include refid="selectCmcDeviceExpenseVo"/>
53
         <include refid="selectCmcDeviceExpenseVo"/>
36
-        where device_expense_id = #{deviceExpenseId}
54
+        where de.device_expense_id = #{deviceExpenseId}
37
     </select>
55
     </select>
38
         
56
         
39
     <insert id="insertCmcDeviceExpense" parameterType="CmcDeviceExpense">
57
     <insert id="insertCmcDeviceExpense" parameterType="CmcDeviceExpense">

+ 66
- 26
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceHandoverMapper.xml View File

7
     <resultMap type="CmcDeviceHandover" id="CmcDeviceHandoverResult">
7
     <resultMap type="CmcDeviceHandover" id="CmcDeviceHandoverResult">
8
         <result property="deviceHandoverId"    column="device_handover_id"    />
8
         <result property="deviceHandoverId"    column="device_handover_id"    />
9
         <result property="deviceId"    column="device_id"    />
9
         <result property="deviceId"    column="device_id"    />
10
-        <result property="handoverDept"    column="handover_dept"    />
11
-        <result property="handoverUser"    column="handover_user"    />
10
+        <result property="handoverDeptId"    column="handover_dept_id"    />
11
+        <result property="handoverUserId"    column="handover_user_id"    />
12
         <result property="handoverDate"    column="handover_date"    />
12
         <result property="handoverDate"    column="handover_date"    />
13
-        <result property="receiveDept"    column="receive_dept"    />
14
-        <result property="receiveUser"    column="receive_user"    />
13
+        <result property="receiveDeptId"    column="receive_dept_id"    />
14
+        <result property="receiveUserId"    column="receive_user_id"    />
15
         <result property="description"    column="description"    />
15
         <result property="description"    column="description"    />
16
         <result property="reason"    column="reason"    />
16
         <result property="reason"    column="reason"    />
17
         <result property="remark"    column="remark"    />
17
         <result property="remark"    column="remark"    />
18
+        <association property="handoverUser"    javaType="SysUser"         resultMap="HandoverUserResult" />
19
+        <association property="receiveUser"    javaType="SysDept"         resultMap="ReceiveUserResult" />
20
+        <association property="handoverDept"    javaType="SysDept"         resultMap="HandoverDeptResult" />
21
+        <association property="receiveDept"    javaType="SysDept"         resultMap="ReceiveDeptResult" />
22
+        <association property="device"    javaType="CmcDevice"         resultMap="CmcDeviceResult" />
23
+    </resultMap>
24
+
25
+    <resultMap type="SysUser" id="HandoverUserResult">
26
+        <result property="userId"    column="user_id"    />
27
+        <result property="nickName"    column="handover_nick_name"    />
28
+    </resultMap>
29
+
30
+    <resultMap type="SysUser" id="ReceiveUserResult">
31
+        <result property="userId"    column="user_id"    />
32
+        <result property="nickName"    column="receive_nick_name"    />
33
+    </resultMap>
34
+
35
+    <resultMap type="SysDept" id="HandoverDeptResult">
36
+        <result property="deptId"    column="dept_id"    />
37
+        <result property="deptName"    column="handover_dept_name"    />
38
+    </resultMap>
39
+
40
+    <resultMap type="SysDept" id="ReceiveDeptResult">
41
+        <result property="deptId"    column="dept_id"    />
42
+        <result property="deptName"    column="receive_dept_name"    />
43
+    </resultMap>
44
+
45
+    <resultMap type="CmcDevice" id="CmcDeviceResult">
46
+        <result property="deviceId"    column="device_id"    />
47
+        <result property="deviceNumber"    column="device_number"    />
48
+        <result property="code"    column="code"    />
49
+        <result property="name"    column="name"    />
50
+        <result property="series"    column="series"    />
51
+        <result property="brand"    column="brand"    />
18
     </resultMap>
52
     </resultMap>
19
 
53
 
20
     <sql id="selectCmcDeviceHandoverVo">
54
     <sql id="selectCmcDeviceHandoverVo">
21
-        select device_handover_id, device_id, handover_dept, handover_user, handover_date, receive_dept, receive_user, description, reason, remark from cmc_device_handover
55
+        select dh.device_handover_id, dh.device_id, dv.device_number, dv.code, dv.name, dv.brand, dv.series, dh.handover_dept_id, d.dept_name as handover_dept_name, u.nick_name as handover_nick_name, dh.handover_user_id, dh.handover_date,
56
+               dh.receive_dept_id, d1.dept_name as receive_dept_name, dh.receive_user_id, u1.nick_name as receive_nick_name, dh.description, dh.reason, dh.remark from cmc_device_handover as dh
57
+        left join sys_user as u on u.user_id = dh.handover_user_id
58
+        left join sys_user as u1 on u1.user_id = dh.receive_user_id
59
+        left join sys_dept as d on d.dept_id = dh.handover_dept_id
60
+        left join sys_dept as d1 on d1.dept_id = dh.receive_dept_id
61
+        left join cmc_device as dv on dv.device_id = dh.device_id
22
     </sql>
62
     </sql>
23
 
63
 
24
     <select id="selectCmcDeviceHandoverList" parameterType="CmcDeviceHandover" resultMap="CmcDeviceHandoverResult">
64
     <select id="selectCmcDeviceHandoverList" parameterType="CmcDeviceHandover" resultMap="CmcDeviceHandoverResult">
25
         <include refid="selectCmcDeviceHandoverVo"/>
65
         <include refid="selectCmcDeviceHandoverVo"/>
26
         <where>  
66
         <where>  
27
-            <if test="deviceId != null "> and device_id = #{deviceId}</if>
28
-            <if test="handoverDept != null "> and handover_dept = #{handoverDept}</if>
29
-            <if test="handoverUser != null "> and handover_user = #{handoverUser}</if>
30
-            <if test="handoverDate != null "> and handover_date = #{handoverDate}</if>
31
-            <if test="receiveDept != null "> and receive_dept = #{receiveDept}</if>
32
-            <if test="receiveUser != null "> and receive_user = #{receiveUser}</if>
33
-            <if test="description != null  and description != ''"> and description = #{description}</if>
34
-            <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
67
+            <if test="deviceId != null "> and dh.device_id = #{deviceId}</if>
68
+            <if test="handoverDeptId != null "> and dh.handover_dept_id = #{handoverDeptId}</if>
69
+            <if test="handoverUserId != null "> and dh.handover_user_id = #{handoverUserId}</if>
70
+            <if test="handoverDate != null "> and dh.handover_date = #{handoverDate}</if>
71
+            <if test="receiveDeptId != null "> and dh.receive_dept_id = #{receiveDeptId}</if>
72
+            <if test="receiveUserId != null "> and dh.receive_user_id = #{receiveUserId}</if>
73
+            <if test="description != null  and description != ''"> and dh.description = #{description}</if>
74
+            <if test="reason != null  and reason != ''"> and dh.reason = #{reason}</if>
35
         </where>
75
         </where>
36
     </select>
76
     </select>
37
     
77
     
38
     <select id="selectCmcDeviceHandoverByDeviceHandoverId" parameterType="String" resultMap="CmcDeviceHandoverResult">
78
     <select id="selectCmcDeviceHandoverByDeviceHandoverId" parameterType="String" resultMap="CmcDeviceHandoverResult">
39
         <include refid="selectCmcDeviceHandoverVo"/>
79
         <include refid="selectCmcDeviceHandoverVo"/>
40
-        where device_handover_id = #{deviceHandoverId}
80
+        where dh.device_handover_id = #{deviceHandoverId}
41
     </select>
81
     </select>
42
         
82
         
43
     <insert id="insertCmcDeviceHandover" parameterType="CmcDeviceHandover">
83
     <insert id="insertCmcDeviceHandover" parameterType="CmcDeviceHandover">
45
         <trim prefix="(" suffix=")" suffixOverrides=",">
85
         <trim prefix="(" suffix=")" suffixOverrides=",">
46
             <if test="deviceHandoverId != null">device_handover_id,</if>
86
             <if test="deviceHandoverId != null">device_handover_id,</if>
47
             <if test="deviceId != null">device_id,</if>
87
             <if test="deviceId != null">device_id,</if>
48
-            <if test="handoverDept != null">handover_dept,</if>
49
-            <if test="handoverUser != null">handover_user,</if>
88
+            <if test="handoverDeptId != null">handover_dept_id,</if>
89
+            <if test="handoverUserId != null">handover_user_id,</if>
50
             <if test="handoverDate != null">handover_date,</if>
90
             <if test="handoverDate != null">handover_date,</if>
51
-            <if test="receiveDept != null">receive_dept,</if>
52
-            <if test="receiveUser != null">receive_user,</if>
91
+            <if test="receiveDeptId != null">receive_dept_id,</if>
92
+            <if test="receiveUserId != null">receive_user_id,</if>
53
             <if test="description != null">description,</if>
93
             <if test="description != null">description,</if>
54
             <if test="reason != null">reason,</if>
94
             <if test="reason != null">reason,</if>
55
             <if test="remark != null">remark,</if>
95
             <if test="remark != null">remark,</if>
57
         <trim prefix="values (" suffix=")" suffixOverrides=",">
97
         <trim prefix="values (" suffix=")" suffixOverrides=",">
58
             <if test="deviceHandoverId != null">#{deviceHandoverId},</if>
98
             <if test="deviceHandoverId != null">#{deviceHandoverId},</if>
59
             <if test="deviceId != null">#{deviceId},</if>
99
             <if test="deviceId != null">#{deviceId},</if>
60
-            <if test="handoverDept != null">#{handoverDept},</if>
61
-            <if test="handoverUser != null">#{handoverUser},</if>
100
+            <if test="handoverDeptId != null">#{handoverDeptId},</if>
101
+            <if test="handoverUserId != null">#{handoverUserId},</if>
62
             <if test="handoverDate != null">#{handoverDate},</if>
102
             <if test="handoverDate != null">#{handoverDate},</if>
63
-            <if test="receiveDept != null">#{receiveDept},</if>
64
-            <if test="receiveUser != null">#{receiveUser},</if>
103
+            <if test="receiveDeptId != null">#{receiveDeptId},</if>
104
+            <if test="receiveUserId != null">#{receiveUserId},</if>
65
             <if test="description != null">#{description},</if>
105
             <if test="description != null">#{description},</if>
66
             <if test="reason != null">#{reason},</if>
106
             <if test="reason != null">#{reason},</if>
67
             <if test="remark != null">#{remark},</if>
107
             <if test="remark != null">#{remark},</if>
72
         update cmc_device_handover
112
         update cmc_device_handover
73
         <trim prefix="SET" suffixOverrides=",">
113
         <trim prefix="SET" suffixOverrides=",">
74
             <if test="deviceId != null">device_id = #{deviceId},</if>
114
             <if test="deviceId != null">device_id = #{deviceId},</if>
75
-            <if test="handoverDept != null">handover_dept = #{handoverDept},</if>
76
-            <if test="handoverUser != null">handover_user = #{handoverUser},</if>
115
+            <if test="handoverDeptId != null">handover_dept_id = #{handoverDeptId},</if>
116
+            <if test="handoverUserId != null">handover_user_id = #{handoverUserId},</if>
77
             <if test="handoverDate != null">handover_date = #{handoverDate},</if>
117
             <if test="handoverDate != null">handover_date = #{handoverDate},</if>
78
-            <if test="receiveDept != null">receive_dept = #{receiveDept},</if>
79
-            <if test="receiveUser != null">receive_user = #{receiveUser},</if>
118
+            <if test="receiveDeptId != null">receive_dept_id = #{receiveDeptId},</if>
119
+            <if test="receiveUserId != null">receive_user_id = #{receiveUserId},</if>
80
             <if test="description != null">description = #{description},</if>
120
             <if test="description != null">description = #{description},</if>
81
             <if test="reason != null">reason = #{reason},</if>
121
             <if test="reason != null">reason = #{reason},</if>
82
             <if test="remark != null">remark = #{remark},</if>
122
             <if test="remark != null">remark = #{remark},</if>

+ 24
- 24
oa-back/sql/sql.sql View File

5600
 INSERT INTO `cmc_device` VALUES (2, '002', '242572', '全站仪', '仪器设备', NULL, 0.00, NULL, 'TCRP1201+R400', '徕卡', 15.00, 'C204', '', 104, NULL);
5600
 INSERT INTO `cmc_device` VALUES (2, '002', '242572', '全站仪', '仪器设备', NULL, 0.00, NULL, 'TCRP1201+R400', '徕卡', 15.00, 'C204', '', 104, NULL);
5601
 INSERT INTO `cmc_device` VALUES (3, '003', '363119', '全站仪', '仪器设备', '2012-03-26', 353000.00, NULL, 'TM30 0.5\"', '徕卡', 15.00, '重庆分公司', '', 104, NULL);
5601
 INSERT INTO `cmc_device` VALUES (3, '003', '363119', '全站仪', '仪器设备', '2012-03-26', 353000.00, NULL, 'TM30 0.5\"', '徕卡', 15.00, '重庆分公司', '', 104, NULL);
5602
 INSERT INTO `cmc_device` VALUES (4, '004', '369141', '全站仪', '仪器设备', '2019-10-12', 280000.00, NULL, 'TM50 0.5\"', '徕卡', 15.00, 'C204', '2022.11.13-2022.11.18用于科博会展览', 104, NULL);
5602
 INSERT INTO `cmc_device` VALUES (4, '004', '369141', '全站仪', '仪器设备', '2019-10-12', 280000.00, NULL, 'TM50 0.5\"', '徕卡', 15.00, 'C204', '2022.11.13-2022.11.18用于科博会展览', 104, NULL);
5603
-INSERT INTO `cmc_device` VALUES (5, '005', '438516', '全站仪', '仪器设备', NULL, 393000.00, NULL, 'TCA2003  0.5\"', '徕卡', 15.00, 'C204', '设备停用,电池坏', 104, NULL);
5603
+INSERT INTO `cmc_device` VALUES (5, '005', '438516', '全站仪', '仪器设备', NULL, 393000.00, NULL, 'TCA2003  0.5\"', '徕卡', 15.00, 'C204', '设备停用,电池坏', 104, '3');
5604
 INSERT INTO `cmc_device` VALUES (6, '006', '7X0126', '全站仪', '仪器设备', '2008-07-01', 128000.00, NULL, 'GPT-7502', '拓普康', 15.00, 'C204', '', 104, NULL);
5604
 INSERT INTO `cmc_device` VALUES (6, '006', '7X0126', '全站仪', '仪器设备', '2008-07-01', 128000.00, NULL, 'GPT-7502', '拓普康', 15.00, 'C204', '', 104, NULL);
5605
 INSERT INTO `cmc_device` VALUES (7, '007', '7X1038', '全站仪', '仪器设备', '2008-07-01', 128000.00, NULL, 'GPT-7502', '拓普康', 15.00, 'C204', '', 104, NULL);
5605
 INSERT INTO `cmc_device` VALUES (7, '007', '7X1038', '全站仪', '仪器设备', '2008-07-01', 128000.00, NULL, 'GPT-7502', '拓普康', 15.00, 'C204', '', 104, NULL);
5606
 INSERT INTO `cmc_device` VALUES (8, '008', 'OP1454', '全站仪', '仪器设备', '2006-01-01', 0.00, NULL, 'GTS-332N', '拓普康', 15.00, 'C204', '无免棱镜', 104, NULL);
5606
 INSERT INTO `cmc_device` VALUES (8, '008', 'OP1454', '全站仪', '仪器设备', '2006-01-01', 0.00, NULL, 'GTS-332N', '拓普康', 15.00, 'C204', '无免棱镜', 104, NULL);
5616
 INSERT INTO `cmc_device` VALUES (18, '018', 'AP0035', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3002LNC', '拓普康', 15.00, 'C204', '2022.12.22二滩项目还回送星辰维修,仪器在项目上摔过,问题1:正倒镜距离偏差较大;问题2:目镜有遮挡物;问题3:竖盘指标差明显变大。', 104, NULL);
5616
 INSERT INTO `cmc_device` VALUES (18, '018', 'AP0035', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3002LNC', '拓普康', 15.00, 'C204', '2022.12.22二滩项目还回送星辰维修,仪器在项目上摔过,问题1:正倒镜距离偏差较大;问题2:目镜有遮挡物;问题3:竖盘指标差明显变大。', 104, NULL);
5617
 INSERT INTO `cmc_device` VALUES (19, '019', '4K2768', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3002LN', '拓普康', 15.00, '巴拉测量中心', '', 104, NULL);
5617
 INSERT INTO `cmc_device` VALUES (19, '019', '4K2768', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3002LN', '拓普康', 15.00, '巴拉测量中心', '', 104, NULL);
5618
 INSERT INTO `cmc_device` VALUES (20, '020', '4K2051', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3002LN', '拓普康', 15.00, 'C204', '', 104, NULL);
5618
 INSERT INTO `cmc_device` VALUES (20, '020', '4K2051', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3002LN', '拓普康', 15.00, 'C204', '', 104, NULL);
5619
-INSERT INTO `cmc_device` VALUES (21, '021', 'XL0461', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-335', '拓普康', 15.00, 'C204', '设备停用', 104, NULL);
5620
-INSERT INTO `cmc_device` VALUES (22, '022', 'XL1614', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-335', '拓普康', 15.00, 'C204', '设备停用', 104, NULL);
5621
-INSERT INTO `cmc_device` VALUES (23, '023', 'KQ0408', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-335W', '拓普康', 15.00, 'C204', '设备停用', 104, NULL);
5622
-INSERT INTO `cmc_device` VALUES (24, '024', '5B0214', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-335N', '拓普康', 15.00, 'C204', '设备停用', 104, NULL);
5623
-INSERT INTO `cmc_device` VALUES (25, '025', '5B0208', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-335N', '拓普康', 15.00, 'C204', '设备停用', 104, NULL);
5624
-INSERT INTO `cmc_device` VALUES (26, '026', '2N1574', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-102N', '拓普康', 15.00, 'C204', '设备停用', 104, NULL);
5619
+INSERT INTO `cmc_device` VALUES (21, '021', 'XL0461', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-335', '拓普康', 15.00, 'C204', '设备停用', 104, '3');
5620
+INSERT INTO `cmc_device` VALUES (22, '022', 'XL1614', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-335', '拓普康', 15.00, 'C204', '设备停用', 104, '3');
5621
+INSERT INTO `cmc_device` VALUES (23, '023', 'KQ0408', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-335W', '拓普康', 15.00, 'C204', '设备停用', 104, '3');
5622
+INSERT INTO `cmc_device` VALUES (24, '024', '5B0214', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-335N', '拓普康', 15.00, 'C204', '设备停用', 104, '3');
5623
+INSERT INTO `cmc_device` VALUES (25, '025', '5B0208', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-335N', '拓普康', 15.00, 'C204', '设备停用', 104, '3');
5624
+INSERT INTO `cmc_device` VALUES (26, '026', '2N1574', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GTS-102N', '拓普康', 15.00, 'C204', '设备停用', 104, '3');
5625
 INSERT INTO `cmc_device` VALUES (27, '027', '4M0255', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3005LN', '拓普康', 15.00, 'C204', '免棱镜', 104, NULL);
5625
 INSERT INTO `cmc_device` VALUES (27, '027', '4M0255', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3005LN', '拓普康', 15.00, 'C204', '免棱镜', 104, NULL);
5626
 INSERT INTO `cmc_device` VALUES (28, '028', '4M0174', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3005LN/OP', '拓普康', 15.00, 'C204', '免棱镜', 104, NULL);
5626
 INSERT INTO `cmc_device` VALUES (28, '028', '4M0174', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3005LN/OP', '拓普康', 15.00, 'C204', '免棱镜', 104, NULL);
5627
-INSERT INTO `cmc_device` VALUES (29, '029', '4M0179', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3005LN/OP', '拓普康', 15.00, 'C204', '设备停用', 104, NULL);
5628
-INSERT INTO `cmc_device` VALUES (30, '030', '4M1731', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3005/LN', '拓普康', 15.00, 'C204', '设备停用', 104, NULL);
5627
+INSERT INTO `cmc_device` VALUES (29, '029', '4M0179', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3005LN/OP', '拓普康', 15.00, 'C204', '设备停用', 104, '3');
5628
+INSERT INTO `cmc_device` VALUES (30, '030', '4M1731', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3005/LN', '拓普康', 15.00, 'C204', '设备停用', 104, '3');
5629
 INSERT INTO `cmc_device` VALUES (31, '031', 'ZQ007616', '全站仪', '仪器设备', '2020-05-10', 49000.00, NULL, 'GM-102', '拓普康', 15.00, 'C204', '', 104, NULL);
5629
 INSERT INTO `cmc_device` VALUES (31, '031', 'ZQ007616', '全站仪', '仪器设备', '2020-05-10', 49000.00, NULL, 'GM-102', '拓普康', 15.00, 'C204', '', 104, NULL);
5630
 INSERT INTO `cmc_device` VALUES (32, '032', 'ZQ007600', '全站仪', '仪器设备', '2020-05-10', 49000.00, NULL, 'GM-102', '拓普康', 15.00, '巴拉测量中心', '', 104, NULL);
5630
 INSERT INTO `cmc_device` VALUES (32, '032', 'ZQ007600', '全站仪', '仪器设备', '2020-05-10', 49000.00, NULL, 'GM-102', '拓普康', 15.00, '巴拉测量中心', '', 104, NULL);
5631
 INSERT INTO `cmc_device` VALUES (33, '033', '4M2584', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3005LN', '拓普康', 15.00, 'C204', '', 104, NULL);
5631
 INSERT INTO `cmc_device` VALUES (33, '033', '4M2584', '全站仪', '仪器设备', NULL, 0.00, NULL, 'GPT-3005LN', '拓普康', 15.00, 'C204', '', 104, NULL);
5632
 INSERT INTO `cmc_device` VALUES (34, '034', 'CF0727', '全站仪', '仪器设备', '2019-05-10', 61440.00, NULL, 'FX-102', '索佳', 15.00, 'C204', '', 104, NULL);
5632
 INSERT INTO `cmc_device` VALUES (34, '034', 'CF0727', '全站仪', '仪器设备', '2019-05-10', 61440.00, NULL, 'FX-102', '索佳', 15.00, 'C204', '', 104, NULL);
5633
 INSERT INTO `cmc_device` VALUES (35, '035', '2P6437', '全站仪', '仪器设备', '2021-09-26', 0.00, NULL, 'GTS-102N', '拓普康', 15.00, 'C314', '无免棱镜', 104, NULL);
5633
 INSERT INTO `cmc_device` VALUES (35, '035', '2P6437', '全站仪', '仪器设备', '2021-09-26', 0.00, NULL, 'GTS-102N', '拓普康', 15.00, 'C314', '无免棱镜', 104, NULL);
5634
-INSERT INTO `cmc_device` VALUES (36, '036', '0220414597', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, NULL);
5635
-INSERT INTO `cmc_device` VALUES (37, '037', '0220412233', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, NULL);
5636
-INSERT INTO `cmc_device` VALUES (38, '038', '0220414589', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '电池卡槽松动,设备停用', 104, NULL);
5637
-INSERT INTO `cmc_device` VALUES (39, '039', '0220384703', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, NULL);
5638
-INSERT INTO `cmc_device` VALUES (40, '040', '0220403484', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, NULL);
5639
-INSERT INTO `cmc_device` VALUES (41, '041', '4838158462', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '电瓶备注“坏”,设备停用', 104, NULL);
5640
-INSERT INTO `cmc_device` VALUES (42, '042', '4913169195', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, NULL);
5641
-INSERT INTO `cmc_device` VALUES (43, '043', '4838158505', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, NULL);
5642
-INSERT INTO `cmc_device` VALUES (44, '043-1', '4852162793', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, NULL);
5634
+INSERT INTO `cmc_device` VALUES (36, '036', '0220414597', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, '3');
5635
+INSERT INTO `cmc_device` VALUES (37, '037', '0220412233', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, '3');
5636
+INSERT INTO `cmc_device` VALUES (38, '038', '0220414589', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '电池卡槽松动,设备停用', 104, '3');
5637
+INSERT INTO `cmc_device` VALUES (39, '039', '0220384703', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, '3');
5638
+INSERT INTO `cmc_device` VALUES (40, '040', '0220403484', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, '3');
5639
+INSERT INTO `cmc_device` VALUES (41, '041', '4838158462', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '电瓶备注“坏”,设备停用', 104, '3');
5640
+INSERT INTO `cmc_device` VALUES (42, '042', '4913169195', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, '3');
5641
+INSERT INTO `cmc_device` VALUES (43, '043', '4838158505', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, '3');
5642
+INSERT INTO `cmc_device` VALUES (44, '043-1', '4852162793', 'GPS接收机', '仪器设备', NULL, 0.00, NULL, '天宝5700', '天宝', NULL, 'C204', '设备停用', 104, '3');
5643
 INSERT INTO `cmc_device` VALUES (45, '044', 'SG6063117172467WHS', 'GNSS接收机', '仪器设备', '2016-03-01', 34000.00, NULL, '银河6', '南方', 5.30, 'C204', '', 104, NULL);
5643
 INSERT INTO `cmc_device` VALUES (45, '044', 'SG6063117172467WHS', 'GNSS接收机', '仪器设备', '2016-03-01', 34000.00, NULL, '银河6', '南方', 5.30, 'C204', '', 104, NULL);
5644
 INSERT INTO `cmc_device` VALUES (46, '045', 'SG6062117168894WHS', 'GNSS接收机', '仪器设备', '2016-03-01', 34000.00, NULL, '银河6', '南方', 5.30, 'C204', '缺充电器', 104, NULL);
5644
 INSERT INTO `cmc_device` VALUES (46, '045', 'SG6062117168894WHS', 'GNSS接收机', '仪器设备', '2016-03-01', 34000.00, NULL, '银河6', '南方', 5.30, 'C204', '缺充电器', 104, NULL);
5645
 INSERT INTO `cmc_device` VALUES (47, '046', 'SG6063117172454WHS', 'GNSS接收机', '仪器设备', '2016-03-01', 34000.00, NULL, '银河6', '南方', 5.30, 'C204', '', 104, NULL);
5645
 INSERT INTO `cmc_device` VALUES (47, '046', 'SG6063117172454WHS', 'GNSS接收机', '仪器设备', '2016-03-01', 34000.00, NULL, '银河6', '南方', 5.30, 'C204', '', 104, NULL);
5754
 INSERT INTO `cmc_device` VALUES (156, '155', 'R22K300JCKT', '平板电脑', '仪器设备', NULL, 0.00, NULL, 'SM-T830', '三星S3', NULL, 'C204', '', 104, NULL);
5754
 INSERT INTO `cmc_device` VALUES (156, '155', 'R22K300JCKT', '平板电脑', '仪器设备', NULL, 0.00, NULL, 'SM-T830', '三星S3', NULL, 'C204', '', 104, NULL);
5755
 INSERT INTO `cmc_device` VALUES (157, '156', 'R22M4001YJZ', '平板电脑', '仪器设备', NULL, 0.00, NULL, 'SM-T830', '三星S4', NULL, 'C204', '', 104, NULL);
5755
 INSERT INTO `cmc_device` VALUES (157, '156', 'R22M4001YJZ', '平板电脑', '仪器设备', NULL, 0.00, NULL, 'SM-T830', '三星S4', NULL, 'C204', '', 104, NULL);
5756
 INSERT INTO `cmc_device` VALUES (158, '157', 'R22KB00570K', '平板电脑', '仪器设备', NULL, 0.00, NULL, 'SM-T830', '三星S4', NULL, 'C204', '', 104, NULL);
5756
 INSERT INTO `cmc_device` VALUES (158, '157', 'R22KB00570K', '平板电脑', '仪器设备', NULL, 0.00, NULL, 'SM-T830', '三星S4', NULL, 'C204', '', 104, NULL);
5757
-INSERT INTO `cmc_device` VALUES (159, '158', 'DSFFCGLS20460247', '无人机', '仪器设备', '2021-11-12', 0.00, NULL, '飞马D200S', '飞马', 137.00, 'C204', '2022.11.13-2022.11.18用于科博会展览,保险有效期为2022.11.25至2023.11.24', 104, NULL);
5757
+INSERT INTO `cmc_device` VALUES (159, '158', 'DSFFCGLS20460247', '无人机', '仪器设备', '2021-11-12', 360000.00, NULL, '飞马D200S', '飞马', 137.00, 'C204', '2022.11.13-2022.11.18用于科博会展览,保险有效期为2022.11.25至2023.11.24', 104, NULL);
5758
 INSERT INTO `cmc_device` VALUES (160, '158-1', 'D-CAM310G1911023', '相机', '仪器设备', NULL, 0.00, NULL, '飞马单镜头相机', '飞马', NULL, 'C204', '', 104, NULL);
5758
 INSERT INTO `cmc_device` VALUES (160, '158-1', 'D-CAM310G1911023', '相机', '仪器设备', NULL, 0.00, NULL, '飞马单镜头相机', '飞马', NULL, 'C204', '', 104, NULL);
5759
 INSERT INTO `cmc_device` VALUES (161, '159', 'DSFFCGLS19480130 ', '无人机', '仪器设备', '2019-12-03', 0.00, NULL, '飞马D200S', '飞马', 137.00, 'C204', '2022.3.8寄天津维护保养,4.12寄回,保险有效期至2023-02-15', 104, NULL);
5759
 INSERT INTO `cmc_device` VALUES (161, '159', 'DSFFCGLS19480130 ', '无人机', '仪器设备', '2019-12-03', 0.00, NULL, '飞马D200S', '飞马', 137.00, 'C204', '2022.3.8寄天津维护保养,4.12寄回,保险有效期至2023-02-15', 104, NULL);
5760
 INSERT INTO `cmc_device` VALUES (162, '160', 'D2000GLS21051080 (相机D-OP300021050682)', '无人机', '仪器设备', NULL, 0.00, NULL, '飞马D2000', '飞马', NULL, 'C204', '保险有效期至2024-02-23,寄回厂家换快门后2024.1.11寄回公司', 104, NULL);
5760
 INSERT INTO `cmc_device` VALUES (162, '160', 'D2000GLS21051080 (相机D-OP300021050682)', '无人机', '仪器设备', NULL, 0.00, NULL, '飞马D2000', '飞马', NULL, 'C204', '保险有效期至2024-02-23,寄回厂家换快门后2024.1.11寄回公司', 104, NULL);
6202
 create table `cmc_device_handover`  (
6202
 create table `cmc_device_handover`  (
6203
   `device_handover_id`	char(19)		not null 		comment '设备移交id',
6203
   `device_handover_id`	char(19)		not null 		comment '设备移交id',
6204
   `device_id` 			int 			default null 	comment '设备id',
6204
   `device_id` 			int 			default null 	comment '设备id',
6205
-  `handover_dept` 		bigint 			default null 	comment '移交部门id',
6206
-  `handover_user` 		bigint 			default null 	comment '移交人id',
6205
+  `handover_dept_id` 	bigint 			default null 	comment '移交部门id',
6206
+  `handover_user_id` 	bigint 			default null 	comment '移交人id',
6207
   `handover_date`		date			default null 	comment '移交日期',
6207
   `handover_date`		date			default null 	comment '移交日期',
6208
-  `receive_dept` 		bigint 			default null 	comment '接收部门id',
6209
-  `receive_user` 		bigint 			default null 	comment '接收人id',
6208
+  `receive_dept_id` 	bigint 			default null 	comment '接收部门id',
6209
+  `receive_user_id` 	bigint 			default null 	comment '接收人id',
6210
   `description`			varchar(255)	default null 	comment '设备软件说明',
6210
   `description`			varchar(255)	default null 	comment '设备软件说明',
6211
   `reason`				varchar(255)	default null 	comment '交接原因',
6211
   `reason`				varchar(255)	default null 	comment '交接原因',
6212
   `remark`				varchar(255)	default null 	comment '备注',
6212
   `remark`				varchar(255)	default null 	comment '备注',
6240
   `apply_date`			date			default null 	comment '申请日期',
6240
   `apply_date`			date			default null 	comment '申请日期',
6241
   `confirm_date`		date			default null 	comment '确认日期',
6241
   `confirm_date`		date			default null 	comment '确认日期',
6242
   `return_date`			date			default null 	comment '归还日期',
6242
   `return_date`			date			default null 	comment '归还日期',
6243
-  `state`				char(1)			default null 	comment '设备状况',
6243
+  `repair_devices`		varchar(50)		default null 	comment '需维修设备id',
6244
   `remark`				varchar(255)	default null 	comment '备注说明',
6244
   `remark`				varchar(255)	default null 	comment '备注说明',
6245
   `dept_time`			date			default null 	comment '部门审批时间',
6245
   `dept_time`			date			default null 	comment '部门审批时间',
6246
   `manager_time`		date			default null 	comment '分管审批时间',
6246
   `manager_time`		date			default null 	comment '分管审批时间',

+ 16
- 9
oa-ui/src/views/flowable/form/oa/deviceForm.vue View File

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-03-07 13:44:39
3
  * @Date: 2024-03-07 13:44:39
4
  * @LastEditors: wrh
4
  * @LastEditors: wrh
5
- * @LastEditTime: 2024-05-23 17:35:16
5
+ * @LastEditTime: 2024-05-24 09:27:36
6
 -->
6
 -->
7
 
7
 
8
 <template>
8
 <template>
61
               <el-form-item label="设备选择:">
61
               <el-form-item label="设备选择:">
62
                 <el-select style="width: 100%;" v-model="form.devices" filterable multiple placeholder="请选择"
62
                 <el-select style="width: 100%;" v-model="form.devices" filterable multiple placeholder="请选择"
63
                   clearable :disabled="taskName != '设备申请'">
63
                   clearable :disabled="taskName != '设备申请'">
64
-                  <el-option v-for="item in deviceList" :key="item.deviceId" :disabled="item.status == null || item.status != 1"
64
+                  <el-option v-for="item in deviceList" :key="item.deviceId" :disabled="item.status != 1"
65
                     :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
65
                     :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
66
                      + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
66
                      + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
67
                   </el-option>
67
                   </el-option>
98
               <el-form-item label-width="120px" label="拟发放设备:">
98
               <el-form-item label-width="120px" label="拟发放设备:">
99
                 <el-select style="width: 100%;" v-model="form.modifyDevices" filterable multiple placeholder="请选择"
99
                 <el-select style="width: 100%;" v-model="form.modifyDevices" filterable multiple placeholder="请选择"
100
                   clearable :disabled="taskName != '安排设备'">
100
                   clearable :disabled="taskName != '安排设备'">
101
-                  <el-option v-for="item in deviceList" :key="item.deviceId" :disabled="item.status == null || item.status != 1"
101
+                  <el-option v-for="item in deviceList" :key="item.deviceId" :disabled="item.status != 1" 
102
                     :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
102
                     :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
103
                      + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
103
                      + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
104
                   </el-option>
104
                   </el-option>
144
               </el-row>
144
               </el-row>
145
               <!-- 归还确认 -->
145
               <!-- 归还确认 -->
146
               <el-divider></el-divider>
146
               <el-divider></el-divider>
147
-              <el-form-item label="设备状况:" prop="state" label-width="120px">                
148
-                <el-radio-group v-model="form.state" size="small" :disabled="taskName != '归还确认'">
149
-                  <el-radio label="0">完好</el-radio>
150
-                  <el-radio label="1">需维修</el-radio>
151
-                </el-radio-group>
147
+              <el-form-item label="需维修设备:" prop="state" label-width="120px">                
148
+                <el-select style="width: 100%;" v-model="form.repairDevices" filterable multiple placeholder="请选择"
149
+                  clearable :disabled="taskName != '归还确认'">
150
+                  <el-option v-for="item in modifyDeviceList" :key="item.deviceId"
151
+                    :label="item.name +'【' +  (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series  + '】': '')
152
+                     + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place"  :value="item.deviceId">
153
+                  </el-option>
154
+                </el-select>
152
               </el-form-item>
155
               </el-form-item>
153
               <el-form-item label="备注:" prop="remark" label-width="120px">
156
               <el-form-item label="备注:" prop="remark" label-width="120px">
154
                 <el-input type="textarea" :rows="2" placeholder="请输入备注" v-model="form.remark"
157
                 <el-input type="textarea" :rows="2" placeholder="请输入备注" v-model="form.remark"
262
         ],
265
         ],
263
       },
266
       },
264
       deviceList: [],
267
       deviceList: [],
268
+      modifyDeviceList: [],
265
       formTotal: 0
269
       formTotal: 0
266
     }
270
     }
267
   },
271
   },
297
             data.modifyDevices = data.modifyDevices.split(',');
301
             data.modifyDevices = data.modifyDevices.split(',');
298
             let arr = []
302
             let arr = []
299
             for (let d of data.modifyDevices) {
303
             for (let d of data.modifyDevices) {
300
-              arr.push(parseInt(d))
304
+              arr.push(parseInt(d));
305
+              getDevice(d).then(result => {
306
+                this.modifyDeviceList.push(result.data);
307
+              })
301
             }
308
             }
302
             data.modifyDevices = arr;
309
             data.modifyDevices = arr;
303
           }
310
           }

+ 120
- 1
oa-ui/src/views/oa/car/detail.vue View File

76
         </template>
76
         </template>
77
         {{ carInfo.dayCost }}
77
         {{ carInfo.dayCost }}
78
       </el-descriptions-item>
78
       </el-descriptions-item>
79
+      <el-descriptions-item>
80
+        <template slot="label">
81
+          <svg-icon slot="prefix" icon-class="dept" class="el-input__icon input-icon" />
82
+          状态
83
+        </template>
84
+        {{ statusTypeText(carInfo.status) }}
85
+      </el-descriptions-item>
79
       <el-descriptions-item>
86
       <el-descriptions-item>
80
         <template slot="label">
87
         <template slot="label">
81
           <svg-icon slot="prefix" icon-class="remark" class="el-input__icon input-icon" />
88
           <svg-icon slot="prefix" icon-class="remark" class="el-input__icon input-icon" />
108
               <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
115
               <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
109
             </el-col>
116
             </el-col>
110
             <el-col :span="1.5">
117
             <el-col :span="1.5">
111
-              <el-button type="info" plain icon="el-icon-s-release" size="mini">前往报废</el-button>
118
+              <el-button type="info" plain icon="el-icon-s-release" size="mini"@click="handleScrap">{{ scrapButtonName }}</el-button>
112
             </el-col>
119
             </el-col>
113
           </el-row>
120
           </el-row>
114
           <el-table v-loading="loading" :data="expenseList" @selection-change="handleSelectionChange">
121
           <el-table v-loading="loading" :data="expenseList" @selection-change="handleSelectionChange">
213
         <el-button @click="cancel">取 消</el-button>
220
         <el-button @click="cancel">取 消</el-button>
214
       </div>
221
       </div>
215
     </el-dialog>
222
     </el-dialog>
223
+    <!-- 添加或修改cmc设备报废对话框 -->
224
+    <el-dialog :title="title" :visible.sync="scrapOpen" width="500px" append-to-body>
225
+      <el-form ref="scrapForm" :model="scrapForm" :rules="rules" label-width="80px">
226
+        <el-form-item label="原价值" prop="cost">
227
+          <el-input v-model="scrapForm.cost" placeholder="请输入原价值" />
228
+        </el-form-item>
229
+        <el-form-item label="报废日期" prop="scrapDate">
230
+          <el-date-picker clearable v-model="scrapForm.scrapDate" type="date" value-format="yyyy-MM-dd"
231
+            placeholder="请选择报废日期">
232
+          </el-date-picker>
233
+        </el-form-item>
234
+        <el-form-item label="报废原因" prop="reason">
235
+          <el-input v-model="scrapForm.reason" placeholder="请输入报废原因" />
236
+        </el-form-item>
237
+        <el-form-item label="处理结果" prop="deal">
238
+          <el-input v-model="scrapForm.deal" placeholder="请输入处理结果" />
239
+        </el-form-item>
240
+        <el-form-item label="备注" prop="remark">
241
+          <el-input v-model="scrapForm.remark" placeholder="请输入备注" />
242
+        </el-form-item>
243
+        <el-form-item label="附件" prop="document">
244
+          <el-input v-model="scrapForm.document" placeholder="请输入附件" />
245
+        </el-form-item>
246
+      </el-form>
247
+      <div slot="footer" class="dialog-footer">
248
+        <el-button type="primary" @click="submitScrapForm">确 定</el-button>
249
+        <el-button @click="scrapCancel">取 消</el-button>
250
+      </div>
251
+    </el-dialog>
216
   </div>
252
   </div>
217
 </template>
253
 </template>
218
 
254
 
219
 <script>
255
 <script>
220
 import { getCar } from '@/api/oa/car/car.js'
256
 import { getCar } from '@/api/oa/car/car.js'
221
 import { listCarExpense, getCarExpense, delCarExpense, addCarExpense, updateCarExpense } from "@/api/oa/car/carExpense";
257
 import { listCarExpense, getCarExpense, delCarExpense, addCarExpense, updateCarExpense } from "@/api/oa/car/carExpense";
258
+import { listDeviceScrap, getDeviceScrap, delDeviceScrap, addDeviceScrap, updateDeviceScrap } from "@/api/oa/device/deviceScrap";
222
 import { listCarApproval } from "@/api/oa/car/carApproval";
259
 import { listCarApproval } from "@/api/oa/car/carApproval";
223
 export default {
260
 export default {
224
   data() {
261
   data() {
252
       single: true,
289
       single: true,
253
       title: '',
290
       title: '',
254
       open: false,
291
       open: false,
292
+      scrapOpen: false,
255
       form: {},
293
       form: {},
294
+      scrapForm: {},
295
+      scrapButtonName: '',
256
       rules: {
296
       rules: {
257
         expenseType: [
297
         expenseType: [
258
           { required: true, message: '请选择费用类型', trigger: 'change' }
298
           { required: true, message: '请选择费用类型', trigger: 'change' }
273
         this.carInfo = res.data;
313
         this.carInfo = res.data;
274
       })
314
       })
275
       this.getList();
315
       this.getList();
316
+      this.getScrapStatus();
276
     }
317
     }
277
     if (this.$store.state.app.device == 'desktop') {
318
     if (this.$store.state.app.device == 'desktop') {
278
 
319
 
298
       this.$tab.closeOpenPage(obj);
339
       this.$tab.closeOpenPage(obj);
299
       this.$router.push({ path: '/car' });
340
       this.$router.push({ path: '/car' });
300
     },
341
     },
342
+    getScrapStatus() {
343
+      this.queryParams.deviceId = this.$route.query.deviceId
344
+      listDeviceScrap(this.queryParams).then(res => {
345
+        if (res.total > 0)
346
+          this.scrapButtonName = '查看报废信息';
347
+        else
348
+          this.scrapButtonName = '前往报废';
349
+      })
350
+    },
301
     /** 搜索按钮操作 */
351
     /** 搜索按钮操作 */
302
     handleQuery() {
352
     handleQuery() {
303
       this.queryParams.pageNum = 1;
353
       this.queryParams.pageNum = 1;
373
       this.open = false;
423
       this.open = false;
374
       this.reset();
424
       this.reset();
375
     },
425
     },
426
+    /* 报废记录 */
427
+    handleScrap() {
428
+      if (this.scrapButtonName == '查看报废信息')
429
+        this.handleUpdateScrap();      
430
+      else
431
+        this.handleAddScrap();  
432
+    },
433
+    handleAddScrap() {
434
+      this.resetScrap();
435
+      this.scrapOpen = true;
436
+      this.title = "添加设备报废信息";
437
+    },
438
+    handleUpdateScrap() {
439
+      this.resetScrap();
440
+      this.scrapForm.carId = this.$route.query.carId
441
+      listDeviceScrap(this.scrapForm).then(response => {
442
+        this.scrapForm = response.rows[0];
443
+        this.scrapOpen = true;
444
+        this.title = "修改设备报废信息";
445
+      });
446
+    },
447
+    // 表单重置
448
+    resetScrap() {
449
+      this.scrapForm = {
450
+        deviceScrapId: null,
451
+      };
452
+      this.resetForm("scrapForm");
453
+    },
454
+    submitScrapForm() {
455
+      this.$refs["scrapForm"].validate(valid => {
456
+        if (valid) {
457
+          this.scrapForm.carId = this.$route.query.carId
458
+          if (this.scrapForm.deviceScrapId != null) {
459
+            updateDeviceScrap(this.scrapForm).then(response => {
460
+              this.$modal.msgSuccess("修改成功");
461
+              this.scrapOpen = false;
462
+              this.getScrapList();
463
+            });
464
+          } else {
465
+            addDeviceScrap(this.scrapForm).then(response => {
466
+              this.$modal.msgSuccess("新增成功");
467
+              this.scrapOpen = false;
468
+              this.getScrapList();
469
+            });
470
+          }
471
+        }
472
+      });
473
+    },
474
+    scrapCancel() {
475
+      this.scrapOpen = false;
476
+      this.resetScrap();
477
+    },
376
     isNumber(value) {
478
     isNumber(value) {
377
       return typeof value === 'number' && /^\d+(\.\d+)?$/.test(value);
479
       return typeof value === 'number' && /^\d+(\.\d+)?$/.test(value);
378
     },
480
     },
481
+    statusTypeText(row) {
482
+      if (row == '0') {
483
+        return '被领用'
484
+      }
485
+      if (row == '1') {
486
+        return '可领用'
487
+      }
488
+      if (row == '2') {
489
+        return '维修中'
490
+      }
491
+      if (row == '3') {
492
+        return '已停用'
493
+      }
494
+      if (row == '4') {
495
+        return '已报废'
496
+      }
497
+    },
379
     expenseTypeText(row) {
498
     expenseTypeText(row) {
380
       if (row == '0') {
499
       if (row == '0') {
381
         return '保险费'
500
         return '保险费'

+ 484
- 146
oa-ui/src/views/oa/device/detail.vue View File

74
           <svg-icon slot="prefix" icon-class="dept" class="el-input__icon input-icon" />
74
           <svg-icon slot="prefix" icon-class="dept" class="el-input__icon input-icon" />
75
           管理部门
75
           管理部门
76
         </template>
76
         </template>
77
-        {{ deviceInfo.manageDeptName }}
77
+        {{ deviceInfo.dept ? deviceInfo.dept.deptName : '' }}
78
+      </el-descriptions-item>
79
+      <el-descriptions-item>
80
+        <template slot="label">
81
+          <svg-icon slot="prefix" icon-class="dept" class="el-input__icon input-icon" />
82
+          状态
83
+        </template>
84
+        {{ statusTypeText(deviceInfo.status) }}
78
       </el-descriptions-item>
85
       </el-descriptions-item>
79
       <el-descriptions-item>
86
       <el-descriptions-item>
80
         <template slot="label">
87
         <template slot="label">
95
           </div>
102
           </div>
96
           <el-row :gutter="10" class="mb8">
103
           <el-row :gutter="10" class="mb8">
97
             <el-col :span="1.5">
104
             <el-col :span="1.5">
98
-              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
99
-            </el-col>
100
-            <el-col :span="1.5">
101
-              <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
102
-                @click="handleUpdate">修改</el-button>
105
+              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddExpense">新增</el-button>
103
             </el-col>
106
             </el-col>
104
             <el-col :span="1.5">
107
             <el-col :span="1.5">
105
               <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
108
               <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
106
-                @click="handleDelete">删除</el-button>
109
+                @click="handleDeleteExpense">删除</el-button>
107
             </el-col>
110
             </el-col>
108
             <el-col :span="1.5">
111
             <el-col :span="1.5">
109
-              <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
112
+              <el-button type="warning" plain icon="el-icon-download" size="mini"
113
+                @click="handleExportExpense">导出</el-button>
110
             </el-col>
114
             </el-col>
111
             <el-col :span="1.5">
115
             <el-col :span="1.5">
112
-              <el-button type="info" plain icon="el-icon-s-release" size="mini">前往报废</el-button>
116
+              <el-button type="info" plain icon="el-icon-s-release" size="mini" @click="handleScrap">{{ scrapButtonName
117
+              }}</el-button>
113
             </el-col>
118
             </el-col>
114
           </el-row>
119
           </el-row>
115
-          <el-table v-loading="loading" :data="expenseList" @selection-change="handleSelectionChange">
120
+          <el-table v-loading="loading" :data="expenseList" @selection-change="handleSelectionExpenseChange">
116
             <el-table-column type="selection" width="55" align="center" />
121
             <el-table-column type="selection" width="55" align="center" />
117
-            <el-table-column type="index" width="55" align="center" label="序号" />
118
-            <el-table-column label="费用类型" align="center" prop="expenseType">
122
+            <el-table-column label="负责人" align="center" prop="userId">
119
               <template slot-scope="scope">
123
               <template slot-scope="scope">
120
-                <el-tag :type="expenseTypeStyle(scope.row.expenseType)">{{ expenseTypeText(scope.row.expenseType) }}</el-tag>
124
+                {{ scope.row.user ? scope.row.user.nickName : '' }}
121
               </template>
125
               </template>
122
             </el-table-column>
126
             </el-table-column>
123
-            <el-table-column label="费用金额" align="center" prop="expense">
127
+            <el-table-column label="费用类型" align="center" prop="expenseType">
124
               <template slot-scope="scope">
128
               <template slot-scope="scope">
125
-                {{ scope.row.expense + '元' }}
129
+                <el-tag :type="expenseTypeStyle(scope.row.expenseType)">{{ expenseTypeText(scope.row.expenseType)
130
+                }}</el-tag>
126
               </template>
131
               </template>
127
             </el-table-column>
132
             </el-table-column>
133
+            <el-table-column label="费用金额" align="center" prop="expense" />
128
             <el-table-column label="发生日期" align="center" prop="occurDate" width="180">
134
             <el-table-column label="发生日期" align="center" prop="occurDate" width="180">
129
               <template slot-scope="scope">
135
               <template slot-scope="scope">
130
-                {{ scope.row.occurDate }}
131
-              </template>
132
-            </el-table-column>
133
-            <el-table-column label="负责人" align="center" prop="userId">
134
-              <template slot-scope="scope">
135
-                {{ scope.row.userId}}
136
+                <span>{{ parseTime(scope.row.occurDate, '{y}-{m}-{d}') }}</span>
136
               </template>
137
               </template>
137
             </el-table-column>
138
             </el-table-column>
138
-            <el-table-column width="55" align="center" label="备注" prop="remark" />
139
+            <el-table-column label="备注" align="center" prop="remark" />
140
+            <el-table-column label="附件" align="center" prop="document" />
139
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
141
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
140
               <template slot-scope="scope">
142
               <template slot-scope="scope">
141
-                <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
142
-                  v-hasPermi="['oa:carExpense:edit']">修改</el-button>
143
-                <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
144
-                  v-hasPermi="['oa:carExpense:remove']">删除</el-button>
143
+                <el-button size="mini" type="text" icon="el-icon-edit"
144
+                  @click="handleUpdateExpense(scope.row)">修改</el-button>
145
+                <el-button size="mini" type="text" icon="el-icon-delete"
146
+                  @click="handleDeleteExpense(scope.row)">删除</el-button>
145
               </template>
147
               </template>
146
             </el-table-column>
148
             </el-table-column>
147
           </el-table>
149
           </el-table>
150
+
148
           <pagination v-show="expenseTotal > 0" :total="expenseTotal" :page.sync="queryParams.pageNum"
151
           <pagination v-show="expenseTotal > 0" :total="expenseTotal" :page.sync="queryParams.pageNum"
149
-            :limit.sync="queryParams.pageSize" @pagination="getList" />
152
+            :limit.sync="queryParams.pageSize" @pagination="getExpenseList" />
150
         </el-card>
153
         </el-card>
151
       </el-col>
154
       </el-col>
152
       <el-col :span="12" :xs="24">
155
       <el-col :span="12" :xs="24">
153
-      <!-- 移交、申领记录 -->
156
+        <!-- 移交、申领记录 -->
154
         <el-card>
157
         <el-card>
155
           <div slot="header" class="clearfix">
158
           <div slot="header" class="clearfix">
156
             <h3>{{ cardName }}</h3>
159
             <h3>{{ cardName }}</h3>
157
           </div>
160
           </div>
158
-          <el-row :gutter="10" class="mb8">
161
+          <el-row v-if="routeType == 'supply'" :gutter="10" class="mb8">
159
             <el-col :span="1.5">
162
             <el-col :span="1.5">
160
-              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
161
-            </el-col>
162
-            <el-col :span="1.5">
163
-              <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
164
-                @click="handleUpdate">修改</el-button>
163
+              <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddHandover">新增</el-button>
165
             </el-col>
164
             </el-col>
166
             <el-col :span="1.5">
165
             <el-col :span="1.5">
167
               <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
166
               <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
168
-                @click="handleDelete">删除</el-button>
167
+                @click="handleDeleteHandover">删除</el-button>
169
             </el-col>
168
             </el-col>
170
             <el-col :span="1.5">
169
             <el-col :span="1.5">
171
-              <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
170
+              <el-button type="warning" plain icon="el-icon-download" size="mini"
171
+                @click="handleExportHandover">导出</el-button>
172
             </el-col>
172
             </el-col>
173
           </el-row>
173
           </el-row>
174
-          <!-- 设备使用记录 -->
175
-          <el-table v-loading="loading" :data="approvalList" @selection-change="handleSelectionChange">
176
-            <el-table-column type="selection" width="55" align="center" />
174
+          <!-- 设备申领记录 -->
175
+          <el-table v-if="routeType == 'equipment'" v-loading="loading" :data="approvalList">
177
             <el-table-column type="index" width="55" align="center" label="序号" />
176
             <el-table-column type="index" width="55" align="center" label="序号" />
178
             <el-table-column label="申请人" align="center" prop="user.nickName">
177
             <el-table-column label="申请人" align="center" prop="user.nickName">
179
               <template slot-scope="scope">
178
               <template slot-scope="scope">
204
               <template slot-scope="scope">
203
               <template slot-scope="scope">
205
                 {{ scope.row.returnDate }}
204
                 {{ scope.row.returnDate }}
206
               </template>
205
               </template>
207
-            </el-table-column>            
206
+            </el-table-column>
208
             <el-table-column label="设备状况" align="center" prop="state">
207
             <el-table-column label="设备状况" align="center" prop="state">
209
               <template slot-scope="scope">
208
               <template slot-scope="scope">
210
-                <el-tag :type="stateTypeStyle(scope.row.state)">{{ stateTypeText(scope.row.state) }}</el-tag>
209
+                <el-tag :type="stateTypeStyle(scope.row)">{{ stateTypeText(scope.row) }}</el-tag>
210
+              </template>
211
+            </el-table-column>
212
+          </el-table>
213
+          <pagination v-show="approvalTotal > 0" :total="approvalTotal" :page.sync="queryParams.pageNum"
214
+            :limit.sync="queryParams.pageSize" @pagination="getApprovalList" />
215
+
216
+          <!-- 设备移交记录 -->
217
+          <el-table v-if="routeType == 'supply'" v-loading="loading" :data="handoverList"
218
+            @selection-change="handleSelectionHandoverChange">
219
+            <el-table-column type="selection" width="55" align="center" />
220
+            <el-table-column label="移交人" align="center" prop="handoverUser.nickName">
221
+              <template slot-scope="scope">
222
+                {{ scope.row.handoverUser ? scope.row.handoverUser.nickName : '' }}
223
+              </template>
224
+            </el-table-column>
225
+            <el-table-column label="移交部门" align="center" prop="handoverDept.deptName">
226
+              <template slot-scope="scope">
227
+                {{ scope.row.handoverDept ? scope.row.handoverDept.deptName : '' }}
228
+              </template>
229
+            </el-table-column>
230
+            <el-table-column label="接收人" align="center" prop="receiveUser.nickName">
231
+              <template slot-scope="scope">
232
+                {{ scope.row.receiveUser ? scope.row.receiveUser.nickName : '' }}
233
+              </template>
234
+            </el-table-column>
235
+            <el-table-column label="接收部门" align="center" prop="receiveDept.deptName">
236
+              <template slot-scope="scope">
237
+                {{ scope.row.receiveDept ? scope.row.receiveDept.deptName : '' }}
238
+              </template>
239
+            </el-table-column>
240
+            <el-table-column label="移交日期" align="center" prop="handoverDate" width="180">
241
+              <template slot-scope="scope">
242
+                <span>{{ parseTime(scope.row.handoverDate, '{y}-{m}-{d}') }}</span>
211
               </template>
243
               </template>
212
             </el-table-column>
244
             </el-table-column>
245
+            <el-table-column label="设备软件说明" align="center" prop="description" />
246
+            <el-table-column label="交接原因" align="center" prop="reason" />
247
+            <el-table-column label="备注" align="center" prop="remark" />
213
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
248
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
214
               <template slot-scope="scope">
249
               <template slot-scope="scope">
215
-                <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
216
-                  v-hasPermi="['oa:deviceApproval:edit']">修改</el-button>
217
-                <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
218
-                  v-hasPermi="['oa:deviceApproval:remove']">删除</el-button>
250
+                <el-button size="mini" type="text" icon="el-icon-edit"
251
+                  @click="handleUpdateHandover(scope.row)">修改</el-button>
252
+                <el-button size="mini" type="text" icon="el-icon-delete"
253
+                  @click="handleDeleteHandover(scope.row)">删除</el-button>
219
               </template>
254
               </template>
220
             </el-table-column>
255
             </el-table-column>
221
           </el-table>
256
           </el-table>
222
-          <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
223
-            :limit.sync="queryParams.pageSize" @pagination="getList" />
257
+
258
+          <pagination v-show="handoverTotal > 0" :total="handoverTotal" :page.sync="queryParams.pageNum"
259
+            :limit.sync="queryParams.pageSize" @pagination="getHandoverList" />
224
         </el-card>
260
         </el-card>
225
       </el-col>
261
       </el-col>
226
     </el-row>
262
     </el-row>
227
-    <!-- 添加明细 -->
228
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
229
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
230
-        <el-form-item label="申请人" prop="applier">
231
-          <el-input v-model="form.applier" placeholder="请输入申请人" />
263
+    <!-- 添加或修改cmc设备费用对话框 -->
264
+    <el-dialog :title="title" :visible.sync="expenseOpen" width="500px" append-to-body>
265
+      <el-form ref="expenseForm" :model="expenseForm" :rules="rules" label-width="80px">
266
+        <el-form-item label="负责人" prop="userId">
267
+          <el-select v-model="expenseForm.userId" filterable clearable style="width:220px">
268
+            <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId"
269
+              v-if="item.nickName != 'admin'">
270
+            </el-option>
271
+          </el-select>
232
         </el-form-item>
272
         </el-form-item>
233
-        <el-form-item label="使用部门" prop="useDept">
234
-          <el-input v-model="form.useDept" placeholder="请输入使用部门" />
273
+        <el-form-item label="费用类型" prop="expenseType">
274
+          <el-select v-model="expenseForm.expenseType" placeholder="请选择" clearable>
275
+            <el-option label="保险费" value="0"></el-option>
276
+            <el-option label="维修/保养费" value="1"></el-option>
277
+            <el-option label="检定费" value="2"></el-option>
278
+          </el-select>
235
         </el-form-item>
279
         </el-form-item>
236
-        <el-form-item label="设备id" prop="devices">
237
-          <el-input v-model="form.devices" placeholder="请输入设备id" />
280
+        <el-form-item label="费用金额" prop="expense">
281
+          <el-input v-model="expenseForm.expense" placeholder="请输入费用金额" />
238
         </el-form-item>
282
         </el-form-item>
239
-        <el-form-item label="项目id" prop="projectId">
240
-          <el-input v-model="form.projectId" placeholder="请输入项目id" />
283
+        <el-form-item label="发生日期" prop="occurDate">
284
+          <el-date-picker clearable v-model="expenseForm.occurDate" type="date" value-format="yyyy-MM-dd"
285
+            placeholder="请选择发生日期">
286
+          </el-date-picker>
241
         </el-form-item>
287
         </el-form-item>
242
-        <el-form-item label="申领事由" prop="applyReason">
243
-          <el-input v-model="form.applyReason" placeholder="请输入申领事由" />
288
+        <el-form-item label="备注" prop="remark">
289
+          <el-input v-model="expenseForm.remark" placeholder="请输入备注" />
244
         </el-form-item>
290
         </el-form-item>
245
-        <el-form-item label="开始日期" prop="beginDate">
246
-          <el-date-picker clearable v-model="form.beginDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择开始日期">
247
-          </el-date-picker>
291
+        <el-form-item label="附件" prop="document">
292
+          <el-input v-model="expenseForm.document" placeholder="请输入附件" />
248
         </el-form-item>
293
         </el-form-item>
249
-        <el-form-item label="结束日期" prop="endDate">
250
-          <el-date-picker clearable v-model="form.endDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择结束日期">
294
+      </el-form>
295
+      <div slot="footer" class="dialog-footer">
296
+        <el-button type="primary" @click="submitExpenseForm">确 定</el-button>
297
+        <el-button @click="expenseCancel">取 消</el-button>
298
+      </div>
299
+    </el-dialog>.
300
+    <!-- 添加或修改cmc设备移交对话框 -->
301
+    <el-dialog :title="title" :visible.sync="handoverOpen" width="500px" append-to-body>
302
+      <el-form ref="handoverForm" :model="handoverForm" :rules="rules" label-width="80px">
303
+        <el-row :gutter="20">
304
+          <el-col :span="12" :xs="24">
305
+            <el-form-item label="移交部门" prop="handoverDeptId">
306
+              <el-select v-model="handoverForm.handoverDeptId" filterable clearable style="width:120px"
307
+                @change="deptChange">
308
+                <el-option v-for="item in deptList" :key="item.deptId" :label="item.deptName" :value="item.deptId">
309
+                </el-option>
310
+              </el-select>
311
+            </el-form-item>
312
+          </el-col>
313
+          <el-col :span="12">
314
+            <el-form-item label="移交人" prop="handoverUserId">
315
+              <el-select v-model="handoverForm.handoverUserId" filterable clearable style="width:120px">
316
+                <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId"
317
+                  v-if="item.nickName != 'admin'">
318
+                </el-option>
319
+              </el-select>
320
+            </el-form-item>
321
+          </el-col>
322
+        </el-row>
323
+        <el-row :gutter="20">
324
+          <el-col :span="12" :xs="24">
325
+            <el-form-item label="接收部门" prop="receiveDeptId">
326
+              <el-select v-model="handoverForm.receiveDeptId" filterable clearable style="width:120px"
327
+                @change="deptChange">
328
+                <el-option v-for="item in deptList" :key="item.deptId" :label="item.deptName" :value="item.deptId">
329
+                </el-option>
330
+              </el-select>
331
+            </el-form-item>
332
+          </el-col>
333
+          <el-col :span="12">
334
+            <el-form-item label="接收人" prop="receiveUserId">
335
+              <el-select v-model="handoverForm.receiveUserId" filterable clearable style="width:120px">
336
+                <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId"
337
+                  v-if="item.nickName != 'admin'">
338
+                </el-option>
339
+              </el-select>
340
+            </el-form-item>
341
+          </el-col>
342
+        </el-row>
343
+        <el-form-item label="移交日期" prop="handoverDate">
344
+          <el-date-picker clearable v-model="handoverForm.handoverDate" type="date" value-format="yyyy-MM-dd"
345
+            placeholder="请选择移交日期">
251
           </el-date-picker>
346
           </el-date-picker>
252
         </el-form-item>
347
         </el-form-item>
253
-        <el-form-item label="天数" prop="days">
254
-          <el-input v-model="form.days" placeholder="请输入天数" />
348
+        <el-form-item label="设备软件说明" prop="description">
349
+          <el-input v-model="handoverForm.description" placeholder="请输入设备软件说明" />
255
         </el-form-item>
350
         </el-form-item>
256
-        <el-form-item label="申请日期" prop="applyDate">
257
-          <el-date-picker clearable v-model="form.applyDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择申请日期">
258
-          </el-date-picker>
351
+        <el-form-item label="交接原因" prop="reason">
352
+          <el-input v-model="handoverForm.reason" placeholder="请输入交接原因" />
353
+        </el-form-item>
354
+        <el-form-item label="备注" prop="remark">
355
+          <el-input v-model="handoverForm.remark" placeholder="请输入备注" />
259
         </el-form-item>
356
         </el-form-item>
260
-        <el-form-item label="归还日期" prop="returnDate">
261
-          <el-date-picker clearable v-model="form.returnDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择归还日期">
357
+      </el-form>
358
+      <div slot="footer" class="dialog-footer">
359
+        <el-button type="primary" @click="submitHandoverForm">确 定</el-button>
360
+        <el-button @click="handoverCancel">取 消</el-button>
361
+      </div>
362
+    </el-dialog>
363
+    <!-- 添加或修改cmc设备报废对话框 -->
364
+    <el-dialog :title="title" :visible.sync="scrapOpen" width="500px" append-to-body>
365
+      <el-form ref="scrapForm" :model="scrapForm" :rules="rules" label-width="80px">
366
+        <el-form-item label="原价值" prop="cost">
367
+          <el-input v-model="scrapForm.cost" placeholder="请输入原价值" />
368
+        </el-form-item>
369
+        <el-form-item label="报废日期" prop="scrapDate">
370
+          <el-date-picker clearable v-model="scrapForm.scrapDate" type="date" value-format="yyyy-MM-dd"
371
+            placeholder="请选择报废日期">
262
           </el-date-picker>
372
           </el-date-picker>
263
         </el-form-item>
373
         </el-form-item>
374
+        <el-form-item label="报废原因" prop="reason">
375
+          <el-input v-model="scrapForm.reason" placeholder="请输入报废原因" />
376
+        </el-form-item>
377
+        <el-form-item label="处理结果" prop="deal">
378
+          <el-input v-model="scrapForm.deal" placeholder="请输入处理结果" />
379
+        </el-form-item>
380
+        <el-form-item label="备注" prop="remark">
381
+          <el-input v-model="scrapForm.remark" placeholder="请输入备注" />
382
+        </el-form-item>
383
+        <el-form-item label="附件" prop="document">
384
+          <el-input v-model="scrapForm.document" placeholder="请输入附件" />
385
+        </el-form-item>
264
       </el-form>
386
       </el-form>
265
       <div slot="footer" class="dialog-footer">
387
       <div slot="footer" class="dialog-footer">
266
-        <el-button type="primary" @click="submitForm">确 定</el-button>
267
-        <el-button @click="cancel">取 消</el-button>
388
+        <el-button type="primary" @click="submitScrapForm">确 定</el-button>
389
+        <el-button @click="scrapCancel">取 消</el-button>
268
       </div>
390
       </div>
269
     </el-dialog>
391
     </el-dialog>
270
   </div>
392
   </div>
273
 <script>
395
 <script>
274
 import { getDevice } from '@/api/oa/device/device.js'
396
 import { getDevice } from '@/api/oa/device/device.js'
275
 import { listDeviceApproval, getDeviceApproval, delDeviceApproval, addDeviceApproval, updateDeviceApproval } from "@/api/oa/device/deviceApproval";
397
 import { listDeviceApproval, getDeviceApproval, delDeviceApproval, addDeviceApproval, updateDeviceApproval } from "@/api/oa/device/deviceApproval";
398
+import { listDeviceHandover, getDeviceHandover, delDeviceHandover, addDeviceHandover, updateDeviceHandover } from "@/api/oa/device/deviceHandover";
399
+import { listDeviceExpense, getDeviceExpense, delDeviceExpense, addDeviceExpense, updateDeviceExpense } from "@/api/oa/device/deviceExpense";
400
+import { listDeviceScrap, getDeviceScrap, delDeviceScrap, addDeviceScrap, updateDeviceScrap } from "@/api/oa/device/deviceScrap";
401
+import { listDept } from '@/api/system/dept';
402
+import { listUser } from '@/api/system/user';
276
 export default {
403
 export default {
277
   data() {
404
   data() {
278
     let validateApproval = (rule, value, callback) => {
405
     let validateApproval = (rule, value, callback) => {
291
       // 遮罩层
418
       // 遮罩层
292
       loading: true,
419
       loading: true,
293
       // 选中数组
420
       // 选中数组
294
-      ids: [],
421
+      expenseIds: [],
422
+      handoverIds: [],
295
       // 非单个禁用
423
       // 非单个禁用
296
       single: true,
424
       single: true,
297
       // 非多个禁用
425
       // 非多个禁用
299
       // 显示搜索条件
427
       // 显示搜索条件
300
       showSearch: true,
428
       showSearch: true,
301
       // 总条数
429
       // 总条数
302
-      total: 0,
430
+      approvalTotal: 0,
303
       expenseTotal: 0,
431
       expenseTotal: 0,
432
+      handoverTotal: 0,
304
       // cmc设备审批表格数据
433
       // cmc设备审批表格数据
305
       approvalList: [],
434
       approvalList: [],
306
       expenseList: [],
435
       expenseList: [],
436
+      handoverList: [],
437
+      userList: [],
438
+      deptList: [],
307
       cardName: '',
439
       cardName: '',
308
       column: 4,
440
       column: 4,
309
       deviceInfo: {},
441
       deviceInfo: {},
310
       // 弹出层标题
442
       // 弹出层标题
311
       title: "",
443
       title: "",
312
       // 是否显示弹出层
444
       // 是否显示弹出层
313
-      open: false,
445
+      expenseOpen: false,
446
+      handoverOpen: false,
447
+      scrapOpen: false,
314
       // 查询参数
448
       // 查询参数
315
       queryParams: {
449
       queryParams: {
316
         pageNum: 1,
450
         pageNum: 1,
317
         pageSize: 10,
451
         pageSize: 10,
318
       },
452
       },
319
       // 表单参数
453
       // 表单参数
320
-      form: {},
454
+      expenseForm: {
455
+        userId: 18,
456
+      },
457
+      handoverForm: {},
458
+      scrapForm: {},
321
       // 表单校验
459
       // 表单校验
322
       rules: {
460
       rules: {
323
       },
461
       },
324
       loading: false,
462
       loading: false,
325
-      routeType:''
463
+      routeType: '',
464
+      scrapButtonName: ''
326
     }
465
     }
327
   },
466
   },
328
   created() {
467
   created() {
329
     if (this.$route.query) {
468
     if (this.$route.query) {
330
       this.routeType = this.$route.query.type
469
       this.routeType = this.$route.query.type
331
-      if (this.$route.query.type == 'equipment')
470
+      if (this.routeType == 'equipment') {
332
         this.cardName = '申领记录';
471
         this.cardName = '申领记录';
333
-      else
472
+        this.getApprovalList();
473
+      }
474
+      else {
334
         this.cardName = '移交记录';
475
         this.cardName = '移交记录';
476
+        this.getHandoverList();
477
+      }
335
       getDevice(this.$route.query.deviceId).then(res => {
478
       getDevice(this.$route.query.deviceId).then(res => {
336
         this.deviceInfo = res.data;
479
         this.deviceInfo = res.data;
337
       })
480
       })
338
-      this.getList();
481
+      this.getExpenseList();
482
+      this.getDeptList();
483
+      this.getUserList();
484
+      this.getScrapStatus();
339
     }
485
     }
340
     if (this.$store.state.app.device == 'desktop') {
486
     if (this.$store.state.app.device == 'desktop') {
341
 
487
 
344
     }
490
     }
345
   },
491
   },
346
   methods: {
492
   methods: {
347
-    getList() {
493
+    getApprovalList() {
348
       this.queryParams.modifyDevices = this.$route.query.deviceId
494
       this.queryParams.modifyDevices = this.$route.query.deviceId
349
       listDeviceApproval(this.queryParams).then(res => {
495
       listDeviceApproval(this.queryParams).then(res => {
350
         this.approvalList = res.rows;
496
         this.approvalList = res.rows;
351
-        this.total = res.total;
497
+        this.approvalTotal = res.total;
498
+      })
499
+    },
500
+    getExpenseList() {
501
+      this.queryParams.deviceId = this.$route.query.deviceId
502
+      listDeviceExpense(this.queryParams).then(res => {
503
+        this.expenseList = res.rows;
504
+        this.expenseTotal = res.total;
505
+      })
506
+    },
507
+    getHandoverList() {
508
+      this.queryParams.deviceId = this.$route.query.deviceId
509
+      listDeviceHandover(this.queryParams).then(res => {
510
+        this.handoverList = res.rows;
511
+        this.handoverTotal = res.total;
512
+      })
513
+    },
514
+    getDeptList() {
515
+      listDept({ pageSize: 9999, pageNum: 1 }).then(res => {
516
+        this.deptList = res.data
517
+      })
518
+    },
519
+    getUserList() {
520
+      listUser({ pageSize: 9999, pageNum: 1 }).then(res => {
521
+        this.userList = res.rows
522
+      })
523
+    },
524
+    deptChange(val) {
525
+      listUser({ pageSize: 9999, pageNum: 1, deptId: val }).then(res => {
526
+        this.userList = res.rows
527
+      })
528
+    },
529
+    getScrapStatus() {
530
+      this.queryParams.deviceId = this.$route.query.deviceId
531
+      listDeviceScrap(this.queryParams).then(res => {
532
+        if (res.total > 0)
533
+          this.scrapButtonName = '查看报废信息';
534
+        else
535
+          this.scrapButtonName = '前往报废';
352
       })
536
       })
353
     },
537
     },
354
     goBack() {
538
     goBack() {
355
       let obj = { path: "/device/detail" }
539
       let obj = { path: "/device/detail" }
356
       this.$tab.closeOpenPage(obj);
540
       this.$tab.closeOpenPage(obj);
357
-      this.$router.push({ path: '/device/'+ this.routeType });
541
+      this.$router.push({ path: '/device/' + this.routeType });
358
     },
542
     },
359
     /** 搜索按钮操作 */
543
     /** 搜索按钮操作 */
360
-    handleQuery() {
544
+    handleExpenseQuery() {
361
       this.queryParams.pageNum = 1;
545
       this.queryParams.pageNum = 1;
362
-      this.getList();
546
+      this.queryParams.deviceId = this.$route.query.deviceId;
547
+      this.getExpenseList();
363
     },
548
     },
364
     // 多选框选中数据
549
     // 多选框选中数据
365
-    handleSelectionChange(selection) {
366
-      this.ids = selection.map(item => item.deviceApprovalId)
550
+    handleSelectionExpenseChange(selection) {
551
+      this.expenseIds = selection.map(item => item.deviceExpenseId)
367
       this.single = selection.length !== 1
552
       this.single = selection.length !== 1
368
       this.multiple = !selection.length
553
       this.multiple = !selection.length
369
     },
554
     },
370
-    handleAdd() {
371
-      this.reset();
372
-      this.open = true;
373
-      this.title = "添加设备使用明细";
374
-    },
375
-    handleUpdate(row) {
376
-      this.reset();
377
-      const deviceApplyId = row.deviceApplyId || this.ids
378
-      getDeviceApproval(deviceApplyId).then(response => {
379
-        this.form = response.data;
380
-        this.open = true;
381
-        this.title = "修改设备使用明细";
555
+    handleAddExpense() {
556
+      this.resetExpense();
557
+      this.expenseOpen = true;
558
+      this.title = "添加设备用明细";
559
+    },
560
+    handleUpdateExpense(row) {
561
+      this.resetExpense();
562
+      const deviceExpenseId = row.deviceExpenseId || this.expenseIds
563
+      getDeviceExpense(deviceExpenseId).then(response => {
564
+        this.expenseForm = response.data;
565
+        this.expenseOpen = true;
566
+        this.title = "修改设备用明细";
382
       });
567
       });
383
     },
568
     },
384
-    handleDelete(row) {
385
-      const deviceApprovalIds = row.deviceApprovalId || this.ids;
386
-      this.$modal.confirm('是否确认删除设备使用费用编号为"' + deviceApprovalIds + '"的数据项?').then(function () {
387
-        return delDeviceApproval(deviceApprovalIds);
569
+    handleDeleteExpense(row) {
570
+      const deviceExpenseIds = row.deviceExpenseId || this.expenseIds;
571
+      this.$modal.confirm('是否确认删除设备费用编号为"' + deviceExpenseIds + '"的数据项?').then(function () {
572
+        return delDeviceExpense(deviceExpenseIds);
388
       }).then(() => {
573
       }).then(() => {
389
-        this.getList();
574
+        this.getExpenseList();
390
         this.$modal.msgSuccess("删除成功");
575
         this.$modal.msgSuccess("删除成功");
391
       }).catch(() => { });
576
       }).catch(() => { });
392
     },
577
     },
393
-    handleExport() {
578
+    handleExportExpense() {
579
+      this.download('oa/deviceExpense/export', {
580
+        ...this.queryParams
581
+      }, `deviceExpense_${new Date().getTime()}.xlsx`)
582
+    },
583
+    // 表单重置
584
+    resetExpense() {
585
+      this.expenseForm = {
586
+        deviceExpenseId: null,
587
+      };
588
+      this.resetForm("expenseForm");
589
+    },
590
+    submitExpenseForm() {
591
+      this.$refs["expenseForm"].validate(valid => {
592
+        if (valid) {
593
+          this.expenseForm.deviceId = this.$route.query.deviceId
594
+          if (this.expenseForm.deviceExpenseId != null) {
595
+            updateDeviceExpense(this.expenseForm).then(response => {
596
+              this.$modal.msgSuccess("修改成功");
597
+              this.expenseOpen = false;
598
+              this.getExpenseList();
599
+            });
600
+          } else {
601
+            addDeviceExpense(this.expenseForm).then(response => {
602
+              this.$modal.msgSuccess("新增成功");
603
+              this.expenseOpen = false;
604
+              this.getExpenseList();
605
+            });
606
+          }
607
+        }
608
+      });
609
+    },
610
+    expenseCancel() {
611
+      this.expenseOpen = false;
612
+      this.resetExpense();
613
+    },
614
+
615
+    /* 申领记录 */
616
+    /** 搜索按钮操作 */
617
+    handleApprovalQuery() {
618
+      this.queryParams.pageNum = 1;
619
+      this.queryParams.modifyDevices = this.$route.query.deviceId;
620
+      this.getApprovalList();
621
+    },
622
+    handleExportApproval() {
394
       this.download('oa/deviceApproval/export', {
623
       this.download('oa/deviceApproval/export', {
395
         ...this.queryParams
624
         ...this.queryParams
396
       }, `deviceApproval_${new Date().getTime()}.xlsx`)
625
       }, `deviceApproval_${new Date().getTime()}.xlsx`)
397
     },
626
     },
627
+
628
+    /* 移交记录 */
629
+    /** 搜索按钮操作 */
630
+    handleHandoverQuery() {
631
+      this.queryParams.pageNum = 1;
632
+      this.getHandoverList();
633
+    },
634
+    // 多选框选中数据
635
+    handleSelectionHandoverChange(selection) {
636
+      this.handoverIds = selection.map(item => item.deviceHandoverId)
637
+      this.single = selection.length !== 1
638
+      this.multiple = !selection.length
639
+    },
640
+    handleAddHandover() {
641
+      this.resetHandover();
642
+      this.handoverOpen = true;
643
+      this.title = "添加设备移交明细";
644
+    },
645
+    handleUpdateHandover(row) {
646
+      this.resetHandover();
647
+      const deviceHandoverId = row.deviceHandoverId || this.handoverIds
648
+      getDeviceHandover(deviceHandoverId).then(response => {
649
+        this.handoverForm = response.data;
650
+        this.handoverOpen = true;
651
+        this.title = "修改设备移交明细";
652
+      });
653
+    },
654
+    handleDeleteHandover(row) {
655
+      const deviceHandoverIds = row.deviceHandoverId || this.handoverIds;
656
+      this.$modal.confirm('是否确认删除设备移交编号为"' + deviceHandoverIds + '"的数据项?').then(function () {
657
+        return delDeviceHandover(deviceHandoverIds);
658
+      }).then(() => {
659
+        this.getHandoverList();
660
+        this.$modal.msgSuccess("删除成功");
661
+      }).catch(() => { });
662
+    },
663
+    handleExportHandover() {
664
+      this.download('oa/deviceHandover/export', {
665
+        ...this.queryParams
666
+      }, `deviceHandover_${new Date().getTime()}.xlsx`)
667
+    },
398
     // 表单重置
668
     // 表单重置
399
-    reset() {
400
-      this.form = {
401
-        deviceApplyId: null,
402
-        applier: null,
403
-        useDept: null,
404
-        devices: null,
405
-        projectId: null,
406
-        applyReason: null,
407
-        beginDate: null,
408
-        beginHalfday: null,
409
-        endDate: null,
410
-        endHalfday: null,
411
-        days: null,
412
-        deptUserId: null,
413
-        deptComment: null,
414
-        managerUserId: null,
415
-        managerComment: null,
416
-        dispatcher: null,
417
-        dispatchComment: null,
418
-        estimateCost: null,
419
-        applyDate: null,
420
-        returnDate: null
669
+    resetHandover() {
670
+      this.handoverForm = {
671
+        deviceHandoverId: null,
421
       };
672
       };
422
-      this.resetForm("form");
673
+      this.resetForm("handoverForm");
423
     },
674
     },
424
-    submitForm() {
425
-      this.$refs["form"].validate(valid => {
675
+    submitHandoverForm() {
676
+      this.$refs["handoverForm"].validate(valid => {
426
         if (valid) {
677
         if (valid) {
427
-          this.form.deviceId = this.$route.query.deviceId
428
-          if (this.form.deviceApprovalId != null) {
429
-            updateDeviceApproval(this.form).then(response => {
678
+          this.handoverForm.deviceId = this.$route.query.deviceId
679
+          if (this.handoverForm.deviceHandoverId != null) {
680
+            updateDeviceHandover(this.handoverForm).then(response => {
430
               this.$modal.msgSuccess("修改成功");
681
               this.$modal.msgSuccess("修改成功");
431
-              this.open = false;
432
-              this.getList();
682
+              this.handoverOpen = false;
683
+              this.getHandoverList();
433
             });
684
             });
434
           } else {
685
           } else {
435
-            addDeviceApproval(this.form).then(response => {
686
+            addDeviceHandover(this.handoverForm).then(response => {
436
               this.$modal.msgSuccess("新增成功");
687
               this.$modal.msgSuccess("新增成功");
437
-              this.open = false;
438
-              this.getList();
688
+              this.handoverOpen = false;
689
+              this.getHandoverList();
439
             });
690
             });
440
           }
691
           }
441
         }
692
         }
442
       });
693
       });
443
     },
694
     },
444
-    cancel() {
445
-      this.open = false;
446
-      this.reset();
695
+    handoverCancel() {
696
+      this.handoverOpen = false;
697
+      this.resetHandover();
698
+    },
699
+
700
+    /* 报废记录 */
701
+    handleScrap() {
702
+      if (this.scrapButtonName == '查看报废信息')
703
+        this.handleUpdateScrap();      
704
+      else
705
+        this.handleAddScrap();  
706
+    },
707
+    handleAddScrap() {
708
+      this.resetScrap();
709
+      this.scrapOpen = true;
710
+      this.title = "添加设备报废信息";
711
+    },
712
+    handleUpdateScrap() {
713
+      this.resetScrap();
714
+      this.scrapForm.deviceId = this.$route.query.deviceId
715
+      listDeviceScrap(this.scrapForm).then(response => {
716
+        this.scrapForm = response.rows[0];
717
+        this.scrapOpen = true;
718
+        this.title = "修改设备报废信息";
719
+      });
720
+    },
721
+    // 表单重置
722
+    resetScrap() {
723
+      this.scrapForm = {
724
+        deviceScrapId: null,
725
+      };
726
+      this.resetForm("scrapForm");
727
+    },
728
+    submitScrapForm() {
729
+      this.$refs["scrapForm"].validate(valid => {
730
+        if (valid) {
731
+          this.scrapForm.deviceId = this.$route.query.deviceId
732
+          if (this.scrapForm.deviceScrapId != null) {
733
+            updateDeviceScrap(this.scrapForm).then(response => {
734
+              this.$modal.msgSuccess("修改成功");
735
+              this.scrapOpen = false;
736
+              this.getScrapList();
737
+            });
738
+          } else {
739
+            addDeviceScrap(this.scrapForm).then(response => {
740
+              this.$modal.msgSuccess("新增成功");
741
+              this.scrapOpen = false;
742
+              this.getScrapList();
743
+            });
744
+          }
745
+        }
746
+      });
747
+    },
748
+    scrapCancel() {
749
+      this.scrapOpen = false;
750
+      this.resetScrap();
447
     },
751
     },
448
     isNumber(value) {
752
     isNumber(value) {
449
       return typeof value === 'number' && /^\d+(\.\d+)?$/.test(value);
753
       return typeof value === 'number' && /^\d+(\.\d+)?$/.test(value);
471
       }
775
       }
472
     },
776
     },
473
     stateTypeText(row) {
777
     stateTypeText(row) {
474
-      if (row == '0') {
778
+      if (row.repairDevices.indexOf(this.$route.query.deviceId) == -1) {
475
         return '完好'
779
         return '完好'
476
       }
780
       }
477
-      if (row == '1') {
781
+      else {
478
         return '需维修'
782
         return '需维修'
479
       }
783
       }
480
     },
784
     },
481
     stateTypeStyle(row) {
785
     stateTypeStyle(row) {
482
-      if (row == '0') {
786
+      if (row.repairDevices.indexOf(this.$route.query.deviceId) == -1) {
483
         return 'success'
787
         return 'success'
484
       }
788
       }
789
+      else {
790
+        return 'danger'
791
+      }
792
+    },
793
+    statusTypeText(row) {
794
+      if (row == '0') {
795
+        return '被领用'
796
+      }
485
       if (row == '1') {
797
       if (row == '1') {
798
+        return '可领用'
799
+      }
800
+      if (row == '2') {
801
+        return '维修中'
802
+      }
803
+      if (row == '3') {
804
+        return '已停用'
805
+      }
806
+      if (row == '4') {
807
+        return '已报废'
808
+      }
809
+    },
810
+    statusTypeStyle(row) {
811
+      if (row == '0') {
812
+        return 'warning'
813
+      }
814
+      if (row == '1') {
815
+        return 'success'
816
+      }
817
+      if (row == '2') {
486
         return 'danger'
818
         return 'danger'
487
       }
819
       }
820
+      if (row == '3') {
821
+        return 'primary'
822
+      }
823
+      if (row == '3') {
824
+        return 'info'
825
+      }
488
     }
826
     }
489
   },
827
   },
490
 }
828
 }

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

37
     <el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
37
     <el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
38
       <el-table-column type="selection" width="55" align="center" />
38
       <el-table-column type="selection" width="55" align="center" />
39
       <!-- <el-table-column label="设备id" align="center" prop="deviceId" /> -->
39
       <!-- <el-table-column label="设备id" align="center" prop="deviceId" /> -->
40
-      <el-table-column label="设备状态" align="center" prop="status" >
40
+      <el-table-column label="设备状态" align="center" prop="status">
41
         <template slot-scope="scope">
41
         <template slot-scope="scope">
42
-                <el-tag :type="stateTypeStyle(scope.row.status)">{{ stateTypeText(scope.row.status) }}</el-tag>
43
-              </template>
42
+          <el-tag :type="statusTypeStyle(scope.row.status)">{{ statusTypeText(scope.row.status) }}</el-tag>
43
+        </template>
44
       </el-table-column>
44
       </el-table-column>
45
       <el-table-column label="出厂编号" align="center" prop="code" />
45
       <el-table-column label="出厂编号" align="center" prop="code" />
46
       <el-table-column label="设备名称" align="center" prop="name" />
46
       <el-table-column label="设备名称" align="center" prop="name" />
141
             </el-form-item>
141
             </el-form-item>
142
           </el-col>
142
           </el-col>
143
         </el-row>
143
         </el-row>
144
-        <el-form-item label="管理部门" prop="dept.deptName">
145
-          <el-input v-model="form.deptName" placeholder="请输入管理部门" />
146
-        </el-form-item>
144
+        <el-row :gutter="20">
145
+          <el-col :span="12">
146
+            <el-form-item label="管理部门" prop="manageDept">
147
+              <el-select v-model="form.manageDept" filterable placeholder="请选择" clearable>
148
+                <el-option v-for="item in deptList" :key="item.deptId" :label="item.deptName" :value="item.deptId">
149
+                </el-option>
150
+              </el-select>
151
+            </el-form-item>
152
+          </el-col>
153
+          <el-col :span="12">
154
+            <el-form-item label="设备状态" prop="status">
155
+              <el-select v-model="form.status" filterable placeholder="请选择">
156
+                <el-option v-for="item in statusList" :key="item.id" :label="item.name" :value="item.id">
157
+                </el-option>
158
+              </el-select>
159
+            </el-form-item>
160
+          </el-col>
161
+        </el-row>
147
         <el-row :gutter="20">
162
         <el-row :gutter="20">
148
           <el-col :span="24">
163
           <el-col :span="24">
149
             <el-form-item label="备注" prop="remark">
164
             <el-form-item label="备注" prop="remark">
163
 
178
 
164
 <script>
179
 <script>
165
 import { listDevice, getDevice, delDevice, addDevice, updateDevice } from "@/api/oa/device/device";
180
 import { listDevice, getDevice, delDevice, addDevice, updateDevice } from "@/api/oa/device/device";
181
+import { listDept } from '@/api/system/dept'
166
 
182
 
167
 export default {
183
 export default {
168
   name: "Device",
184
   name: "Device",
182
       total: 0,
198
       total: 0,
183
       // cmc设备信息表格数据
199
       // cmc设备信息表格数据
184
       deviceList: [],
200
       deviceList: [],
201
+      deptList: [],
202
+      statusList: [{ id: '0', name: '被领用' }, { id: '1', name: '可领用' }, { id: '2', name: '维修中' }, { id: '3', name: '已停用' }],
185
       // 弹出层标题
203
       // 弹出层标题
186
       title: "",
204
       title: "",
187
       // 是否显示弹出层
205
       // 是否显示弹出层
206
   },
224
   },
207
   created() {
225
   created() {
208
     this.getList();
226
     this.getList();
227
+    this.getDeptList();
209
   },
228
   },
210
   methods: {
229
   methods: {
211
     /** 查询cmc设备信息列表 */
230
     /** 查询cmc设备信息列表 */
217
         this.loading = false;
236
         this.loading = false;
218
       });
237
       });
219
     },
238
     },
239
+    getDeptList() {
240
+      listDept({ pageSize: 9999, pageNum: 1 }).then(res => {
241
+        this.deptList = res.data
242
+      })
243
+    },
220
     // 取消按钮
244
     // 取消按钮
221
     cancel() {
245
     cancel() {
222
       this.open = false;
246
       this.open = false;
314
         ...this.queryParams
338
         ...this.queryParams
315
       }, `device_${new Date().getTime()}.xlsx`)
339
       }, `device_${new Date().getTime()}.xlsx`)
316
     },
340
     },
317
-    stateTypeText(row) {
341
+    statusTypeText(row) {
318
       if (row == '0') {
342
       if (row == '0') {
319
         return '被领用'
343
         return '被领用'
320
       }
344
       }
322
         return '可领用'
346
         return '可领用'
323
       }
347
       }
324
       if (row == '2') {
348
       if (row == '2') {
349
+        return '维修中'
350
+      }
351
+      if (row == '3') {
325
         return '已停用'
352
         return '已停用'
326
       }
353
       }
327
     },
354
     },
328
-    stateTypeStyle(row) {
355
+    statusTypeStyle(row) {
329
       if (row == '0') {
356
       if (row == '0') {
330
         return 'warning'
357
         return 'warning'
331
       }
358
       }
333
         return 'success'
360
         return 'success'
334
       }
361
       }
335
       if (row == '2') {
362
       if (row == '2') {
363
+        return 'danger'
364
+      }
365
+      if (row == '3') {
336
         return 'info'
366
         return 'info'
337
       }
367
       }
338
     }
368
     }

Loading…
Cancel
Save