Commit a7880dc888a9a3be400ed7c01a62916a67fa1e5b
m
Showing
47 changed files
with
3936 additions
and
31 deletions
Too many changes to show.
To preserve performance only 47 of 94 files are displayed.
trash-garbage/pom.xml
| ... | ... | @@ -42,6 +42,10 @@ |
| 42 | 42 | <artifactId>hutool-all</artifactId> |
| 43 | 43 | <version>5.3.8</version> |
| 44 | 44 | </dependency> |
| 45 | + <dependency> | |
| 46 | + <groupId>com.trash</groupId> | |
| 47 | + <artifactId>trash-unit</artifactId> | |
| 48 | + </dependency> | |
| 45 | 49 | </dependencies> |
| 46 | 50 | <!-- 项目打包时会将java目录中的*.xml文件也进行打包 --> |
| 47 | 51 | <build> | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/controller/GarbageOrderController.java
0 → 100644
| 1 | +package com.trash.garbage.controller; | |
| 2 | + | |
| 3 | + | |
| 4 | +import com.trash.common.config.trashConfig; | |
| 5 | +import com.trash.common.utils.file.FileUploadUtils; | |
| 6 | +import com.trash.framework.config.ServerConfig; | |
| 7 | +import com.trash.garbage.custom.BizException; | |
| 8 | +import com.trash.garbage.global.Result; | |
| 9 | +import com.trash.garbage.global.ResultCode; | |
| 10 | +import com.trash.garbage.pojo.dto.EvaluateDto; | |
| 11 | +import com.trash.garbage.pojo.dto.OrderDto; | |
| 12 | +import com.trash.garbage.pojo.dto.OrderUpdateDto; | |
| 13 | +import com.trash.garbage.pojo.dto.UploadDto; | |
| 14 | +import com.trash.garbage.pojo.vo.OrderDetailVo; | |
| 15 | +import com.trash.garbage.service.GarOrderService; | |
| 16 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 17 | +import org.springframework.validation.annotation.Validated; | |
| 18 | +import org.springframework.web.bind.annotation.*; | |
| 19 | +import org.springframework.web.multipart.MultipartFile; | |
| 20 | + | |
| 21 | +import java.io.IOException; | |
| 22 | +import java.util.HashMap; | |
| 23 | +import java.util.Map; | |
| 24 | + | |
| 25 | +/** | |
| 26 | + * 订单控制 | |
| 27 | + * | |
| 28 | + * @author 20412 | |
| 29 | + */ | |
| 30 | +@RestController | |
| 31 | +@RequestMapping("/order") | |
| 32 | +public class GarbageOrderController { | |
| 33 | + | |
| 34 | + @Autowired | |
| 35 | + private GarOrderService garOrderService; | |
| 36 | + @Autowired | |
| 37 | + private ServerConfig serverConfig; | |
| 38 | + | |
| 39 | + @PostMapping("/add") | |
| 40 | + public Result<?> saveOrder(@Validated @RequestBody OrderDto dto) { | |
| 41 | + return Result.OK(garOrderService.saveOrder(dto)); | |
| 42 | + } | |
| 43 | + | |
| 44 | + @RequestMapping("upload") | |
| 45 | + public Result<?> uploadFile(@RequestParam("file") MultipartFile file) { | |
| 46 | + String fileName = null; | |
| 47 | + try { // 上传文件路径 | |
| 48 | + String filePath = trashConfig.getUploadPath(); | |
| 49 | + // 上传并返回新文件名称 | |
| 50 | + fileName = FileUploadUtils.upload(filePath, file); | |
| 51 | + } catch (IOException e) { | |
| 52 | + throw new BizException(ResultCode.CODE_400, ResultCode.CODE_400.getMsg()); | |
| 53 | + } | |
| 54 | + String url = serverConfig.getUrl() + fileName; | |
| 55 | + Map<String, String> urlMap = new HashMap<>(); | |
| 56 | + urlMap.put("url", url); | |
| 57 | + urlMap.put("fileName", fileName); | |
| 58 | + return Result.OK(urlMap, "图片上传成功"); | |
| 59 | + } | |
| 60 | + | |
| 61 | + @GetMapping("/detail/{id}") | |
| 62 | + public Result<OrderDetailVo> queryOrderDetail(@PathVariable("id") String id) { | |
| 63 | + return Result.OK(garOrderService.queryOrderDetail(id)); | |
| 64 | + } | |
| 65 | + | |
| 66 | + @PutMapping("/update") | |
| 67 | + public Result<String> uploadOrder(@RequestBody OrderUpdateDto dto) { | |
| 68 | + return Result.OK(garOrderService.uploadOrder(dto)); | |
| 69 | + } | |
| 70 | + | |
| 71 | + @PostMapping("/evaluate") | |
| 72 | + public Result<String> evaluateOrder(@Validated @RequestBody EvaluateDto dto) { | |
| 73 | + return Result.OK(garOrderService.evaluateOrder(dto)); | |
| 74 | + } | |
| 75 | + | |
| 76 | + | |
| 77 | + @GetMapping("/query/list") | |
| 78 | + public Result<?> queryOrderList(@RequestParam("type") Integer type, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) { | |
| 79 | + return Result.OK(garOrderService.queryOrderList(type, pageNo, pageSize)); | |
| 80 | + } | |
| 81 | + | |
| 82 | + @PostMapping("/upload/imageUrl") | |
| 83 | + public Result<?> uploadImageUrlByType(@RequestBody UploadDto dto) { | |
| 84 | + return Result.OK(garOrderService.uploadImageUrlByType(dto)); | |
| 85 | + } | |
| 86 | + | |
| 87 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/controller/GarbageUserController.java
| ... | ... | @@ -3,6 +3,7 @@ package com.trash.garbage.controller; |
| 3 | 3 | |
| 4 | 4 | import com.trash.garbage.global.Result; |
| 5 | 5 | import com.trash.garbage.pojo.domain.GarAddress; |
| 6 | +import com.trash.garbage.pojo.domain.GarUser; | |
| 6 | 7 | import com.trash.garbage.pojo.dto.AddressDto; |
| 7 | 8 | import com.trash.garbage.pojo.dto.LoginDto; |
| 8 | 9 | import com.trash.garbage.service.GarUserService; |
| ... | ... | @@ -67,4 +68,11 @@ public class GarbageUserController { |
| 67 | 68 | } |
| 68 | 69 | |
| 69 | 70 | |
| 71 | + @PutMapping("/update") | |
| 72 | + public Result<?> updateUser(@RequestBody GarUser user){ | |
| 73 | + garUserService.updateUserInfo(user); | |
| 74 | + return Result.OK(); | |
| 75 | + } | |
| 76 | + | |
| 77 | + | |
| 70 | 78 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/custom/BizException.java
| ... | ... | @@ -35,10 +35,8 @@ public class BizException extends RuntimeException{ |
| 35 | 35 | this.code = code; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - | |
| 39 | - | |
| 40 | - public BizException(ResultCode code, String msg){ | |
| 41 | - this.msg = msg; | |
| 38 | + public BizException(ResultCode code, String msg){ | |
| 42 | 39 | this.code = code; |
| 40 | + this.msg = msg; | |
| 43 | 41 | } |
| 44 | 42 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/global/GlobalStatus.java
| ... | ... | @@ -36,13 +36,13 @@ public class GlobalStatus { |
| 36 | 36 | * 普通登录 |
| 37 | 37 | */ |
| 38 | 38 | NORMAL_LOGIN(0, "普通登录"), |
| 39 | - NORMAL_USER(0, "普通用户"), | |
| 40 | - DRIVER_USER(1, "驾驶员用户"); | |
| 39 | + NORMAL_USER(0, "居民用户"), | |
| 40 | + DRIVER_USER(1, "管理负责人"); | |
| 41 | 41 | |
| 42 | 42 | private Integer status; |
| 43 | 43 | private String description; |
| 44 | 44 | |
| 45 | - public int getStatus() { | |
| 45 | + public Integer getStatus() { | |
| 46 | 46 | return this.status; |
| 47 | 47 | } |
| 48 | 48 | |
| ... | ... | @@ -57,7 +57,7 @@ public class GlobalStatus { |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * 字典 | |
| 60 | + * 地址 | |
| 61 | 61 | */ |
| 62 | 62 | public enum GarAddressStatus { |
| 63 | 63 | NORMAL_ADDRESS(0, "地址"), |
| ... | ... | @@ -78,6 +78,38 @@ public class GlobalStatus { |
| 78 | 78 | public String getDescription() { |
| 79 | 79 | return this.description; |
| 80 | 80 | } |
| 81 | + } | |
| 82 | + | |
| 83 | + /** | |
| 84 | + * 订单 | |
| 85 | + */ | |
| 86 | + public enum GarOrderStatus { | |
| 87 | + NEW_ORDER(0, "新订单"), | |
| 88 | + ACTIVE_ORDER(1, "处理中"), | |
| 89 | + ALL_ORDER(2, "全部订单"), | |
| 90 | + SUCCESS_ORDER(3, "待支付订单"), | |
| 91 | + FAIL_ORDER(9, "订单处理失败"), | |
| 92 | + CANCEL_FLAG_NO(0, "未取消订单"), | |
| 93 | + IMAGE_TYPE_CURRENT(0, "现场图片"), | |
| 94 | + IMAGE_TYPE_PUT_ON(1, "装车图片"), | |
| 95 | + IMAGE_TYPE_PUT_DOWN(2, "卸车图片"), | |
| 96 | + EVALUATE_ORDER_NO(0,"待评价"), | |
| 97 | + EVALUATE_ORDER_YES(1,"已评价"); | |
| 98 | + | |
| 99 | + GarOrderStatus(Integer status, String description) { | |
| 100 | + this.status = status; | |
| 101 | + this.description = description; | |
| 102 | + } | |
| 103 | + | |
| 104 | + private String description; | |
| 105 | + private Integer status; | |
| 81 | 106 | |
| 107 | + public Integer getValue() { | |
| 108 | + return this.status; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public String getDescription() { | |
| 112 | + return this.description; | |
| 113 | + } | |
| 82 | 114 | } |
| 83 | 115 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/interceptor/MyMetaObjectHandler.java
| ... | ... | @@ -23,17 +23,12 @@ public class MyMetaObjectHandler implements MetaObjectHandler { |
| 23 | 23 | if (metaObject.hasGetter("garCreateTime")) { |
| 24 | 24 | this.strictInsertFill(metaObject, "garCreateTime", Date.class, new Date()); |
| 25 | 25 | } |
| 26 | - | |
| 27 | 26 | if (metaObject.hasGetter("garCreateBy")) { |
| 28 | 27 | this.strictInsertFill(metaObject, "garCreateBy", String.class, SecurityUtils.getLoginUser().getUser().getUserId()); |
| 29 | 28 | } |
| 30 | - | |
| 31 | 29 | if (metaObject.hasGetter("garUpdateTime")) { |
| 32 | 30 | this.strictInsertFill(metaObject, "garUpdateTime", Date.class, new Date()); |
| 33 | 31 | } |
| 34 | - if (metaObject.hasGetter("garUserId")) { | |
| 35 | - this.strictInsertFill(metaObject, "garUserId", String.class, SecurityUtils.getLoginUser().getUser().getUserId()); | |
| 36 | - } | |
| 37 | 32 | if (metaObject.hasGetter("garUpdateBy")) { |
| 38 | 33 | this.strictInsertFill(metaObject, "garUpdateBy", String.class, SecurityUtils.getLoginUser().getUser().getUserId()); |
| 39 | 34 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderEvaluateMapper.java
0 → 100644
| 1 | +package com.trash.garbage.mapper; | |
| 2 | + | |
| 3 | +import com.trash.garbage.pojo.domain.GarOrderEvaluate; | |
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
| 5 | + | |
| 6 | +/** | |
| 7 | +* @author 20412 | |
| 8 | +* @description 针对表【gar_order_evaluate(建筑垃圾-派单评分)】的数据库操作Mapper | |
| 9 | +* @createDate 2023-11-29 14:19:18 | |
| 10 | +* @Entity com.trash.garbage.pojo.domain.GarOrderEvaluate | |
| 11 | +*/ | |
| 12 | +public interface GarOrderEvaluateMapper extends BaseMapper<GarOrderEvaluate> { | |
| 13 | + | |
| 14 | +} | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderImageMapper.java
0 → 100644
| 1 | +package com.trash.garbage.mapper; | |
| 2 | + | |
| 3 | +import com.trash.garbage.pojo.domain.GarOrderImage; | |
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
| 5 | + | |
| 6 | +/** | |
| 7 | +* @author 20412 | |
| 8 | +* @description 针对表【gar_order_image(装修垃圾-订单图片表)】的数据库操作Mapper | |
| 9 | +* @createDate 2023-11-24 16:26:19 | |
| 10 | +* @Entity com.trash.garbage.pojo.domain.GarOrderImage | |
| 11 | +*/ | |
| 12 | +public interface GarOrderImageMapper extends BaseMapper<GarOrderImage> { | |
| 13 | + | |
| 14 | +} | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderMapper.java
0 → 100644
| 1 | +package com.trash.garbage.mapper; | |
| 2 | + | |
| 3 | +import com.trash.garbage.pojo.domain.GarOrder; | |
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
| 5 | + | |
| 6 | +/** | |
| 7 | +* @author 20412 | |
| 8 | +* @description 针对表【gar_order(建筑垃圾—订单表)】的数据库操作Mapper | |
| 9 | +* @createDate 2023-11-24 16:26:19 | |
| 10 | +* @Entity com.trash.garbage.pojo.domain.GarOrder | |
| 11 | +*/ | |
| 12 | +public interface GarOrderMapper extends BaseMapper<GarOrder> { | |
| 13 | + | |
| 14 | +} | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarAddress.java
| ... | ... | @@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | 7 | |
| 8 | 8 | import java.io.Serializable; |
| 9 | 9 | import java.util.Date; |
| 10 | +import java.util.Objects; | |
| 10 | 11 | |
| 11 | 12 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 12 | 13 | import lombok.Data; |
| 14 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 13 | 15 | |
| 14 | 16 | |
| 15 | 17 | /** |
| ... | ... | @@ -48,6 +50,7 @@ public class GarAddress implements Serializable { |
| 48 | 50 | */ |
| 49 | 51 | @TableField(fill = FieldFill.INSERT, select = false) |
| 50 | 52 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") |
| 53 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 51 | 54 | private Date garCreateTime; |
| 52 | 55 | |
| 53 | 56 | /** |
| ... | ... | @@ -55,6 +58,7 @@ public class GarAddress implements Serializable { |
| 55 | 58 | */ |
| 56 | 59 | @TableField(fill = FieldFill.INSERT_UPDATE, select = false) |
| 57 | 60 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") |
| 61 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 58 | 62 | private Date garUpdateTime; |
| 59 | 63 | |
| 60 | 64 | /** |
| ... | ... | @@ -72,6 +76,9 @@ public class GarAddress implements Serializable { |
| 72 | 76 | */ |
| 73 | 77 | private String garRemark; |
| 74 | 78 | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 75 | 82 | @TableField(exist = false) |
| 76 | 83 | private static final long serialVersionUID = 1L; |
| 77 | 84 | |
| ... | ... | @@ -209,6 +216,5 @@ public class GarAddress implements Serializable { |
| 209 | 216 | public static long getSerialversionuid() { |
| 210 | 217 | return serialVersionUID; |
| 211 | 218 | } |
| 212 | - | |
| 213 | - | |
| 219 | + | |
| 214 | 220 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrder.java
0 → 100644
| 1 | +package com.trash.garbage.pojo.domain; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.*; | |
| 4 | + | |
| 5 | +import java.io.Serializable; | |
| 6 | +import java.util.Date; | |
| 7 | + | |
| 8 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 9 | +import com.fasterxml.jackson.annotation.JsonIgnore; | |
| 10 | +import lombok.Data; | |
| 11 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 建筑垃圾—订单表 | |
| 15 | + * @TableName gar_order | |
| 16 | + */ | |
| 17 | +@TableName(value ="gar_order") | |
| 18 | +@Data | |
| 19 | +public class GarOrder implements Serializable { | |
| 20 | + /** | |
| 21 | + * 订单id | |
| 22 | + */ | |
| 23 | + @TableId | |
| 24 | + private String garOrderId; | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 用户id | |
| 28 | + */ | |
| 29 | + @JsonIgnore | |
| 30 | + private String garOrderUserId; | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 负责处理人id | |
| 34 | + */ | |
| 35 | + private String garOrderHandlerId; | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 订单地址 | |
| 39 | + */ | |
| 40 | + private String garOrderAddress; | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 订单详细地址 | |
| 44 | + */ | |
| 45 | + private String garOrderAddressDetails; | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 订单姓名 | |
| 49 | + */ | |
| 50 | + private String garOrderContactName; | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * 垃圾类型 | |
| 54 | + */ | |
| 55 | + private String garOrderTrashType; | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 订单人电话 | |
| 59 | + */ | |
| 60 | + private String garOrderContactTel; | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 承接经营单位 | |
| 64 | + */ | |
| 65 | + private String garOrderCompanyId; | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 公司名称 | |
| 69 | + */ | |
| 70 | + private String garOrderCompanyName; | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * 公司负责人电话 | |
| 74 | + */ | |
| 75 | + private String garOrderCompanyTel; | |
| 76 | + | |
| 77 | + /** | |
| 78 | + * 处理状态 | |
| 79 | + */ | |
| 80 | + private Integer garOrderHandlerStatus; | |
| 81 | + | |
| 82 | + /** | |
| 83 | + * 约定时间 | |
| 84 | + */ | |
| 85 | + private String garOrderAgreementTime; | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * 订单创建时间 | |
| 89 | + */ | |
| 90 | + @TableField(fill = FieldFill.INSERT) | |
| 91 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 92 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 93 | + private Date garCreateTime; | |
| 94 | + | |
| 95 | + /** | |
| 96 | + * 订单修改时间 | |
| 97 | + */ | |
| 98 | + @TableField(fill = FieldFill.INSERT_UPDATE) | |
| 99 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 100 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 101 | + private Date garUpdateTime; | |
| 102 | + | |
| 103 | + /** | |
| 104 | + * 订单创建人 | |
| 105 | + */ | |
| 106 | + @TableField(fill = FieldFill.INSERT) | |
| 107 | + private String garCreateBy; | |
| 108 | + | |
| 109 | + /** | |
| 110 | + * 订单修改人 | |
| 111 | + */ | |
| 112 | + @TableField(fill = FieldFill.INSERT_UPDATE) | |
| 113 | + private String garUpdateBy; | |
| 114 | + | |
| 115 | + /** | |
| 116 | + * 备注 | |
| 117 | + */ | |
| 118 | + private String garRemark; | |
| 119 | + /** | |
| 120 | + * 取消标识 | |
| 121 | + */ | |
| 122 | + private Integer garCancelFlag; | |
| 123 | + | |
| 124 | + /** | |
| 125 | + * 评分标识 | |
| 126 | + */ | |
| 127 | + private Integer garEvaluateFlag; | |
| 128 | + /** | |
| 129 | + * 原因 | |
| 130 | + */ | |
| 131 | + private String garReason; | |
| 132 | + | |
| 133 | + | |
| 134 | + @TableField(exist = false) | |
| 135 | + private static final long serialVersionUID = 1L; | |
| 136 | + | |
| 137 | +} | |
| 0 | 138 | \ No newline at end of file | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrderEvaluate.java
0 → 100644
| 1 | +package com.trash.garbage.pojo.domain; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 6 | +import java.io.Serializable; | |
| 7 | +import java.util.Date; | |
| 8 | +import lombok.Data; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 建筑垃圾-派单评分 | |
| 12 | + * @author 20412 | |
| 13 | + * @TableName gar_order_evaluate | |
| 14 | + */ | |
| 15 | +@TableName(value ="gar_order_evaluate") | |
| 16 | +@Data | |
| 17 | +public class GarOrderEvaluate implements Serializable { | |
| 18 | + /** | |
| 19 | + * id | |
| 20 | + */ | |
| 21 | + @TableId | |
| 22 | + private String garEvaluateId; | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 订单id | |
| 26 | + */ | |
| 27 | + private String garOrderId; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 公司id | |
| 31 | + */ | |
| 32 | + private String garCompanyId; | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 评价内容 | |
| 36 | + */ | |
| 37 | + private String garEvaluateContent; | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 评分 | |
| 41 | + */ | |
| 42 | + private Integer garEvaluateScore; | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * 修改人 | |
| 46 | + */ | |
| 47 | + private String garUpdateBy; | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 创建人 | |
| 51 | + */ | |
| 52 | + private String garCreateBy; | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 修改时间 | |
| 56 | + */ | |
| 57 | + private Date garUpdateTime; | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 创建时间 | |
| 61 | + */ | |
| 62 | + private Date garCreateTime; | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * 备注 | |
| 66 | + */ | |
| 67 | + private String garRemark; | |
| 68 | + | |
| 69 | + @TableField(exist = false) | |
| 70 | + private static final long serialVersionUID = 1L; | |
| 71 | +} | |
| 0 | 72 | \ No newline at end of file | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrderImage.java
0 → 100644
| 1 | +package com.trash.garbage.pojo.domain; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.FieldFill; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import java.io.Serializable; | |
| 8 | +import java.util.Date; | |
| 9 | + | |
| 10 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 11 | +import lombok.Data; | |
| 12 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 装修垃圾-订单图片表 | |
| 16 | + * @TableName gar_order_image | |
| 17 | + */ | |
| 18 | +@TableName(value ="gar_order_image") | |
| 19 | +@Data | |
| 20 | +public class GarOrderImage implements Serializable { | |
| 21 | + /** | |
| 22 | + * 图片id | |
| 23 | + */ | |
| 24 | + @TableId | |
| 25 | + private String garImageId; | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 订单表id | |
| 29 | + */ | |
| 30 | + private String garOrderId; | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 图片类型 | |
| 34 | + */ | |
| 35 | + private Integer garOrderImageType; | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 图片路径 | |
| 39 | + */ | |
| 40 | + private String garOrderImageUrl; | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 创建时间 | |
| 44 | + */ | |
| 45 | + @TableField(fill = FieldFill.INSERT) | |
| 46 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 47 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 48 | + private Date garCreateTime; | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 修改时间 | |
| 52 | + */ | |
| 53 | + @TableField(fill = FieldFill.INSERT_UPDATE) | |
| 54 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 55 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 56 | + private Date garUpdateTime; | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * 创建人 | |
| 60 | + */ | |
| 61 | + @TableField(fill = FieldFill.INSERT) | |
| 62 | + private String garCreateBy; | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * 修改人 | |
| 66 | + */ | |
| 67 | + @TableField(fill = FieldFill.INSERT_UPDATE) | |
| 68 | + private String garUpdateBy; | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * 备注 | |
| 72 | + */ | |
| 73 | + private String garRemark; | |
| 74 | + | |
| 75 | + @TableField(exist = false) | |
| 76 | + private static final long serialVersionUID = 1L; | |
| 77 | + | |
| 78 | +} | |
| 0 | 79 | \ No newline at end of file | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarUser.java
| ... | ... | @@ -9,6 +9,7 @@ import java.util.Date; |
| 9 | 9 | |
| 10 | 10 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 11 | 11 | import lombok.Data; |
| 12 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 12 | 13 | |
| 13 | 14 | /** |
| 14 | 15 | * 建筑垃圾-用户表 |
| ... | ... | @@ -54,6 +55,7 @@ public class GarUser implements Serializable { |
| 54 | 55 | |
| 55 | 56 | @TableField(fill = FieldFill.INSERT) |
| 56 | 57 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") |
| 58 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 57 | 59 | private Date garCreateTime; |
| 58 | 60 | |
| 59 | 61 | /** |
| ... | ... | @@ -61,6 +63,7 @@ public class GarUser implements Serializable { |
| 61 | 63 | */ |
| 62 | 64 | @TableField(fill = FieldFill.INSERT_UPDATE) |
| 63 | 65 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") |
| 66 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 64 | 67 | private Date garUpdateTime; |
| 65 | 68 | |
| 66 | 69 | /** |
| ... | ... | @@ -206,6 +209,4 @@ public class GarUser implements Serializable { |
| 206 | 209 | return serialVersionUID; |
| 207 | 210 | } |
| 208 | 211 | |
| 209 | - | |
| 210 | - | |
| 211 | 212 | } |
| 212 | 213 | \ No newline at end of file | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/EvaluateDto.java
0 → 100644
| 1 | +package com.trash.garbage.pojo.dto; | |
| 2 | + | |
| 3 | +import lombok.Data; | |
| 4 | + | |
| 5 | +import javax.validation.constraints.NotBlank; | |
| 6 | +import javax.validation.constraints.NotNull; | |
| 7 | +import java.util.List; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * @author 20412 | |
| 11 | + */ | |
| 12 | +@Data | |
| 13 | +public class EvaluateDto { | |
| 14 | + @NotBlank(message = "订单id不能为空") | |
| 15 | + private String orderId; | |
| 16 | + private String content; | |
| 17 | + @NotNull | |
| 18 | + private Integer score; | |
| 19 | + private List<String> imageUrls; | |
| 20 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/OrderDto.java
0 → 100644
| 1 | +package com.trash.garbage.pojo.dto; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import javax.validation.constraints.NotBlank; | |
| 7 | +import javax.validation.constraints.NotEmpty; | |
| 8 | +import java.util.List; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 新增订单dto | |
| 12 | + * @author 20412 | |
| 13 | + */ | |
| 14 | +@Data | |
| 15 | +public class OrderDto { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 订单地址 | |
| 19 | + */ | |
| 20 | + @NotBlank(message = "地址不能为空") | |
| 21 | + private String garOrderAddress; | |
| 22 | + /** | |
| 23 | + * 图片列表 | |
| 24 | + */ | |
| 25 | + @NotEmpty(message = "必须要有现场图片") | |
| 26 | + private List<String> imageUrls; | |
| 27 | + /** | |
| 28 | + * 订单详细地址 | |
| 29 | + */ | |
| 30 | + private String garOrderAddressDetails; | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 订单姓名 | |
| 34 | + */ | |
| 35 | + private String garOrderContactName; | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 垃圾类型 | |
| 39 | + */ | |
| 40 | + private String garOrderTrashType; | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 订单人电话 | |
| 44 | + */ | |
| 45 | + @NotBlank(message = "电话不能为空") | |
| 46 | + private String garOrderContactTel; | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 承接经营单位 | |
| 50 | + */ | |
| 51 | + private String garOrderCompanyId; | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * 公司名称 | |
| 55 | + */ | |
| 56 | + @NotEmpty(message = "公司名称不能为空") | |
| 57 | + private String garOrderCompanyName; | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 公司负责人电话 | |
| 61 | + */ | |
| 62 | + private String garOrderCompanyTel; | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * 约定时间 | |
| 66 | + */ | |
| 67 | + @NotBlank(message = "约定时间不能为空") | |
| 68 | + private String garOrderAgreementTime; | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * 备注 | |
| 72 | + */ | |
| 73 | + private String garRemark; | |
| 74 | + | |
| 75 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/OrderUpdateDto.java
0 → 100644
| 1 | +package com.trash.garbage.pojo.dto; | |
| 2 | + | |
| 3 | +import lombok.Data; | |
| 4 | + | |
| 5 | +import java.util.List; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * @author 20412 | |
| 9 | + */ | |
| 10 | +@Data | |
| 11 | +public class OrderUpdateDto { | |
| 12 | + | |
| 13 | + /** | |
| 14 | + * 订单id | |
| 15 | + */ | |
| 16 | + private String garOrderId; | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 处理类型 | |
| 20 | + */ | |
| 21 | + private Integer handleType; | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 照片url | |
| 25 | + */ | |
| 26 | + private List<String> imageUrls; | |
| 27 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/UploadDto.java
0 → 100644
trash-garbage/src/main/java/com/trash/garbage/pojo/vo/OrderDetailVo.java
0 → 100644
| 1 | +package com.trash.garbage.pojo.vo; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import javax.validation.constraints.NotEmpty; | |
| 7 | +import java.util.ArrayList; | |
| 8 | +import java.util.Date; | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * @author 20412 | |
| 13 | + */ | |
| 14 | +@Data | |
| 15 | +public class OrderDetailVo { | |
| 16 | + | |
| 17 | + private String garOrderHandlerId; | |
| 18 | + | |
| 19 | + private Integer garEvaluateFlag; | |
| 20 | + /** | |
| 21 | + * 订单地址 | |
| 22 | + */ | |
| 23 | + private String garOrderAddress; | |
| 24 | + /** | |
| 25 | + * 现场图片图片列表 | |
| 26 | + */ | |
| 27 | + private List<String> currentImages; | |
| 28 | + /** | |
| 29 | + * 装车图片 | |
| 30 | + */ | |
| 31 | + private List<String> putOnImages; | |
| 32 | + /** | |
| 33 | + * 卸车图片 | |
| 34 | + */ | |
| 35 | + private List<String> putDownImages; | |
| 36 | + /** | |
| 37 | + * 订单详细地址 | |
| 38 | + */ | |
| 39 | + private String garOrderAddressDetails; | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 订单姓名 | |
| 43 | + */ | |
| 44 | + private String garOrderContactName; | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 垃圾类型 | |
| 48 | + */ | |
| 49 | + private String garOrderTrashType; | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 订单状态 | |
| 53 | + */ | |
| 54 | + private Integer garOrderHandlerStatus; | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * 创建时间 | |
| 58 | + */ | |
| 59 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") | |
| 60 | + private Date garCreateTime; | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 订单人电话 | |
| 64 | + */ | |
| 65 | + private String garOrderContactTel; | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 承接经营单位 | |
| 69 | + */ | |
| 70 | + private String garOrderCompanyId; | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * 公司名称 | |
| 74 | + */ | |
| 75 | + private String garOrderCompanyName; | |
| 76 | + | |
| 77 | + /** | |
| 78 | + * 公司负责人电话 | |
| 79 | + */ | |
| 80 | + private String garOrderCompanyTel; | |
| 81 | + | |
| 82 | + /** | |
| 83 | + * 约定时间 | |
| 84 | + */ | |
| 85 | + private String garOrderAgreementTime; | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * 备注 | |
| 89 | + */ | |
| 90 | + private String garRemark; | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * 允许处理标识 | |
| 94 | + */ | |
| 95 | + private Boolean handleFlag; | |
| 96 | + | |
| 97 | + public OrderDetailVo(){ | |
| 98 | + this.currentImages = new ArrayList<>(); | |
| 99 | + this.putDownImages = new ArrayList<>(); | |
| 100 | + this.putOnImages = new ArrayList<>(); | |
| 101 | + this.handleFlag = false; | |
| 102 | + } | |
| 103 | + | |
| 104 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderEvaluateService.java
0 → 100644
| 1 | +package com.trash.garbage.service; | |
| 2 | + | |
| 3 | +import com.trash.garbage.pojo.domain.GarOrderEvaluate; | |
| 4 | +import com.baomidou.mybatisplus.extension.service.IService; | |
| 5 | + | |
| 6 | +/** | |
| 7 | +* @author 20412 | |
| 8 | +* @description 针对表【gar_order_evaluate(建筑垃圾-派单评分)】的数据库操作Service | |
| 9 | +* @createDate 2023-11-29 14:19:18 | |
| 10 | +*/ | |
| 11 | +public interface GarOrderEvaluateService extends IService<GarOrderEvaluate> { | |
| 12 | + | |
| 13 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderImageService.java
0 → 100644
| 1 | +package com.trash.garbage.service; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
| 4 | +import com.trash.garbage.pojo.domain.GarOrderImage; | |
| 5 | + | |
| 6 | +/** | |
| 7 | +* @author 20412 | |
| 8 | +* @description 针对表【gar_order_image(装修垃圾-订单图片表)】的数据库操作Service | |
| 9 | +* @createDate 2023-11-24 16:26:19 | |
| 10 | +*/ | |
| 11 | +public interface GarOrderImageService extends IService<GarOrderImage> { | |
| 12 | + | |
| 13 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderService.java
0 → 100644
| 1 | +package com.trash.garbage.service; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
| 4 | +import com.github.pagehelper.PageInfo; | |
| 5 | +import com.trash.garbage.pojo.domain.GarOrder; | |
| 6 | +import com.trash.garbage.pojo.dto.EvaluateDto; | |
| 7 | +import com.trash.garbage.pojo.dto.OrderDto; | |
| 8 | +import com.trash.garbage.pojo.dto.OrderUpdateDto; | |
| 9 | +import com.trash.garbage.pojo.dto.UploadDto; | |
| 10 | +import com.trash.garbage.pojo.vo.OrderDetailVo; | |
| 11 | + | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | +* @author 20412 | |
| 16 | +* @description 针对表【gar_order(建筑垃圾—订单表)】的数据库操作Service | |
| 17 | +* @createDate 2023-11-24 16:26:19 | |
| 18 | +*/ | |
| 19 | +public interface GarOrderService extends IService<GarOrder> { | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 新增订单 | |
| 23 | + * @param dto | |
| 24 | + * @return | |
| 25 | + */ | |
| 26 | + String saveOrder(OrderDto dto); | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 根据id查询订单详情 | |
| 30 | + * @param id | |
| 31 | + * @return | |
| 32 | + */ | |
| 33 | + OrderDetailVo queryOrderDetail(String id); | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 根据类型查询订单 | |
| 37 | + * | |
| 38 | + * @param type | |
| 39 | + * @param pageNo | |
| 40 | + * @param pageSize | |
| 41 | + * @return | |
| 42 | + */ | |
| 43 | + PageInfo queryOrderList(Integer type, Integer pageNo, Integer pageSize); | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * 修改订单状态 | |
| 47 | + * @param dto | |
| 48 | + * @return | |
| 49 | + */ | |
| 50 | + String uploadOrder(OrderUpdateDto dto); | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * 上传图片url执行图片type | |
| 54 | + * @param dto | |
| 55 | + * @return | |
| 56 | + */ | |
| 57 | + String uploadImageUrlByType(UploadDto dto); | |
| 58 | + | |
| 59 | + String evaluateOrder(EvaluateDto dto); | |
| 60 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/GarUserService.java
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderEvaluateServiceImpl.java
0 → 100644
| 1 | +package com.trash.garbage.service.impl; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
| 4 | +import com.trash.garbage.pojo.domain.GarOrderEvaluate; | |
| 5 | +import com.trash.garbage.service.GarOrderEvaluateService; | |
| 6 | +import com.trash.garbage.mapper.GarOrderEvaluateMapper; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +/** | |
| 10 | +* @author 20412 | |
| 11 | +* @description 针对表【gar_order_evaluate(建筑垃圾-派单评分)】的数据库操作Service实现 | |
| 12 | +* @createDate 2023-11-29 14:19:18 | |
| 13 | +*/ | |
| 14 | +@Service | |
| 15 | +public class GarOrderEvaluateServiceImpl extends ServiceImpl<GarOrderEvaluateMapper, GarOrderEvaluate> | |
| 16 | + implements GarOrderEvaluateService{ | |
| 17 | + | |
| 18 | +} | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderImageServiceImpl.java
0 → 100644
| 1 | +package com.trash.garbage.service.impl; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
| 4 | +import com.trash.garbage.pojo.domain.GarOrderImage; | |
| 5 | +import com.trash.garbage.service.GarOrderImageService; | |
| 6 | +import com.trash.garbage.mapper.GarOrderImageMapper; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +/** | |
| 10 | +* @author 20412 | |
| 11 | +* @description 针对表【gar_order_image(装修垃圾-订单图片表)】的数据库操作Service实现 | |
| 12 | +* @createDate 2023-11-24 16:26:19 | |
| 13 | +*/ | |
| 14 | +@Service | |
| 15 | +public class GarOrderImageServiceImpl extends ServiceImpl<GarOrderImageMapper, GarOrderImage> | |
| 16 | + implements GarOrderImageService{ | |
| 17 | + | |
| 18 | +} | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java
0 → 100644
| 1 | +package com.trash.garbage.service.impl; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollectionUtil; | |
| 4 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
| 5 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
| 6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
| 7 | +import com.github.pagehelper.PageHelper; | |
| 8 | +import com.github.pagehelper.PageInfo; | |
| 9 | +import com.trash.common.utils.SecurityUtils; | |
| 10 | +import com.trash.common.utils.bean.BeanUtils; | |
| 11 | +import com.trash.driver.domain.vo.DriverVo; | |
| 12 | +import com.trash.driver.service.IDriverService; | |
| 13 | +import com.trash.garbage.global.GlobalStatus; | |
| 14 | +import com.trash.garbage.pojo.domain.GarOrder; | |
| 15 | +import com.trash.garbage.pojo.domain.GarOrderEvaluate; | |
| 16 | +import com.trash.garbage.pojo.domain.GarOrderImage; | |
| 17 | +import com.trash.garbage.pojo.domain.GarUser; | |
| 18 | +import com.trash.garbage.pojo.dto.EvaluateDto; | |
| 19 | +import com.trash.garbage.pojo.dto.OrderDto; | |
| 20 | +import com.trash.garbage.pojo.dto.OrderUpdateDto; | |
| 21 | +import com.trash.garbage.pojo.dto.UploadDto; | |
| 22 | +import com.trash.garbage.pojo.vo.OrderDetailVo; | |
| 23 | +import com.trash.garbage.service.GarOrderEvaluateService; | |
| 24 | +import com.trash.garbage.service.GarOrderImageService; | |
| 25 | +import com.trash.garbage.service.GarOrderService; | |
| 26 | +import com.trash.garbage.mapper.GarOrderMapper; | |
| 27 | +import com.trash.garbage.service.GarUserService; | |
| 28 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 29 | +import org.springframework.stereotype.Service; | |
| 30 | +import org.springframework.transaction.annotation.Transactional; | |
| 31 | + | |
| 32 | +import java.util.ArrayList; | |
| 33 | +import java.util.List; | |
| 34 | + | |
| 35 | +/** | |
| 36 | + * @author 20412 | |
| 37 | + * @description 针对表【gar_order(建筑垃圾—订单表)】的数据库操作Service实现 | |
| 38 | + * @createDate 2023-11-24 16:26:19 | |
| 39 | + */ | |
| 40 | +@Service | |
| 41 | +public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | |
| 42 | + implements GarOrderService { | |
| 43 | + | |
| 44 | + | |
| 45 | + @Autowired | |
| 46 | + private GarOrderImageService garOrderImageService; | |
| 47 | + | |
| 48 | + @Autowired | |
| 49 | + private GarOrderEvaluateService garOrderEvaluateService; | |
| 50 | + | |
| 51 | + @Autowired | |
| 52 | + private GarUserService garUserService; | |
| 53 | + | |
| 54 | + @Autowired | |
| 55 | + private IDriverService driverService; | |
| 56 | + | |
| 57 | + @Override | |
| 58 | + @Transactional(rollbackFor = Exception.class) | |
| 59 | + public String saveOrder(OrderDto dto) { | |
| 60 | + String userId = SecurityUtils.getLoginUser().getUser().getUserId(); | |
| 61 | + GarOrder order = new GarOrder(); | |
| 62 | + BeanUtils.copyBeanProp(order, dto); | |
| 63 | + order.setGarOrderUserId(userId); | |
| 64 | + order.setGarOrderHandlerStatus(GlobalStatus.GarOrderStatus.NEW_ORDER.getValue()); | |
| 65 | + order.setGarCancelFlag(GlobalStatus.GarOrderStatus.CANCEL_FLAG_NO.getValue()); | |
| 66 | + save(order); | |
| 67 | + // 保存图片url | |
| 68 | + List<String> imageUrls = dto.getImageUrls(); | |
| 69 | + List<GarOrderImage> images = new ArrayList<>(imageUrls.size()); | |
| 70 | + for (String imageUrl : imageUrls) { | |
| 71 | + GarOrderImage image = new GarOrderImage(); | |
| 72 | + image.setGarOrderId(order.getGarOrderId()); | |
| 73 | + image.setGarOrderImageUrl(imageUrl); | |
| 74 | + image.setGarOrderImageType(GlobalStatus.GarOrderStatus.IMAGE_TYPE_CURRENT.getValue()); | |
| 75 | + images.add(image); | |
| 76 | + } | |
| 77 | + garOrderImageService.saveBatch(images); | |
| 78 | + return order.getGarOrderId(); | |
| 79 | + } | |
| 80 | + | |
| 81 | + @Override | |
| 82 | + public OrderDetailVo queryOrderDetail(String id) { | |
| 83 | + GarOrder order = this.getById(id); | |
| 84 | + String tel = SecurityUtils.getLoginUser().getUser().getPhonenumber(); | |
| 85 | + LambdaQueryWrapper<GarOrderImage> qwi = new LambdaQueryWrapper<>(); | |
| 86 | + qwi.eq(GarOrderImage::getGarOrderId, id); | |
| 87 | + OrderDetailVo vo = new OrderDetailVo(); | |
| 88 | + BeanUtils.copyBeanProp(vo, order); | |
| 89 | + DriverVo driverVo = new DriverVo(); | |
| 90 | + driverVo.setPhoneNo(tel); | |
| 91 | + driverVo.setCompanyId(Long.valueOf(order.getGarOrderCompanyId())); | |
| 92 | + List<DriverVo> driverVos = driverService.selectDriverList(driverVo); | |
| 93 | + if (CollectionUtil.isNotEmpty(driverVos)) { | |
| 94 | + vo.setHandleFlag(true); | |
| 95 | + } | |
| 96 | + List<GarOrderImage> imageList = garOrderImageService.list(qwi); | |
| 97 | + for (GarOrderImage image : imageList) { | |
| 98 | + if (GlobalStatus.GarOrderStatus.CANCEL_FLAG_NO.getValue().equals(image.getGarOrderImageType())) { | |
| 99 | + vo.getCurrentImages().add(image.getGarOrderImageUrl()); | |
| 100 | + } | |
| 101 | + if (GlobalStatus.GarOrderStatus.IMAGE_TYPE_PUT_ON.getValue().equals(image.getGarOrderImageType())) { | |
| 102 | + vo.getPutOnImages().add(image.getGarOrderImageUrl()); | |
| 103 | + } | |
| 104 | + if (GlobalStatus.GarOrderStatus.IMAGE_TYPE_PUT_DOWN.getValue().equals(image.getGarOrderImageType())) { | |
| 105 | + vo.getPutDownImages().add(image.getGarOrderImageUrl()); | |
| 106 | + } | |
| 107 | + } | |
| 108 | + return vo; | |
| 109 | + } | |
| 110 | + | |
| 111 | + @Override | |
| 112 | + public PageInfo queryOrderList(Integer type, Integer pageNo, Integer pageSize) { | |
| 113 | + String userId = SecurityUtils.getLoginUser().getUser().getUserId(); | |
| 114 | + GarUser user = garUserService.getById(userId); | |
| 115 | + LambdaQueryWrapper<GarOrder> qw = new LambdaQueryWrapper<>(); | |
| 116 | + qw.orderByAsc(GarOrder::getGarEvaluateFlag, GarOrder::getGarOrderHandlerStatus); | |
| 117 | + // 居民用户 | |
| 118 | + if (user.getGarUserType().equals(GlobalStatus.UserStatusEnum.DRIVER_USER.getDescription())) { | |
| 119 | + PageHelper.startPage(pageNo, pageSize); | |
| 120 | + // 待清运 || 清运中 || 已完成 || 待支付 | |
| 121 | + if (GlobalStatus.GarOrderStatus.NEW_ORDER.getValue().equals(type) | |
| 122 | + || GlobalStatus.GarOrderStatus.ACTIVE_ORDER.getValue().equals(type) | |
| 123 | + || GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue().equals(type)) { | |
| 124 | + qw.eq(GarOrder::getGarOrderUserId, userId) | |
| 125 | + .eq(GarOrder::getGarOrderHandlerStatus, type); | |
| 126 | + List<GarOrder> orderList = list(qw); | |
| 127 | + PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); | |
| 128 | + return pageInfo; | |
| 129 | + } | |
| 130 | + // 全部 | |
| 131 | + if (GlobalStatus.GarOrderStatus.ALL_ORDER.getValue().equals(type)) { | |
| 132 | + qw.eq(GarOrder::getGarOrderUserId, userId); | |
| 133 | + List<GarOrder> orderList = list(qw); | |
| 134 | + PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); | |
| 135 | + return pageInfo; | |
| 136 | + } | |
| 137 | + } else { | |
| 138 | + DriverVo driver = new DriverVo(); | |
| 139 | + driver.setPhoneNo(user.getGarUserTel()); | |
| 140 | + List<DriverVo> driverList = driverService.selectDriverList(driver); | |
| 141 | + DriverVo driverVo = driverList.get(0); | |
| 142 | + String companyId = String.valueOf(driverVo.getCompanyId()); | |
| 143 | + PageHelper.startPage(pageNo, pageSize); | |
| 144 | + if (GlobalStatus.GarOrderStatus.NEW_ORDER.getValue().equals(type)) { | |
| 145 | + qw.eq(GarOrder::getGarOrderCompanyId, companyId) | |
| 146 | + .eq(GarOrder::getGarOrderHandlerStatus, GlobalStatus.GarOrderStatus.NEW_ORDER.getValue()); | |
| 147 | + List<GarOrder> orderList = list(qw); | |
| 148 | + PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); | |
| 149 | + return pageInfo; | |
| 150 | + } | |
| 151 | + | |
| 152 | + if (GlobalStatus.GarOrderStatus.ACTIVE_ORDER.getValue().equals(type) | |
| 153 | + || GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue().equals(type)) { | |
| 154 | + qw.eq(GarOrder::getGarOrderCompanyId, companyId) | |
| 155 | + .eq(GarOrder::getGarOrderHandlerId, user.getGarUserId()) | |
| 156 | + .eq(GarOrder::getGarOrderHandlerStatus, type); | |
| 157 | + List<GarOrder> orderList = list(qw); | |
| 158 | + PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); | |
| 159 | + return pageInfo; | |
| 160 | + } | |
| 161 | + | |
| 162 | + // 全部 | |
| 163 | + if (GlobalStatus.GarOrderStatus.ALL_ORDER.getValue().equals(type)) { | |
| 164 | + qw.eq(GarOrder::getGarOrderHandlerId, userId); | |
| 165 | + List<GarOrder> orderList = list(qw); | |
| 166 | + PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); | |
| 167 | + return pageInfo; | |
| 168 | + } | |
| 169 | + } | |
| 170 | + return null; | |
| 171 | + } | |
| 172 | + | |
| 173 | + @Override | |
| 174 | + public String uploadOrder(OrderUpdateDto dto) { | |
| 175 | + GarOrder order = getById(dto.getGarOrderId()); | |
| 176 | + String userId = SecurityUtils.getLoginUser().getUser().getUserId(); | |
| 177 | + GarUser user = garUserService.getById(userId); | |
| 178 | + // 运输员操作 TODO 公司所属 待清运- 》 清运中 | |
| 179 | + if (GlobalStatus.UserStatusEnum.NORMAL_USER.getDescription().equals(user.getGarUserType())){ | |
| 180 | + if (order.getGarOrderHandlerStatus().equals(GlobalStatus.GarOrderStatus.NEW_ORDER.getValue()) | |
| 181 | + || GlobalStatus.GarOrderStatus.NEW_ORDER.getValue().equals(dto.getHandleType())) { | |
| 182 | + LambdaUpdateWrapper<GarOrder> uw = new LambdaUpdateWrapper<>(); | |
| 183 | + uw.eq(GarOrder::getGarOrderId, dto.getGarOrderId()) | |
| 184 | + .set(GarOrder::getGarOrderHandlerStatus, GlobalStatus.GarOrderStatus.ACTIVE_ORDER.getValue()) | |
| 185 | + .set(GarOrder::getGarOrderHandlerId, userId); | |
| 186 | + update(uw); | |
| 187 | + return "准备清运"; | |
| 188 | + } | |
| 189 | + // 运输员操作 清运中 ==》已完成 | |
| 190 | + if (GlobalStatus.GarOrderStatus.ACTIVE_ORDER.getValue().equals(order.getGarOrderHandlerStatus()) | |
| 191 | + && GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue().equals(dto.getHandleType())) { | |
| 192 | + LambdaUpdateWrapper<GarOrder> uw = new LambdaUpdateWrapper<>(); | |
| 193 | + uw.eq(GarOrder::getGarOrderId, dto.getGarOrderId()) | |
| 194 | + .set(GarOrder::getGarOrderHandlerStatus, GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue()) | |
| 195 | + .set(GarOrder::getGarEvaluateFlag, GlobalStatus.GarOrderStatus.EVALUATE_ORDER_NO.getValue()); | |
| 196 | + update(uw); | |
| 197 | + } | |
| 198 | + return "派单已完成"; | |
| 199 | + } | |
| 200 | + return "什么都没发生"; | |
| 201 | + } | |
| 202 | + | |
| 203 | + @Override | |
| 204 | + public String uploadImageUrlByType(UploadDto dto) { | |
| 205 | + List<GarOrderImage> garOrderImages = new ArrayList<>(dto.getImageUrls().size()); | |
| 206 | + for (String imageUrl : dto.getImageUrls()) { | |
| 207 | + GarOrderImage orderImage = new GarOrderImage(); | |
| 208 | + orderImage.setGarOrderId(dto.getGarOrderId()); | |
| 209 | + orderImage.setGarOrderImageUrl(imageUrl); | |
| 210 | + orderImage.setGarOrderImageType(dto.getType()); | |
| 211 | + garOrderImages.add(orderImage); | |
| 212 | + } | |
| 213 | + garOrderImageService.saveBatch(garOrderImages); | |
| 214 | + return "上传成功!"; | |
| 215 | + } | |
| 216 | + | |
| 217 | + @Override | |
| 218 | + public String evaluateOrder(EvaluateDto dto) { | |
| 219 | + String userId = SecurityUtils.getLoginUser().getUser().getUserId(); | |
| 220 | + GarUser user = garUserService.getById(userId); | |
| 221 | + GarOrder order = getById(dto.getOrderId()); | |
| 222 | + // TODO 用户评价 | |
| 223 | + if (GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue().equals(order.getGarOrderHandlerStatus())) { | |
| 224 | + evaluate(dto, order); | |
| 225 | + } | |
| 226 | + return "已评价"; | |
| 227 | + } | |
| 228 | + | |
| 229 | + private void evaluate(EvaluateDto dto, GarOrder order) { | |
| 230 | + GarOrderEvaluate evaluate = new GarOrderEvaluate(); | |
| 231 | + evaluate.setGarOrderId(order.getGarOrderId()); | |
| 232 | + evaluate.setGarEvaluateContent(dto.getContent()); | |
| 233 | + evaluate.setGarEvaluateScore(dto.getScore()); | |
| 234 | + garOrderEvaluateService.save(evaluate); | |
| 235 | + // 修改订单评价状态 | |
| 236 | + LambdaUpdateWrapper<GarOrder> uw = new LambdaUpdateWrapper<>(); | |
| 237 | + uw.eq(GarOrder::getGarOrderId, order.getGarOrderId()) | |
| 238 | + .set(GarOrder::getGarEvaluateFlag, GlobalStatus.GarOrderStatus.EVALUATE_ORDER_YES.getValue()); | |
| 239 | + update(uw); | |
| 240 | + } | |
| 241 | +} | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
| ... | ... | @@ -116,9 +116,6 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> |
| 116 | 116 | user.setRoles(roles); |
| 117 | 117 | loginUser.setPermissions(set); |
| 118 | 118 | String token = JwtUtils.createToken(nUser.getGarUserId(), nUser.getGarUserTel()); |
| 119 | - if (!token.contains("Bearer ")) { | |
| 120 | - token = "Bearer " + token; | |
| 121 | - } | |
| 122 | 119 | loginUser.setToken(token); |
| 123 | 120 | tokenService.refreshToken(loginUser); |
| 124 | 121 | return token; |
| ... | ... | @@ -209,6 +206,17 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> |
| 209 | 206 | return "删除成功!"; |
| 210 | 207 | } |
| 211 | 208 | |
| 209 | + @Override | |
| 210 | + public void updateUserInfo(GarUser user) { | |
| 211 | + String userId = SecurityUtils.getLoginUser().getUser().getUserId(); | |
| 212 | + LambdaUpdateWrapper<GarUser> uw = new LambdaUpdateWrapper<>(); | |
| 213 | + uw.eq(GarUser::getGarUserId, userId) | |
| 214 | + .set(GarUser::getGarUserType, user.getGarUserType()) | |
| 215 | + .set(GarUser::getGarUserName, user.getGarUserName()) | |
| 216 | + .set(GarUser::getGarUserCarNum, user.getGarUserCarNum()); | |
| 217 | + update(uw); | |
| 218 | + } | |
| 219 | + | |
| 212 | 220 | |
| 213 | 221 | /** |
| 214 | 222 | * 微信小程序解密 | ... | ... |
trash-garbage/src/main/resources/mapper/GarOrderEvaluateMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper | |
| 3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | +<mapper namespace="com.trash.garbage.mapper.GarOrderEvaluateMapper"> | |
| 6 | + | |
| 7 | + <resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarOrderEvaluate"> | |
| 8 | + <id property="garEvaluateId" column="gar_evaluate_id" jdbcType="VARCHAR"/> | |
| 9 | + <result property="garEvaluateContent" column="gar_evaluate_content" jdbcType="VARCHAR"/> | |
| 10 | + <result property="garOrderId" column="gar_order_id" jdbcType="VARCHAR"/> | |
| 11 | + <result property="garEvaluateScore" column="gar_evaluate_score" jdbcType="TINYINT"/> | |
| 12 | + <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/> | |
| 13 | + <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/> | |
| 14 | + <result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/> | |
| 15 | + <result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/> | |
| 16 | + <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/> | |
| 17 | + <result property="garCompanyId" column="gar_company_id" jdbcType="VARCHAR"/> | |
| 18 | + </resultMap> | |
| 19 | + | |
| 20 | + <sql id="Base_Column_List"> | |
| 21 | + gar_evaluate_id,gar_evaluate_content,gar_evaluate_score, | |
| 22 | + gar_update_by,gar_create_by,gar_update_time, | |
| 23 | + gar_create_time,gar_remark,gar_order_id,gar_company_id | |
| 24 | + </sql> | |
| 25 | +</mapper> | ... | ... |
trash-garbage/src/main/resources/mapper/GarOrderImageMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper | |
| 3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | +<mapper namespace="com.trash.garbage.mapper.GarOrderImageMapper"> | |
| 6 | + | |
| 7 | + <resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarOrderImage"> | |
| 8 | + <id property="garImageId" column="gar_image_id" jdbcType="VARCHAR"/> | |
| 9 | + <result property="garOrderId" column="gar_order_id" jdbcType="VARCHAR"/> | |
| 10 | + <result property="garOrderImageType" column="gar_order_image_type" jdbcType="TINYINT"/> | |
| 11 | + <result property="garOrderImageUrl" column="gar_order_image_url" jdbcType="VARCHAR"/> | |
| 12 | + <result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/> | |
| 13 | + <result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/> | |
| 14 | + <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/> | |
| 15 | + <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/> | |
| 16 | + <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/> | |
| 17 | + </resultMap> | |
| 18 | + | |
| 19 | + <sql id="Base_Column_List"> | |
| 20 | + gar_image_id,gar_order_id,gar_order_image_type, | |
| 21 | + gar_order_image_url,gar_create_time,gar_update_time, | |
| 22 | + gar_create_by,gar_update_by,gar_remark | |
| 23 | + </sql> | |
| 24 | +</mapper> | ... | ... |
trash-garbage/src/main/resources/mapper/GarOrderMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper | |
| 3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | +<mapper namespace="com.trash.garbage.mapper.GarOrderMapper"> | |
| 6 | + | |
| 7 | + <resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarOrder"> | |
| 8 | + <id property="garOrderId" column="gar_order_id" jdbcType="VARCHAR"/> | |
| 9 | + <result property="garOrderUserId" column="gar_order_user_id" jdbcType="VARCHAR"/> | |
| 10 | + <result property="garOrderHandlerId" column="gar_order_handler_id" jdbcType="VARCHAR"/> | |
| 11 | + <result property="garOrderAddress" column="gar_order_address" jdbcType="VARCHAR"/> | |
| 12 | + <result property="garOrderAddressDetails" column="gar_order_address_details" jdbcType="VARCHAR"/> | |
| 13 | + <result property="garOrderContactName" column="gar_order_contact_name" jdbcType="VARCHAR"/> | |
| 14 | + <result property="garOrderTrashType" column="gar_order_trash_type" jdbcType="VARCHAR"/> | |
| 15 | + <result property="garOrderContactTel" column="gar_order_contact_tel" jdbcType="VARCHAR"/> | |
| 16 | + <result property="garOrderCompanyId" column="gar_order_company_id" jdbcType="VARCHAR"/> | |
| 17 | + <result property="garOrderCompanyName" column="gar_order_company_name" jdbcType="VARCHAR"/> | |
| 18 | + <result property="garOrderCompanyTel" column="gar_order_company_tel" jdbcType="VARCHAR"/> | |
| 19 | + <result property="garOrderHandlerStatus" column="gar_order_handler_status" jdbcType="INTEGER"/> | |
| 20 | + <result property="garOrderAgreementTime" column="gar_order_agreement_time" jdbcType="VARCHAR"/> | |
| 21 | + <result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/> | |
| 22 | + <result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/> | |
| 23 | + <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/> | |
| 24 | + <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/> | |
| 25 | + <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/> | |
| 26 | + <result property="garReason" column="gar_reason" jdbcType="VARCHAR"/> | |
| 27 | + <result property="garCancelFlag" column="gar_cancel_flag" jdbcType="TINYINT"/> | |
| 28 | + <result property="garEvaluateFlag" column="gar_evaluate_flag" jdbcType="TINYINT"/> | |
| 29 | + </resultMap> | |
| 30 | + | |
| 31 | + <sql id="Base_Column_List"> | |
| 32 | + gar_order_id | |
| 33 | + ,gar_order_user_id,gar_order_handle_id, | |
| 34 | + gar_order_address,gar_order_address_details,gar_order_contact_name, | |
| 35 | + gar_order_trash_type,gar_order_contact_tel,gar_order_company_id, | |
| 36 | + gar_order_company_name,gar_order_company_tel,gar_order_hander_status, | |
| 37 | + gar_order_agreement_time,gar_create_time,gar_update_time, | |
| 38 | + gar_create_by,gar_update_by,gar_remark,gar_reason,gar_cancel_flag,gar_evaluate_flag | |
| 39 | + </sql> | |
| 40 | +</mapper> | ... | ... |
trash-ui/src/api/other/documentData.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 查询文件资料列表 | |
| 4 | +export function listDocumentData(query) { | |
| 5 | + return request({ | |
| 6 | + url: '/other/documentData/list', | |
| 7 | + method: 'get', | |
| 8 | + params: query | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 查询文件资料详细 | |
| 13 | +export function getDocumentData(id) { | |
| 14 | + return request({ | |
| 15 | + url: '/other/documentData/' + id, | |
| 16 | + method: 'get' | |
| 17 | + }) | |
| 18 | +} | |
| 19 | + | |
| 20 | +// 新增文件资料 | |
| 21 | +export function addDocumentData(data) { | |
| 22 | + return request({ | |
| 23 | + url: '/other/documentData', | |
| 24 | + method: 'post', | |
| 25 | + data: data | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 修改文件资料 | |
| 30 | +export function updateDocumentData(data) { | |
| 31 | + return request({ | |
| 32 | + url: '/other/documentData', | |
| 33 | + method: 'put', | |
| 34 | + data: data | |
| 35 | + }) | |
| 36 | +} | |
| 37 | + | |
| 38 | +// 删除文件资料 | |
| 39 | +export function delDocumentData(id) { | |
| 40 | + return request({ | |
| 41 | + url: '/other/documentData/' + id, | |
| 42 | + method: 'delete' | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 导出文件资料 | |
| 47 | +export function exportDocumentData(query) { | |
| 48 | + return request({ | |
| 49 | + url: '/other/documentData/export', | |
| 50 | + method: 'get', | |
| 51 | + params: query | |
| 52 | + }) | |
| 53 | +} | |
| 0 | 54 | \ No newline at end of file | ... | ... |
trash-ui/src/api/other/incorruptData.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 查询文件资料列表 | |
| 4 | +export function listIncorruptData(tableName) { | |
| 5 | + return request({ | |
| 6 | + url: '/other/incorrupt/list/'+tableName, | |
| 7 | + method: 'get' | |
| 8 | + }) | |
| 9 | +} | |
| 10 | + | |
| 11 | +// 新增文件资料 | |
| 12 | +export function addIncorruptData(data) { | |
| 13 | + return request({ | |
| 14 | + url: '/other/incorrupt', | |
| 15 | + method: 'post', | |
| 16 | + data: data | |
| 17 | + }) | |
| 18 | +} | ... | ... |
trash-ui/src/api/unit/businessUnit.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 查询运输企业管理列表 | |
| 4 | +export function listEnterprise(query) { | |
| 5 | + return request({ | |
| 6 | + url: '/unit/enterprise/list', | |
| 7 | + method: 'get', | |
| 8 | + params: query | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 查询运输企业管理详细 | |
| 13 | +export function getEnterprise(id) { | |
| 14 | + return request({ | |
| 15 | + url: '/unit/enterprise/' + id, | |
| 16 | + method: 'get' | |
| 17 | + }) | |
| 18 | +} | |
| 19 | + | |
| 20 | +// 新增运输企业管理 | |
| 21 | +export function addEnterprise(data) { | |
| 22 | + return request({ | |
| 23 | + url: '/unit/enterprise', | |
| 24 | + method: 'post', | |
| 25 | + data: data | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 修改运输企业管理 | |
| 30 | +export function updateEnterprise(data) { | |
| 31 | + return request({ | |
| 32 | + url: '/unit/enterprise', | |
| 33 | + method: 'put', | |
| 34 | + data: data | |
| 35 | + }) | |
| 36 | +} | |
| 37 | + | |
| 38 | +// 删除运输企业管理 | |
| 39 | +export function delEnterprise(id) { | |
| 40 | + return request({ | |
| 41 | + url: '/unit/enterprise/' + id, | |
| 42 | + method: 'delete' | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 导出运输企业管理 | |
| 47 | +export function exportEnterprise(query) { | |
| 48 | + return request({ | |
| 49 | + url: '/unit/enterprise/export', | |
| 50 | + method: 'get', | |
| 51 | + params: query | |
| 52 | + }) | |
| 53 | +} | ... | ... |
trash-ui/src/api/unit/carInfo.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 查询运输车辆管理列表 | |
| 4 | +export function listCarInfo(query) { | |
| 5 | + return request({ | |
| 6 | + url: '/unit/carInfo/list', | |
| 7 | + method: 'get', | |
| 8 | + params: query | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 查询运输车辆管理详细 | |
| 13 | +export function getCarInfo(id) { | |
| 14 | + return request({ | |
| 15 | + url: '/unit/carInfo/' + id, | |
| 16 | + method: 'get' | |
| 17 | + }) | |
| 18 | +} | |
| 19 | + | |
| 20 | +// 新增运输车辆管理 | |
| 21 | +export function addCarInfo(data) { | |
| 22 | + return request({ | |
| 23 | + url: '/unit/carInfo', | |
| 24 | + method: 'post', | |
| 25 | + data: data | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 修改运输车辆管理 | |
| 30 | +export function updateCarInfo(data) { | |
| 31 | + return request({ | |
| 32 | + url: '/unit/carInfo', | |
| 33 | + method: 'put', | |
| 34 | + data: data | |
| 35 | + }) | |
| 36 | +} | |
| 37 | + | |
| 38 | +// 删除运输车辆管理 | |
| 39 | +export function delCarInfo(id) { | |
| 40 | + return request({ | |
| 41 | + url: '/unit/carInfo/' + id, | |
| 42 | + method: 'delete' | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 导出运输车辆管理 | |
| 47 | +export function exportCarInfo(query) { | |
| 48 | + return request({ | |
| 49 | + url: '/unit/carInfo/export', | |
| 50 | + method: 'get', | |
| 51 | + params: query | |
| 52 | + }) | |
| 53 | +} | ... | ... |
trash-ui/src/api/unit/disposalSite.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 查询处理场所管理列表 | |
| 4 | +export function listDisposalSite(query) { | |
| 5 | + return request({ | |
| 6 | + url: '/unit/disposalSite/list', | |
| 7 | + method: 'get', | |
| 8 | + params: query | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 查询处理场所管理详细 | |
| 13 | +export function getDisposalSite(id) { | |
| 14 | + return request({ | |
| 15 | + url: '/unit/disposalSite/' + id, | |
| 16 | + method: 'get' | |
| 17 | + }) | |
| 18 | +} | |
| 19 | + | |
| 20 | +// 新增处理场所管理 | |
| 21 | +export function addDisposalSite(data) { | |
| 22 | + return request({ | |
| 23 | + url: '/unit/disposalSite', | |
| 24 | + method: 'post', | |
| 25 | + data: data | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 修改处理场所管理 | |
| 30 | +export function updateDisposalSite(data) { | |
| 31 | + return request({ | |
| 32 | + url: '/unit/disposalSite', | |
| 33 | + method: 'put', | |
| 34 | + data: data | |
| 35 | + }) | |
| 36 | +} | |
| 37 | + | |
| 38 | +// 删除处理场所管理 | |
| 39 | +export function delDisposalSite(id) { | |
| 40 | + return request({ | |
| 41 | + url: '/unit/disposalSite/' + id, | |
| 42 | + method: 'delete' | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 导出处理场所管理 | |
| 47 | +export function exportDisposalSite(query) { | |
| 48 | + return request({ | |
| 49 | + url: '/unit/disposalSite/export', | |
| 50 | + method: 'get', | |
| 51 | + params: query | |
| 52 | + }) | |
| 53 | +} | ... | ... |
trash-ui/src/api/unit/driver.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 查询驾驶员管理列表 | |
| 4 | +export function listDriver(query) { | |
| 5 | + return request({ | |
| 6 | + url: '/unit/driver/list', | |
| 7 | + method: 'get', | |
| 8 | + params: query | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | + | |
| 13 | +// 查询驾驶员管理详细 | |
| 14 | +export function listDriverByCompanyId(companyId) { | |
| 15 | + return request({ | |
| 16 | + url: '/unit/driver/listDriverByCompany/' + companyId, | |
| 17 | + method: 'get' | |
| 18 | + }) | |
| 19 | +} | |
| 20 | + | |
| 21 | +// 查询驾驶员管理详细 | |
| 22 | +export function getDriver(id) { | |
| 23 | + return request({ | |
| 24 | + url: '/unit/driver/' + id, | |
| 25 | + method: 'get' | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 新增驾驶员管理 | |
| 30 | +export function addDriver(data) { | |
| 31 | + return request({ | |
| 32 | + url: '/unit/driver', | |
| 33 | + method: 'post', | |
| 34 | + data: data | |
| 35 | + }) | |
| 36 | +} | |
| 37 | + | |
| 38 | +// 修改驾驶员管理 | |
| 39 | +export function updateDriver(data) { | |
| 40 | + return request({ | |
| 41 | + url: '/unit/driver', | |
| 42 | + method: 'put', | |
| 43 | + data: data | |
| 44 | + }) | |
| 45 | +} | |
| 46 | + | |
| 47 | +// 删除驾驶员管理 | |
| 48 | +export function delDriver(id) { | |
| 49 | + return request({ | |
| 50 | + url: '/unit/driver/' + id, | |
| 51 | + method: 'delete' | |
| 52 | + }) | |
| 53 | +} | |
| 54 | + | |
| 55 | +// 导出驾驶员管理 | |
| 56 | +export function exportDriver(query) { | |
| 57 | + return request({ | |
| 58 | + url: '/unit/driver/export', | |
| 59 | + method: 'get', | |
| 60 | + params: query | |
| 61 | + }) | |
| 62 | +} | ... | ... |
trash-ui/src/api/unit/enterprise.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 查询运输企业管理列表 | |
| 4 | +export function listEnterprise(query) { | |
| 5 | + return request({ | |
| 6 | + url: '/unit/enterprise/list', | |
| 7 | + method: 'get', | |
| 8 | + params: query | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 查询运输企业管理详细 | |
| 13 | +export function getEnterprise(id) { | |
| 14 | + return request({ | |
| 15 | + url: '/unit/enterprise/' + id, | |
| 16 | + method: 'get' | |
| 17 | + }) | |
| 18 | +} | |
| 19 | + | |
| 20 | +// 新增运输企业管理 | |
| 21 | +export function addEnterprise(data) { | |
| 22 | + return request({ | |
| 23 | + url: '/unit/enterprise', | |
| 24 | + method: 'post', | |
| 25 | + data: data | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 修改运输企业管理 | |
| 30 | +export function updateEnterprise(data) { | |
| 31 | + return request({ | |
| 32 | + url: '/unit/enterprise', | |
| 33 | + method: 'put', | |
| 34 | + data: data | |
| 35 | + }) | |
| 36 | +} | |
| 37 | + | |
| 38 | +// 删除运输企业管理 | |
| 39 | +export function delEnterprise(id) { | |
| 40 | + return request({ | |
| 41 | + url: '/unit/enterprise/' + id, | |
| 42 | + method: 'delete' | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 导出运输企业管理 | |
| 47 | +export function exportEnterprise(query) { | |
| 48 | + return request({ | |
| 49 | + url: '/unit/enterprise/export', | |
| 50 | + method: 'get', | |
| 51 | + params: query | |
| 52 | + }) | |
| 53 | +} | ... | ... |
trash-ui/src/main.js
| ... | ... | @@ -12,6 +12,7 @@ import '@/assets/styles/trash.scss' // trash css |
| 12 | 12 | import App from './App' |
| 13 | 13 | import store from './store' |
| 14 | 14 | import router from './router' |
| 15 | +import plugins from './plugins' // plugins | |
| 15 | 16 | import permission from './directive/permission' |
| 16 | 17 | |
| 17 | 18 | import './assets/icons' // icon |
| ... | ... | @@ -35,7 +36,11 @@ Vue.prototype.selectDictLabels = selectDictLabels |
| 35 | 36 | Vue.prototype.download = download |
| 36 | 37 | Vue.prototype.handleTree = handleTree |
| 37 | 38 | Vue.prototype.parseStatus = parseStatus |
| 38 | -Vue.prototype.checkPer = checkPermi | |
| 39 | +Vue.prototype.checkPer = checkPermi | |
| 40 | + | |
| 41 | +Vue.use(plugins) | |
| 42 | +Vue.prototype.$aMapKey = "902732b0ff4758e4b39f0f34f0cb1cb0";// 高德地图key | |
| 43 | + | |
| 39 | 44 | |
| 40 | 45 | Vue.prototype.remoteFrame = "http://183.66.242.6:14601" |
| 41 | 46 | // Vue.prototype.remoteFrame = "http://175.6.47.84:8008" |
| ... | ... | @@ -67,8 +72,8 @@ Vue.use(permission) |
| 67 | 72 | * |
| 68 | 73 | * Currently MockJs will be used in the production environment, |
| 69 | 74 | * please remove it before going online! ! ! |
| 70 | - */ | |
| 71 | -Element.Dialog.props.closeOnClickModal.default = false; | |
| 75 | + */ | |
| 76 | +Element.Dialog.props.closeOnClickModal.default = false; | |
| 72 | 77 | |
| 73 | 78 | Vue.use(Element, { |
| 74 | 79 | size: Cookies.get('size') || 'medium' // set element-ui default size | ... | ... |
trash-ui/src/plugins/index.js
0 → 100644
trash-ui/src/plugins/tab.js
0 → 100644
| 1 | +import store from '@/store' | |
| 2 | +import router from '@/router'; | |
| 3 | + | |
| 4 | +export default { | |
| 5 | + // 刷新当前tab页签 | |
| 6 | + refreshPage(obj) { | |
| 7 | + const { path, query, matched } = router.currentRoute; | |
| 8 | + if (obj === undefined) { | |
| 9 | + matched.forEach((m) => { | |
| 10 | + if (m.components && m.components.default && m.components.default.name) { | |
| 11 | + if (!['Layout', 'ParentView'].includes(m.components.default.name)) { | |
| 12 | + obj = { name: m.components.default.name, path: path, query: query }; | |
| 13 | + } | |
| 14 | + } | |
| 15 | + }); | |
| 16 | + } | |
| 17 | + return store.dispatch('tagsView/delCachedView', obj).then(() => { | |
| 18 | + const { path, query } = obj | |
| 19 | + router.replace({ | |
| 20 | + path: '/redirect' + path, | |
| 21 | + query: query | |
| 22 | + }) | |
| 23 | + }) | |
| 24 | + }, | |
| 25 | + // 关闭当前tab页签,打开新页签 | |
| 26 | + closeOpenPage(obj) { | |
| 27 | + store.dispatch("tagsView/delView", router.currentRoute); | |
| 28 | + if (obj !== undefined) { | |
| 29 | + return router.push(obj); | |
| 30 | + } | |
| 31 | + }, | |
| 32 | + // 关闭指定tab页签 | |
| 33 | + closePage(obj) { | |
| 34 | + if (obj === undefined) { | |
| 35 | + return store.dispatch('tagsView/delView', router.currentRoute).then(({ visitedViews }) => { | |
| 36 | + const latestView = visitedViews.slice(-1)[0] | |
| 37 | + if (latestView) { | |
| 38 | + return router.push(latestView.fullPath) | |
| 39 | + } | |
| 40 | + return router.push('/'); | |
| 41 | + }); | |
| 42 | + } | |
| 43 | + return store.dispatch('tagsView/delView', obj); | |
| 44 | + }, | |
| 45 | + // 关闭所有tab页签 | |
| 46 | + closeAllPage() { | |
| 47 | + return store.dispatch('tagsView/delAllViews'); | |
| 48 | + }, | |
| 49 | + // 关闭左侧tab页签 | |
| 50 | + closeLeftPage(obj) { | |
| 51 | + return store.dispatch('tagsView/delLeftTags', obj || router.currentRoute); | |
| 52 | + }, | |
| 53 | + // 关闭右侧tab页签 | |
| 54 | + closeRightPage(obj) { | |
| 55 | + return store.dispatch('tagsView/delRightTags', obj || router.currentRoute); | |
| 56 | + }, | |
| 57 | + // 关闭其他tab页签 | |
| 58 | + closeOtherPage(obj) { | |
| 59 | + return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute); | |
| 60 | + }, | |
| 61 | + // 添加tab页签 | |
| 62 | + openPage(title, url, params) { | |
| 63 | + var obj = { path: url, meta: { title: title } } | |
| 64 | + store.dispatch('tagsView/addView', obj); | |
| 65 | + return router.push({ path: url, query: params }); | |
| 66 | + }, | |
| 67 | + // 修改tab页签 | |
| 68 | + updatePage(obj) { | |
| 69 | + return store.dispatch('tagsView/updateVisitedView', obj); | |
| 70 | + } | |
| 71 | +} | ... | ... |
trash-ui/src/router/index.js
| ... | ... | @@ -65,6 +65,7 @@ export const constantRoutes = [ |
| 65 | 65 | } |
| 66 | 66 | ] |
| 67 | 67 | }, |
| 68 | + | |
| 68 | 69 | { |
| 69 | 70 | path: '/user', |
| 70 | 71 | component: Layout, |
| ... | ... | @@ -115,9 +116,79 @@ export const constantRoutes = [ |
| 115 | 116 | component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), |
| 116 | 117 | name: 'GenEdit', |
| 117 | 118 | meta: { title: '修改生成配置' } |
| 118 | - } | |
| 119 | + }, | |
| 120 | + { | |
| 121 | + path: '/disposalSite/info', | |
| 122 | + component: (resolve) => require(['@/views/unit/disposalSite/info'], resolve), | |
| 123 | + name: '新增处理场所', | |
| 124 | + hidden: true, | |
| 125 | + meta: { title: '新增处理场所' } | |
| 126 | + }, | |
| 127 | + { | |
| 128 | + path: '/disposalSite/infoEdit', | |
| 129 | + component: (resolve) => require(['@/views/unit/disposalSite/info'], resolve), | |
| 130 | + name: '修改处理场所', | |
| 131 | + hidden: true, | |
| 132 | + meta: { title: '修改处理场所' } | |
| 133 | + }, | |
| 134 | + { | |
| 135 | + path: '/enterprise/info', | |
| 136 | + component: (resolve) => require(['@/views/unit/enterprise/info'], resolve), | |
| 137 | + name: '新增运输企业', | |
| 138 | + hidden: true, | |
| 139 | + meta: { title: '新增运输企业' } | |
| 140 | + }, | |
| 141 | + { | |
| 142 | + path: '/enterprise/infoEdit', | |
| 143 | + component: (resolve) => require(['@/views/unit/enterprise/info'], resolve), | |
| 144 | + name: '修改运输企业', | |
| 145 | + hidden: true, | |
| 146 | + meta: { title: '修改运输企业' } | |
| 147 | + }, | |
| 148 | + { | |
| 149 | + path: '/unit/info', | |
| 150 | + component: (resolve) => require(['@/views/unit/businessUnit/info'], resolve), | |
| 151 | + name: '新增经营单位', | |
| 152 | + hidden: true, | |
| 153 | + meta: { title: '新增经营单位' } | |
| 154 | + }, | |
| 155 | + { | |
| 156 | + path: '/unit/infoEdit', | |
| 157 | + component: (resolve) => require(['@/views/unit/businessUnit/info'], resolve), | |
| 158 | + name: '修改经营单位', | |
| 159 | + hidden: true, | |
| 160 | + meta: { title: '修改经营单位' } | |
| 161 | + }, | |
| 162 | + { | |
| 163 | + path: '/carInfo/info', | |
| 164 | + component: (resolve) => require(['@/views/unit/carInfo/info'], resolve), | |
| 165 | + name: '新增车辆信息', | |
| 166 | + hidden: true, | |
| 167 | + meta: { title: '新增车辆信息' } | |
| 168 | + }, | |
| 169 | + { | |
| 170 | + path: '/carInfo/infoEdit', | |
| 171 | + component: (resolve) => require(['@/views/unit/carInfo/info'], resolve), | |
| 172 | + name: '修改车辆信息', | |
| 173 | + hidden: true, | |
| 174 | + meta: { title: '修改车辆信息' } | |
| 175 | + }, | |
| 176 | + { | |
| 177 | + path: '/driverInfo/info', | |
| 178 | + component: (resolve) => require(['@/views/unit/driver/info'], resolve), | |
| 179 | + name: '新增驾驶员', | |
| 180 | + hidden: true, | |
| 181 | + meta: { title: '新增驾驶员' } | |
| 182 | + }, | |
| 183 | + { | |
| 184 | + path: '/driverInfo/infoEdit', | |
| 185 | + component: (resolve) => require(['@/views/unit/driver/info'], resolve), | |
| 186 | + name: '修改驾驶员', | |
| 187 | + hidden: true, | |
| 188 | + meta: { title: '修改驾驶员' } | |
| 189 | + }, | |
| 119 | 190 | ] |
| 120 | - }, | |
| 191 | + }, | |
| 121 | 192 | { |
| 122 | 193 | path: '/business', |
| 123 | 194 | component: Layout, |
| ... | ... | @@ -128,12 +199,12 @@ export const constantRoutes = [ |
| 128 | 199 | component: (resolve) => require(['@/views/business/ConstructionCredit'], resolve), |
| 129 | 200 | name: '工地失信管理', |
| 130 | 201 | meta: { title: '工地失信管理' } |
| 131 | - }, | |
| 132 | - { | |
| 133 | - path: 'track', | |
| 134 | - component: (resolve) => require(['@/views/business/track'], resolve), | |
| 135 | - name: '跟踪监督', | |
| 136 | - meta: { title: '跟踪监督' } | |
| 202 | + }, | |
| 203 | + { | |
| 204 | + path: 'track', | |
| 205 | + component: (resolve) => require(['@/views/business/track'], resolve), | |
| 206 | + name: '跟踪监督', | |
| 207 | + meta: { title: '跟踪监督' } | |
| 137 | 208 | }, |
| 138 | 209 | { |
| 139 | 210 | path: 'supervision/threestep', |
| ... | ... | @@ -371,6 +442,7 @@ export const constantRoutes = [ |
| 371 | 442 | }, |
| 372 | 443 | ] |
| 373 | 444 | }, |
| 445 | + | |
| 374 | 446 | // { |
| 375 | 447 | // path: '/task/handle', |
| 376 | 448 | // component: Layout, | ... | ... |
trash-ui/src/views/other/documentData/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> | |
| 4 | + <el-form-item label="标题" prop="title"> | |
| 5 | + <el-input | |
| 6 | + v-model="queryParams.title" | |
| 7 | + placeholder="请输入标题" | |
| 8 | + clearable | |
| 9 | + size="small" | |
| 10 | + @keyup.enter.native="handleQuery" | |
| 11 | + /> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item> | |
| 14 | + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | |
| 15 | + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | |
| 16 | + </el-form-item> | |
| 17 | + </el-form> | |
| 18 | + | |
| 19 | + <el-row :gutter="10" class="mb8"> | |
| 20 | + <el-col :span="1.5"> | |
| 21 | + <el-button | |
| 22 | + type="primary" | |
| 23 | + icon="el-icon-plus" | |
| 24 | + size="mini" | |
| 25 | + @click="handleAdd" | |
| 26 | + v-hasPermi="['other:documentData:add']" | |
| 27 | + >新增 | |
| 28 | + </el-button> | |
| 29 | + </el-col> | |
| 30 | + <el-col :span="1.5"> | |
| 31 | + <el-button | |
| 32 | + type="success" | |
| 33 | + icon="el-icon-edit" | |
| 34 | + size="mini" | |
| 35 | + :disabled="single" | |
| 36 | + @click="handleUpdate" | |
| 37 | + v-hasPermi="['other:documentData:edit']" | |
| 38 | + >修改 | |
| 39 | + </el-button> | |
| 40 | + </el-col> | |
| 41 | + <el-col :span="1.5"> | |
| 42 | + <el-button | |
| 43 | + type="danger" | |
| 44 | + icon="el-icon-delete" | |
| 45 | + size="mini" | |
| 46 | + :disabled="multiple" | |
| 47 | + @click="handleDelete" | |
| 48 | + v-hasPermi="['other:documentData:remove']" | |
| 49 | + >删除 | |
| 50 | + </el-button> | |
| 51 | + </el-col> | |
| 52 | + <el-col :span="1.5"> | |
| 53 | + <el-button | |
| 54 | + type="warning" | |
| 55 | + icon="el-icon-download" | |
| 56 | + size="mini" | |
| 57 | + @click="handleExport" | |
| 58 | + v-hasPermi="['other:documentData:export']" | |
| 59 | + >导出 | |
| 60 | + </el-button> | |
| 61 | + </el-col> | |
| 62 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 63 | + </el-row> | |
| 64 | + | |
| 65 | + <el-table v-loading="loading" :data="documentDataList" @selection-change="handleSelectionChange"> | |
| 66 | + <el-table-column type="selection" width="55" align="center"/> | |
| 67 | + <el-table-column label="附件" align="center" prop="id"/> | |
| 68 | + <el-table-column label="标题" align="center" prop="title"/> | |
| 69 | + <el-table-column label="时间" align="center" prop="createTime"> | |
| 70 | + <template slot-scope="scope"> | |
| 71 | + <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}:{s}") }}</span> | |
| 72 | + </template> | |
| 73 | + </el-table-column> | |
| 74 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | |
| 75 | + <template slot-scope="scope"> | |
| 76 | + <el-button | |
| 77 | + size="mini" | |
| 78 | + type="text" | |
| 79 | + icon="el-icon-edit" | |
| 80 | + @click="handleUpdate(scope.row)" | |
| 81 | + v-hasPermi="['other:documentData:edit']" | |
| 82 | + >修改 | |
| 83 | + </el-button> | |
| 84 | + <el-button | |
| 85 | + size="mini" | |
| 86 | + type="text" | |
| 87 | + icon="el-icon-delete" | |
| 88 | + @click="handleDelete(scope.row)" | |
| 89 | + v-hasPermi="['other:documentData:remove']" | |
| 90 | + >删除 | |
| 91 | + </el-button> | |
| 92 | + </template> | |
| 93 | + </el-table-column> | |
| 94 | + </el-table> | |
| 95 | + | |
| 96 | + <pagination | |
| 97 | + v-show="total>0" | |
| 98 | + :total="total" | |
| 99 | + :page.sync="queryParams.pageNum" | |
| 100 | + :limit.sync="queryParams.pageSize" | |
| 101 | + @pagination="getList" | |
| 102 | + /> | |
| 103 | + | |
| 104 | + <!-- 添加或修改文件资料对话框 --> | |
| 105 | + <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> | |
| 106 | + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | |
| 107 | + <el-form-item label="标题" prop="title"> | |
| 108 | + <el-input v-model="form.title" placeholder="请输入标题"/> | |
| 109 | + </el-form-item> | |
| 110 | + <el-form-item label="内容" prop="content"> | |
| 111 | + <editor v-model="form.content" :min-height="368"/> | |
| 112 | + </el-form-item> | |
| 113 | + <el-row> | |
| 114 | + <el-col :span="12"> | |
| 115 | + <el-form-item label="录入时间"> | |
| 116 | + <el-input v-model="form.createTime" disabled="disabled"/> | |
| 117 | + </el-form-item> | |
| 118 | + </el-col> | |
| 119 | + <el-col :span="12"> | |
| 120 | + <el-form-item label="录入人"> | |
| 121 | + <el-input v-model="form.createBy" disabled="disabled"/> | |
| 122 | + </el-form-item> | |
| 123 | + </el-col> | |
| 124 | + </el-row> | |
| 125 | + <el-form-item label="附件预览"> | |
| 126 | + <el-image v-for="item in fileEntityList" | |
| 127 | + v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" | |
| 128 | + style="width: 150px; height: 100px; margin: 5px;" | |
| 129 | + :src="createUrl(item)" | |
| 130 | + :preview-src-list="[createUrl(item)]" | |
| 131 | + :z-index="999"> | |
| 132 | + </el-image> | |
| 133 | + </el-form-item> | |
| 134 | + <el-form-item prop="fileEntityList" label="附件"> | |
| 135 | + <el-upload | |
| 136 | + ref="upload" | |
| 137 | + action="" | |
| 138 | + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx" | |
| 139 | + :on-change="fileChange" | |
| 140 | + :auto-upload="false" | |
| 141 | + :show-file-list="false" | |
| 142 | + multiple | |
| 143 | + :file-list="fileEntityList"> | |
| 144 | + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button> | |
| 145 | + </el-upload> | |
| 146 | + </el-form-item> | |
| 147 | + <el-table :data="fileEntityList"> | |
| 148 | + <el-table-column property="name" label="附件名称" header-align="center" align="center"></el-table-column> | |
| 149 | + <el-table-column label="操作" class-name="small-padding fixed-width" header-align="center" align="center"> | |
| 150 | + <template slot-scope="scope"> | |
| 151 | + <el-button | |
| 152 | + size="small" type="success" | |
| 153 | + icon="el-icon-download" | |
| 154 | + @click="tempDownload(scope.row)" | |
| 155 | + v-hasPermi="['other:documentData:edit']" | |
| 156 | + round>下载 | |
| 157 | + </el-button> | |
| 158 | + <el-button | |
| 159 | + size="small" type="danger" | |
| 160 | + icon="el-icon-delete" | |
| 161 | + @click="handleDeleteFile(scope.$index)" | |
| 162 | + v-hasPermi="['other:documentData:remove']" | |
| 163 | + round>删除 | |
| 164 | + </el-button> | |
| 165 | + </template> | |
| 166 | + </el-table-column> | |
| 167 | + </el-table> | |
| 168 | + </el-form> | |
| 169 | + <div slot="footer" class="dialog-footer"> | |
| 170 | + <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 171 | + <el-button @click="cancel">取 消</el-button> | |
| 172 | + </div> | |
| 173 | + </el-dialog> | |
| 174 | + </div> | |
| 175 | +</template> | |
| 176 | + | |
| 177 | +<script> | |
| 178 | +import { | |
| 179 | + addDocumentData, | |
| 180 | + delDocumentData, | |
| 181 | + exportDocumentData, | |
| 182 | + getDocumentData, | |
| 183 | + listDocumentData, | |
| 184 | + updateDocumentData | |
| 185 | +} from "@/api/other/documentData"; | |
| 186 | +import Editor from '@/components/ZcEditor'; | |
| 187 | +import {parseTime} from "../../../utils/trash"; | |
| 188 | + | |
| 189 | +export default { | |
| 190 | + name: "DocumentData", | |
| 191 | + components: {Editor}, | |
| 192 | + data() { | |
| 193 | + return { | |
| 194 | + // 遮罩层 | |
| 195 | + loading: true, | |
| 196 | + // 选中数组 | |
| 197 | + ids: [], | |
| 198 | + // 非单个禁用 | |
| 199 | + single: true, | |
| 200 | + // 非多个禁用 | |
| 201 | + multiple: true, | |
| 202 | + // 显示搜索条件 | |
| 203 | + showSearch: true, | |
| 204 | + // 总条数 | |
| 205 | + total: 0, | |
| 206 | + // 文件资料表格数据 | |
| 207 | + documentDataList: [], | |
| 208 | + // 弹出层标题 | |
| 209 | + title: "", | |
| 210 | + // 是否显示弹出层 | |
| 211 | + open: false, | |
| 212 | + // 查询参数 | |
| 213 | + queryParams: { | |
| 214 | + pageNum: 1, | |
| 215 | + pageSize: 10, | |
| 216 | + title: null, | |
| 217 | + content: null, | |
| 218 | + files: null, | |
| 219 | + }, | |
| 220 | + // 表单参数 | |
| 221 | + form: {}, | |
| 222 | + // 表单校验 | |
| 223 | + rules: { | |
| 224 | + title: [ | |
| 225 | + {required: true, message: "请输入标题", trigger: "blur"}, | |
| 226 | + {min: 1, max: 100, message: "长度在 1 到 100 个字符", trigger: "blur"} | |
| 227 | + ], | |
| 228 | + content: [ | |
| 229 | + {required: true, message: "请输入内容", trigger: "blur"}, | |
| 230 | + {min: 1, max: 10000, message: "长度在 1 到 10000 个字符", trigger: "blur"} | |
| 231 | + ], | |
| 232 | + files: [ | |
| 233 | + {required: true, message: "请上传附件", trigger: "blur"} | |
| 234 | + ] | |
| 235 | + }, | |
| 236 | + fileEntityList: [], | |
| 237 | + }; | |
| 238 | + }, | |
| 239 | + created() { | |
| 240 | + this.getList(); | |
| 241 | + }, | |
| 242 | + methods: { | |
| 243 | + /** 查询文件资料列表 */ | |
| 244 | + getList() { | |
| 245 | + this.loading = true; | |
| 246 | + listDocumentData(this.queryParams).then(response => { | |
| 247 | + this.documentDataList = response.rows; | |
| 248 | + this.total = response.total; | |
| 249 | + this.loading = false; | |
| 250 | + }); | |
| 251 | + }, | |
| 252 | + // 取消按钮 | |
| 253 | + cancel() { | |
| 254 | + this.open = false; | |
| 255 | + this.reset(); | |
| 256 | + }, | |
| 257 | + // 表单重置 | |
| 258 | + reset() { | |
| 259 | + this.form = { | |
| 260 | + id: null, | |
| 261 | + title: null, | |
| 262 | + content: null, | |
| 263 | + files: null, | |
| 264 | + createTime: null, | |
| 265 | + createBy: null, | |
| 266 | + updateTime: null, | |
| 267 | + updateBy: null | |
| 268 | + }; | |
| 269 | + this.fileEntityList = []; | |
| 270 | + this.resetForm("form"); | |
| 271 | + }, | |
| 272 | + /** 搜索按钮操作 */ | |
| 273 | + handleQuery() { | |
| 274 | + this.queryParams.pageNum = 1; | |
| 275 | + this.getList(); | |
| 276 | + }, | |
| 277 | + /** 重置按钮操作 */ | |
| 278 | + resetQuery() { | |
| 279 | + this.resetForm("queryForm"); | |
| 280 | + this.handleQuery(); | |
| 281 | + }, | |
| 282 | + // 多选框选中数据 | |
| 283 | + handleSelectionChange(selection) { | |
| 284 | + this.ids = selection.map(item => item.id) | |
| 285 | + this.single = selection.length !== 1 | |
| 286 | + this.multiple = !selection.length | |
| 287 | + }, | |
| 288 | + /** 新增按钮操作 */ | |
| 289 | + handleAdd() { | |
| 290 | + this.reset(); | |
| 291 | + //yyyy-MM-dd HH:mm:ss | |
| 292 | + this.form.createTime = parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}"); | |
| 293 | + this.form.createBy = this.$store.getters.name; | |
| 294 | + this.open = true; | |
| 295 | + this.title = "添加文件资料"; | |
| 296 | + }, | |
| 297 | + /** 修改按钮操作 */ | |
| 298 | + handleUpdate(row) { | |
| 299 | + this.reset(); | |
| 300 | + const id = row.id || this.ids | |
| 301 | + getDocumentData(id).then(response => { | |
| 302 | + this.form = response.data; | |
| 303 | + //将附件转换为前端可视化数组 | |
| 304 | + if (this.form.files != null && this.form.files !== "") { | |
| 305 | + let fileList = this.form.files.split(";"); | |
| 306 | + fileList.map(item => { | |
| 307 | + let name = item.substring(item.lastIndexOf("/") + 1); | |
| 308 | + this.fileEntityList.push({name: name, url: item}) | |
| 309 | + }) | |
| 310 | + } | |
| 311 | + this.open = true; | |
| 312 | + this.title = "修改文件资料"; | |
| 313 | + }); | |
| 314 | + }, | |
| 315 | + /** 提交按钮 */ | |
| 316 | + submitForm() { | |
| 317 | + this.$refs["form"].validate(valid => { | |
| 318 | + if (valid) { | |
| 319 | + let formData = new FormData(); | |
| 320 | + let form = this.form; | |
| 321 | + //去掉params属性 | |
| 322 | + delete form.params; | |
| 323 | + //先清空原有的附件 | |
| 324 | + form.files = null; | |
| 325 | + | |
| 326 | + | |
| 327 | + this.fileEntityList.forEach(item => { | |
| 328 | + if (item.raw != null) { | |
| 329 | + formData.append('fileList', item.raw) | |
| 330 | + } else { | |
| 331 | + //将原有的附件拼接到form中 | |
| 332 | + form.files = form.files !== null ? form.files + ";" + item.url : item.url; | |
| 333 | + } | |
| 334 | + }) | |
| 335 | + | |
| 336 | + for (let key in form) { | |
| 337 | + formData.append(key, form[key] == null ? "" : form[key]) | |
| 338 | + } | |
| 339 | + | |
| 340 | + if (this.form.id != null) { | |
| 341 | + updateDocumentData(formData).then(response => { | |
| 342 | + this.msgSuccess("修改成功"); | |
| 343 | + this.open = false; | |
| 344 | + this.getList(); | |
| 345 | + }); | |
| 346 | + } else { | |
| 347 | + addDocumentData(formData).then(response => { | |
| 348 | + this.msgSuccess("新增成功"); | |
| 349 | + this.open = false; | |
| 350 | + this.getList(); | |
| 351 | + }); | |
| 352 | + } | |
| 353 | + } | |
| 354 | + }); | |
| 355 | + }, | |
| 356 | + /** 删除按钮操作 */ | |
| 357 | + handleDelete(row) { | |
| 358 | + const ids = row.id || this.ids; | |
| 359 | + this.$confirm('是否确认删除文件资料编号为"' + ids + '"的数据项?', "警告", { | |
| 360 | + confirmButtonText: "确定", | |
| 361 | + cancelButtonText: "取消", | |
| 362 | + type: "warning" | |
| 363 | + }).then(function () { | |
| 364 | + return delDocumentData(ids); | |
| 365 | + }).then(() => { | |
| 366 | + this.getList(); | |
| 367 | + this.msgSuccess("删除成功"); | |
| 368 | + }) | |
| 369 | + }, | |
| 370 | + /** 导出按钮操作 */ | |
| 371 | + handleExport() { | |
| 372 | + const queryParams = this.queryParams; | |
| 373 | + this.$confirm('是否确认导出所有文件资料数据项?', "警告", { | |
| 374 | + confirmButtonText: "确定", | |
| 375 | + cancelButtonText: "取消", | |
| 376 | + type: "warning" | |
| 377 | + }).then(function () { | |
| 378 | + return exportDocumentData(queryParams); | |
| 379 | + }).then(response => { | |
| 380 | + this.download(response.msg); | |
| 381 | + }) | |
| 382 | + }, | |
| 383 | + /** | |
| 384 | + * 文件改变时,限制文件上传格式和大小 | |
| 385 | + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg | |
| 386 | + * 大小不超过20M | |
| 387 | + * */ | |
| 388 | + fileChange(file, fileList) { | |
| 389 | + let count = 0; | |
| 390 | + for (let i = 0; i < fileList.length; i++) { | |
| 391 | + // console.log(fileList.length) | |
| 392 | + // console.log(this.fileEntityList[i].name+"111"+file.name) | |
| 393 | + if (fileList[i].name == file.name) { | |
| 394 | + count++; | |
| 395 | + if (count == 2) { | |
| 396 | + this.$message({ | |
| 397 | + message: '已存在此文件!', | |
| 398 | + type: 'warning' | |
| 399 | + }); | |
| 400 | + for (let j = fileList.length; j > 0; j--) { | |
| 401 | + //如果存在此文件,去除新选择的重复文件 | |
| 402 | + if (fileList[j - 1].name == file.name) { | |
| 403 | + fileList.splice(j - 1, 1); | |
| 404 | + i--; | |
| 405 | + return false; | |
| 406 | + } | |
| 407 | + } | |
| 408 | + } | |
| 409 | + } | |
| 410 | + } | |
| 411 | + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase(); | |
| 412 | + //格式符合后判断大小 | |
| 413 | + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) { | |
| 414 | + let max5M = file.size / 1024 / 1024 < 100; | |
| 415 | + if (!max5M) { | |
| 416 | + this.$message({ | |
| 417 | + message: '上传文件大小不得超过100M!', | |
| 418 | + type: 'warning' | |
| 419 | + }); | |
| 420 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 421 | + } else { | |
| 422 | + //符合条件后进行添加 | |
| 423 | + this.fileEntityList = fileList | |
| 424 | + } | |
| 425 | + } else { | |
| 426 | + this.$message({ | |
| 427 | + message: '上传文件只能是 jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx格式!', | |
| 428 | + type: 'warning' | |
| 429 | + }); | |
| 430 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 431 | + } | |
| 432 | + }, | |
| 433 | + // 删除文件 | |
| 434 | + handleDeleteFile(index) { | |
| 435 | + this.fileEntityList.splice(index, 1); | |
| 436 | + }, | |
| 437 | + /** 文件下载 */ | |
| 438 | + tempDownload(row) { | |
| 439 | + let name = row.name; | |
| 440 | + let url = ""; | |
| 441 | + if (row.raw != null) { | |
| 442 | + url = URL.createObjectURL(row.raw); | |
| 443 | + } else { | |
| 444 | + url = process.env.VUE_APP_BASE_API + row.url; | |
| 445 | + } | |
| 446 | + const a = document.createElement('a') | |
| 447 | + a.setAttribute('download', name) | |
| 448 | + a.setAttribute('target', '_blank') | |
| 449 | + a.setAttribute('href', url); | |
| 450 | + a.click() | |
| 451 | + }, | |
| 452 | + createUrl(file) { | |
| 453 | + if (file.raw != null) { | |
| 454 | + return URL.createObjectURL(file.raw); | |
| 455 | + } else { | |
| 456 | + return process.env.VUE_APP_BASE_API + file.url; | |
| 457 | + } | |
| 458 | + | |
| 459 | + }, | |
| 460 | + } | |
| 461 | +}; | |
| 462 | +</script> | ... | ... |
trash-ui/src/views/other/incorruptEducation/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <el-row :gutter="10" class="mb8"> | |
| 4 | + <el-col :span="1.5"> | |
| 5 | + <el-upload | |
| 6 | + ref="upload" | |
| 7 | + action="" | |
| 8 | + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp" | |
| 9 | + :on-change="fileChange" | |
| 10 | + :auto-upload="false" | |
| 11 | + :show-file-list="false" | |
| 12 | + multiple | |
| 13 | + :file-list="file"> | |
| 14 | + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button> | |
| 15 | + </el-upload> | |
| 16 | + </el-col> | |
| 17 | + <el-col :span="1.5"> | |
| 18 | + <el-button size="small" type="primary" @click="file=[]">删除附件</el-button> | |
| 19 | + </el-col> | |
| 20 | + <el-col :span="1.5"> | |
| 21 | + <el-button size="small" type="primary" @click="submitForm">提交</el-button> | |
| 22 | + </el-col> | |
| 23 | + </el-row> | |
| 24 | + <el-image v-if="file.length!=0" style="" | |
| 25 | + :src="createUrl(file[0])" | |
| 26 | + :preview-src-list="[createUrl(file[0])]" | |
| 27 | + :z-index="999"> | |
| 28 | + </el-image> | |
| 29 | + </div> | |
| 30 | +</template> | |
| 31 | + | |
| 32 | +<script> | |
| 33 | +import {addIncorruptData, listIncorruptData} from "@/api/other/incorruptData"; | |
| 34 | + | |
| 35 | +export default { | |
| 36 | + name: "incorruptEducation", | |
| 37 | + data() { | |
| 38 | + return { | |
| 39 | + file: [], | |
| 40 | + }; | |
| 41 | + }, | |
| 42 | + created() { | |
| 43 | + this.getList(); | |
| 44 | + }, | |
| 45 | + methods: { | |
| 46 | + /** 查询文件资料列表 */ | |
| 47 | + getList() { | |
| 48 | + this.loading = true; | |
| 49 | + listIncorruptData("education").then(response => { | |
| 50 | + this.file = [{ | |
| 51 | + url:response[0].filePath, | |
| 52 | + name:response[0].fileName, | |
| 53 | + }]; | |
| 54 | + }); | |
| 55 | + }, | |
| 56 | + delFile(){ | |
| 57 | + this.file=[]; | |
| 58 | + }, | |
| 59 | + /** 提交按钮 */ | |
| 60 | + submitForm() { | |
| 61 | + | |
| 62 | + let formData = new FormData(); | |
| 63 | + let form = { | |
| 64 | + files: null, | |
| 65 | + tableName: "education", | |
| 66 | + }; | |
| 67 | + | |
| 68 | + this.file.forEach(item => { | |
| 69 | + if (item.raw != null) { | |
| 70 | + formData.append('files', item.raw) | |
| 71 | + } else { | |
| 72 | + //将原有的附件拼接到form中 | |
| 73 | + form.files = form.files !== null ? form.files + ";" + item.url : item.url; | |
| 74 | + } | |
| 75 | + }) | |
| 76 | + | |
| 77 | + for (let key in form) { | |
| 78 | + formData.append(key, form[key] == null ? "" : form[key]) | |
| 79 | + } | |
| 80 | + | |
| 81 | + addIncorruptData(formData).then(response => { | |
| 82 | + this.msgSuccess("新增成功"); | |
| 83 | + this.open = false; | |
| 84 | + this.getList(); | |
| 85 | + }); | |
| 86 | + }, | |
| 87 | + /** | |
| 88 | + * 文件改变时,限制文件上传格式和大小 | |
| 89 | + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg | |
| 90 | + * 大小不超过20M | |
| 91 | + * */ | |
| 92 | + fileChange(file, fileList) { | |
| 93 | + let count = 0; | |
| 94 | + if(fileList.length>1){ | |
| 95 | + this.$message({ | |
| 96 | + message: '只能上传一张图片!', | |
| 97 | + type: 'warning' | |
| 98 | + }); | |
| 99 | + return false; | |
| 100 | + } | |
| 101 | + for (let i = 0; i < fileList.length; i++) { | |
| 102 | + // console.log(fileList.length) | |
| 103 | + // console.log(this.fileEntityList[i].name+"111"+file.name) | |
| 104 | + if (fileList[i].name == file.name) { | |
| 105 | + count++; | |
| 106 | + if (count == 2) { | |
| 107 | + this.$message({ | |
| 108 | + message: '已存在此文件!', | |
| 109 | + type: 'warning' | |
| 110 | + }); | |
| 111 | + for (let j = fileList.length; j > 0; j--) { | |
| 112 | + //如果存在此文件,去除新选择的重复文件 | |
| 113 | + if (fileList[j - 1].name == file.name) { | |
| 114 | + fileList.splice(j - 1, 1); | |
| 115 | + i--; | |
| 116 | + return false; | |
| 117 | + } | |
| 118 | + } | |
| 119 | + } | |
| 120 | + } | |
| 121 | + } | |
| 122 | + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase(); | |
| 123 | + //格式符合后判断大小 | |
| 124 | + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp".indexOf(fileType) != -1) { | |
| 125 | + let max5M = file.size / 1024 / 1024 < 100; | |
| 126 | + if (!max5M) { | |
| 127 | + this.$message({ | |
| 128 | + message: '上传文件大小不得超过100M!', | |
| 129 | + type: 'warning' | |
| 130 | + }); | |
| 131 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 132 | + } else { | |
| 133 | + //符合条件后进行添加 | |
| 134 | + this.file = fileList | |
| 135 | + } | |
| 136 | + } else { | |
| 137 | + this.$message({ | |
| 138 | + message: '上传文件只能是 jpg,jpeg,png,gif,jfif,pjpeg,pjp格式!', | |
| 139 | + type: 'warning' | |
| 140 | + }); | |
| 141 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 142 | + } | |
| 143 | + }, | |
| 144 | + createUrl(file) { | |
| 145 | + if (file.raw != null) { | |
| 146 | + return URL.createObjectURL(file.raw); | |
| 147 | + } else { | |
| 148 | + return process.env.VUE_APP_BASE_API + file.url; | |
| 149 | + } | |
| 150 | + | |
| 151 | + }, | |
| 152 | + } | |
| 153 | +}; | |
| 154 | +</script> | ... | ... |
trash-ui/src/views/other/incorruptGovernment/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + | |
| 4 | + | |
| 5 | + <el-row :gutter="10" class="mb8"> | |
| 6 | + <el-col :span="1.5"> | |
| 7 | + <el-upload | |
| 8 | + ref="upload" | |
| 9 | + action="" | |
| 10 | + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp" | |
| 11 | + :on-change="fileChange" | |
| 12 | + :auto-upload="false" | |
| 13 | + :show-file-list="false" | |
| 14 | + multiple | |
| 15 | + :file-list="file"> | |
| 16 | + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button> | |
| 17 | + </el-upload> | |
| 18 | + </el-col> | |
| 19 | + <el-col :span="1.5"> | |
| 20 | + <el-button size="small" type="primary" @click="file=[]">删除附件</el-button> | |
| 21 | + </el-col> | |
| 22 | + <el-col :span="1.5"> | |
| 23 | + <el-button size="small" type="primary" @click="submitForm">提交</el-button> | |
| 24 | + </el-col> | |
| 25 | + </el-row> | |
| 26 | + <el-image v-if="file.length!=0" style="" | |
| 27 | + :src="createUrl(file[0])" | |
| 28 | + :preview-src-list="[createUrl(file[0])]" | |
| 29 | + :z-index="999"> | |
| 30 | + </el-image> | |
| 31 | + </div> | |
| 32 | +</template> | |
| 33 | + | |
| 34 | +<script> | |
| 35 | +import {addIncorruptData, listIncorruptData} from "@/api/other/incorruptData"; | |
| 36 | + | |
| 37 | +export default { | |
| 38 | + name: "incorruptGovernment", | |
| 39 | + data() { | |
| 40 | + return { | |
| 41 | + file: [], | |
| 42 | + }; | |
| 43 | + }, | |
| 44 | + created() { | |
| 45 | + this.getList(); | |
| 46 | + }, | |
| 47 | + methods: { | |
| 48 | + /** 查询文件资料列表 */ | |
| 49 | + getList() { | |
| 50 | + this.loading = true; | |
| 51 | + listIncorruptData("government").then(response => { | |
| 52 | + this.file = [{ | |
| 53 | + url:response[0].filePath, | |
| 54 | + name:response[0].fileName, | |
| 55 | + }]; | |
| 56 | + }); | |
| 57 | + }, | |
| 58 | + delFile(){ | |
| 59 | + this.file=[]; | |
| 60 | + }, | |
| 61 | + /** 提交按钮 */ | |
| 62 | + submitForm() { | |
| 63 | + | |
| 64 | + let formData = new FormData(); | |
| 65 | + let form = { | |
| 66 | + files: null, | |
| 67 | + tableName: "government", | |
| 68 | + }; | |
| 69 | + | |
| 70 | + this.file.forEach(item => { | |
| 71 | + if (item.raw != null) { | |
| 72 | + formData.append('files', item.raw) | |
| 73 | + } else { | |
| 74 | + //将原有的附件拼接到form中 | |
| 75 | + form.files = form.files !== null ? form.files + ";" + item.url : item.url; | |
| 76 | + } | |
| 77 | + }) | |
| 78 | + | |
| 79 | + for (let key in form) { | |
| 80 | + formData.append(key, form[key] == null ? "" : form[key]) | |
| 81 | + } | |
| 82 | + | |
| 83 | + addIncorruptData(formData).then(response => { | |
| 84 | + this.msgSuccess("新增成功"); | |
| 85 | + this.open = false; | |
| 86 | + this.getList(); | |
| 87 | + }); | |
| 88 | + }, | |
| 89 | + /** | |
| 90 | + * 文件改变时,限制文件上传格式和大小 | |
| 91 | + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg | |
| 92 | + * 大小不超过20M | |
| 93 | + * */ | |
| 94 | + fileChange(file, fileList) { | |
| 95 | + let count = 0; | |
| 96 | + if(fileList.length>1){ | |
| 97 | + this.$message({ | |
| 98 | + message: '只能上传一张图片!', | |
| 99 | + type: 'warning' | |
| 100 | + }); | |
| 101 | + return false; | |
| 102 | + } | |
| 103 | + for (let i = 0; i < fileList.length; i++) { | |
| 104 | + // console.log(fileList.length) | |
| 105 | + // console.log(this.fileEntityList[i].name+"111"+file.name) | |
| 106 | + if (fileList[i].name == file.name) { | |
| 107 | + count++; | |
| 108 | + if (count == 2) { | |
| 109 | + this.$message({ | |
| 110 | + message: '已存在此文件!', | |
| 111 | + type: 'warning' | |
| 112 | + }); | |
| 113 | + for (let j = fileList.length; j > 0; j--) { | |
| 114 | + //如果存在此文件,去除新选择的重复文件 | |
| 115 | + if (fileList[j - 1].name == file.name) { | |
| 116 | + fileList.splice(j - 1, 1); | |
| 117 | + i--; | |
| 118 | + return false; | |
| 119 | + } | |
| 120 | + } | |
| 121 | + } | |
| 122 | + } | |
| 123 | + } | |
| 124 | + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase(); | |
| 125 | + //格式符合后判断大小 | |
| 126 | + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp".indexOf(fileType) != -1) { | |
| 127 | + let max5M = file.size / 1024 / 1024 < 100; | |
| 128 | + if (!max5M) { | |
| 129 | + this.$message({ | |
| 130 | + message: '上传文件大小不得超过100M!', | |
| 131 | + type: 'warning' | |
| 132 | + }); | |
| 133 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 134 | + } else { | |
| 135 | + //符合条件后进行添加 | |
| 136 | + this.file = fileList | |
| 137 | + } | |
| 138 | + } else { | |
| 139 | + this.$message({ | |
| 140 | + message: '上传文件只能是 jpg,jpeg,png,gif,jfif,pjpeg,pjp格式!', | |
| 141 | + type: 'warning' | |
| 142 | + }); | |
| 143 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 144 | + } | |
| 145 | + }, | |
| 146 | + createUrl(file) { | |
| 147 | + if (file.raw != null) { | |
| 148 | + return URL.createObjectURL(file.raw); | |
| 149 | + } else { | |
| 150 | + return process.env.VUE_APP_BASE_API + file.url; | |
| 151 | + } | |
| 152 | + | |
| 153 | + }, | |
| 154 | + } | |
| 155 | +}; | |
| 156 | +</script> | ... | ... |
trash-ui/src/views/unit/businessUnit/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="88px"> | |
| 4 | + <el-form-item label="企业名称" prop="name"> | |
| 5 | + <el-input | |
| 6 | + v-model="queryParams.name" | |
| 7 | + placeholder="请输入企业名称" | |
| 8 | + clearable | |
| 9 | + size="small" | |
| 10 | + @keyup.enter.native="handleQuery" | |
| 11 | + /> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item label="所属区域" prop="registrationArea"> | |
| 14 | + <el-select v-model="queryParams.registrationArea" placeholder="请输入注册地所在区域" style="width: 100%" clearable> | |
| 15 | + <el-option v-for="(area,index) in areas" :label="area.name" :value="area.name" :key="index"/> | |
| 16 | + </el-select> | |
| 17 | + </el-form-item> | |
| 18 | + | |
| 19 | + <el-form-item label="法人代表" prop="legalRepresentative"> | |
| 20 | + <el-input | |
| 21 | + v-model="queryParams.legalRepresentative" | |
| 22 | + placeholder="请输入法人代表" | |
| 23 | + clearable | |
| 24 | + size="small" | |
| 25 | + @keyup.enter.native="handleQuery" | |
| 26 | + /> | |
| 27 | + </el-form-item> | |
| 28 | + <el-form-item label="审批状态" prop="status"> | |
| 29 | + <el-select v-model="queryParams.status" placeholder="请选择审批状态" clearable size="small"> | |
| 30 | + <el-option label="审批中" value="0" /> | |
| 31 | + <el-option label="审批通过" value="1" /> | |
| 32 | + <el-option label="被驳回" value="2" /> | |
| 33 | + </el-select> | |
| 34 | + </el-form-item> | |
| 35 | + <el-form-item> | |
| 36 | + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | |
| 37 | + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | |
| 38 | + </el-form-item> | |
| 39 | + </el-form> | |
| 40 | + | |
| 41 | + <el-row :gutter="10" class="mb8"> | |
| 42 | + <el-col :span="1.5"> | |
| 43 | + <el-button | |
| 44 | + type="primary" | |
| 45 | + icon="el-icon-plus" | |
| 46 | + size="mini" | |
| 47 | + @click="handleAdd" | |
| 48 | + v-hasPermi="['unit:enterprise:add']" | |
| 49 | + >新增</el-button> | |
| 50 | + </el-col> | |
| 51 | + <el-col :span="1.5"> | |
| 52 | + <el-button | |
| 53 | + type="success" | |
| 54 | + icon="el-icon-edit" | |
| 55 | + size="mini" | |
| 56 | + :disabled="single" | |
| 57 | + @click="handleUpdate" | |
| 58 | + v-hasPermi="['unit:enterprise:edit']" | |
| 59 | + >修改</el-button> | |
| 60 | + </el-col> | |
| 61 | + <el-col :span="1.5"> | |
| 62 | + <el-button | |
| 63 | + type="danger" | |
| 64 | + icon="el-icon-delete" | |
| 65 | + size="mini" | |
| 66 | + :disabled="multiple" | |
| 67 | + @click="handleDelete" | |
| 68 | + v-hasPermi="['unit:enterprise:remove']" | |
| 69 | + >删除</el-button> | |
| 70 | + </el-col> | |
| 71 | + <el-col :span="1.5"> | |
| 72 | + <el-button | |
| 73 | + type="warning" | |
| 74 | + icon="el-icon-download" | |
| 75 | + size="mini" | |
| 76 | + @click="handleExport" | |
| 77 | + v-hasPermi="['unit:enterprise:export']" | |
| 78 | + >导出</el-button> | |
| 79 | + </el-col> | |
| 80 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 81 | + </el-row> | |
| 82 | + | |
| 83 | + <el-table v-loading="loading" :data="enterpriseList" @selection-change="handleSelectionChange"> | |
| 84 | + <el-table-column type="selection" width="55" align="center" /> | |
| 85 | + <el-table-column type="index" width="55" align="center" label="序号"/> | |
| 86 | + <el-table-column label="企业名称" align="center" prop="name" /> | |
| 87 | + <el-table-column label="简称" align="center" prop="abbreviation" /> | |
| 88 | + <el-table-column label="所属区域" align="center" prop="registrationArea" /> | |
| 89 | + <el-table-column label="车辆数" align="center" prop="carNumber" /> | |
| 90 | + <el-table-column label="法人代表" align="center" prop="legalRepresentative" /> | |
| 91 | + <el-table-column label="联系方式" align="center" prop="legalRepresentativePhone" /> | |
| 92 | + <el-table-column label="审批状态" align="center" prop="status"> | |
| 93 | + <template slot-scope="scope"> | |
| 94 | + <span>{{ parseStatus(scope.row.status) }}</span> | |
| 95 | + </template> | |
| 96 | + </el-table-column> | |
| 97 | + <el-table-column label="信用状态" align="center" prop="creditStatus" /> | |
| 98 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | |
| 99 | + <template slot-scope="scope"> | |
| 100 | + <el-button | |
| 101 | + size="mini" | |
| 102 | + type="text" | |
| 103 | + icon="el-icon-edit" | |
| 104 | + @click="handleUpdate(scope.row)" | |
| 105 | + v-hasPermi="['unit:enterprise:edit']" | |
| 106 | + >修改</el-button> | |
| 107 | + <el-button | |
| 108 | + size="mini" | |
| 109 | + type="text" | |
| 110 | + icon="el-icon-delete" | |
| 111 | + @click="handleDelete(scope.row)" | |
| 112 | + v-hasPermi="['unit:enterprise:remove']" | |
| 113 | + >删除</el-button> | |
| 114 | + </template> | |
| 115 | + </el-table-column> | |
| 116 | + </el-table> | |
| 117 | + | |
| 118 | + <pagination | |
| 119 | + v-show="total>0" | |
| 120 | + :total="total" | |
| 121 | + :page.sync="queryParams.pageNum" | |
| 122 | + :limit.sync="queryParams.pageSize" | |
| 123 | + @pagination="getList" | |
| 124 | + /> | |
| 125 | + | |
| 126 | + </div> | |
| 127 | +</template> | |
| 128 | + | |
| 129 | +<script> | |
| 130 | +import { listEnterprise, getEnterprise, delEnterprise, addEnterprise, updateEnterprise, exportEnterprise } from "@/api/unit/enterprise"; | |
| 131 | +import {getAreaList} from "@/api/casefile/remoteServer"; | |
| 132 | + | |
| 133 | +export default { | |
| 134 | + name: "Enterprise", | |
| 135 | + data() { | |
| 136 | + return { | |
| 137 | + // 遮罩层 | |
| 138 | + loading: true, | |
| 139 | + // 选中数组 | |
| 140 | + ids: [], | |
| 141 | + // 非单个禁用 | |
| 142 | + single: true, | |
| 143 | + // 非多个禁用 | |
| 144 | + multiple: true, | |
| 145 | + // 显示搜索条件 | |
| 146 | + showSearch: true, | |
| 147 | + // 总条数 | |
| 148 | + total: 0, | |
| 149 | + // 运输企业管理表格数据 | |
| 150 | + enterpriseList: [], | |
| 151 | + // 弹出层标题 | |
| 152 | + title: "", | |
| 153 | + // 是否显示弹出层 | |
| 154 | + open: false, | |
| 155 | + // 查询参数 | |
| 156 | + queryParams: { | |
| 157 | + pageNum: 1, | |
| 158 | + pageSize: 10, | |
| 159 | + name: null, | |
| 160 | + abbreviation: null, | |
| 161 | + registrationArea: null, | |
| 162 | + transportPermissionDate: null, | |
| 163 | + enterDate: null, | |
| 164 | + businessLicenseDate: null, | |
| 165 | + officeAddress: null, | |
| 166 | + parkingLotLocation: null, | |
| 167 | + parkingArea: null, | |
| 168 | + carNumber: null, | |
| 169 | + safetyManagerName: null, | |
| 170 | + safetyManagerPhone: null, | |
| 171 | + socialUniformCreditCodeNumber: null, | |
| 172 | + legalRepresentative: null, | |
| 173 | + legalRepresentativePhone: null, | |
| 174 | + safetyPeopleName: null, | |
| 175 | + transportPermission: null, | |
| 176 | + enterpriseBusinessLicense: null, | |
| 177 | + safetyOfficerQualificationCertificate: null, | |
| 178 | + safetyCertificate: null, | |
| 179 | + carParkPanorama: null, | |
| 180 | + businessUnit: null, | |
| 181 | + status: null, | |
| 182 | + parentId: null, | |
| 183 | + companyType: null, | |
| 184 | + creditStatus: null, | |
| 185 | + qrCode: null | |
| 186 | + }, | |
| 187 | + // 表单参数 | |
| 188 | + form: {}, | |
| 189 | + // 表单校验 | |
| 190 | + rules: { | |
| 191 | + }, | |
| 192 | + areas: [] | |
| 193 | + }; | |
| 194 | + }, | |
| 195 | + created() { | |
| 196 | + getAreaList().then(res => { | |
| 197 | + this.areas = res.data; | |
| 198 | + }); | |
| 199 | + this.getList(); | |
| 200 | + }, | |
| 201 | + watch:{ | |
| 202 | + '$route.query.unitRefresh':'getList' | |
| 203 | + }, | |
| 204 | + methods: { | |
| 205 | + /** 查询运输企业管理列表 */ | |
| 206 | + getList() { | |
| 207 | + this.loading = true; | |
| 208 | + this.queryParams.companyType = "0"; | |
| 209 | + listEnterprise(this.queryParams).then(response => { | |
| 210 | + this.enterpriseList = response.rows; | |
| 211 | + this.total = response.total; | |
| 212 | + this.loading = false; | |
| 213 | + }); | |
| 214 | + }, | |
| 215 | + /** 搜索按钮操作 */ | |
| 216 | + handleQuery() { | |
| 217 | + this.queryParams.pageNum = 1; | |
| 218 | + this.getList(); | |
| 219 | + }, | |
| 220 | + /** 重置按钮操作 */ | |
| 221 | + resetQuery() { | |
| 222 | + this.resetForm("queryForm"); | |
| 223 | + this.handleQuery(); | |
| 224 | + }, | |
| 225 | + // 多选框选中数据 | |
| 226 | + handleSelectionChange(selection) { | |
| 227 | + this.ids = selection.map(item => item.id) | |
| 228 | + this.single = selection.length!==1 | |
| 229 | + this.multiple = !selection.length | |
| 230 | + }, | |
| 231 | + /** 新增按钮操作 */ | |
| 232 | + handleAdd() { | |
| 233 | + this.$tab.openPage("新增经营单位","/unit/info",{unitRefresh:0}); | |
| 234 | + }, | |
| 235 | + /** 修改按钮操作 */ | |
| 236 | + handleUpdate(row) { | |
| 237 | + const id = row.id || this.ids | |
| 238 | + this.$tab.openPage("修改经营单位","/unit/infoEdit",{unitId: id,unitRefresh:0}); | |
| 239 | + }, | |
| 240 | + /** 删除按钮操作 */ | |
| 241 | + handleDelete(row) { | |
| 242 | + const ids = row.id || this.ids; | |
| 243 | + this.$confirm('是否确认删除运输企业管理编号为"' + ids + '"的数据项?', "警告", { | |
| 244 | + confirmButtonText: "确定", | |
| 245 | + cancelButtonText: "取消", | |
| 246 | + type: "warning" | |
| 247 | + }).then(function() { | |
| 248 | + return delEnterprise(ids); | |
| 249 | + }).then(() => { | |
| 250 | + this.getList(); | |
| 251 | + this.msgSuccess("删除成功"); | |
| 252 | + }) | |
| 253 | + }, | |
| 254 | + /** 导出按钮操作 */ | |
| 255 | + handleExport() { | |
| 256 | + const queryParams = this.queryParams; | |
| 257 | + this.$confirm('是否确认导出所有运输企业管理数据项?', "警告", { | |
| 258 | + confirmButtonText: "确定", | |
| 259 | + cancelButtonText: "取消", | |
| 260 | + type: "warning" | |
| 261 | + }).then(function() { | |
| 262 | + return exportEnterprise(queryParams); | |
| 263 | + }).then(response => { | |
| 264 | + this.download(response.msg); | |
| 265 | + }) | |
| 266 | + } | |
| 267 | + } | |
| 268 | +}; | |
| 269 | +</script> | ... | ... |
trash-ui/src/views/unit/businessUnit/info.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + | |
| 4 | + <!-- 添加或修改处理场所管理对话框 --> | |
| 5 | + <h3> | |
| 6 | + 基础信息 | |
| 7 | + </h3> | |
| 8 | + <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="top"> | |
| 9 | + <el-row :gutter="30"> | |
| 10 | + <el-col :span="7"> | |
| 11 | + <el-form-item label="企业名称" prop="name"> | |
| 12 | + <el-input v-model="form.name" placeholder="请输入企业名称" /> | |
| 13 | + </el-form-item> | |
| 14 | + </el-col> | |
| 15 | + <el-col :span="7"> | |
| 16 | + <el-form-item label="简称" prop="abbreviation"> | |
| 17 | + <el-input v-model="form.abbreviation" placeholder="请输入简称" /> | |
| 18 | + </el-form-item> | |
| 19 | + </el-col> | |
| 20 | + <el-col :span="7"> | |
| 21 | + <el-form-item label="注册地所在区域" prop="registrationArea"> | |
| 22 | + <el-select v-model="form.registrationArea" placeholder="请输入注册地所在区域" style="width: 100%"> | |
| 23 | + <el-option v-for="(area,index) in areas" :label="area.name" :value="area.name" :key="index"/> | |
| 24 | + </el-select> | |
| 25 | + </el-form-item> | |
| 26 | + </el-col> | |
| 27 | + </el-row> | |
| 28 | + <el-row :gutter="30"> | |
| 29 | + <el-col :span="7"> | |
| 30 | + <el-form-item label="企业道路运输经营许可证有效期" prop="transportPermissionDate"> | |
| 31 | + <el-date-picker clearable size="small" style="width: 100%;" | |
| 32 | + v-model="form.transportPermissionDate" | |
| 33 | + type="date" | |
| 34 | + value-format="yyyy-MM-dd" | |
| 35 | + placeholder="选择企业道路运输经营许可证有效期"> | |
| 36 | + </el-date-picker> | |
| 37 | + </el-form-item> | |
| 38 | + </el-col> | |
| 39 | + <el-col :span="7"> | |
| 40 | + <el-form-item label="企业入市时间" prop="enterDate"> | |
| 41 | + <el-date-picker clearable size="small" style="width: 100%;" | |
| 42 | + v-model="form.enterDate" | |
| 43 | + type="date" | |
| 44 | + value-format="yyyy-MM-dd" | |
| 45 | + placeholder="选择企业入市时间"> | |
| 46 | + </el-date-picker> | |
| 47 | + </el-form-item> | |
| 48 | + </el-col> | |
| 49 | + <el-col :span="7"> | |
| 50 | + <el-form-item label="企业营业执照有效期" prop="businessLicenseDate"> | |
| 51 | + <el-date-picker clearable size="small" style="width: 100%;" | |
| 52 | + v-model="form.businessLicenseDate" | |
| 53 | + type="date" | |
| 54 | + value-format="yyyy-MM-dd" | |
| 55 | + placeholder="选择企业营业执照有效期"> | |
| 56 | + </el-date-picker> | |
| 57 | + </el-form-item> | |
| 58 | + </el-col> | |
| 59 | + </el-row> | |
| 60 | + <el-row :gutter="30"> | |
| 61 | + <el-col :span="7"> | |
| 62 | + <el-form-item label="办公地址" prop="officeAddress"> | |
| 63 | + <el-input v-model="form.officeAddress" placeholder="请输入内容" /> | |
| 64 | + </el-form-item> | |
| 65 | + </el-col> | |
| 66 | + <el-col :span="7"> | |
| 67 | + <el-form-item label="停车场位置" prop="parkingLotLocation"> | |
| 68 | + <el-input v-model="form.parkingLotLocation" placeholder="请输入内容" /> | |
| 69 | + </el-form-item> | |
| 70 | + </el-col> | |
| 71 | + <el-col :span="7"> | |
| 72 | + <el-form-item label="停车场面积(m²)" prop="parkingArea"> | |
| 73 | + <el-input v-model="form.parkingArea" placeholder="请输入停车场面积" /> | |
| 74 | + </el-form-item> | |
| 75 | + </el-col> | |
| 76 | + </el-row> | |
| 77 | + <el-row :gutter="30"> | |
| 78 | + <el-col :span="7"> | |
| 79 | + <el-form-item label="企业安全负责人姓名及联系方式" prop="safetyManagerName"> | |
| 80 | + <el-row> | |
| 81 | + <el-col :span="6"> | |
| 82 | + <el-input v-model="form.safetyManagerName" placeholder="姓名" /> | |
| 83 | + </el-col> | |
| 84 | + <el-col :span="18"> | |
| 85 | + <el-input v-model="form.safetyManagerPhone" placeholder="联系方式" :maxlength="11" show-word-limit/> | |
| 86 | + </el-col> | |
| 87 | + </el-row> | |
| 88 | + </el-form-item> | |
| 89 | + </el-col> | |
| 90 | + <el-col :span="7"> | |
| 91 | + <el-form-item label="社会统一信用代码编号" prop="socialUniformCreditCodeNumber"> | |
| 92 | + <el-input v-model="form.socialUniformCreditCodeNumber" placeholder="请输入社会统一信用代码编号" /> | |
| 93 | + </el-form-item> | |
| 94 | + </el-col> | |
| 95 | + <el-col :span="7"> | |
| 96 | + <el-form-item label="法人代表及联系方式" prop="legalRepresentative"> | |
| 97 | + <el-row> | |
| 98 | + <el-col :span="6"> | |
| 99 | + <el-input v-model="form.legalRepresentative" placeholder="姓名" /> | |
| 100 | + </el-col> | |
| 101 | + <el-col :span="18"> | |
| 102 | + <el-input v-model="form.legalRepresentativePhone" placeholder="联系方式" :maxlength="11" show-word-limit/> | |
| 103 | + </el-col> | |
| 104 | + </el-row> | |
| 105 | + </el-form-item> | |
| 106 | + </el-col> | |
| 107 | + </el-row> | |
| 108 | + | |
| 109 | + <el-row :gutter="30"> | |
| 110 | + <el-col :span="7"> | |
| 111 | + <el-form-item label="安全管理人员" prop="safetyPeopleName"> | |
| 112 | + <el-input v-model="form.safetyPeopleName" placeholder="请输入安全管理人员" /> | |
| 113 | + </el-form-item> | |
| 114 | + </el-col> | |
| 115 | + <el-col :span="14"> | |
| 116 | + <el-form-item label="备注" prop="remark"> | |
| 117 | + <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | |
| 118 | + </el-form-item> | |
| 119 | + </el-col> | |
| 120 | + </el-row> | |
| 121 | + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;"> | |
| 122 | + <el-col :span="3"> | |
| 123 | + <div class="upload_lable"> | |
| 124 | + 企业道路运输经营许可证 | |
| 125 | + <el-upload | |
| 126 | + ref="upload" | |
| 127 | + action="" | |
| 128 | + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx" | |
| 129 | + :on-change="fileChange" | |
| 130 | + :auto-upload="false" | |
| 131 | + :show-file-list="false" | |
| 132 | + multiple | |
| 133 | + :file-list="transportPermission"> | |
| 134 | + | |
| 135 | + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button> | |
| 136 | + </el-upload> | |
| 137 | + </div> | |
| 138 | + </el-col> | |
| 139 | + <el-col :span="21"> | |
| 140 | + <div class="upload_btn"> | |
| 141 | + <div v-for="(item,index) in transportPermission"> | |
| 142 | + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image"> | |
| 143 | + <div class="upload_close" @click="transportPermission.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div> | |
| 144 | + <el-image | |
| 145 | + style="width: 110px; height: 95px; margin: 5px;float:left;" | |
| 146 | + :src="createUrl(item)" | |
| 147 | + :preview-src-list="[createUrl(item)]" | |
| 148 | + :z-index="999"> | |
| 149 | + </el-image> | |
| 150 | + </div> | |
| 151 | + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file"> | |
| 152 | + <div class="upload_close_file" @click="transportPermission.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div> | |
| 153 | + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span> | |
| 154 | + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div> | |
| 155 | + </div> | |
| 156 | + </div> | |
| 157 | + </div> | |
| 158 | + </el-col> | |
| 159 | + </el-row> | |
| 160 | + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;"> | |
| 161 | + <el-col :span="3"> | |
| 162 | + <div class="upload_lable"> | |
| 163 | + 企业营业执照 | |
| 164 | + <el-upload | |
| 165 | + ref="upload" | |
| 166 | + action="" | |
| 167 | + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx" | |
| 168 | + :on-change="fileChange1" | |
| 169 | + :auto-upload="false" | |
| 170 | + :show-file-list="false" | |
| 171 | + multiple | |
| 172 | + :file-list="enterpriseBusinessLicense"> | |
| 173 | + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button> | |
| 174 | + </el-upload> | |
| 175 | + </div> | |
| 176 | + </el-col> | |
| 177 | + <el-col :span="21"> | |
| 178 | + <div class="upload_btn"> | |
| 179 | + <div v-for="(item,index) in enterpriseBusinessLicense"> | |
| 180 | + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image"> | |
| 181 | + <div class="upload_close" @click="enterpriseBusinessLicense.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div> | |
| 182 | + <el-image | |
| 183 | + style="width: 110px; height: 95px; margin: 5px;float:left;" | |
| 184 | + :src="createUrl(item)" | |
| 185 | + :preview-src-list="[createUrl(item)]" | |
| 186 | + :z-index="999"> | |
| 187 | + </el-image> | |
| 188 | + </div> | |
| 189 | + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file"> | |
| 190 | + <div class="upload_close_file" @click="enterpriseBusinessLicense.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div> | |
| 191 | + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span> | |
| 192 | + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div> | |
| 193 | + </div> | |
| 194 | + </div> | |
| 195 | + </div> | |
| 196 | + </el-col> | |
| 197 | + </el-row> | |
| 198 | + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;"> | |
| 199 | + <el-col :span="3"> | |
| 200 | + <div class="upload_lable"> | |
| 201 | + 安全员考核合格证明 | |
| 202 | + <el-upload | |
| 203 | + ref="upload" | |
| 204 | + action="" | |
| 205 | + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx" | |
| 206 | + :on-change="fileChange2" | |
| 207 | + :auto-upload="false" | |
| 208 | + :show-file-list="false" | |
| 209 | + multiple | |
| 210 | + :file-list="safetyOfficerQualificationCertificate"> | |
| 211 | + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button> | |
| 212 | + </el-upload> | |
| 213 | + </div> | |
| 214 | + </el-col> | |
| 215 | + <el-col :span="21"> | |
| 216 | + <div class="upload_btn"> | |
| 217 | + <div v-for="(item,index) in safetyOfficerQualificationCertificate"> | |
| 218 | + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image"> | |
| 219 | + <div class="upload_close" @click="safetyOfficerQualificationCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div> | |
| 220 | + <el-image | |
| 221 | + style="width: 110px; height: 95px; margin: 5px;float:left;" | |
| 222 | + :src="createUrl(item)" | |
| 223 | + :preview-src-list="[createUrl(item)]" | |
| 224 | + :z-index="999"> | |
| 225 | + </el-image> | |
| 226 | + </div> | |
| 227 | + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file"> | |
| 228 | + <div class="upload_close_file" @click="safetyOfficerQualificationCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div> | |
| 229 | + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span> | |
| 230 | + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div> | |
| 231 | + </div> | |
| 232 | + </div> | |
| 233 | + </div> | |
| 234 | + </el-col> | |
| 235 | + </el-row> | |
| 236 | + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;"> | |
| 237 | + <el-col :span="3"> | |
| 238 | + <div class="upload_lable"> | |
| 239 | + 企业负责人安全考核证 | |
| 240 | + <el-upload | |
| 241 | + ref="upload" | |
| 242 | + action="" | |
| 243 | + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx" | |
| 244 | + :on-change="fileChange3" | |
| 245 | + :auto-upload="false" | |
| 246 | + :show-file-list="false" | |
| 247 | + multiple | |
| 248 | + :file-list="safetyCertificate"> | |
| 249 | + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button> | |
| 250 | + </el-upload> | |
| 251 | + </div> | |
| 252 | + </el-col> | |
| 253 | + <el-col :span="21"> | |
| 254 | + <div class="upload_btn"> | |
| 255 | + <div v-for="(item,index) in safetyCertificate"> | |
| 256 | + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image"> | |
| 257 | + <div class="upload_close" @click="safetyCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div> | |
| 258 | + <el-image | |
| 259 | + style="width: 110px; height: 95px; margin: 5px;float:left;" | |
| 260 | + :src="createUrl(item)" | |
| 261 | + :preview-src-list="[createUrl(item)]" | |
| 262 | + :z-index="999"> | |
| 263 | + </el-image> | |
| 264 | + </div> | |
| 265 | + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file"> | |
| 266 | + <div class="upload_close_file" @click="safetyCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div> | |
| 267 | + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span> | |
| 268 | + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div> | |
| 269 | + </div> | |
| 270 | + </div> | |
| 271 | + </div> | |
| 272 | + </el-col> | |
| 273 | + </el-row> | |
| 274 | + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;"> | |
| 275 | + <el-col :span="3"> | |
| 276 | + <div class="upload_lable"> | |
| 277 | + 停车场全景图 | |
| 278 | + <el-upload | |
| 279 | + ref="upload" | |
| 280 | + action="" | |
| 281 | + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx" | |
| 282 | + :on-change="fileChange4" | |
| 283 | + :auto-upload="false" | |
| 284 | + :show-file-list="false" | |
| 285 | + multiple | |
| 286 | + :file-list="carParkPanorama"> | |
| 287 | + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button> | |
| 288 | + </el-upload> | |
| 289 | + </div> | |
| 290 | + </el-col> | |
| 291 | + <el-col :span="21"> | |
| 292 | + <div class="upload_btn"> | |
| 293 | + <div v-for="(item,index) in carParkPanorama"> | |
| 294 | + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image"> | |
| 295 | + <div class="upload_close" @click="carParkPanorama.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div> | |
| 296 | + <el-image | |
| 297 | + style="width: 110px; height: 95px; margin: 5px;float:left;" | |
| 298 | + :src="createUrl(item)" | |
| 299 | + :preview-src-list="[createUrl(item)]" | |
| 300 | + :z-index="999"> | |
| 301 | + </el-image> | |
| 302 | + </div> | |
| 303 | + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file"> | |
| 304 | + <div class="upload_close_file" @click="carParkPanorama.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div> | |
| 305 | + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span> | |
| 306 | + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div> | |
| 307 | + </div> | |
| 308 | + </div> | |
| 309 | + </div> | |
| 310 | + </el-col> | |
| 311 | + </el-row> | |
| 312 | + <!-- <el-form-item label="" prop="environmentalApproval">--> | |
| 313 | + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />--> | |
| 314 | + <!-- </el-form-item>--> | |
| 315 | + <!-- <el-form-item label="" prop="authorization">--> | |
| 316 | + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />--> | |
| 317 | + <!-- </el-form-item>--> | |
| 318 | + <!-- <el-form-item label="" prop="otherInformation">--> | |
| 319 | + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />--> | |
| 320 | + <!-- </el-form-item>--> | |
| 321 | + <!-- <el-form-item label="运输企业" prop="companyIds">--> | |
| 322 | + <!-- <el-input v-model="form.companyIds" placeholder="请输入运输企业" />--> | |
| 323 | + <!-- </el-form-item>--> | |
| 324 | + <!-- <el-form-item label="审批状态,0=审批中,1=审批通过,2=被驳回">--> | |
| 325 | + <!-- <el-radio-group v-model="form.status">--> | |
| 326 | + <!-- <el-radio label="1">请选择字典生成</el-radio>--> | |
| 327 | + <!-- </el-radio-group>--> | |
| 328 | + <!-- </el-form-item>--> | |
| 329 | + <!-- <el-form-item label="二维码" prop="qrCode">--> | |
| 330 | + <!-- <el-input v-model="form.qrCode" placeholder="请输入二维码" />--> | |
| 331 | + <!-- </el-form-item>--> | |
| 332 | + </el-form> | |
| 333 | + <div slot="footer" class="dialog-footer" style="margin-top: 20px"> | |
| 334 | + <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 335 | + <el-button @click="cancel">取 消</el-button> | |
| 336 | + </div> | |
| 337 | + </div> | |
| 338 | +</template> | |
| 339 | + | |
| 340 | +<script> | |
| 341 | +import { listEnterprise, getEnterprise, delEnterprise, addEnterprise, updateEnterprise, exportEnterprise } from "@/api/unit/enterprise"; | |
| 342 | +import Treeselect from "@riophae/vue-treeselect"; | |
| 343 | +import '@riophae/vue-treeselect/dist/vue-treeselect.css' | |
| 344 | +import {getAreaList} from "@/api/casefile/remoteServer"; | |
| 345 | + | |
| 346 | +export default { | |
| 347 | + name: "DisposalSite", | |
| 348 | + components: {Treeselect}, | |
| 349 | + data() { | |
| 350 | + return { | |
| 351 | + // 遮罩层 | |
| 352 | + loading: true, | |
| 353 | + // 选中数组 | |
| 354 | + ids: [], | |
| 355 | + // 非单个禁用 | |
| 356 | + single: true, | |
| 357 | + // 非多个禁用 | |
| 358 | + multiple: true, | |
| 359 | + // 显示搜索条件 | |
| 360 | + showSearch: true, | |
| 361 | + // 总条数 | |
| 362 | + total: 0, | |
| 363 | + // 处理场所管理表格数据 | |
| 364 | + disposalSiteList: [], | |
| 365 | + // 弹出层标题 | |
| 366 | + title: "", | |
| 367 | + // 是否显示弹出层 | |
| 368 | + open: false, | |
| 369 | + // 表单参数 | |
| 370 | + form: {}, | |
| 371 | + // 表单校验 | |
| 372 | + rules: { | |
| 373 | + name: [ | |
| 374 | + {required: true, message: "请输入企业名称", trigger: "blur"} | |
| 375 | + ], | |
| 376 | + abbreviation: [ | |
| 377 | + {required: true, message: "请输入简称", trigger: "blur"} | |
| 378 | + ], | |
| 379 | + registrationArea: [ | |
| 380 | + {required: true, message: "请输入注册地所在区域", trigger: "blur"} | |
| 381 | + ], | |
| 382 | + transportPermissionDate: [ | |
| 383 | + {required: true, message: "请选择企业道路运输经营许可证有效期", trigger: "blur"} | |
| 384 | + ], | |
| 385 | + enterDate: [ | |
| 386 | + {required: true, message: "请选择企业入市时间", trigger: "blur"} | |
| 387 | + ], | |
| 388 | + businessLicenseDate: [ | |
| 389 | + {required: true, message: "请选择企业营业执照有效期", trigger: "blur"} | |
| 390 | + ], | |
| 391 | + officeAddress: [ | |
| 392 | + {required: true, message: "请输入办公地址", trigger: "blur"} | |
| 393 | + ], | |
| 394 | + parkingLotLocation: [ | |
| 395 | + {required: true, message: "请输入停车场位置", trigger: "blur"} | |
| 396 | + ], | |
| 397 | + parkingArea: [ | |
| 398 | + {required: true, message: "请输入停车场面积", trigger: "blur"}, | |
| 399 | + {pattern: /^\d+(\.\d+)?$/, message: "只能输入正数和小数", trigger: "blur"} | |
| 400 | + ], | |
| 401 | + safetyManagerName: [ | |
| 402 | + {required: true, message: "请输入企业安全负责人姓名", trigger: "blur"} | |
| 403 | + ], | |
| 404 | + socialUniformCreditCodeNumber: [ | |
| 405 | + {required: true, message: "请输入社会统一信用代码编号", trigger: "blur"} | |
| 406 | + ], | |
| 407 | + legalRepresentative: [ | |
| 408 | + {required: true, message: "请输入法人代表", trigger: "blur"} | |
| 409 | + ], | |
| 410 | + safetyPeopleName: [ | |
| 411 | + {required: true, message: "请输入安全管理人员", trigger: "blur"} | |
| 412 | + ], | |
| 413 | + }, | |
| 414 | + areas:[], | |
| 415 | + // 企业道路运输经营许可证 | |
| 416 | + transportPermission:[], | |
| 417 | + // 企业营业执照 | |
| 418 | + enterpriseBusinessLicense:[], | |
| 419 | + // 安全员考核合格证明 | |
| 420 | + safetyOfficerQualificationCertificate:[], | |
| 421 | + // 企业负责人安全考核证 | |
| 422 | + safetyCertificate:[], | |
| 423 | + // 停车场全景图 | |
| 424 | + carParkPanorama:[], | |
| 425 | + }; | |
| 426 | + }, | |
| 427 | + created() { | |
| 428 | + getAreaList().then(res => { | |
| 429 | + this.areas = res.data; | |
| 430 | + }); | |
| 431 | + this.initData(); | |
| 432 | + }, | |
| 433 | + watch: { | |
| 434 | + '$route.query.unitId': 'initData' | |
| 435 | + }, | |
| 436 | + methods: { | |
| 437 | + reset(){ | |
| 438 | + this.form = {}; | |
| 439 | + this.transportPermission = []; | |
| 440 | + this.enterpriseBusinessLicense = []; | |
| 441 | + this.safetyOfficerQualificationCertificate = []; | |
| 442 | + this.safetyCertificate = []; | |
| 443 | + this.carParkPanorama = []; | |
| 444 | + }, | |
| 445 | + initData(){ | |
| 446 | + this.reset(); | |
| 447 | + let id = this.$route.query.unitId; | |
| 448 | + if(id!=null){ | |
| 449 | + getEnterprise(id).then(response => { | |
| 450 | + this.form = response.data; | |
| 451 | + //将附件转换为前端可视化数组 | |
| 452 | + if(this.form.transportPermission!=null&&this.form.transportPermission!==""){ | |
| 453 | + let approvalDocument = this.form.transportPermission.split(";"); | |
| 454 | + approvalDocument.map(item=>{ | |
| 455 | + let name = item.substring(item.lastIndexOf("/")+1); | |
| 456 | + this.transportPermission.push({name:name,url:item}) | |
| 457 | + }) | |
| 458 | + } | |
| 459 | + if(this.form.enterpriseBusinessLicense!=null&&this.form.enterpriseBusinessLicense!==""){ | |
| 460 | + let approvalData = this.form.enterpriseBusinessLicense.split(";"); | |
| 461 | + approvalData.map(item=>{ | |
| 462 | + let name = item.substring(item.lastIndexOf("/")+1); | |
| 463 | + this.enterpriseBusinessLicense.push({name:name,url:item}) | |
| 464 | + }) | |
| 465 | + } | |
| 466 | + if(this.form.safetyOfficerQualificationCertificate!=null&&this.form.safetyOfficerQualificationCertificate!==""){ | |
| 467 | + let scenePhoto = this.form.safetyOfficerQualificationCertificate.split(";"); | |
| 468 | + scenePhoto.map(item=>{ | |
| 469 | + let name = item.substring(item.lastIndexOf("/")+1); | |
| 470 | + this.safetyOfficerQualificationCertificate.push({name:name,url:item}) | |
| 471 | + }) | |
| 472 | + } | |
| 473 | + if(this.form.safetyCertificate!=null&&this.form.safetyCertificate!==""){ | |
| 474 | + let carWashingFacilitiesImage = this.form.safetyCertificate.split(";"); | |
| 475 | + carWashingFacilitiesImage.map(item=>{ | |
| 476 | + let name = item.substring(item.lastIndexOf("/")+1); | |
| 477 | + this.safetyCertificate.push({name:name,url:item}) | |
| 478 | + }) | |
| 479 | + } | |
| 480 | + if(this.form.carParkPanorama!=null&&this.form.carParkPanorama!==""){ | |
| 481 | + let safetyAssessmentReport = this.form.carParkPanorama.split(";"); | |
| 482 | + safetyAssessmentReport.map(item=>{ | |
| 483 | + let name = item.substring(item.lastIndexOf("/")+1); | |
| 484 | + this.carParkPanorama.push({name:name,url:item}) | |
| 485 | + }) | |
| 486 | + } | |
| 487 | + }); | |
| 488 | + } | |
| 489 | + }, | |
| 490 | + createUrl(file){ | |
| 491 | + if(file.raw!=null){ | |
| 492 | + return URL.createObjectURL(file.raw); | |
| 493 | + }else{ | |
| 494 | + return process.env.VUE_APP_BASE_API + file.url; | |
| 495 | + } | |
| 496 | + | |
| 497 | + }, | |
| 498 | + tempDownload(row){ | |
| 499 | + let name = row.name; | |
| 500 | + let url = ""; | |
| 501 | + if(row.raw!=null){ | |
| 502 | + url = URL.createObjectURL(row.raw); | |
| 503 | + }else{ | |
| 504 | + url = process.env.VUE_APP_BASE_API + row.url; | |
| 505 | + } | |
| 506 | + const a = document.createElement('a') | |
| 507 | + a.setAttribute('download', name) | |
| 508 | + a.setAttribute('target', '_blank') | |
| 509 | + a.setAttribute('href', url); | |
| 510 | + a.click() | |
| 511 | + }, | |
| 512 | + // 取消按钮 | |
| 513 | + cancel() { | |
| 514 | + this.$tab.closePage({path:"/unit/info"}).then(() => { | |
| 515 | + this.$tab.openPage("经营单位管理", "/tool/unit",{unitRefresh:1}) | |
| 516 | + }) | |
| 517 | + }, | |
| 518 | + /** 提交按钮 */ | |
| 519 | + submitForm() { | |
| 520 | + this.$refs["form"].validate(valid => { | |
| 521 | + if (valid) { | |
| 522 | + let phoneTest = /^1[3456789]\d{9}$/; | |
| 523 | + if(phoneTest.test(this.form.safetyManagerPhone)===false){ | |
| 524 | + this.msgError("请输入正确的企业安全负责人联系方式"); | |
| 525 | + return false; | |
| 526 | + } | |
| 527 | + if(phoneTest.test(this.form.legalRepresentativePhone)===false){ | |
| 528 | + this.msgError("请输入正确的法人代表联系方式"); | |
| 529 | + return false; | |
| 530 | + } | |
| 531 | + let formData = new FormData(); | |
| 532 | + let form = this.form; | |
| 533 | + //去掉params属性 | |
| 534 | + delete form.params; | |
| 535 | + | |
| 536 | + //先清空原有的附件 | |
| 537 | + form.transportPermission = null; | |
| 538 | + form.enterpriseBusinessLicense = null; | |
| 539 | + form.safetyOfficerQualificationCertificate = null; | |
| 540 | + form.safetyCertificate = null; | |
| 541 | + form.carParkPanorama = null; | |
| 542 | + form.companyType = "0"; | |
| 543 | + | |
| 544 | + this.transportPermission.forEach(item => { | |
| 545 | + if (item.raw != null) { | |
| 546 | + formData.append('transportPermissionFiles', item.raw) | |
| 547 | + }else{ | |
| 548 | + //将原有的附件拼接到form中 | |
| 549 | + form.transportPermission = form.transportPermission!==null?form.transportPermission+";"+item.url:item.url; | |
| 550 | + } | |
| 551 | + }) | |
| 552 | + | |
| 553 | + this.enterpriseBusinessLicense.forEach(item => { | |
| 554 | + if (item.raw != null) { | |
| 555 | + formData.append('enterpriseBusinessLicenseFiles', item.raw) | |
| 556 | + }else{ | |
| 557 | + //将原有的附件拼接到form中 | |
| 558 | + form.enterpriseBusinessLicense = form.enterpriseBusinessLicense!==null?form.enterpriseBusinessLicense+";"+item.url:item.url; | |
| 559 | + } | |
| 560 | + }) | |
| 561 | + this.safetyOfficerQualificationCertificate.forEach(item => { | |
| 562 | + if (item.raw != null) { | |
| 563 | + formData.append('safetyOfficerQualificationCertificateFiles', item.raw) | |
| 564 | + }else{ | |
| 565 | + //将原有的附件拼接到form中 | |
| 566 | + form.safetyOfficerQualificationCertificate = form.safetyOfficerQualificationCertificate!==null?form.safetyOfficerQualificationCertificate+";"+item.url:item.url; | |
| 567 | + } | |
| 568 | + }) | |
| 569 | + this.safetyCertificate.forEach(item => { | |
| 570 | + if (item.raw != null) { | |
| 571 | + formData.append('safetyCertificateFiles', item.raw) | |
| 572 | + }else{ | |
| 573 | + //将原有的附件拼接到form中 | |
| 574 | + form.safetyCertificate = form.safetyCertificate!==null?form.safetyCertificate+";"+item.url:item.url; | |
| 575 | + } | |
| 576 | + }) | |
| 577 | + this.carParkPanorama.forEach(item => { | |
| 578 | + if (item.raw != null) { | |
| 579 | + formData.append('carParkPanoramaFiles', item.raw) | |
| 580 | + }else{ | |
| 581 | + //将原有的附件拼接到form中 | |
| 582 | + form.carParkPanorama = form.carParkPanorama!==null?form.carParkPanorama+";"+item.url:item.url; | |
| 583 | + } | |
| 584 | + }) | |
| 585 | + for (let key in form) { | |
| 586 | + formData.append(key, form[key] == null ? "" : form[key]) | |
| 587 | + } | |
| 588 | + if (this.form.id != null) { | |
| 589 | + updateEnterprise(formData).then(response => { | |
| 590 | + this.msgSuccess("修改成功"); | |
| 591 | + this.$tab.closePage({path:"/unit/infoEdit"}).then(() => { | |
| 592 | + this.$tab.openPage("经营单位管理", "/tool/unit",{unitRefresh:1}) | |
| 593 | + }) | |
| 594 | + }); | |
| 595 | + } else { | |
| 596 | + addEnterprise(formData).then(response => { | |
| 597 | + this.msgSuccess("新增成功"); | |
| 598 | + this.$tab.closePage({path:"/unit/info"}).then(() => { | |
| 599 | + this.$tab.openPage("经营单位管理", "/tool/unit",{unitRefresh:1}) | |
| 600 | + }) | |
| 601 | + }); | |
| 602 | + } | |
| 603 | + } | |
| 604 | + }); | |
| 605 | + }, | |
| 606 | + /** | |
| 607 | + * 文件改变时,限制文件上传格式和大小 | |
| 608 | + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg | |
| 609 | + * 大小不超过20M | |
| 610 | + * */ | |
| 611 | + fileChange(file, fileList) { | |
| 612 | + let count = 0; | |
| 613 | + for (let i = 0; i < fileList.length; i++) { | |
| 614 | + // console.log(fileList.length) | |
| 615 | + // console.log(this.fileEntityList[i].name+"111"+file.name) | |
| 616 | + if (fileList[i].name == file.name) { | |
| 617 | + count++; | |
| 618 | + if (count == 2) { | |
| 619 | + this.$message({ | |
| 620 | + message: '已存在此文件!', | |
| 621 | + type: 'warning' | |
| 622 | + }); | |
| 623 | + for (let j = fileList.length; j > 0; j--) { | |
| 624 | + //如果存在此文件,去除新选择的重复文件 | |
| 625 | + if (fileList[j - 1].name == file.name) { | |
| 626 | + fileList.splice(j - 1, 1); | |
| 627 | + i--; | |
| 628 | + return false; | |
| 629 | + } | |
| 630 | + } | |
| 631 | + } | |
| 632 | + } | |
| 633 | + } | |
| 634 | + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase(); | |
| 635 | + //格式符合后判断大小 | |
| 636 | + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) { | |
| 637 | + let max5M = file.size / 1024 / 1024 < 100; | |
| 638 | + if (!max5M) { | |
| 639 | + this.$message({ | |
| 640 | + message: '上传文件大小不得超过100M!', | |
| 641 | + type: 'warning' | |
| 642 | + }); | |
| 643 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 644 | + } else { | |
| 645 | + //符合条件后进行添加 | |
| 646 | + this.transportPermission = fileList | |
| 647 | + } | |
| 648 | + } else { | |
| 649 | + this.$message({ | |
| 650 | + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!', | |
| 651 | + type: 'warning' | |
| 652 | + }); | |
| 653 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 654 | + } | |
| 655 | + }, | |
| 656 | + fileChange1(file, fileList) { | |
| 657 | + let count = 0; | |
| 658 | + for (let i = 0; i < fileList.length; i++) { | |
| 659 | + // console.log(fileList.length) | |
| 660 | + // console.log(this.fileEntityList[i].name+"111"+file.name) | |
| 661 | + if (fileList[i].name == file.name) { | |
| 662 | + count++; | |
| 663 | + if (count == 2) { | |
| 664 | + this.$message({ | |
| 665 | + message: '已存在此文件!', | |
| 666 | + type: 'warning' | |
| 667 | + }); | |
| 668 | + for (let j = fileList.length; j > 0; j--) { | |
| 669 | + //如果存在此文件,去除新选择的重复文件 | |
| 670 | + if (fileList[j - 1].name == file.name) { | |
| 671 | + fileList.splice(j - 1, 1); | |
| 672 | + i--; | |
| 673 | + return false; | |
| 674 | + } | |
| 675 | + } | |
| 676 | + } | |
| 677 | + } | |
| 678 | + } | |
| 679 | + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase(); | |
| 680 | + //格式符合后判断大小 | |
| 681 | + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) { | |
| 682 | + let max5M = file.size / 1024 / 1024 < 100; | |
| 683 | + if (!max5M) { | |
| 684 | + this.$message({ | |
| 685 | + message: '上传文件大小不得超过100M!', | |
| 686 | + type: 'warning' | |
| 687 | + }); | |
| 688 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 689 | + } else { | |
| 690 | + //符合条件后进行添加 | |
| 691 | + this.enterpriseBusinessLicense = fileList | |
| 692 | + } | |
| 693 | + } else { | |
| 694 | + this.$message({ | |
| 695 | + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!', | |
| 696 | + type: 'warning' | |
| 697 | + }); | |
| 698 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 699 | + } | |
| 700 | + }, | |
| 701 | + fileChange2(file, fileList) { | |
| 702 | + let count = 0; | |
| 703 | + for (let i = 0; i < fileList.length; i++) { | |
| 704 | + // console.log(fileList.length) | |
| 705 | + // console.log(this.fileEntityList[i].name+"111"+file.name) | |
| 706 | + if (fileList[i].name == file.name) { | |
| 707 | + count++; | |
| 708 | + if (count == 2) { | |
| 709 | + this.$message({ | |
| 710 | + message: '已存在此文件!', | |
| 711 | + type: 'warning' | |
| 712 | + }); | |
| 713 | + for (let j = fileList.length; j > 0; j--) { | |
| 714 | + //如果存在此文件,去除新选择的重复文件 | |
| 715 | + if (fileList[j - 1].name == file.name) { | |
| 716 | + fileList.splice(j - 1, 1); | |
| 717 | + i--; | |
| 718 | + return false; | |
| 719 | + } | |
| 720 | + } | |
| 721 | + } | |
| 722 | + } | |
| 723 | + } | |
| 724 | + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase(); | |
| 725 | + //格式符合后判断大小 | |
| 726 | + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) { | |
| 727 | + let max5M = file.size / 1024 / 1024 < 100; | |
| 728 | + if (!max5M) { | |
| 729 | + this.$message({ | |
| 730 | + message: '上传文件大小不得超过100M!', | |
| 731 | + type: 'warning' | |
| 732 | + }); | |
| 733 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 734 | + } else { | |
| 735 | + //符合条件后进行添加 | |
| 736 | + this.safetyOfficerQualificationCertificate = fileList | |
| 737 | + } | |
| 738 | + } else { | |
| 739 | + this.$message({ | |
| 740 | + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!', | |
| 741 | + type: 'warning' | |
| 742 | + }); | |
| 743 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 744 | + } | |
| 745 | + }, | |
| 746 | + fileChange3(file, fileList) { | |
| 747 | + let count = 0; | |
| 748 | + for (let i = 0; i < fileList.length; i++) { | |
| 749 | + // console.log(fileList.length) | |
| 750 | + // console.log(this.fileEntityList[i].name+"111"+file.name) | |
| 751 | + if (fileList[i].name == file.name) { | |
| 752 | + count++; | |
| 753 | + if (count == 2) { | |
| 754 | + this.$message({ | |
| 755 | + message: '已存在此文件!', | |
| 756 | + type: 'warning' | |
| 757 | + }); | |
| 758 | + for (let j = fileList.length; j > 0; j--) { | |
| 759 | + //如果存在此文件,去除新选择的重复文件 | |
| 760 | + if (fileList[j - 1].name == file.name) { | |
| 761 | + fileList.splice(j - 1, 1); | |
| 762 | + i--; | |
| 763 | + return false; | |
| 764 | + } | |
| 765 | + } | |
| 766 | + } | |
| 767 | + } | |
| 768 | + } | |
| 769 | + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase(); | |
| 770 | + //格式符合后判断大小 | |
| 771 | + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) { | |
| 772 | + let max5M = file.size / 1024 / 1024 < 100; | |
| 773 | + if (!max5M) { | |
| 774 | + this.$message({ | |
| 775 | + message: '上传文件大小不得超过100M!', | |
| 776 | + type: 'warning' | |
| 777 | + }); | |
| 778 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 779 | + } else { | |
| 780 | + //符合条件后进行添加 | |
| 781 | + this.safetyCertificate = fileList | |
| 782 | + } | |
| 783 | + } else { | |
| 784 | + this.$message({ | |
| 785 | + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!', | |
| 786 | + type: 'warning' | |
| 787 | + }); | |
| 788 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 789 | + } | |
| 790 | + }, | |
| 791 | + fileChange4(file, fileList) { | |
| 792 | + let count = 0; | |
| 793 | + for (let i = 0; i < fileList.length; i++) { | |
| 794 | + // console.log(fileList.length) | |
| 795 | + // console.log(this.fileEntityList[i].name+"111"+file.name) | |
| 796 | + if (fileList[i].name == file.name) { | |
| 797 | + count++; | |
| 798 | + if (count == 2) { | |
| 799 | + this.$message({ | |
| 800 | + message: '已存在此文件!', | |
| 801 | + type: 'warning' | |
| 802 | + }); | |
| 803 | + for (let j = fileList.length; j > 0; j--) { | |
| 804 | + //如果存在此文件,去除新选择的重复文件 | |
| 805 | + if (fileList[j - 1].name == file.name) { | |
| 806 | + fileList.splice(j - 1, 1); | |
| 807 | + i--; | |
| 808 | + return false; | |
| 809 | + } | |
| 810 | + } | |
| 811 | + } | |
| 812 | + } | |
| 813 | + } | |
| 814 | + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase(); | |
| 815 | + //格式符合后判断大小 | |
| 816 | + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) { | |
| 817 | + let max5M = file.size / 1024 / 1024 < 100; | |
| 818 | + if (!max5M) { | |
| 819 | + this.$message({ | |
| 820 | + message: '上传文件大小不得超过100M!', | |
| 821 | + type: 'warning' | |
| 822 | + }); | |
| 823 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 824 | + } else { | |
| 825 | + //符合条件后进行添加 | |
| 826 | + this.carParkPanorama = fileList | |
| 827 | + } | |
| 828 | + } else { | |
| 829 | + this.$message({ | |
| 830 | + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!', | |
| 831 | + type: 'warning' | |
| 832 | + }); | |
| 833 | + fileList = fileList.splice(fileList.length - 1, 1); | |
| 834 | + } | |
| 835 | + }, | |
| 836 | + } | |
| 837 | +}; | |
| 838 | +</script> | |
| 839 | +<style lang="scss" scoped> | |
| 840 | +.upload_lable{ | |
| 841 | + border-right: 1px solid #dcdfe6; | |
| 842 | + padding: 27px 30px; | |
| 843 | + background: #fafafa; | |
| 844 | + text-align: center; | |
| 845 | +} | |
| 846 | +.upload_btn{ | |
| 847 | + max-height: 106px; | |
| 848 | +} | |
| 849 | +.upload_close{ | |
| 850 | + position: absolute; | |
| 851 | + left: 105px; | |
| 852 | + z-index:99; | |
| 853 | + top:-1px; | |
| 854 | + font-size:18px; | |
| 855 | + color:red; | |
| 856 | +} | |
| 857 | +.upload_close_file{ | |
| 858 | + position: absolute; | |
| 859 | + left: 80px; | |
| 860 | + z-index:99; | |
| 861 | + top:-1px; | |
| 862 | + font-size:18px; | |
| 863 | + color:red; | |
| 864 | +} | |
| 865 | +.upload_div_image{ | |
| 866 | + display: inline-block; | |
| 867 | + width: 110px; | |
| 868 | + height: 95px; | |
| 869 | + position: relative; | |
| 870 | + float: left; | |
| 871 | + margin-left: 5px; | |
| 872 | +} | |
| 873 | +.upload_div_file{ | |
| 874 | + display: inline-block; | |
| 875 | + width: 110px; | |
| 876 | + height: 95px; | |
| 877 | + text-align: center; | |
| 878 | + float:left; | |
| 879 | + margin: 5px; | |
| 880 | + position: relative; | |
| 881 | +} | |
| 882 | +.serach_map{ | |
| 883 | + position: absolute; | |
| 884 | + top: 100px; | |
| 885 | + left: 25px; | |
| 886 | + z-index: 999; | |
| 887 | + background: #fff; | |
| 888 | + padding: 10px; | |
| 889 | + border-radius: 5px; | |
| 890 | + box-shadow: 0 0 10px rgba(0,0,0,.2); | |
| 891 | +} | |
| 892 | +</style> | ... | ... |
trash-ui/src/views/unit/carInfo/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> | |
| 4 | + <el-form-item label="所属公司" prop="companyName"> | |
| 5 | + <el-input | |
| 6 | + v-model="queryParams.companyName" | |
| 7 | + placeholder="请输入所属公司" | |
| 8 | + clearable | |
| 9 | + size="small" | |
| 10 | + @keyup.enter.native="handleQuery" | |
| 11 | + /> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item label="车辆类型" prop="carType"> | |
| 14 | + <el-select v-model="queryParams.carType" placeholder="请选择车辆类型" clearable style="width: 100%;" size="small"> | |
| 15 | + <el-option label="燃油渣土车" value="燃油渣土车" /> | |
| 16 | + <el-option label="电动渣土车" value="电动渣土车" /> | |
| 17 | + <el-option label="其它" value="其它" /> | |
| 18 | + </el-select> | |
| 19 | + </el-form-item> | |
| 20 | + <el-form-item label="车牌号" prop="carCode"> | |
| 21 | + <el-input | |
| 22 | + v-model="queryParams.carCode" | |
| 23 | + placeholder="请输入车牌号" | |
| 24 | + clearable | |
| 25 | + size="small" | |
| 26 | + @keyup.enter.native="handleQuery" | |
| 27 | + /> | |
| 28 | + </el-form-item> | |
| 29 | + <el-form-item label="车辆品牌" prop="carBrank"> | |
| 30 | + <el-input | |
| 31 | + v-model="queryParams.carBrank" | |
| 32 | + placeholder="请输入车辆品牌" | |
| 33 | + clearable | |
| 34 | + size="small" | |
| 35 | + @keyup.enter.native="handleQuery" | |
| 36 | + /> | |
| 37 | + </el-form-item> | |
| 38 | + <el-form-item> | |
| 39 | + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | |
| 40 | + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | |
| 41 | + </el-form-item> | |
| 42 | + </el-form> | |
| 43 | + | |
| 44 | + <el-row :gutter="10" class="mb8"> | |
| 45 | + <el-col :span="1.5"> | |
| 46 | + <el-button | |
| 47 | + type="primary" | |
| 48 | + icon="el-icon-plus" | |
| 49 | + size="mini" | |
| 50 | + @click="handleAdd" | |
| 51 | + v-hasPermi="['unit:carInfo:add']" | |
| 52 | + >新增</el-button> | |
| 53 | + </el-col> | |
| 54 | + <el-col :span="1.5"> | |
| 55 | + <el-button | |
| 56 | + type="success" | |
| 57 | + icon="el-icon-edit" | |
| 58 | + size="mini" | |
| 59 | + :disabled="single" | |
| 60 | + @click="handleUpdate" | |
| 61 | + v-hasPermi="['unit:carInfo:edit']" | |
| 62 | + >修改</el-button> | |
| 63 | + </el-col> | |
| 64 | + <el-col :span="1.5"> | |
| 65 | + <el-button | |
| 66 | + type="danger" | |
| 67 | + icon="el-icon-delete" | |
| 68 | + size="mini" | |
| 69 | + :disabled="multiple" | |
| 70 | + @click="handleDelete" | |
| 71 | + v-hasPermi="['unit:carInfo:remove']" | |
| 72 | + >删除</el-button> | |
| 73 | + </el-col> | |
| 74 | + <el-col :span="1.5"> | |
| 75 | + <el-button | |
| 76 | + type="warning" | |
| 77 | + icon="el-icon-download" | |
| 78 | + size="mini" | |
| 79 | + @click="handleExport" | |
| 80 | + v-hasPermi="['unit:carInfo:export']" | |
| 81 | + >导出</el-button> | |
| 82 | + </el-col> | |
| 83 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 84 | + </el-row> | |
| 85 | + | |
| 86 | + <el-table v-loading="loading" :data="carInfoList" @selection-change="handleSelectionChange"> | |
| 87 | + <el-table-column type="selection" width="55" align="center" /> | |
| 88 | + <el-table-column type="index" width="55" align="center" label="序号"/> | |
| 89 | + <el-table-column label="车牌号" align="center" prop="carCode" /> | |
| 90 | + <el-table-column label="车辆标识牌" align="center" prop="carIdentification" /> | |
| 91 | + <el-table-column label="所属公司" align="center" prop="companyName" /> | |
| 92 | + <el-table-column label="驾驶员" align="center" prop="driversName" /> | |
| 93 | + <el-table-column label="车辆品牌" align="center" prop="carBrank" /> | |
| 94 | + <el-table-column label="所属区域" align="center" prop="emissionStandard" /> | |
| 95 | + <el-table-column label="车辆类型" align="center" prop="carType" /> | |
| 96 | + <el-table-column label="SIM卡号" align="center" prop="farmeNumber" /> | |
| 97 | + <el-table-column label="审批状态" align="center" prop="status" > | |
| 98 | + <template slot-scope="scope"> | |
| 99 | + {{ parseStatus(scope.row.status)}} | |
| 100 | + </template> | |
| 101 | + </el-table-column> | |
| 102 | + <el-table-column label="信用状态" align="center" prop="creditStatus" /> | |
| 103 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | |
| 104 | + <template slot-scope="scope"> | |
| 105 | + <el-button | |
| 106 | + size="mini" | |
| 107 | + type="text" | |
| 108 | + icon="el-icon-edit" | |
| 109 | + @click="handleUpdate(scope.row)" | |
| 110 | + v-hasPermi="['unit:carInfo:edit']" | |
| 111 | + >修改</el-button> | |
| 112 | + <el-button | |
| 113 | + size="mini" | |
| 114 | + type="text" | |
| 115 | + icon="el-icon-delete" | |
| 116 | + @click="handleDelete(scope.row)" | |
| 117 | + v-hasPermi="['unit:carInfo:remove']" | |
| 118 | + >删除</el-button> | |
| 119 | + </template> | |
| 120 | + </el-table-column> | |
| 121 | + </el-table> | |
| 122 | + | |
| 123 | + <pagination | |
| 124 | + v-show="total>0" | |
| 125 | + :total="total" | |
| 126 | + :page.sync="queryParams.pageNum" | |
| 127 | + :limit.sync="queryParams.pageSize" | |
| 128 | + @pagination="getList" | |
| 129 | + /> | |
| 130 | + | |
| 131 | + </div> | |
| 132 | +</template> | |
| 133 | + | |
| 134 | +<script> | |
| 135 | +import { listCarInfo, getCarInfo, delCarInfo, addCarInfo, updateCarInfo, exportCarInfo } from "@/api/unit/carInfo"; | |
| 136 | +import {parseStatus} from "../../../utils/trash"; | |
| 137 | + | |
| 138 | +export default { | |
| 139 | + name: "CarInfo", | |
| 140 | + data() { | |
| 141 | + return { | |
| 142 | + // 遮罩层 | |
| 143 | + loading: true, | |
| 144 | + // 选中数组 | |
| 145 | + ids: [], | |
| 146 | + // 非单个禁用 | |
| 147 | + single: true, | |
| 148 | + // 非多个禁用 | |
| 149 | + multiple: true, | |
| 150 | + // 显示搜索条件 | |
| 151 | + showSearch: true, | |
| 152 | + // 总条数 | |
| 153 | + total: 0, | |
| 154 | + // 运输车辆管理表格数据 | |
| 155 | + carInfoList: [], | |
| 156 | + // 弹出层标题 | |
| 157 | + title: "", | |
| 158 | + // 是否显示弹出层 | |
| 159 | + open: false, | |
| 160 | + // 查询参数 | |
| 161 | + queryParams: { | |
| 162 | + pageNum: 1, | |
| 163 | + pageSize: 10, | |
| 164 | + companyId: null, | |
| 165 | + carType: null, | |
| 166 | + carCode: null, | |
| 167 | + carBrank: null, | |
| 168 | + emissionStandard: null, | |
| 169 | + roadTransportDate: null, | |
| 170 | + drivingLicenseDate: null, | |
| 171 | + enterDate: null, | |
| 172 | + farmeNumber: null, | |
| 173 | + carIdentification: null, | |
| 174 | + containerVolume: null, | |
| 175 | + carColor: null, | |
| 176 | + carEquipment: null, | |
| 177 | + roadTransport: null, | |
| 178 | + drivingLicense: null, | |
| 179 | + carFront: null, | |
| 180 | + carLeft: null, | |
| 181 | + carBehind: null, | |
| 182 | + carRight: null, | |
| 183 | + drivers: null, | |
| 184 | + status: null, | |
| 185 | + creditStatus: null, | |
| 186 | + qrCode: null | |
| 187 | + }, | |
| 188 | + // 表单参数 | |
| 189 | + form: {}, | |
| 190 | + // 表单校验 | |
| 191 | + rules: { | |
| 192 | + } | |
| 193 | + }; | |
| 194 | + }, | |
| 195 | + created() { | |
| 196 | + this.getList(); | |
| 197 | + }, | |
| 198 | + watch:{ | |
| 199 | + '$route.query.carInfoRefresh':'getList' | |
| 200 | + }, | |
| 201 | + methods: { | |
| 202 | + /** 查询运输车辆管理列表 */ | |
| 203 | + getList() { | |
| 204 | + this.loading = true; | |
| 205 | + listCarInfo(this.queryParams).then(response => { | |
| 206 | + this.carInfoList = response.rows; | |
| 207 | + this.total = response.total; | |
| 208 | + this.loading = false; | |
| 209 | + }); | |
| 210 | + }, | |
| 211 | + /** 搜索按钮操作 */ | |
| 212 | + handleQuery() { | |
| 213 | + this.queryParams.pageNum = 1; | |
| 214 | + this.getList(); | |
| 215 | + }, | |
| 216 | + /** 重置按钮操作 */ | |
| 217 | + resetQuery() { | |
| 218 | + this.resetForm("queryForm"); | |
| 219 | + this.handleQuery(); | |
| 220 | + }, | |
| 221 | + // 多选框选中数据 | |
| 222 | + handleSelectionChange(selection) { | |
| 223 | + this.ids = selection.map(item => item.id) | |
| 224 | + this.single = selection.length!==1 | |
| 225 | + this.multiple = !selection.length | |
| 226 | + }, | |
| 227 | + /** 新增按钮操作 */ | |
| 228 | + handleAdd() { | |
| 229 | + this.$tab.openPage("新增车辆信息","/carInfo/info",{carInfoRefresh:0}); | |
| 230 | + }, | |
| 231 | + /** 修改按钮操作 */ | |
| 232 | + handleUpdate(row) { | |
| 233 | + const id = row.id || this.ids | |
| 234 | + this.$tab.openPage("修改运输企业","/carInfo/infoEdit",{carInfoId: id,carInfoRefresh:0}); | |
| 235 | + }, | |
| 236 | + /** 提交按钮 */ | |
| 237 | + submitForm() { | |
| 238 | + this.$refs["form"].validate(valid => { | |
| 239 | + if (valid) { | |
| 240 | + if (this.form.id != null) { | |
| 241 | + updateCarInfo(this.form).then(response => { | |
| 242 | + this.msgSuccess("修改成功"); | |
| 243 | + this.open = false; | |
| 244 | + this.getList(); | |
| 245 | + }); | |
| 246 | + } else { | |
| 247 | + addCarInfo(this.form).then(response => { | |
| 248 | + this.msgSuccess("新增成功"); | |
| 249 | + this.open = false; | |
| 250 | + this.getList(); | |
| 251 | + }); | |
| 252 | + } | |
| 253 | + } | |
| 254 | + }); | |
| 255 | + }, | |
| 256 | + /** 删除按钮操作 */ | |
| 257 | + handleDelete(row) { | |
| 258 | + const ids = row.id || this.ids; | |
| 259 | + this.$confirm('是否确认删除运输车辆管理编号为"' + ids + '"的数据项?', "警告", { | |
| 260 | + confirmButtonText: "确定", | |
| 261 | + cancelButtonText: "取消", | |
| 262 | + type: "warning" | |
| 263 | + }).then(function() { | |
| 264 | + return delCarInfo(ids); | |
| 265 | + }).then(() => { | |
| 266 | + this.getList(); | |
| 267 | + this.msgSuccess("删除成功"); | |
| 268 | + }) | |
| 269 | + }, | |
| 270 | + /** 导出按钮操作 */ | |
| 271 | + handleExport() { | |
| 272 | + const queryParams = this.queryParams; | |
| 273 | + this.$confirm('是否确认导出所有运输车辆管理数据项?', "警告", { | |
| 274 | + confirmButtonText: "确定", | |
| 275 | + cancelButtonText: "取消", | |
| 276 | + type: "warning" | |
| 277 | + }).then(function() { | |
| 278 | + return exportCarInfo(queryParams); | |
| 279 | + }).then(response => { | |
| 280 | + this.download(response.msg); | |
| 281 | + }) | |
| 282 | + } | |
| 283 | + } | |
| 284 | +}; | |
| 285 | +</script> | ... | ... |