过程检/终检/审核
This commit is contained in:
parent
e2ceafc29d
commit
ae754e2a71
@ -18,7 +18,7 @@ const categoryList = ref([
|
||||
},
|
||||
{
|
||||
path: 'unqualifiedNotification',
|
||||
name: '品质异常通知',
|
||||
name: '品质异常审核',
|
||||
auth: false,
|
||||
imgUrl: '/static/images/unqualifiedNotification.png',
|
||||
defaultImgUrl: '/static/images/unqualifiedNotification-default.png',
|
||||
|
@ -49,6 +49,7 @@ public class BgMasterLineController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建过程检报工")
|
||||
@PreAuthorize("@ss.hasPermission('heli:bg-master-line:create')")
|
||||
@ -73,6 +74,8 @@ public class BgMasterLineController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得过程检报工")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@ -81,7 +84,13 @@ public class BgMasterLineController {
|
||||
BgMasterLineDO bgMasterLine = bgMasterLineService.getBgMasterLine(id);
|
||||
return success(BeanUtils.toBean(bgMasterLine, BgMasterLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/validExceed")
|
||||
@Operation(summary = "获得过程检报工")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:bg-master-line:query')")
|
||||
public CommonResult<Boolean> validExceed(@RequestParam("id") Long id,@RequestParam("amount") Integer amount) {
|
||||
return success(bgMasterLineService.validExceed(id,amount));
|
||||
}
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得过程检报工分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:bg-master-line:query')")
|
||||
|
@ -38,6 +38,15 @@ public class BgMasterLinePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工时")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private BigDecimal[] workTime;
|
||||
|
||||
private BigDecimal[] workTime;
|
||||
private String userName;
|
||||
private Integer isRepre;
|
||||
private Integer isQua;
|
||||
private String remark;
|
||||
private Integer notificationStatus;
|
||||
private Integer conStatus;
|
||||
private String auditOpinion;
|
||||
private Integer auditor;
|
||||
private LocalDateTime audit_time;
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.bgmasterline.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
@ -53,5 +54,13 @@ public class BgMasterLineRespVO {
|
||||
@Schema(description = "报工人")
|
||||
@ExcelProperty("报工人")
|
||||
private String userName;
|
||||
|
||||
private Integer isRepre;
|
||||
private Integer isQua;
|
||||
private String remark;
|
||||
private Integer notificationStatus;
|
||||
private Integer conStatus;
|
||||
private String auditOpinion;
|
||||
private Integer auditor;
|
||||
private LocalDateTime audit_time;
|
||||
private List<String> fileUrlList;
|
||||
}
|
@ -20,7 +20,7 @@ public class BgMasterLineSaveReqVO {
|
||||
private Integer zjId;
|
||||
|
||||
@Schema(description = "过程检明细id", example = "10005")
|
||||
private Integer zjMxId;
|
||||
private Long zjMxId;
|
||||
|
||||
@Schema(description = "报工人")
|
||||
private String bgUser;
|
||||
@ -34,4 +34,14 @@ public class BgMasterLineSaveReqVO {
|
||||
@Schema(description = "工时")
|
||||
private BigDecimal workTime;
|
||||
|
||||
private Integer isRepre;
|
||||
private Integer isQua;
|
||||
private String remark;
|
||||
private Integer type;
|
||||
private String userName;
|
||||
private Integer notificationStatus;
|
||||
private Integer conStatus;
|
||||
private String auditOpinion;
|
||||
private Integer auditor;
|
||||
private LocalDateTime audit_time;
|
||||
}
|
@ -62,7 +62,7 @@ public class PgMasterController {
|
||||
@PostMapping("/zfPgMaster")
|
||||
@Operation(summary = "作废过程检验派工单")
|
||||
@PreAuthorize("@ss.hasPermission('heli:pg-master:create')")
|
||||
public CommonResult<Integer> zfPgMaster(@RequestParam("id") Integer id) {
|
||||
public CommonResult<Integer> zfPgMaster(@RequestParam("id") Long id) {
|
||||
return success(pgMasterService.zfPgMaster(id));
|
||||
}
|
||||
|
||||
@ -104,6 +104,7 @@ public class PgMasterController {
|
||||
@PreAuthorize("@ss.hasPermission('heli:pg-master:query')")
|
||||
public CommonResult<PageResult<PgMasterRespVO>> getPgMasterPage(@Valid PgMasterPageReqVO pageReqVO) {
|
||||
PageResult<PgMasterDO> pageResult = pgMasterService.getPgMasterPage(pageReqVO);
|
||||
|
||||
return success(BeanUtils.toBean(pageResult, PgMasterRespVO.class));
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class UnqualifiedNotificationController {
|
||||
@PostMapping("/createWx")
|
||||
@Operation(summary = "创建品质异常通知单审核Wx")
|
||||
@PreAuthorize("@ss.hasPermission('heli:unqualified-notification:create')")
|
||||
public CommonResult<String> uploadFile(@RequestParam("file") MultipartFile file,@RequestHeader("id") String id) {
|
||||
public CommonResult<String> uploadFile(@RequestParam("file") MultipartFile file,@RequestHeader("id") String id,@RequestHeader("type") String type) {
|
||||
if (file.isEmpty()) {
|
||||
System.out.println(file);
|
||||
return error(500,"The file is empty.");
|
||||
@ -94,7 +94,9 @@ public class UnqualifiedNotificationController {
|
||||
fileDO.setUnqualifiedId(Long.valueOf(id));
|
||||
fileDO.setFileName(fileName);
|
||||
fileDO.setFileUrl( HeliWebConfiguration.FILE_URL+id+"/"+fileName);
|
||||
|
||||
if (type != null){
|
||||
fileDO.setType(Integer.valueOf(type));
|
||||
}
|
||||
fileDO.setFilePath(directory+id+"/" + fileName);
|
||||
unqualifiedNotificationFileService.createUnqualifiedNotificationFile(fileDO);
|
||||
return success("File uploaded successfully: " + fileName);
|
||||
@ -148,7 +150,7 @@ public class UnqualifiedNotificationController {
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
for (UnqualifiedNotificationDO unqualifiedNotificationDO : list) {
|
||||
List<String> fileUrlList = new ArrayList<>();
|
||||
List<UnqualifiedNotificationFileDO> unqualifiedNotificationFileDOS = unqualifiedNotificationFileService.queryUnqualifiedNotificationFileBySuperId(unqualifiedNotificationDO.getId());
|
||||
List<UnqualifiedNotificationFileDO> unqualifiedNotificationFileDOS = unqualifiedNotificationFileService.queryUnqualifiedNotificationFileBySuperId(unqualifiedNotificationDO.getId(),0);
|
||||
if(CollUtil.isNotEmpty(unqualifiedNotificationFileDOS)){
|
||||
for (UnqualifiedNotificationFileDO unqualifiedNotificationFileDO : unqualifiedNotificationFileDOS) {
|
||||
fileUrlList.add(unqualifiedNotificationFileDO.getFileUrl());
|
||||
@ -160,7 +162,29 @@ public class UnqualifiedNotificationController {
|
||||
|
||||
return success(BeanUtils.toBean(unqualifiedNotificationPage, UnqualifiedNotificationRespVO.class));
|
||||
}
|
||||
@GetMapping("/pageWx")
|
||||
@Operation(summary = "获得品质异常通知单审核分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:unqualified-notification:query')")
|
||||
public CommonResult<PageResult<UnqualifiedNotificationDO>> getUnqualifiedNotificationPageWx(@Valid UnqualifiedNotificationPageReqVO pageReqVO) {
|
||||
int i = pageReqVO.getPageNo() * pageReqVO.getPageSize();
|
||||
pageReqVO.setPageNum(i);
|
||||
PageResult<UnqualifiedNotificationDO> unqualifiedNotificationPage = unqualifiedNotificationService.getUnqualifiedNotificationPageWx(pageReqVO);
|
||||
// List<UnqualifiedNotificationDO> list = unqualifiedNotificationPage.getList();
|
||||
// if(CollUtil.isNotEmpty(list)){
|
||||
// for (UnqualifiedNotificationDO unqualifiedNotificationDO : list) {
|
||||
// List<String> fileUrlList = new ArrayList<>();
|
||||
// List<UnqualifiedNotificationFileDO> unqualifiedNotificationFileDOS = unqualifiedNotificationFileService.queryUnqualifiedNotificationFileBySuperId(unqualifiedNotificationDO.getId(),0);
|
||||
// if(CollUtil.isNotEmpty(unqualifiedNotificationFileDOS)){
|
||||
// for (UnqualifiedNotificationFileDO unqualifiedNotificationFileDO : unqualifiedNotificationFileDOS) {
|
||||
// fileUrlList.add(unqualifiedNotificationFileDO.getFileUrl());
|
||||
// }
|
||||
// unqualifiedNotificationDO.setFileUrlList(fileUrlList);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
return success(unqualifiedNotificationPage);
|
||||
}
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出品质异常通知单审核 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:unqualified-notification:export')")
|
||||
|
@ -82,6 +82,7 @@ public class UnqualifiedNotificationPageReqVO extends PageParam {
|
||||
@Schema(description = "创建人名称")
|
||||
private String creatorName;
|
||||
|
||||
private Integer pageNum;
|
||||
@Schema(description = "最小创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime minCreateTime;
|
||||
@ -89,4 +90,6 @@ public class UnqualifiedNotificationPageReqVO extends PageParam {
|
||||
@Schema(description = "最大创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime maxCreateTime;
|
||||
|
||||
private Integer queryType;
|
||||
}
|
||||
|
@ -45,7 +45,13 @@ public class ZjBgMasterLineController {
|
||||
public CommonResult<Integer> endBg(@Valid @RequestBody ZjBgMasterLineSaveReqVO createReqVO) {
|
||||
return success(zjBgMasterLineService.updateBgMasterLines(createReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/validExceed")
|
||||
@Operation(summary = "获得过程检报工")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:bg-master-line:query')")
|
||||
public CommonResult<Boolean> validExceed(@RequestParam("id") Long id,@RequestParam("amount") Integer amount) {
|
||||
return success(zjBgMasterLineService.validExceed(id,amount));
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建终检报工")
|
||||
@ -69,7 +75,7 @@ public class ZjBgMasterLineController {
|
||||
@Operation(summary = "删除终检报工")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:delete')")
|
||||
public CommonResult<Boolean> deleteZjBgMasterLine(@RequestParam("id") Integer id) {
|
||||
public CommonResult<Boolean> deleteZjBgMasterLine(@RequestParam("id") Long id) {
|
||||
zjBgMasterLineService.deleteZjBgMasterLine(id);
|
||||
return success(true);
|
||||
}
|
||||
@ -78,7 +84,7 @@ public class ZjBgMasterLineController {
|
||||
@Operation(summary = "获得终检报工")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:query')")
|
||||
public CommonResult<ZjBgMasterLineRespVO> getZjBgMasterLine(@RequestParam("id") Integer id) {
|
||||
public CommonResult<ZjBgMasterLineRespVO> getZjBgMasterLine(@RequestParam("id") Long id) {
|
||||
ZjBgMasterLineDO zjBgMasterLine = zjBgMasterLineService.getZjBgMasterLine(id);
|
||||
return success(BeanUtils.toBean(zjBgMasterLine, ZjBgMasterLineRespVO.class));
|
||||
}
|
||||
|
@ -53,5 +53,14 @@ public class ZjBgMasterLineRespVO {
|
||||
@Schema(description = "报工人")
|
||||
@ExcelProperty("报工人")
|
||||
private String userName;
|
||||
private Integer isRepre;
|
||||
private Integer isQua;
|
||||
private String remark;
|
||||
private Integer notificationStatus;
|
||||
private Integer conStatus;
|
||||
private String auditOpinion;
|
||||
private Integer auditor;
|
||||
private LocalDateTime audit_time;
|
||||
private List<String> fileUrlList;
|
||||
|
||||
}
|
@ -14,13 +14,13 @@ import java.time.LocalDateTime;
|
||||
public class ZjBgMasterLineSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24341")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "终检ID", example = "30462")
|
||||
private Integer zjId;
|
||||
|
||||
@Schema(description = "终检检明细id", example = "21667")
|
||||
private Integer zjMxId;
|
||||
private Long zjMxId;
|
||||
|
||||
@Schema(description = "报工人")
|
||||
private String bgUser;
|
||||
@ -33,5 +33,14 @@ public class ZjBgMasterLineSaveReqVO {
|
||||
|
||||
@Schema(description = "工时")
|
||||
private BigDecimal workTime;
|
||||
|
||||
private Integer isRepre;
|
||||
private Integer isQua;
|
||||
private String remark;
|
||||
private Integer type;
|
||||
private String userName;
|
||||
private Integer notificationStatus;
|
||||
private Integer conStatus;
|
||||
private String auditOpinion;
|
||||
private Integer auditor;
|
||||
private LocalDateTime audit_time;
|
||||
}
|
@ -55,7 +55,7 @@ public class ZjPgMasterController {
|
||||
@PostMapping("/zfZjPgMaster")
|
||||
@Operation(summary = "作废终检派工单")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-pg-master:create')")
|
||||
public CommonResult<Integer> zfZjPgMaster(@RequestParam("id") Integer id) {
|
||||
public CommonResult<Integer> zfZjPgMaster(@RequestParam("id") Long id) {
|
||||
return success(zjPgMasterService.zfZjPgMaster(id));
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class BgMasterLineDO extends BaseDO {
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
private Long id;
|
||||
/**
|
||||
* 过程检ID
|
||||
*/
|
||||
@ -36,7 +36,7 @@ public class BgMasterLineDO extends BaseDO {
|
||||
/**
|
||||
* 过程检明细id
|
||||
*/
|
||||
private Integer zjMxId;
|
||||
private Long zjMxId;
|
||||
/**
|
||||
* 报工人
|
||||
*/
|
||||
@ -60,5 +60,14 @@ public class BgMasterLineDO extends BaseDO {
|
||||
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
private Integer isRepre;
|
||||
private Integer isQua;
|
||||
private String remark;
|
||||
private Integer notificationStatus;
|
||||
private Integer conStatus;
|
||||
private String auditOpinion;
|
||||
private Integer auditor;
|
||||
private LocalDateTime audit_time;
|
||||
@TableField(exist = false)
|
||||
private List<String> fileUrlList;
|
||||
}
|
@ -94,7 +94,6 @@ public class UnqualifiedNotificationDO extends BaseDO {
|
||||
* 审核时间
|
||||
*/
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String projectName;
|
||||
|
||||
@ -139,7 +138,10 @@ public class UnqualifiedNotificationDO extends BaseDO {
|
||||
|
||||
@TableField(exist = false)
|
||||
private String creatorName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer totalAmount;
|
||||
@TableField(exist = false)
|
||||
private String typeName;
|
||||
@TableField(exist = false)
|
||||
private String statisticAmount;
|
||||
@TableField(exist = false)
|
||||
|
@ -41,4 +41,5 @@ public class UnqualifiedNotificationFileDO extends BaseDO {
|
||||
private String fileName;
|
||||
private String filePath;
|
||||
private String fileUrl;
|
||||
private Integer type;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class ZjBgMasterLineDO extends BaseDO {
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
private Long id;
|
||||
/**
|
||||
* 终检ID
|
||||
*/
|
||||
@ -36,7 +36,7 @@ public class ZjBgMasterLineDO extends BaseDO {
|
||||
/**
|
||||
* 终检检明细id
|
||||
*/
|
||||
private Integer zjMxId;
|
||||
private Long zjMxId;
|
||||
/**
|
||||
* 报工人
|
||||
*/
|
||||
@ -61,6 +61,15 @@ public class ZjBgMasterLineDO extends BaseDO {
|
||||
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
private Integer isRepre;
|
||||
private Integer isQua;
|
||||
private String remark;
|
||||
private Integer notificationStatus;
|
||||
private Integer conStatus;
|
||||
private String auditOpinion;
|
||||
private Integer auditor;
|
||||
private LocalDateTime audit_time;
|
||||
@TableField(exist = false)
|
||||
private List<String> fileUrlList;
|
||||
|
||||
}
|
@ -30,7 +30,8 @@ public interface BgMasterLineMapper extends BaseMapperX<BgMasterLineDO> {
|
||||
.select("u2.username as userName")
|
||||
.leftJoin("system_users u2 on u2.id = t.bg_user")
|
||||
;
|
||||
query.eq(BgMasterLineDO::getZjMxId, reqVO.getZjMxId());
|
||||
query.eq(BgMasterLineDO::getZjMxId, reqVO.getZjMxId())
|
||||
.orderByDesc(BgMasterLineDO::getId);
|
||||
return selectPage(reqVO, query);
|
||||
|
||||
|
||||
@ -46,7 +47,7 @@ public interface BgMasterLineMapper extends BaseMapperX<BgMasterLineDO> {
|
||||
.orderByDesc(BgMasterLineDO::getId))
|
||||
;*/
|
||||
}
|
||||
default BgMasterLineDO selectSum(Integer zjMxId) {
|
||||
default BgMasterLineDO selectSum(Long zjMxId) {
|
||||
MPJLambdaWrapper<BgMasterLineDO> query = new MPJLambdaWrapper<>();
|
||||
query.select("SUM(t.amount) as amount ,SUM(t.work_time) as workTime");
|
||||
|
||||
@ -57,7 +58,19 @@ public interface BgMasterLineMapper extends BaseMapperX<BgMasterLineDO> {
|
||||
|
||||
return selectOne(query);
|
||||
}
|
||||
default BgMasterLineDO selectEnd(Integer zjMxId) {
|
||||
default BgMasterLineDO selectCountUn(Integer type) {
|
||||
MPJLambdaWrapper<BgMasterLineDO> query = new MPJLambdaWrapper<>();
|
||||
query.select("count(1) as amount");
|
||||
|
||||
|
||||
query
|
||||
.eq(BgMasterLineDO::getNotificationStatus,type)
|
||||
|
||||
;
|
||||
|
||||
return selectOne(query);
|
||||
}
|
||||
default BgMasterLineDO selectEnd(Long zjMxId) {
|
||||
MPJLambdaWrapper<BgMasterLineDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
|
||||
@ -67,5 +80,15 @@ public interface BgMasterLineMapper extends BaseMapperX<BgMasterLineDO> {
|
||||
|
||||
return selectOne(query);
|
||||
}
|
||||
default BgMasterLineDO selectLast(Long zjMxId) {
|
||||
MPJLambdaWrapper<BgMasterLineDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
|
||||
query.eq( BgMasterLineDO::getZjMxId, zjMxId)
|
||||
.orderByDesc(BgMasterLineDO::getId)
|
||||
.last("limit 1");
|
||||
;
|
||||
|
||||
return selectOne(query);
|
||||
}
|
||||
}
|
@ -72,6 +72,13 @@ public interface UnqualifiedNotificationMapper extends BaseMapperX<UnqualifiedNo
|
||||
|
||||
return selectPage(reqVO, query);
|
||||
}
|
||||
Long selectCountPageWx( @Param("queryType") Integer queryType,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("limit") Integer limit);
|
||||
|
||||
List<UnqualifiedNotificationDO> selectPageWx( @Param("queryType") Integer queryType,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("limit") Integer limit);
|
||||
|
||||
default UnqualifiedNotificationDO selectById(Long id) {
|
||||
MPJLambdaWrapper<UnqualifiedNotificationDO> query = new MPJLambdaWrapper<>();
|
||||
|
@ -18,9 +18,10 @@ import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface UnqualifiedNotificationFileMapper extends BaseMapperX<UnqualifiedNotificationFileDO> {
|
||||
default List<UnqualifiedNotificationFileDO> queryUnqualifiedNotificationFileBySuperId(Long unqualifiedId){
|
||||
default List<UnqualifiedNotificationFileDO> queryUnqualifiedNotificationFileBySuperId(Long unqualifiedId,Integer type){
|
||||
MPJLambdaWrapper<UnqualifiedNotificationFileDO> query = new MPJLambdaWrapper<>();
|
||||
query.eq(UnqualifiedNotificationFileDO::getUnqualifiedId,unqualifiedId);
|
||||
query.eq(UnqualifiedNotificationFileDO::getUnqualifiedId,unqualifiedId)
|
||||
.eq(UnqualifiedNotificationFileDO::getType,type);
|
||||
return selectList(query);
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public interface ZjBgMasterLineMapper extends BaseMapperX<ZjBgMasterLineDO> {
|
||||
.orderByDesc(ZjBgMasterLineDO::getId));*/
|
||||
}
|
||||
|
||||
default ZjBgMasterLineDO selectSum(Integer zjMxId) {
|
||||
default ZjBgMasterLineDO selectSum(Long zjMxId) {
|
||||
MPJLambdaWrapper<ZjBgMasterLineDO> query = new MPJLambdaWrapper<>();
|
||||
query.select("SUM(t.amount) as amount ,SUM(t.work_time) as workTime");
|
||||
|
||||
@ -54,15 +54,25 @@ public interface ZjBgMasterLineMapper extends BaseMapperX<ZjBgMasterLineDO> {
|
||||
return selectOne(query);
|
||||
}
|
||||
|
||||
default ZjBgMasterLineDO selectEnd(Integer zjMxId) {
|
||||
default ZjBgMasterLineDO selectEnd(Long zjMxId) {
|
||||
MPJLambdaWrapper<ZjBgMasterLineDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
|
||||
query.eq( BgMasterLineDO::getZjMxId, zjMxId)
|
||||
.isNull(BgMasterLineDO::getAmount)
|
||||
query.eq( ZjBgMasterLineDO::getZjMxId, zjMxId)
|
||||
.isNull(ZjBgMasterLineDO::getAmount)
|
||||
;
|
||||
|
||||
return selectOne(query);
|
||||
}
|
||||
default ZjBgMasterLineDO selectLast(Long zjMxId) {
|
||||
MPJLambdaWrapper<ZjBgMasterLineDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
|
||||
query.eq( BgMasterLineDO::getZjMxId, zjMxId)
|
||||
.orderByDesc(ZjBgMasterLineDO::getId)
|
||||
.last("limit 1");
|
||||
;
|
||||
|
||||
return selectOne(query);
|
||||
}
|
||||
}
|
@ -51,7 +51,7 @@ public interface BgMasterLineService {
|
||||
* @return 过程检报工
|
||||
*/
|
||||
BgMasterLineDO getBgMasterLine(Integer id);
|
||||
|
||||
public boolean validExceed(Long zjmxId,Integer amount);
|
||||
/**
|
||||
* 获得过程检报工分页
|
||||
*
|
||||
|
@ -1,14 +1,18 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.bgmasterline;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotificationfile.UnqualifiedNotificationFileDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.pgmaster.PgMasterLineMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.pgmaster.PgMasterMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchDetailMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.service.unqualifiednotificationfile.UnqualifiedNotificationFileService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -43,39 +47,65 @@ public class BgMasterLineServiceImpl implements BgMasterLineService {
|
||||
private PgMasterLineMapper pgMasterLineMapper;
|
||||
@Resource
|
||||
private TaskDispatchDetailMapper taskDispatchDetailMapper;
|
||||
@Resource
|
||||
private UnqualifiedNotificationFileService unqualifiedNotificationFileService;
|
||||
|
||||
|
||||
//结束本次报工
|
||||
@Override
|
||||
public Integer updateBgMasterLines(BgMasterLineSaveReqVO createReqVO){
|
||||
if(createReqVO.getAmount() == null || createReqVO.getWorkTime() == null){
|
||||
throw exception(TASK_REPORT_PARAMS_ERROR);
|
||||
}
|
||||
|
||||
public boolean validExceed(Long zjmxId,Integer amount){
|
||||
//先取出总的派工数量和预计工时
|
||||
PgMasterLineDO pgMasterLineDO = pgMasterLineMapper.selectById(createReqVO.getZjMxId());
|
||||
PgMasterLineDO pgMasterLineDO = pgMasterLineMapper.selectById(zjmxId);
|
||||
//然后再取出这条ID明细ID下的所有工时和报工数量相加
|
||||
BgMasterLineDO bgMasterLineDO = bgMasterLineMapper.selectSum(createReqVO.getZjMxId());
|
||||
BgMasterLineDO bgMasterLineDO = bgMasterLineMapper.selectSum(zjmxId);
|
||||
//然后加上用户传入的当前的工时和查出的工时进行相加,进行判断
|
||||
int value1 = 0;
|
||||
if(bgMasterLineDO!=null){
|
||||
//然后加上用户传入的当前的工时和查出的工时进行相加,进行判断
|
||||
value1 = bgMasterLineDO.getAmount()+createReqVO.getAmount();
|
||||
value1 = bgMasterLineDO.getAmount()+amount;
|
||||
}else{
|
||||
value1 = createReqVO.getAmount();
|
||||
value1 = amount;
|
||||
}
|
||||
//先判断报工数量是否大于派工数量
|
||||
if(value1>pgMasterLineDO.getAmount()){
|
||||
//这个地方返回错误:报工数量不允许超过派工数量请检查
|
||||
throw exception(TASK_REPORT_PARAMS_ERRORS);
|
||||
}else{
|
||||
return value1>pgMasterLineDO.getAmount();
|
||||
}
|
||||
|
||||
//结束本次报工
|
||||
@Override
|
||||
public Integer updateBgMasterLines(BgMasterLineSaveReqVO createReqVO){
|
||||
//非结束时判断
|
||||
if (createReqVO.getType() != null && createReqVO.getType() != 0){
|
||||
if(createReqVO.getAmount() == null || createReqVO.getWorkTime() == null){
|
||||
throw exception(TASK_REPORT_PARAMS_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// //先取出总的派工数量和预计工时
|
||||
PgMasterLineDO pgMasterLineDO = pgMasterLineMapper.selectById(createReqVO.getZjMxId());
|
||||
// //然后再取出这条ID明细ID下的所有工时和报工数量相加
|
||||
// BgMasterLineDO bgMasterLineDO = bgMasterLineMapper.selectSum(createReqVO.getZjMxId());
|
||||
// //然后加上用户传入的当前的工时和查出的工时进行相加,进行判断
|
||||
// int value1 = 0;
|
||||
// if(bgMasterLineDO!=null){
|
||||
// //然后加上用户传入的当前的工时和查出的工时进行相加,进行判断
|
||||
// value1 = bgMasterLineDO.getAmount()+createReqVO.getAmount();
|
||||
// }else{
|
||||
// value1 = createReqVO.getAmount();
|
||||
// }
|
||||
// //先判断报工数量是否大于派工数量
|
||||
// if(value1>pgMasterLineDO.getAmount()){
|
||||
// //这个地方返回错误:报工数量不允许超过派工数量请检查
|
||||
// throw exception(TASK_REPORT_PARAMS_ERRORS);
|
||||
// }else{
|
||||
//取出本派工单在报工明细中,有没有报
|
||||
BgMasterLineDO bgMasterLineDOs = bgMasterLineMapper.selectEnd(createReqVO.getZjMxId());
|
||||
if (createReqVO.getType() != null && createReqVO.getType() == 0){
|
||||
bgMasterLineDOs = bgMasterLineMapper.selectLast(createReqVO.getZjMxId());
|
||||
}
|
||||
//判断报工user是否相等
|
||||
if(bgMasterLineDOs.getBgUser().equals(createReqVO.getBgUser())){
|
||||
//相同时判断报工数量和派工数量是否相等,相等设置为设置报工状态为1 已完成
|
||||
LocalDateTime currentDateTime = LocalDateTime.now();
|
||||
if(value1 == pgMasterLineDO.getAmount()){
|
||||
if(createReqVO.getType() != null && createReqVO.getType() == 0){
|
||||
//这个地方跟定是否完成状态
|
||||
pgMasterLineDO.setPgType(1);
|
||||
pgMasterLineDO.setDetilUser(Long.parseLong(createReqVO.getBgUser()));
|
||||
@ -86,44 +116,34 @@ public class BgMasterLineServiceImpl implements BgMasterLineService {
|
||||
LambdaUpdateWrapper<TaskDispatchDetailDO> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(TaskDispatchDetailDO::getId,pgMasterLineDO.getDispatchDetailId());
|
||||
wrapper.set(TaskDispatchDetailDO::getTestYn,"Y");
|
||||
taskDispatchDetailMapper.update(wrapper);
|
||||
// TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectById(pgMasterLineDO.getDispatchDetailId());
|
||||
// if (ObjectUtil.isNotEmpty(taskDispatchDetailDO)){
|
||||
// LambdaQueryWrapper<TaskDispatchDetailDO> wrapper1 = new LambdaQueryWrapper<>();
|
||||
// wrapper1.eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDetailDO.getDispatchId());
|
||||
// wrapper1.gt(TaskDispatchDetailDO::getSort, taskDispatchDetailDO.getSort());
|
||||
// wrapper1.eq(TaskDispatchDetailDO::getReportStatus, 0);
|
||||
// wrapper1.eq(TaskDispatchDetailDO::getDeleted, 0);
|
||||
// wrapper1.orderByAsc(TaskDispatchDetailDO::getSort);
|
||||
// wrapper1.last("limit 1");
|
||||
// TaskDispatchDetailDO nextTaskDispatchDetailDO = taskDispatchDetailMapper.selectOne(wrapper1);
|
||||
// if (ObjectUtil.isNotEmpty(nextTaskDispatchDetailDO)){
|
||||
// nextTaskDispatchDetailDO.setReportStatus(1);
|
||||
// taskDispatchDetailMapper.updateById(nextTaskDispatchDetailDO);
|
||||
// }
|
||||
// }
|
||||
return taskDispatchDetailMapper.update(wrapper);
|
||||
|
||||
}else{
|
||||
//不相等时只更新当前报工状态
|
||||
pgMasterLineDO.setActive("END");
|
||||
pgMasterLineDO.setEntTime(currentDateTime);
|
||||
pgMasterLineMapper.updateById(pgMasterLineDO);
|
||||
}
|
||||
//更新报工信息
|
||||
//结束时间
|
||||
bgMasterLineDOs.setEntTime(currentDateTime);
|
||||
//报工工时
|
||||
bgMasterLineDOs.setWorkTime(createReqVO.getWorkTime());
|
||||
bgMasterLineDOs.setIsQua(createReqVO.getIsQua()==null ?null :createReqVO.getIsQua());
|
||||
bgMasterLineDOs.setIsRepre(createReqVO.getIsRepre()==null ?null :createReqVO.getIsRepre());
|
||||
bgMasterLineDOs.setRemark(createReqVO.getRemark()!=null && !createReqVO.getRemark().trim().equals("")?createReqVO.getRemark() :null);
|
||||
|
||||
bgMasterLineDOs.setNotificationStatus(1);
|
||||
//报工数量
|
||||
bgMasterLineDOs.setAmount(createReqVO.getAmount());
|
||||
|
||||
return bgMasterLineMapper.updateById(bgMasterLineDOs);
|
||||
}
|
||||
|
||||
}else{
|
||||
//当创建人和报工人不一样时返回报错,不允许用户报工
|
||||
throw exception(TASK_REPORT_PARAMS_ERRORBG);
|
||||
}
|
||||
//
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -179,7 +199,21 @@ public class BgMasterLineServiceImpl implements BgMasterLineService {
|
||||
|
||||
@Override
|
||||
public PageResult<BgMasterLineDO> getBgMasterLinePage(BgMasterLinePageReqVO pageReqVO) {
|
||||
return bgMasterLineMapper.selectPage(pageReqVO);
|
||||
PageResult<BgMasterLineDO> pageResult = bgMasterLineMapper.selectPage(pageReqVO);
|
||||
List<BgMasterLineDO> list = pageResult.getList();
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
for (BgMasterLineDO bgMasterLineDO : list) {
|
||||
List<String> fileUrlList = new ArrayList<>();
|
||||
List<UnqualifiedNotificationFileDO> unqualifiedNotificationFileDOS = unqualifiedNotificationFileService.queryUnqualifiedNotificationFileBySuperId(bgMasterLineDO.getId(),1);
|
||||
if(CollUtil.isNotEmpty(unqualifiedNotificationFileDOS)){
|
||||
for (UnqualifiedNotificationFileDO unqualifiedNotificationFileDO : unqualifiedNotificationFileDOS) {
|
||||
fileUrlList.add(unqualifiedNotificationFileDO.getFileUrl());
|
||||
}
|
||||
bgMasterLineDO.setFileUrlList(fileUrlList);
|
||||
}
|
||||
}
|
||||
}
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public interface PgMasterService {
|
||||
* @param id 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer zfPgMaster(Integer id);
|
||||
Integer zfPgMaster(Long id);
|
||||
/**
|
||||
* 创建质量过程检派工单主
|
||||
*
|
||||
|
@ -164,7 +164,7 @@ public class PgMasterServiceImpl implements PgMasterService {
|
||||
|
||||
|
||||
@Override
|
||||
public Integer zfPgMaster(Integer id) {
|
||||
public Integer zfPgMaster(Long id) {
|
||||
|
||||
//作废先判断是否已经报工
|
||||
BgMasterLineDO bgMasterLineDO = bgMasterLineMapper.selectSum(id);
|
||||
|
@ -5,6 +5,8 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 品质异常通知单审核 Service 接口
|
||||
*
|
||||
@ -49,6 +51,7 @@ public interface UnqualifiedNotificationService {
|
||||
* @return 品质异常通知单审核分页
|
||||
*/
|
||||
PageResult<UnqualifiedNotificationDO> getUnqualifiedNotificationPage(UnqualifiedNotificationPageReqVO pageReqVO);
|
||||
PageResult<UnqualifiedNotificationDO> getUnqualifiedNotificationPageWx(UnqualifiedNotificationPageReqVO pageReqVO);
|
||||
|
||||
void operate(UnqualifiedNotificationSaveReqVO operateReqVO);
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.chanko.yunxi.mes.module.heli.service.unqualifiednotification;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum;
|
||||
import com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.QualityStatistics;
|
||||
@ -10,11 +11,15 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationSaveReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotificationfile.UnqualifiedNotificationFileDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.bgmasterline.BgMasterLineMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.unqualifiednotification.UnqualifiedNotificationMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjbgmasterline.ZjBgMasterLineMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.CodeEnum;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.UnqualifiedNotificationStatusEnum;
|
||||
@ -55,7 +60,10 @@ public class UnqualifiedNotificationServiceImpl implements UnqualifiedNotificati
|
||||
private com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper bdgzsomthingMapper;
|
||||
@Resource
|
||||
private AttentiontodoMapper attentiontodoMapper;
|
||||
|
||||
@Resource
|
||||
private ZjBgMasterLineMapper zjBgMasterLineMapper;
|
||||
@Resource
|
||||
private BgMasterLineMapper bgMasterLineMapper;
|
||||
@Resource
|
||||
private UnqualifiedNotificationMapper unqualifiedNotificationMapper;
|
||||
@Resource
|
||||
@ -196,7 +204,7 @@ try {
|
||||
@Override
|
||||
public UnqualifiedNotificationDO getUnqualifiedNotification(Long id) {
|
||||
UnqualifiedNotificationDO unqualifiedNotificationDO = unqualifiedNotificationMapper.selectById(id);
|
||||
List<UnqualifiedNotificationFileDO> unqualifiedNotificationFileDOS = unqualifiedNotificationFileService.queryUnqualifiedNotificationFileBySuperId(unqualifiedNotificationDO.getId());
|
||||
List<UnqualifiedNotificationFileDO> unqualifiedNotificationFileDOS = unqualifiedNotificationFileService.queryUnqualifiedNotificationFileBySuperId(unqualifiedNotificationDO.getId(),0);
|
||||
List<String> fileUrlList = unqualifiedNotificationFileDOS.stream()
|
||||
.map(UnqualifiedNotificationFileDO::getFileUrl)
|
||||
.collect(Collectors.toList());
|
||||
@ -208,7 +216,19 @@ try {
|
||||
public PageResult<UnqualifiedNotificationDO> getUnqualifiedNotificationPage(UnqualifiedNotificationPageReqVO pageReqVO) {
|
||||
return unqualifiedNotificationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
@Override
|
||||
public PageResult<UnqualifiedNotificationDO> getUnqualifiedNotificationPageWx(UnqualifiedNotificationPageReqVO pageReqVO) {
|
||||
PageResult<UnqualifiedNotificationDO> pageResult = new PageResult<>();
|
||||
Long total = unqualifiedNotificationMapper.selectCountPageWx(pageReqVO.getQueryType(), pageReqVO.getPageNum(), pageReqVO.getPageSize());
|
||||
|
||||
pageResult.setTotal(total);
|
||||
if (total > 0L){
|
||||
pageResult.setTotalPages(total.intValue()/ pageReqVO.getPageSize());
|
||||
}
|
||||
List<UnqualifiedNotificationDO> unqualifiedNotificationDOS = unqualifiedNotificationMapper.selectPageWx(pageReqVO.getQueryType(), pageReqVO.getPageNum(), pageReqVO.getPageSize());
|
||||
pageResult.setList(unqualifiedNotificationDOS);
|
||||
return pageResult;
|
||||
}
|
||||
@Override
|
||||
public void operate(UnqualifiedNotificationSaveReqVO operateReqVO) {
|
||||
if(operateReqVO.getId() == null){
|
||||
|
@ -21,7 +21,7 @@ public interface UnqualifiedNotificationFileService {
|
||||
|
||||
int createUnqualifiedNotificationFile(@Valid UnqualifiedNotificationFileDO unqualifiedNotificationFileDO);
|
||||
// void updateUnqualifiedNotificationFile(@Valid UnqualifiedNotificationFileDO unqualifiedNotificationFileDO);
|
||||
List<UnqualifiedNotificationFileDO> queryUnqualifiedNotificationFileBySuperId(@Valid Long unqualificationId);
|
||||
List<UnqualifiedNotificationFileDO> queryUnqualifiedNotificationFileBySuperId(@Valid Long unqualificationId,Integer type);
|
||||
/**
|
||||
* 删除品质异常通知单审核
|
||||
*
|
||||
|
@ -33,8 +33,8 @@ public class UnqualifiedNotificationFileServiceImpl implements UnqualifiedNotifi
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<UnqualifiedNotificationFileDO> queryUnqualifiedNotificationFileBySuperId(Long unqualificationId) {
|
||||
return unqualifiedNotificationFileMapper.queryUnqualifiedNotificationFileBySuperId(unqualificationId);
|
||||
public List<UnqualifiedNotificationFileDO> queryUnqualifiedNotificationFileBySuperId(Long unqualificationId,Integer type) {
|
||||
return unqualifiedNotificationFileMapper.queryUnqualifiedNotificationFileBySuperId(unqualificationId,type);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,7 +22,7 @@ public interface ZjBgMasterLineService {
|
||||
* @return 编号
|
||||
*/
|
||||
Integer updateBgMasterLines(@Valid ZjBgMasterLineSaveReqVO createReqVO);
|
||||
|
||||
public boolean validExceed(Long zjmxId,Integer amount);
|
||||
|
||||
/**
|
||||
* 创建终检报工
|
||||
@ -44,7 +44,7 @@ public interface ZjBgMasterLineService {
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteZjBgMasterLine(Integer id);
|
||||
void deleteZjBgMasterLine(Long id);
|
||||
|
||||
/**
|
||||
* 获得终检报工
|
||||
@ -52,7 +52,7 @@ public interface ZjBgMasterLineService {
|
||||
* @param id 编号
|
||||
* @return 终检报工
|
||||
*/
|
||||
ZjBgMasterLineDO getZjBgMasterLine(Integer id);
|
||||
ZjBgMasterLineDO getZjBgMasterLine(Long id);
|
||||
|
||||
/**
|
||||
* 获得终检报工分页
|
||||
|
@ -1,12 +1,15 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.zjbgmasterline;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.bgmasterline.vo.BgMasterLineSaveReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotificationfile.UnqualifiedNotificationFileDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjpgmaster.ZjPgMasterDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjpgmaster.ZjPgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjpgmaster.ZjPgMasterLineMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjpgmaster.ZjPgMasterMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.service.unqualifiednotificationfile.UnqualifiedNotificationFileService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -43,46 +46,53 @@ public class ZjBgMasterLineServiceImpl implements ZjBgMasterLineService {
|
||||
@Resource
|
||||
private ZjPgMasterLineMapper zjPgMasterLineMapper;
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private UnqualifiedNotificationFileService unqualifiedNotificationFileService;
|
||||
@Override
|
||||
public boolean validExceed(Long zjmxId,Integer amount){
|
||||
//先取出总的派工数量和预计工时
|
||||
ZjPgMasterLineDO zjPgMasterLineDO = zjPgMasterLineMapper.selectById(zjmxId);
|
||||
//然后再取出这条ID明细ID下的所有工时和报工数量相加
|
||||
ZjBgMasterLineDO zjBgMasterLineDO = zjBgMasterLineMapper.selectSum(zjmxId);
|
||||
//然后加上用户传入的当前的工时和查出的工时进行相加,进行判断
|
||||
int value1 = 0;
|
||||
if(zjBgMasterLineDO!=null){
|
||||
//然后加上用户传入的当前的工时和查出的工时进行相加,进行判断
|
||||
value1 = zjBgMasterLineDO.getAmount()+amount;
|
||||
}else{
|
||||
value1 = amount;
|
||||
}
|
||||
return value1>zjPgMasterLineDO.getAmount();
|
||||
}
|
||||
|
||||
|
||||
//结束本次报工
|
||||
@Override
|
||||
public Integer updateBgMasterLines(ZjBgMasterLineSaveReqVO createReqVO){
|
||||
if (createReqVO.getType() != null && createReqVO.getType() != 0){
|
||||
if(createReqVO.getAmount() == null || createReqVO.getWorkTime() == null){
|
||||
throw exception(TASK_REPORT_PARAMS_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
//先取出总的派工数量和预计工时
|
||||
ZjPgMasterLineDO zjPgMasterLineDO = zjPgMasterLineMapper.selectById(createReqVO.getZjMxId());
|
||||
//然后再取出这条ID明细ID下的所有工时和报工数量相加
|
||||
ZjBgMasterLineDO zjBgMasterLineDO = zjBgMasterLineMapper.selectSum(createReqVO.getZjMxId());
|
||||
//然后加上用户传入的当前的工时和查出的工时进行相加,进行判断
|
||||
int value1 = 0;
|
||||
if(zjBgMasterLineDO!=null){
|
||||
//然后加上用户传入的当前的工时和查出的工时进行相加,进行判断
|
||||
value1 = zjBgMasterLineDO.getAmount()+createReqVO.getAmount();
|
||||
}else{
|
||||
value1 = createReqVO.getAmount();
|
||||
}
|
||||
//先判断报工数量是否大于派工数量
|
||||
if(value1>zjPgMasterLineDO.getAmount()){
|
||||
//这个地方返回错误:报工数量不允许超过派工数量请检查
|
||||
throw exception(TASK_REPORT_PARAMS_ERRORS);
|
||||
}else{
|
||||
//取出本派工单在报工明细中,有没有报
|
||||
ZjBgMasterLineDO zjBgMasterLineDO1 = zjBgMasterLineMapper.selectEnd(createReqVO.getZjMxId());
|
||||
if (createReqVO.getType() != null && createReqVO.getType() == 0){
|
||||
zjBgMasterLineDO1 = zjBgMasterLineMapper.selectLast(createReqVO.getZjMxId());
|
||||
}
|
||||
//判断报工user是否相等
|
||||
if(zjBgMasterLineDO1.getBgUser().equals(createReqVO.getBgUser())){
|
||||
//相同时判断报工数量和派工数量是否相等,相等设置为设置报工状态为1 已完成
|
||||
LocalDateTime currentDateTime = LocalDateTime.now();
|
||||
if(value1 == zjPgMasterLineDO.getAmount()){
|
||||
if(createReqVO.getType() != null && createReqVO.getType() == 0){
|
||||
//这个地方跟定是否完成状态
|
||||
zjPgMasterLineDO.setPgType(1);
|
||||
zjPgMasterLineDO.setDetilUser(Long.parseLong(createReqVO.getBgUser()));
|
||||
zjPgMasterLineDO.setActive("END");
|
||||
zjPgMasterLineDO.setEntTime(currentDateTime);
|
||||
zjPgMasterLineMapper.updateById(zjPgMasterLineDO);
|
||||
return zjPgMasterLineMapper.updateById(zjPgMasterLineDO);
|
||||
//更新工时
|
||||
|
||||
}else{
|
||||
@ -90,7 +100,6 @@ public class ZjBgMasterLineServiceImpl implements ZjBgMasterLineService {
|
||||
zjPgMasterLineDO.setActive("END");
|
||||
zjPgMasterLineDO.setEntTime(currentDateTime);
|
||||
zjPgMasterLineMapper.updateById(zjPgMasterLineDO);
|
||||
}
|
||||
//更新报工信息
|
||||
//结束时间
|
||||
zjBgMasterLineDO1.setEntTime(currentDateTime);
|
||||
@ -98,14 +107,16 @@ public class ZjBgMasterLineServiceImpl implements ZjBgMasterLineService {
|
||||
zjBgMasterLineDO1.setWorkTime(createReqVO.getWorkTime());
|
||||
//报工数量
|
||||
zjBgMasterLineDO1.setAmount(createReqVO.getAmount());
|
||||
|
||||
zjBgMasterLineDO1.setIsQua(createReqVO.getIsQua()==null ?null :createReqVO.getIsQua());
|
||||
zjBgMasterLineDO1.setIsRepre(createReqVO.getIsRepre()==null ?null :createReqVO.getIsRepre());
|
||||
zjBgMasterLineDO1.setRemark(createReqVO.getRemark()!=null && !createReqVO.getRemark().trim().equals("")?createReqVO.getRemark() :null);
|
||||
zjBgMasterLineDO1.setNotificationStatus(1);
|
||||
return zjBgMasterLineMapper.updateById(zjBgMasterLineDO1);
|
||||
}
|
||||
}else{
|
||||
//当创建人和报工人不一样时返回报错,不允许用户报工
|
||||
throw exception(TASK_REPORT_PARAMS_ERRORBG);
|
||||
}
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -187,27 +198,41 @@ public class ZjBgMasterLineServiceImpl implements ZjBgMasterLineService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteZjBgMasterLine(Integer id) {
|
||||
public void deleteZjBgMasterLine(Long id) {
|
||||
// 校验存在
|
||||
validateZjBgMasterLineExists(id);
|
||||
// 删除
|
||||
zjBgMasterLineMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateZjBgMasterLineExists(Integer id) {
|
||||
private void validateZjBgMasterLineExists(Long id) {
|
||||
if (zjBgMasterLineMapper.selectById(id) == null) {
|
||||
throw exception(ZJ_BG_MASTER_LINE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZjBgMasterLineDO getZjBgMasterLine(Integer id) {
|
||||
public ZjBgMasterLineDO getZjBgMasterLine(Long id) {
|
||||
return zjBgMasterLineMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ZjBgMasterLineDO> getZjBgMasterLinePage(ZjBgMasterLinePageReqVO pageReqVO) {
|
||||
return zjBgMasterLineMapper.selectPage(pageReqVO);
|
||||
PageResult<ZjBgMasterLineDO> pageResult = zjBgMasterLineMapper.selectPage(pageReqVO);
|
||||
List<ZjBgMasterLineDO> list = pageResult.getList();
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
for (ZjBgMasterLineDO bgMasterLineDO : list) {
|
||||
List<String> fileUrlList = new ArrayList<>();
|
||||
List<UnqualifiedNotificationFileDO> unqualifiedNotificationFileDOS = unqualifiedNotificationFileService.queryUnqualifiedNotificationFileBySuperId(bgMasterLineDO.getId(),1);
|
||||
if(CollUtil.isNotEmpty(unqualifiedNotificationFileDOS)){
|
||||
for (UnqualifiedNotificationFileDO unqualifiedNotificationFileDO : unqualifiedNotificationFileDOS) {
|
||||
fileUrlList.add(unqualifiedNotificationFileDO.getFileUrl());
|
||||
}
|
||||
bgMasterLineDO.setFileUrlList(fileUrlList);
|
||||
}
|
||||
}
|
||||
}
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public interface ZjPgMasterService {
|
||||
* @param createReqVO 作废
|
||||
* @return 编号
|
||||
*/
|
||||
Integer zfZjPgMaster(Integer id);
|
||||
Integer zfZjPgMaster(Long id);
|
||||
/**
|
||||
* 创建质量终检派工单主
|
||||
*
|
||||
|
@ -208,7 +208,7 @@ public class ZjPgMasterServiceImpl implements ZjPgMasterService {
|
||||
|
||||
|
||||
@Override
|
||||
public Integer zfZjPgMaster(Integer id) {
|
||||
public Integer zfZjPgMaster(Long id) {
|
||||
//作废先判断是否已经报工
|
||||
ZjBgMasterLineDO zjBgMasterLineDOS = zjBgMasterLineMapper.selectSum(id);
|
||||
|
||||
|
@ -108,4 +108,67 @@
|
||||
</if>
|
||||
order by t.createTime desc
|
||||
</select>
|
||||
<select id="selectCountPageWx" parameterType="java.lang.Integer" resultType="java.lang.Long">
|
||||
SELECT count(gh.*)
|
||||
FROM (
|
||||
SELECT t.id as id, g.pg_number as code, g.project_sub_name as projectSubName,
|
||||
t.amount as amount, g.amount as totalAmount, '过程检' as typeName,
|
||||
t.ent_time as createTime,u.nickname as creatorName,g.project_sub_number as projectSubCode,
|
||||
g.project_name as projectName ,g.material_name as materialName,
|
||||
g.blueprint_no as blueprintNo, pr1.name as procedureName
|
||||
FROM quality_bg_master_line t
|
||||
LEFT JOIN quality_pg_master_line g ON t.zj_mx_id = g.id
|
||||
LEFT JOIN base_procedure pr1 ON pr1.id = g.procedure_id
|
||||
left join system_users u on u.id = t.bg_user
|
||||
WHERE t.deleted = 0 AND t.tenant_id = 2 AND g.deleted = 0 AND g.tenant_id = 2
|
||||
AND pr1.deleted = 0 AND pr1.tenant_id = 2
|
||||
AND t.notification_status = #{queryType}
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT zj.id as id, g1.pg_number as code, g1.project_sub_name as projectSubName,
|
||||
zj.amount as amount, g1.amount as totalAmount, '终检' as typeName,
|
||||
zj.ent_time as createTime,u1.nickname as creatorName,g1.project_sub_number as projectSubCode,
|
||||
g1.project_name as projectName , '' as materialName, '' as blueprintNo, '' as procedureName
|
||||
FROM quality_zj_bg_master_line zj
|
||||
LEFT JOIN quality_zj_pg_master_line g1 ON zj.zj_mx_id = g1.id
|
||||
left join system_users u1 on u1.id = zj.bg_user
|
||||
WHERE zj.deleted = 0 AND zj.tenant_id = 2 AND g1.deleted = 0 AND g1.tenant_id = 2
|
||||
AND zj.notification_status = #{queryType}
|
||||
) gh
|
||||
</select>
|
||||
<select id="selectPageWx" parameterType="java.lang.Integer" resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO">
|
||||
SELECT gh.id as id, gh.code as code, gh.projectSubName as projectSubName,
|
||||
gh.amount as amount, gh.totalAmount as totalAmount, gh.typeName as typeName,
|
||||
gh.createTime as createTime,gh.creatorName as creatorName,gh.projectSubCode as projectSubCode,
|
||||
gh.projectName as projectName, gh.materialName as materialName,
|
||||
gh.blueprintNo as blueprintNo, gh.procedureName as procedureName
|
||||
FROM (
|
||||
SELECT t.id as id, g.pg_number as code, g.project_sub_name as projectSubName,
|
||||
t.amount as amount, g.amount as totalAmount, '过程检' as typeName,
|
||||
t.ent_time as createTime,u.nickname as creatorName,g.project_sub_number as projectSubCode,
|
||||
g.project_name as projectName ,g.material_name as materialName,
|
||||
g.blueprint_no as blueprintNo, pr1.name as procedureName
|
||||
FROM quality_bg_master_line t
|
||||
LEFT JOIN quality_pg_master_line g ON t.zj_mx_id = g.id
|
||||
LEFT JOIN base_procedure pr1 ON pr1.id = g.procedure_id
|
||||
left join system_users u on u.id = t.bg_user
|
||||
WHERE t.deleted = 0 AND t.tenant_id = 2 AND g.deleted = 0 AND g.tenant_id = 2
|
||||
AND pr1.deleted = 0 AND pr1.tenant_id = 2
|
||||
AND t.notification_status = #{queryType}
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT zj.id as id, g1.pg_number as code, g1.project_sub_name as projectSubName,
|
||||
zj.amount as amount, g1.amount as totalAmount, '终检' as typeName,
|
||||
zj.ent_time as createTime,u1.nickname as creatorName,g1.project_sub_number as projectSubCode,
|
||||
g1.project_name as projectName , '' as materialName, '' as blueprintNo, '' as procedureName
|
||||
FROM quality_zj_bg_master_line zj
|
||||
LEFT JOIN quality_zj_pg_master_line g1 ON zj.zj_mx_id = g1.id
|
||||
left join system_users u1 on u1.id = zj.bg_user
|
||||
WHERE zj.deleted = 0 AND zj.tenant_id = 2 AND g1.deleted = 0 AND g1.tenant_id = 2
|
||||
AND zj.notification_status = #{queryType}
|
||||
) gh
|
||||
ORDER BY gh.createTime DESC LIMIT #{offset}, #{limit}
|
||||
</select>
|
||||
</mapper>
|
@ -96,6 +96,12 @@
|
||||
"navigationBarTitleText": "过程检报工"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/pgMaster/components/showpicture",
|
||||
"style": {
|
||||
"navigationBarTitleText": "过程检图片"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/pgMaster/pgMaster-detail",
|
||||
"style": {
|
||||
|
@ -120,10 +120,10 @@ if (historyList.value.length) {
|
||||
id,
|
||||
}
|
||||
const data = await getTaskDetailAPI(params)
|
||||
if (data.beforeProcedureStatus == 0) {
|
||||
//如果上一道工序没结束
|
||||
isOverBeforeProcedure.value = true;
|
||||
}
|
||||
// if (data.beforeProcedureStatus == 0) {
|
||||
// //如果上一道工序没结束
|
||||
// isOverBeforeProcedure.value = true;
|
||||
// }
|
||||
data.startTime = formatDate(data.startTime, 'YYYY-MM-DD HH:mm');
|
||||
data.endTime = formatDate(data.endTime, 'YYYY-MM-DD HH:mm'); // 去掉了末尾的空格
|
||||
|
||||
@ -162,16 +162,13 @@ if (historyList.value.length) {
|
||||
try {
|
||||
const data = await postOperateAPI(params);
|
||||
console.log(data)
|
||||
console.log('ai')
|
||||
} catch (error) {
|
||||
console.log('meijinlai ')
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: error.data.msg,
|
||||
})
|
||||
} finally {
|
||||
console.log('jie')
|
||||
await getDetailData(detailInfo.value.id)
|
||||
await getData()
|
||||
const obj = historyList.value[0]
|
||||
@ -246,7 +243,7 @@ if (historyList.value.length) {
|
||||
</script>
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="isOverBeforeProcedure==true" class="data-detail">
|
||||
<view class="data-detail">
|
||||
<template v-if="!isLoading">
|
||||
<view class="module">
|
||||
<view class="module-info">
|
||||
|
118
mes-ui/mini-app/src/pages/pgMaster/components/showpicture.vue
Normal file
118
mes-ui/mini-app/src/pages/pgMaster/components/showpicture.vue
Normal file
@ -0,0 +1,118 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- <image v-for="(item, index) in src" :key="index" :src="item" @click="preview(item)" mode="aspectFill" @error="imageError"></image> -->
|
||||
<htz-image-upload v-model="src" :max="9" :remove="false" :add="false"></htz-image-upload>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, toRefs,nextTick,onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue'
|
||||
const title = ref('图片预览');
|
||||
const src = ref([]);
|
||||
const route = useRoute();
|
||||
const picture = ref('');
|
||||
const previewImage = ref(null);
|
||||
|
||||
const imageError = (event) => {
|
||||
console.error('Image load error:', event.detail.errMsg);
|
||||
};
|
||||
const preview = (url) => {
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$nextTick(()=>{
|
||||
previewImage.value.open(url);
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
previewImage.value.open(url);
|
||||
// #endif
|
||||
};
|
||||
|
||||
const onLongpress = e =>{
|
||||
console.log('当前长按的图片是' + e);
|
||||
uni.showActionSheet({
|
||||
itemList: ['转发给朋友', '保存到手机'],
|
||||
success: function (res) {
|
||||
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log(res.errMsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onLoad( (options) => {
|
||||
picture.value = options.picture;
|
||||
console.log(picture.value)
|
||||
if (picture.value) {
|
||||
try {
|
||||
var fileUrlList = decodeURIComponent(picture.value);
|
||||
src.value = JSON.parse(fileUrlList);
|
||||
console.log(src.value)
|
||||
} catch (error) {
|
||||
console.error('Error parsing picture data:', error);
|
||||
}
|
||||
}
|
||||
})
|
||||
// const previewImage = (index) => {
|
||||
// const urls = src.value.map(item => item.url);
|
||||
// uni.previewImage({
|
||||
// current: index,
|
||||
// urls: urls,
|
||||
// longPressActions: {
|
||||
// itemList: ['保存图片'],
|
||||
// success: (data) => {
|
||||
// saveImage(urls[data.index]);
|
||||
// },
|
||||
// fail: (err) => {
|
||||
// console.error(err);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
const saveImage = (url) => {
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: '图片保存成功',
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: '图片保存失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* ... other styles ... */
|
||||
.thumbnail-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
/* Other styles */
|
||||
}
|
||||
.thumbnail-wrapper {
|
||||
margin: 10px;
|
||||
/* Other styles */
|
||||
}
|
||||
.clickable-image {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
@ -1,56 +1,58 @@
|
||||
<script setup lang="ts">
|
||||
import { toRaw, ref, computed } from 'vue'
|
||||
import { formatDate } from '@/utils/index'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { useLoginStore } from '@/stores/modules/login'
|
||||
import { getTaskRepotPageAPI, getTaskDetailAPI, postOperateAPI,postOperateAPIEnd } from '@/services/pgMaster'
|
||||
const popup = ref<UniHelper.UniPopupInstance>()
|
||||
const userStore = useLoginStore()
|
||||
const dictInfo = userStore?.dictInfo || []
|
||||
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
|
||||
const userId = userStore.userInfo.userId
|
||||
|
||||
const isShowStart = computed(() => {
|
||||
let flag = true
|
||||
if (historyList.value.length) {
|
||||
const obj = historyList.value[0]
|
||||
if (!obj?.endTime) {
|
||||
flag = false
|
||||
}
|
||||
}
|
||||
// // 派工数量和总报工数量相等了就不展示开始生产
|
||||
// if (detailInfo.value.amount == detailInfo.value.totalReportAmount) {
|
||||
import { toRaw, ref, computed } from 'vue'
|
||||
import { formatDate } from '@/utils/index'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { useLoginStore } from '@/stores/modules/login'
|
||||
import { getTaskRepotPageAPI, getTaskDetailAPI, postOperateAPI, postOperateAPIEnd, validExceed } from '@/services/pgMaster'
|
||||
import { serviceDomain } from '@/services/constants'
|
||||
const popup = ref(null)
|
||||
const userStore = useLoginStore()
|
||||
const dictInfo = userStore?.dictInfo || []
|
||||
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
|
||||
const userId = userStore.userInfo.userId
|
||||
const isShowStart = ref(false)
|
||||
const isShowEnd = ref(false)
|
||||
// const isShowStart = computed(() => {
|
||||
// let flag = true
|
||||
// if (historyList.value.length) {
|
||||
// const obj = historyList.value[0]
|
||||
// if (!obj?.endTime) {
|
||||
// flag = false
|
||||
// }
|
||||
return flag
|
||||
})
|
||||
const isShowEnd = computed(() => {
|
||||
let flag = true
|
||||
if (historyList.value.length) {
|
||||
const obj = historyList.value[0]
|
||||
if (obj?.endTime) {
|
||||
flag = false
|
||||
}
|
||||
} else {
|
||||
flag = false
|
||||
}
|
||||
return flag
|
||||
})
|
||||
const productionTitle = ref('开始生产')
|
||||
const amount = ref('')
|
||||
const workTime = ref('')
|
||||
// 详情数据
|
||||
const detailInfo = ref({})
|
||||
let isLoading = ref(false)
|
||||
const historyList = ref([])
|
||||
const formObj = ref({})
|
||||
// 历史明细
|
||||
const getData = async () => {
|
||||
// }
|
||||
// // // 派工数量和总报工数量相等了就不展示开始生产
|
||||
// // if (detailInfo.value.amount == detailInfo.value.totalReportAmount) {
|
||||
// // flag = false
|
||||
// // }
|
||||
// return flag
|
||||
// })
|
||||
// const isShowEnd = computed(() => {
|
||||
// let flag = true
|
||||
// if (historyList.value.length) {
|
||||
// const obj = historyList.value[0]
|
||||
// if (obj?.endTime) {
|
||||
// flag = false
|
||||
// }
|
||||
// } else {
|
||||
// flag = false
|
||||
// }
|
||||
// return flag
|
||||
// })
|
||||
const productionTitle = ref('开始生产')
|
||||
const amount = ref('')
|
||||
const workTime = ref('')
|
||||
// 详情数据
|
||||
const detailInfo = ref({})
|
||||
let isLoading = ref(false)
|
||||
const historyList = ref([])
|
||||
const formObj = ref({})
|
||||
// 历史明细
|
||||
const getData = async () => {
|
||||
// 发送请求
|
||||
isLoading.value = true
|
||||
const params = {
|
||||
pageNo: 1,
|
||||
integerpageSize: 5,
|
||||
pageSize: 999,
|
||||
bgUser: userId,
|
||||
zjMxId: detailInfo.value.id,
|
||||
}
|
||||
@ -67,11 +69,34 @@ const getData = async () => {
|
||||
const leave1 = time % (24 * 3600 * 1000) //计算天数后剩余的毫秒数
|
||||
workTime.value = Math.floor(leave1 / (3600 * 1000))
|
||||
}
|
||||
|
||||
historyList.value = data.list
|
||||
isShowEnd.value = true;
|
||||
isShowStart.value = true
|
||||
if (historyList.value.length) {
|
||||
const obj = historyList.value[0]
|
||||
if (obj.amount != null && obj.amount >= 0) {
|
||||
isShowStart.value = true
|
||||
|
||||
} else {
|
||||
isShowStart.value = false
|
||||
}
|
||||
}
|
||||
if (historyList.value.length) {
|
||||
const obj = historyList.value[0]
|
||||
if (obj.amount != null && obj.amount >= 0) {
|
||||
isShowEnd.value = false
|
||||
} else {
|
||||
isShowEnd.value = true
|
||||
detailId.value = obj.id
|
||||
}
|
||||
} else {
|
||||
isShowEnd.value = false
|
||||
}
|
||||
isLoading.value = false
|
||||
}
|
||||
// 详情
|
||||
const getDetailData = async (id) => {
|
||||
}
|
||||
// 详情
|
||||
const getDetailData = async (id) => {
|
||||
// 发送请求
|
||||
// isLoading.value = true
|
||||
const params = {
|
||||
@ -87,8 +112,10 @@ const getDetailData = async (id) => {
|
||||
data.unit = lineObj.label
|
||||
detailInfo.value = data || {}
|
||||
isLoading.value = false
|
||||
}
|
||||
onLoad(async (options: any) => {
|
||||
}
|
||||
const idValue = ref();
|
||||
onLoad(async (options : any) => {
|
||||
idValue.value = options.id
|
||||
await getDetailData(options.id)
|
||||
await getData()
|
||||
const obj = historyList.value[0]
|
||||
@ -96,47 +123,160 @@ onLoad(async (options: any) => {
|
||||
if (obj && obj?.workTime == null && obj.endTime) {
|
||||
popup.value?.open()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// 生产完成
|
||||
const handleComplate = async () => {
|
||||
/* const params = {
|
||||
id: detailInfo.value?.id,
|
||||
active: 'FINISH',
|
||||
ownerId: userId,
|
||||
// 生产完成
|
||||
const handleComplate = async () => {
|
||||
try {
|
||||
isLoading.value = true;
|
||||
const params = {
|
||||
zjMxId: detailInfo.value?.id,
|
||||
bgUser: userId,
|
||||
type: 0,
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
}) */
|
||||
}
|
||||
// 提交报工
|
||||
const handleOk = async (active) => {
|
||||
if(amount.value>0&&workTime.value>0){
|
||||
const data = await postOperateAPIEnd(params)
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: error.data.msg,
|
||||
})
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
// const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}`
|
||||
// uni.redirectTo({
|
||||
// url,
|
||||
// })
|
||||
await initPage();
|
||||
const pages = getCurrentPages(); // 获取当前页面栈
|
||||
const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
uni.reLaunch({ url }); // 重新加载当前页面
|
||||
}
|
||||
}
|
||||
const validExceedOrNo = async () => {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 提交报工
|
||||
const handleOk = async () => {
|
||||
|
||||
|
||||
try {
|
||||
|
||||
if (isQua.value == 1) {
|
||||
//不合格判断图片
|
||||
if (!(imageDataType1.value != null && imageDataType1.value.length != 0)) {
|
||||
uni.showToast({
|
||||
title: '不符合必须上传图片!',
|
||||
icon: 'none', // 显示纯文本时icon设为none
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
}
|
||||
if (amount.value > 0 && workTime.value > 0) {
|
||||
var data = await validExceed(idValue.value, parseFloat(amount.value))
|
||||
if (data) {
|
||||
|
||||
uni.showModal({
|
||||
title: '总报工数量超出派工数量,请确认',
|
||||
confirmText: '确认',
|
||||
cancelText: '取消',
|
||||
success: async(res) => {
|
||||
|
||||
if (res.confirm) {
|
||||
const params = {
|
||||
zjMxId: detailInfo.value?.id,
|
||||
amount: amount.value,
|
||||
workTime: workTime.value,
|
||||
bgUser: userId,
|
||||
isRepre: isRepre.value,
|
||||
isQua: isQua.value,
|
||||
remark: remark.value
|
||||
}
|
||||
const data = await postOperateAPIEnd(params)
|
||||
const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
})
|
||||
if (isQua.value == 1) {
|
||||
await imgUpload()
|
||||
}
|
||||
const pages = getCurrentPages(); // 获取当前页面栈
|
||||
await initPage();
|
||||
const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
uni.reLaunch({ url }); // 重新加载当前页面
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
}else{
|
||||
const params = {
|
||||
zjMxId: detailInfo.value?.id,
|
||||
amount: amount.value,
|
||||
workTime: workTime.value,
|
||||
bgUser: userId,
|
||||
isRepre: isRepre.value,
|
||||
isQua: isQua.value,
|
||||
remark: remark.value
|
||||
}
|
||||
const data = await postOperateAPIEnd(params)
|
||||
if (isQua.value == 1) {
|
||||
await imgUpload()
|
||||
}
|
||||
const pages = getCurrentPages(); // 获取当前页面栈
|
||||
await initPage();
|
||||
const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
uni.reLaunch({ url }); // 重新加载当前页面
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '报工数量或报工时间必须大于0,请检查!',
|
||||
icon: 'none', // 显示纯文本时icon设为none
|
||||
duration: 2000
|
||||
duraltion: 2000
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: error.data.msg,
|
||||
})
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
// const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}`
|
||||
// uni.redirectTo({
|
||||
// url,
|
||||
// })
|
||||
// const pages = getCurrentPages(); // 获取当前页面栈
|
||||
// await initPage();
|
||||
// const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
// const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
// uni.reLaunch({ url }); // 重新加载当前页面
|
||||
|
||||
}
|
||||
// 开始生产
|
||||
const handleStart = async () => {
|
||||
// 发送请求
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
const quaRadio = [{
|
||||
text: ' ',
|
||||
value: 1
|
||||
}]
|
||||
const initPage = async () => {
|
||||
popup.value.close();
|
||||
await getDetailData(idValue.value)
|
||||
await getData()
|
||||
const obj = historyList.value[0]
|
||||
// 最新的报工是否完成
|
||||
if (obj && obj?.workTime == null && obj.endTime) {
|
||||
popup.value?.open()
|
||||
}
|
||||
}
|
||||
// 开始生产
|
||||
const handleStart = async () => {
|
||||
try {
|
||||
isLoading.value = true
|
||||
const params = {
|
||||
zjMxId: detailInfo.value?.id,
|
||||
@ -144,13 +284,31 @@ const handleStart = async () => {
|
||||
bgUser: userId,
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: error.data.msg,
|
||||
})
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
await initPage()
|
||||
|
||||
const pages = getCurrentPages(); // 获取当前页面栈
|
||||
const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
uni.reLaunch({ url }); // 重新加载当前页面
|
||||
// const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}`
|
||||
// uni.redirectTo({
|
||||
// url,
|
||||
// })
|
||||
}
|
||||
// 发送请求
|
||||
|
||||
|
||||
//popup.value.open();
|
||||
|
||||
|
||||
//popup.value?.open();
|
||||
/* const params = {
|
||||
id: detailInfo.value.id,
|
||||
active: 'START',
|
||||
@ -162,31 +320,143 @@ const handleStart = async () => {
|
||||
url,
|
||||
})
|
||||
productionTitle.value = '生产中' */
|
||||
}
|
||||
// 结束生产
|
||||
const handleStop = async () => {
|
||||
}
|
||||
|
||||
// 结束生产
|
||||
const handleStop = async () => {
|
||||
|
||||
//算时间和数量
|
||||
//算时间
|
||||
var lastIndex = historyList.value.length-1;
|
||||
var lastIndex = historyList.value.length - 1;
|
||||
var lastItem = historyList.value[lastIndex];
|
||||
console.log( historyList.value)
|
||||
console.log(historyList.value)
|
||||
workTime.value = Math.floor(Math.abs(lastItem.createTime - Date.now()) / (1000 * 60 * 60)).toString();
|
||||
//算数量
|
||||
if(historyList.value.length == 1){
|
||||
amount.value =detailInfo.value.amount;
|
||||
}else{
|
||||
if (historyList.value.length == 1) {
|
||||
amount.value = detailInfo.value.amount;
|
||||
} else {
|
||||
var beforeAmount = 0;
|
||||
for (var i = 0 ; i < historyList.value.length-1;i++){
|
||||
for (var i = 0; i < historyList.value.length - 1; i++) {
|
||||
beforeAmount += historyList.value[i].amount
|
||||
}
|
||||
var finalamount = detailInfo.value.amount -beforeAmount
|
||||
if(finalamount < 0){finalamount = 0}
|
||||
var finalamount = detailInfo.value.amount - beforeAmount
|
||||
if (finalamount < 0) { finalamount = 0 }
|
||||
amount.value = finalamount.toString();
|
||||
}
|
||||
popup.value.open();
|
||||
}
|
||||
popup.value?.open();
|
||||
}
|
||||
const thisDatas = ref([]);
|
||||
const imageDataType1 = ref([]);
|
||||
const choocessImag = (tempFilePaths, e) => {
|
||||
//console.log('ceshiChooseSuccessDataType1', tempFilePaths, e);
|
||||
var thisDatas = []
|
||||
tempFilePaths.forEach(item => {
|
||||
thisDatas.push({
|
||||
type: e,
|
||||
url: item
|
||||
})
|
||||
})
|
||||
imageDataType1.value.push(...thisDatas)
|
||||
};
|
||||
const imgDelete = (del, tempFilePaths) => {
|
||||
}
|
||||
const uploadImagFail = () => {
|
||||
}
|
||||
const isQua = ref();
|
||||
const isQuaTemp = ref([]);
|
||||
const isRepre = ref();
|
||||
const isRepreTemp = ref([]);
|
||||
const remark = ref('')
|
||||
const showUn = ref(false)
|
||||
const noQua = (e) => {
|
||||
console.log(e)
|
||||
if (e.detail.value == null || e.detail.value.length == 0) {
|
||||
//取消勾选 清空不符合描述和文件列表
|
||||
imageDataType1.value = []
|
||||
remark.value = ''
|
||||
showUn.value = false
|
||||
isQua.value = 0;
|
||||
} else {
|
||||
showUn.value = true
|
||||
isQua.value = 1;
|
||||
}
|
||||
}
|
||||
const perep = (e) => {
|
||||
if (!e) {
|
||||
//取消勾选 清空不符合描述和文件列表
|
||||
isRepre.value = 0
|
||||
} else {
|
||||
isRepre.value = 1
|
||||
}
|
||||
}
|
||||
const emit = defineEmits<{
|
||||
(event : 'close') : void
|
||||
}>()
|
||||
const imgUpload = async () => {
|
||||
const storage_token = uni.getStorageSync('storage_loginInfo')?.accessToken
|
||||
const token = userStore.userInfo?.accessToken || storage_token
|
||||
//console.log('imgUpload', tempFilePaths)
|
||||
let uploadImgs = [];
|
||||
imageDataType1.value.forEach(item => {
|
||||
console.log(item)
|
||||
uploadImgs.push(new Promise((resolve, reject) => {
|
||||
uni.showLoading({
|
||||
title: '上传中'
|
||||
});
|
||||
//console.log(index, item)
|
||||
uni.uploadFile({
|
||||
url: serviceDomain + "/admin-api/heli/unqualified-notification/createWx",
|
||||
filePath: item.url,
|
||||
name: 'file',
|
||||
header: {
|
||||
id: detailId.value,
|
||||
Authorization: token,
|
||||
'Tenant-Id': 2,
|
||||
'type':2,
|
||||
},
|
||||
success: async (uploadFileRes) => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '提交完成!',
|
||||
icon: 'none', // 显示纯文本时icon设为none
|
||||
duration: 2000
|
||||
});
|
||||
await initPage()
|
||||
popup.value.close();
|
||||
|
||||
},
|
||||
fail: async (err) => {
|
||||
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '提交失败!',
|
||||
icon: 'none', // 显示纯文本时icon设为none
|
||||
duration: 2000
|
||||
});
|
||||
await initPage()
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
}))
|
||||
})
|
||||
// Promise.all(uploadImgs) //执行所有需请求的接口
|
||||
// .then((results) => {
|
||||
// uni.hideLoading();
|
||||
// })
|
||||
// .catch((res, object) => {
|
||||
// uni.hideLoading();
|
||||
// });
|
||||
}
|
||||
const showpicture = (pictureArray : []) => {
|
||||
let picture = JSON.stringify(pictureArray);
|
||||
console.log(picture)
|
||||
uni.navigateTo({
|
||||
url: './components/showpicture?picture=' + encodeURIComponent(picture)
|
||||
});
|
||||
}
|
||||
const detailId = ref()
|
||||
</script>
|
||||
<template>
|
||||
<view class="data-detail">
|
||||
@ -194,10 +464,12 @@ const handleStop = async () => {
|
||||
<view class="module">
|
||||
<view class="module-info">
|
||||
<view class="product-item">项目:{{detailInfo.projectName}}</view>
|
||||
<image src="/static/images/productionReport-page.png" class="product-img" mode="scaleToFill"></image>
|
||||
<image src="/static/images/productionReport-page.png" class="product-img" mode="scaleToFill">
|
||||
</image>
|
||||
<view :class="[detailInfo.pgType == 1 ? 'had' : 'unhad', 'product-status']">{{
|
||||
detailInfo.pgType == 1 ? '已完成' : '未完成' }}</view>
|
||||
<view class="product-item">子项目:{{ detailInfo.projectSubCode || '' }} {{' ' + detailInfo.projectSubName }}
|
||||
<view class="product-item">子项目:{{ detailInfo.projectSubCode || '' }}
|
||||
{{' ' + detailInfo.projectSubName }}
|
||||
</view>
|
||||
<view class="product-item">零件名称:{{detailInfo.materialName}}</view>
|
||||
<view class="product-item">图号:{{ detailInfo.blueprintNo }}</view>
|
||||
@ -223,9 +495,9 @@ const handleStop = async () => {
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="product-item">预计生产日期:{{ detailInfo.startTime }} ~ {{ detailInfo.entTime }}</view> -->
|
||||
<view class="finish" v-if="isShowStart && detailInfo.procedureStatus !== 2 && detailInfo.totalWorkTime"
|
||||
@click="handleComplate">
|
||||
<image class="complate-img" src="/static/images/productionReport-detail-complate.png" mode="scaleToFill" />
|
||||
<view class="finish" v-if="isShowStart && historyList.length &&detailInfo.pgType != 1" @click="handleComplate">
|
||||
<image class="complate-img" src="/static/images/productionReport-detail-complate.png"
|
||||
mode="scaleToFill" />
|
||||
生产完成
|
||||
</view>
|
||||
</view>
|
||||
@ -257,8 +529,30 @@ const handleStop = async () => {
|
||||
<view class="val high-color">{{ item.amount }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="product-row">
|
||||
<view class="row-item">
|
||||
<view class="label">是否复检:</view>
|
||||
<view class="val high-color">{{ item.isRepre == 0 ? '是':'否' }}</view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<view class="label">是否合格:</view>
|
||||
<view class="val high-color">{{ item.isQua == 0?'合格':'不合格' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.remark" class="product-item">异常描述:{{ item.remark }}</view>
|
||||
|
||||
<view v-if="item.fileUrlList">
|
||||
<htz-image-upload v-model="item.fileUrlList" :max="9" :remove="false"
|
||||
:add="false"></htz-image-upload>
|
||||
|
||||
<!-- <text class="blue" @click="showpicture(item.fileUrlList)">查看图片</text> -->
|
||||
</view>
|
||||
<view v-if="!item.fileUrlList">
|
||||
<text class="red">暂无图片</text>
|
||||
</view>
|
||||
<view class="tip-index">
|
||||
<image src="/static/images/productionReport-detail-index.png" class="icon-status" mode="scaleToFit">
|
||||
<image src="/static/images/productionReport-detail-index.png" class="icon-status"
|
||||
mode="scaleToFit">
|
||||
</image>
|
||||
<view class="text">{{historyList.length - index}}</view>
|
||||
</view>
|
||||
@ -268,8 +562,8 @@ const handleStop = async () => {
|
||||
</view>
|
||||
</view>
|
||||
<view class="action" v-if="detailInfo.pgType !== 1">
|
||||
<view class="action-item start" v-if="detailInfo.active != 'START'" @click="handleStart">开始报工</view>
|
||||
<view class="action-item stop" v-if="detailInfo.active == 'START'" @click="handleStop">结束报工</view>
|
||||
<view class="action-item start" v-if="isShowStart" @click="handleStart">开始生产</view>
|
||||
<view class="action-item stop" v-if="isShowEnd" @click="handleStop">结束生产</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="loading-text" v-else>加载中..</view>
|
||||
@ -278,33 +572,57 @@ const handleStop = async () => {
|
||||
<view class="text">填写信息</view>
|
||||
<!-- <view class="close" @click="handleClose">X</view> -->
|
||||
</view>
|
||||
<scroll-view scroll-y="true" style="height: 100%;">
|
||||
<view class="cont">
|
||||
<!-- <view class="item">
|
||||
<view class="label">过程检开始时间:</view>
|
||||
<view class="val">{{ formObj.startTime }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label">过程检结束时间:</view>
|
||||
<view class="val">{{ formObj.endTime }}</view>
|
||||
</view> -->
|
||||
<!---0-否 1是 -->
|
||||
<view class="label" style="display: flex;">复检:
|
||||
<uni-data-checkbox multiple @change="e => perep(e)" v-model="isRepreTemp"
|
||||
:localdata="quaRadio" />
|
||||
|
||||
</view>
|
||||
<view class="label" style="text-align: right;">不合格:</view>
|
||||
<uni-data-checkbox @change="e => noQua(e)" multiple v-model="isQuaTemp" :localdata="quaRadio" />
|
||||
|
||||
</view>
|
||||
|
||||
<view class="item">
|
||||
<view class="label"><span class="star">*</span>本次报工工时:</view>
|
||||
<uni-easyinput class="val" type="digit" v-model="workTime" placeholder="请输入本次报工工时"></uni-easyinput>
|
||||
<uni-easyinput class="val" type="digit" v-model="workTime"
|
||||
placeholder="请输入本次报工工时"></uni-easyinput>
|
||||
<view class="unit">小时</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label"><span class="star">*</span>本次报工数量:</view>
|
||||
<uni-easyinput class="val" type="number" v-model="amount" placeholder="请输入本次报工数量"></uni-easyinput>
|
||||
<uni-easyinput class="val" type="number" v-model="amount"
|
||||
placeholder="请输入本次报工数量"></uni-easyinput>
|
||||
<view class="unit"> {{ detailInfo.unit }}</view>
|
||||
</view>
|
||||
<view v-if="showUn" class="item">
|
||||
<view class="label">异常描述:</view>
|
||||
<uni-easyinput type="textarea" v-model="remark" placeholder="请输入情况描述" />
|
||||
|
||||
</view>
|
||||
<view v-if="showUn" class="item">
|
||||
<view class="label"><span class="star">*</span>图片上传:</view>
|
||||
<htz-image-upload v-model="imageDataType1" mediaType="image" :sourceType="['album','camera']"
|
||||
:max="19" :compress="true" :quality="80" :remove="true" :dataType="1" @imgDelete="imgDelete"
|
||||
@uploadFail="uploadImagFail" @chooseSuccess="choocessImag"></htz-image-upload>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="ok" @click="handleOk">确定</view>
|
||||
</uni-popup>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss">
|
||||
// 订单列表
|
||||
.data-detail {
|
||||
// 订单列表
|
||||
.blue {
|
||||
color: #409EFF;
|
||||
}
|
||||
|
||||
.data-detail {
|
||||
border-radius: 10rpx;
|
||||
padding-bottom: 200rpx;
|
||||
|
||||
@ -336,10 +654,12 @@ const handleStop = async () => {
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
padding: 8rpx 12rpx;
|
||||
|
||||
&.had {
|
||||
background: #E8FFEA;
|
||||
color: #00B42A;
|
||||
}
|
||||
|
||||
&.unhad {
|
||||
background: #FFF7E8;
|
||||
color: #FF7D00;
|
||||
@ -377,6 +697,7 @@ const handleStop = async () => {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.finish {
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
@ -390,6 +711,7 @@ const handleStop = async () => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.complate-img {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
@ -431,10 +753,12 @@ const handleStop = async () => {
|
||||
|
||||
.product-item {
|
||||
margin: 10rpx 0;
|
||||
|
||||
.hight-color {
|
||||
color: #00B42A;
|
||||
}
|
||||
}
|
||||
|
||||
.product-row {
|
||||
margin: 20rpx 0;
|
||||
display: flex;
|
||||
@ -446,8 +770,10 @@ const handleStop = async () => {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.label {
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
&.high-color {
|
||||
color: #00B42A
|
||||
}
|
||||
@ -463,15 +789,18 @@ const handleStop = async () => {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.tip-index {
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
|
||||
.icon-status {
|
||||
width: 100rpx;
|
||||
height: 72rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
@ -580,6 +909,7 @@ const handleStop = async () => {
|
||||
.label {
|
||||
font-size: 32rpx;
|
||||
width: 260rpx;
|
||||
|
||||
.star {
|
||||
color: red
|
||||
}
|
||||
@ -589,6 +919,7 @@ const handleStop = async () => {
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.unit {
|
||||
width: 100rpx;
|
||||
margin-left: 4rpx;
|
||||
@ -596,7 +927,16 @@ const handleStop = async () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no {
|
||||
font-size: 32rpx;
|
||||
margin: 20rpx auto 80rpx;
|
||||
text-align: center;
|
||||
width: 200rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 8rpx 0;
|
||||
background-color: red;
|
||||
color: #fff;
|
||||
}
|
||||
.ok {
|
||||
font-size: 32rpx;
|
||||
margin: 20rpx auto 80rpx;
|
||||
@ -608,5 +948,5 @@ const handleStop = async () => {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -121,10 +121,10 @@
|
||||
id,
|
||||
}
|
||||
const data = await getTaskDetailAPI(params)
|
||||
if (data.beforeProcedureStatus == 0) {
|
||||
//如果上一道工序没结束
|
||||
isOverBeforeProcedure.value = true;
|
||||
}
|
||||
// if (data.beforeProcedureStatus == 0) {
|
||||
// //如果上一道工序没结束
|
||||
// isOverBeforeProcedure.value = true;
|
||||
// }
|
||||
if ("Y"==data.isOutsourcing){
|
||||
workTime.value=data.estimatedPrice
|
||||
}
|
||||
@ -157,13 +157,25 @@
|
||||
try {
|
||||
const data = await postOperateAPI(params);
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: error.data.msg,
|
||||
})
|
||||
} finally {
|
||||
await getDetailData(detailInfo.value.id)
|
||||
await getData()
|
||||
const obj = historyList.value[0]
|
||||
// 最新的报工是否完成
|
||||
if (obj && obj?.workTime == null && obj.endTime) {
|
||||
popupShow.value = true
|
||||
}
|
||||
isLoading.value = false;
|
||||
}
|
||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
})
|
||||
// const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
// uni.redirectTo({
|
||||
// url,
|
||||
// })
|
||||
}
|
||||
// 提交报工
|
||||
const handleOk = async (active) => {
|
||||
@ -174,10 +186,15 @@
|
||||
workTime: workTime.value,
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
})
|
||||
const pages = getCurrentPages(); // 获取当前页面栈
|
||||
const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
uni.reLaunch({ url }); // 重新加载当前页面
|
||||
|
||||
// const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
// uni.redirectTo({
|
||||
// url,
|
||||
// })
|
||||
}
|
||||
// 开始生产
|
||||
const handleStart = async () => {
|
||||
@ -187,12 +204,15 @@
|
||||
ownerId: userId
|
||||
}
|
||||
productionTitle.value = '生产中';
|
||||
console.log(detailInfo.value)
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
})
|
||||
const pages = getCurrentPages(); // 获取当前页面栈
|
||||
const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
uni.reLaunch({ url }); // 重新加载当前页面
|
||||
// const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
// uni.redirectTo({
|
||||
// url,
|
||||
// })
|
||||
}
|
||||
const popupShow = ref(false)
|
||||
const productionTitle = ref('开始生产')
|
||||
@ -214,7 +234,7 @@
|
||||
</script>
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="isOverBeforeProcedure==true" class="data-detail">
|
||||
<view class="data-detail">
|
||||
<template v-if="!isLoading">
|
||||
<view class="module">
|
||||
<view class="module-info">
|
||||
|
@ -30,7 +30,8 @@ const isLoading = ref(false)
|
||||
const queryParams: Required<any> = {
|
||||
pageNo: 1,
|
||||
pageSize: 5,
|
||||
creator: userId,
|
||||
queryType: parseFloat(props.orderState) +1 ,
|
||||
// creator: userId,
|
||||
minCreateTime: '',
|
||||
maxCreateTime: ''
|
||||
}
|
||||
@ -43,6 +44,7 @@ const getListData = async () => {
|
||||
}
|
||||
isLoading.value = true
|
||||
// 发送请求
|
||||
|
||||
const data = await getNotificationPageAPI(queryParams)
|
||||
isLoading.value = false
|
||||
data.list.forEach((e) => {
|
||||
@ -116,12 +118,12 @@ const showpicture= (pictureArray:[])=>{
|
||||
@refresherrefresh="onRefresherrefresh" @scrolltolower="getListData">
|
||||
<view class="item" v-for="item in dataList" :key="item.id">
|
||||
<view class="hd">
|
||||
<view class="num">异常通知单:</view>
|
||||
<view class="num">检验单据:</view>
|
||||
<view class="statusLabel">(单号:{{ item.code }})</view>
|
||||
</view>
|
||||
<view class="md">
|
||||
|
||||
<view class="product-item">项目:<text class="blue">{{ item.projectCode + ' ' + item.projectName }}</text>
|
||||
<view class="product-item">项目:<text class="blue">{{ item.projectName}}</text>
|
||||
</view>
|
||||
<view class="product-item">通知日期:<text class="">{{ item.createTime }}</text></view>
|
||||
|
||||
@ -130,18 +132,26 @@ const showpicture= (pictureArray:[])=>{
|
||||
<view class="label">质检员:<text class="blue">{{ item.creatorName }}</text></view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<view class="label">类型:<text class="blue">{{ item.type }}</text></view>
|
||||
<view class="label">类型:<text class="blue">{{ item.typeName }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="product-row">
|
||||
<view class="row-item">
|
||||
<view class="label">检查数量:<text class="blue">{{ item.amount }}</text></view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<view class="label">派工总数量:<text class="blue">{{ item.totalAmount }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="product-item">子项目:<text class="blue">{{ item.projectSubCode || '' }} {{' ' +
|
||||
item.projectSubName }}</text></view>
|
||||
<!-- <view class="product-item">客户名称:<text class="blue">{{ item.customerName }}</text></view> -->
|
||||
<view v-if="item.fileUrlList && item.fileUrlList.length>0">
|
||||
<!-- <view v-if="item.fileUrlList && item.fileUrlList.length>0">
|
||||
<text class="blue" @click="showpicture(item.fileUrlList)">查看图片</text>
|
||||
</view>
|
||||
<view v-if="!item.fileUrlList">
|
||||
<text class="red">暂无图片</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="product-item">零件名称:<text class="blue">{{ item.materialName }}</text></view>
|
||||
<view class="product-row">
|
||||
<view class="row-item">
|
||||
|
@ -6,8 +6,8 @@ import detailPanel from './components/detailPanel.vue'
|
||||
const childRef = ref(null);
|
||||
// tabs 数据
|
||||
const orderTabs = ref([
|
||||
{ orderState: '0', title: '近三个月', isRender: false },
|
||||
{ orderState: '1', title: '三个月前', isRender: false },
|
||||
{ orderState: '0', title: '未审批', isRender: false },
|
||||
{ orderState: '1', title: '已审批', isRender: false },
|
||||
])
|
||||
// 高亮下标
|
||||
const activeIndex = ref(0)
|
||||
|
@ -117,19 +117,6 @@ const onRefresherrefresh = async () => {
|
||||
// 关闭动画
|
||||
isTriggered.value = false
|
||||
}
|
||||
// const searchVal = ref('')
|
||||
// const dataListDefault = ref([])
|
||||
// const handleSearch = async () => {
|
||||
// const code = searchVal.value
|
||||
// if (code) {
|
||||
// dataListDefault.value = dataList.value
|
||||
// dataList.value = dataList.value.filter((e) => {
|
||||
// return e.code == code
|
||||
// })
|
||||
// } else {
|
||||
// dataList.value = dataListDefault.value
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
<template>
|
||||
<view class="cont">
|
||||
|
@ -1,51 +1,53 @@
|
||||
<script setup lang="ts">
|
||||
import { toRaw, ref, computed } from 'vue'
|
||||
import { formatDate } from '@/utils/index'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { useLoginStore } from '@/stores/modules/login'
|
||||
import { getTaskRepotPageAPI, getTaskDetailAPI, postOperateAPI,postOperateAPIEnd } from '@/services/zjPgMaster'
|
||||
const popup = ref<UniHelper.UniPopupInstance>()
|
||||
const userStore = useLoginStore()
|
||||
const dictInfo = userStore?.dictInfo || []
|
||||
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
|
||||
const userId = userStore.userInfo.userId
|
||||
|
||||
const isShowStart = computed(() => {
|
||||
let flag = true
|
||||
if (historyList.value.length) {
|
||||
const obj = historyList.value[0]
|
||||
if (!obj?.endTime) {
|
||||
flag = false
|
||||
}
|
||||
}
|
||||
// // 派工数量和总报工数量相等了就不展示开始生产
|
||||
// if (detailInfo.value.amount == detailInfo.value.totalReportAmount) {
|
||||
import { toRaw, ref, computed } from 'vue'
|
||||
import { formatDate } from '@/utils/index'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { useLoginStore } from '@/stores/modules/login'
|
||||
import { getTaskRepotPageAPI, getTaskDetailAPI, postOperateAPI, postOperateAPIEnd, validExceed } from '@/services/zjPgMaster'
|
||||
import { serviceDomain } from '@/services/constants'
|
||||
const popup = ref<UniHelper.UniPopupInstance>()
|
||||
const userStore = useLoginStore()
|
||||
const dictInfo = userStore?.dictInfo || []
|
||||
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
|
||||
const userId = userStore.userInfo.userId
|
||||
const isShowStart = ref(false)
|
||||
const isShowEnd = ref(false)
|
||||
// const isShowStart = computed(() => {
|
||||
// let flag = true
|
||||
// if (historyList.value.length) {
|
||||
// const obj = historyList.value[0]
|
||||
// if (!obj?.endTime) {
|
||||
// flag = false
|
||||
// }
|
||||
return flag
|
||||
})
|
||||
const isShowEnd = computed(() => {
|
||||
let flag = true
|
||||
if (historyList.value.length) {
|
||||
const obj = historyList.value[0]
|
||||
if (obj?.endTime) {
|
||||
flag = false
|
||||
}
|
||||
} else {
|
||||
flag = false
|
||||
}
|
||||
return flag
|
||||
})
|
||||
const productionTitle = ref('开始生产')
|
||||
const amount = ref('')
|
||||
const workTime = ref('')
|
||||
// 详情数据
|
||||
const detailInfo = ref({})
|
||||
let isLoading = ref(false)
|
||||
const historyList = ref([])
|
||||
const formObj = ref({})
|
||||
// 历史明细
|
||||
const getData = async () => {
|
||||
// }
|
||||
// // // 派工数量和总报工数量相等了就不展示开始生产
|
||||
// // if (detailInfo.value.amount == detailInfo.value.totalReportAmount) {
|
||||
// // flag = false
|
||||
// // }
|
||||
// return flag
|
||||
// })
|
||||
// const isShowEnd = computed(() => {
|
||||
// let flag = true
|
||||
// if (historyList.value.length) {
|
||||
// const obj = historyList.value[0]
|
||||
// if (obj?.endTime) {
|
||||
// flag = false
|
||||
// }
|
||||
// } else {
|
||||
// flag = false
|
||||
// }
|
||||
// return flag
|
||||
// })
|
||||
const productionTitle = ref('开始生产')
|
||||
const amount = ref('')
|
||||
const workTime = ref('')
|
||||
// 详情数据
|
||||
const detailInfo = ref({})
|
||||
let isLoading = ref(false)
|
||||
const historyList = ref([])
|
||||
const formObj = ref({})
|
||||
// 历史明细
|
||||
const getData = async () => {
|
||||
// 发送请求
|
||||
isLoading.value = true
|
||||
const params = {
|
||||
@ -68,10 +70,33 @@ const getData = async () => {
|
||||
workTime.value = Math.floor(leave1 / (3600 * 1000))
|
||||
}
|
||||
historyList.value = data.list
|
||||
isShowEnd.value = true;
|
||||
isShowStart.value = true
|
||||
if (historyList.value.length) {
|
||||
const obj = historyList.value[0]
|
||||
if (obj.amount != null && obj.amount >= 0) {
|
||||
isShowStart.value = true
|
||||
|
||||
} else {
|
||||
isShowStart.value = false
|
||||
}
|
||||
}
|
||||
if (historyList.value.length) {
|
||||
const obj = historyList.value[0]
|
||||
if (obj.amount != null && obj.amount >= 0) {
|
||||
isShowEnd.value = false
|
||||
} else {
|
||||
isShowEnd.value = true
|
||||
detailId.value = obj.id
|
||||
}
|
||||
} else {
|
||||
isShowEnd.value = false
|
||||
}
|
||||
isLoading.value = false
|
||||
}
|
||||
// 详情
|
||||
const getDetailData = async (id) => {
|
||||
isLoading.value = false
|
||||
}
|
||||
// 详情
|
||||
const getDetailData = async (id) => {
|
||||
// 发送请求
|
||||
// isLoading.value = true
|
||||
const params = {
|
||||
@ -87,8 +112,10 @@ const getDetailData = async (id) => {
|
||||
data.unit = lineObj.label
|
||||
detailInfo.value = data || {}
|
||||
isLoading.value = false
|
||||
}
|
||||
onLoad(async (options: any) => {
|
||||
}
|
||||
const idValue = ref()
|
||||
onLoad(async (options : any) => {
|
||||
idValue.value = options.id
|
||||
await getDetailData(options.id)
|
||||
await getData()
|
||||
const obj = historyList.value[0]
|
||||
@ -96,103 +123,315 @@ onLoad(async (options: any) => {
|
||||
if (obj && obj?.workTime == null && obj.endTime) {
|
||||
popup.value?.open()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// 生产完成
|
||||
const handleComplate = async () => {
|
||||
/* const params = {
|
||||
id: detailInfo.value?.id,
|
||||
active: 'FINISH',
|
||||
ownerId: userId,
|
||||
// 生产完成
|
||||
const handleComplate = async () => {
|
||||
try {
|
||||
isLoading.value = true;
|
||||
const params = {
|
||||
zjMxId: detailInfo.value?.id,
|
||||
bgUser: userId,
|
||||
type: 0,
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
}) */
|
||||
}
|
||||
// 提交报工
|
||||
const handleOk = async (active) => {
|
||||
if(amount.value>0&&workTime.value>0){
|
||||
const data = await postOperateAPIEnd(params)
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: error.data.msg,
|
||||
})
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
// const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}`
|
||||
// uni.redirectTo({
|
||||
// url,
|
||||
// })
|
||||
await initPage();
|
||||
const pages = getCurrentPages(); // 获取当前页面栈
|
||||
const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
uni.reLaunch({ url }); // 重新加载当前页面
|
||||
}
|
||||
}
|
||||
|
||||
// 提交报工
|
||||
const handleOk = async (active) => {
|
||||
try {
|
||||
|
||||
if (isQua.value == 1) {
|
||||
//不合格判断图片
|
||||
if (!(imageDataType1.value != null && imageDataType1.value.length != 0)) {
|
||||
uni.showToast({
|
||||
title: '不符合必须上传图片!',
|
||||
icon: 'none', // 显示纯文本时icon设为none
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
}
|
||||
if (amount.value > 0 && workTime.value > 0) {
|
||||
var data = await validExceed(idValue.value, parseFloat(amount.value))
|
||||
if (data) {
|
||||
|
||||
uni.showModal({
|
||||
title: '总报工数量超出派工数量,请确认',
|
||||
confirmText: '确认',
|
||||
cancelText: '取消',
|
||||
success: async (res) => {
|
||||
|
||||
if (res.confirm) {
|
||||
const params = {
|
||||
zjMxId: detailInfo.value?.id,
|
||||
amount: amount.value,
|
||||
workTime: workTime.value,
|
||||
bgUser: userId,
|
||||
isRepre: isRepre.value,
|
||||
isQua: isQua.value,
|
||||
remark: remark.value
|
||||
}
|
||||
const data = await postOperateAPIEnd(params)
|
||||
const url = `/pages/zjPgMaster/zjPgMaster-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
})
|
||||
}else{
|
||||
if (isQua.value == 1) {
|
||||
await imgUpload()
|
||||
}
|
||||
const pages = getCurrentPages(); // 获取当前页面栈
|
||||
await initPage();
|
||||
const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
uni.reLaunch({ url }); // 重新加载当前页面
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
} else {
|
||||
const params = {
|
||||
zjMxId: detailInfo.value?.id,
|
||||
amount: amount.value,
|
||||
workTime: workTime.value,
|
||||
bgUser: userId,
|
||||
isRepre: isRepre.value,
|
||||
isQua: isQua.value,
|
||||
remark: remark.value
|
||||
}
|
||||
const data = await postOperateAPIEnd(params)
|
||||
if (isQua.value == 1) {
|
||||
await imgUpload()
|
||||
}
|
||||
const pages = getCurrentPages(); // 获取当前页面栈
|
||||
await initPage();
|
||||
const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
uni.reLaunch({ url }); // 重新加载当前页面
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '报工数量或报工时间必须大于0,请检查!',
|
||||
icon: 'none', // 显示纯文本时icon设为none
|
||||
duration: 2000
|
||||
duraltion: 2000
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: error.data.msg,
|
||||
})
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
// const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}`
|
||||
// uni.redirectTo({
|
||||
// url,
|
||||
// })
|
||||
// const pages = getCurrentPages(); // 获取当前页面栈
|
||||
// await initPage();
|
||||
// const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
// const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
// uni.reLaunch({ url }); // 重新加载当前页面
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// 开始生产
|
||||
const handleStart = async () => {
|
||||
isLoading.value = true;
|
||||
|
||||
}
|
||||
const quaRadio = [{
|
||||
text: ' ',
|
||||
value: 1
|
||||
}]
|
||||
const initPage = async () => {
|
||||
popup.value.close();
|
||||
await getDetailData(idValue.value)
|
||||
await getData()
|
||||
const obj = historyList.value[0]
|
||||
// 最新的报工是否完成
|
||||
if (obj && obj?.workTime == null && obj.endTime) {
|
||||
popup.value?.open()
|
||||
}
|
||||
}
|
||||
// 开始生产
|
||||
const handleStart = async () => {
|
||||
try {
|
||||
isLoading.value = true
|
||||
const params = {
|
||||
zjMxId: detailInfo.value?.id,
|
||||
workTime: workTime.value,
|
||||
bgUser: userId,
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/zjPgMaster/zjPgMaster-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: error.data.msg,
|
||||
})
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
await initPage()
|
||||
|
||||
/* const params = {
|
||||
id: detailInfo.value.id,
|
||||
active: 'START',
|
||||
ownerId: userId,
|
||||
const pages = getCurrentPages(); // 获取当前页面栈
|
||||
const currentPage = pages[pages.length - 1]; // 当前页面
|
||||
const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;
|
||||
uni.reLaunch({ url }); // 重新加载当前页面
|
||||
// const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}`
|
||||
// uni.redirectTo({
|
||||
// url,
|
||||
// })
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
})
|
||||
productionTitle.value = '生产中' */
|
||||
}
|
||||
// 结束生产
|
||||
const handleStop = async () => {
|
||||
}
|
||||
// 结束生产
|
||||
const handleStop = async () => {
|
||||
// var lastIndex = historyList.value.length-1;
|
||||
var lastItem = historyList.value[0];
|
||||
console.log(historyList.value)
|
||||
workTime.value = Math.floor(Math.abs(lastItem.createTime - Date.now()) / (1000 * 60 * 60)).toString();
|
||||
//算数量
|
||||
if(historyList.value.length == 1){
|
||||
if (historyList.value.length == 1) {
|
||||
amount.value = detailInfo.value.amount;
|
||||
}else{
|
||||
} else {
|
||||
var beforeAmount = 0;
|
||||
for (var i = historyList.value.length-1 ; i >0;i--){
|
||||
console.log( historyList.value[i])
|
||||
for (var i = historyList.value.length - 1; i > 0; i--) {
|
||||
console.log(historyList.value[i])
|
||||
beforeAmount += historyList.value[i].amount
|
||||
}
|
||||
var finalamount = detailInfo.value.amount -beforeAmount
|
||||
if(finalamount < 0){finalamount = 0}
|
||||
var finalamount = detailInfo.value.amount - beforeAmount
|
||||
if (finalamount < 0) { finalamount = 0 }
|
||||
amount.value = finalamount.toString();
|
||||
}
|
||||
popup.value.open();
|
||||
/* const params = {
|
||||
id: detailInfo.value?.id,
|
||||
active: 'END',
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
const thisDatas = ref([]);
|
||||
const imageDataType1 = ref([]);
|
||||
const choocessImag = (tempFilePaths, e) => {
|
||||
//console.log('ceshiChooseSuccessDataType1', tempFilePaths, e);
|
||||
var thisDatas = []
|
||||
tempFilePaths.forEach(item => {
|
||||
thisDatas.push({
|
||||
type: e,
|
||||
url: item
|
||||
})
|
||||
popup.value?.open() */
|
||||
}
|
||||
})
|
||||
imageDataType1.value.push(...thisDatas)
|
||||
};
|
||||
const imgDelete = (del, tempFilePaths) => {
|
||||
}
|
||||
const uploadImagFail = () => {
|
||||
}
|
||||
const isQua = ref();
|
||||
const isQuaTemp = ref([]);
|
||||
const isRepre = ref();
|
||||
const isRepreTemp = ref([]);
|
||||
const remark = ref('')
|
||||
const showUn = ref(false)
|
||||
const noQua = (e) => {
|
||||
console.log(e)
|
||||
if (e.detail.value == null || e.detail.value.length == 0) {
|
||||
//取消勾选 清空不符合描述和文件列表
|
||||
imageDataType1.value = []
|
||||
remark.value = ''
|
||||
showUn.value = false
|
||||
isQua.value = 0;
|
||||
} else {
|
||||
showUn.value = true
|
||||
isQua.value = 1;
|
||||
}
|
||||
}
|
||||
const perep = (e) => {
|
||||
if (!e) {
|
||||
//取消勾选 清空不符合描述和文件列表
|
||||
isRepre.value = 0
|
||||
} else {
|
||||
isRepre.value = 1
|
||||
}
|
||||
}
|
||||
const emit = defineEmits<{
|
||||
(event : 'close') : void
|
||||
}>()
|
||||
const imgUpload = async () => {
|
||||
const storage_token = uni.getStorageSync('storage_loginInfo')?.accessToken
|
||||
const token = userStore.userInfo?.accessToken || storage_token
|
||||
//console.log('imgUpload', tempFilePaths)
|
||||
let uploadImgs = [];
|
||||
imageDataType1.value.forEach(item => {
|
||||
console.log(item)
|
||||
uploadImgs.push(new Promise((resolve, reject) => {
|
||||
uni.showLoading({
|
||||
title: '上传中'
|
||||
});
|
||||
//console.log(index, item)
|
||||
uni.uploadFile({
|
||||
url: serviceDomain + "/admin-api/heli/unqualified-notification/createWx",
|
||||
filePath: item.url,
|
||||
name: 'file',
|
||||
header: {
|
||||
id: detailId.value,
|
||||
Authorization: token,
|
||||
'Tenant-Id': 2,
|
||||
'type': 2,
|
||||
},
|
||||
success: async (uploadFileRes) => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '提交完成!',
|
||||
icon: 'none', // 显示纯文本时icon设为none
|
||||
duration: 2000
|
||||
});
|
||||
await initPage()
|
||||
popup.value.close();
|
||||
|
||||
},
|
||||
fail: async (err) => {
|
||||
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '提交失败!',
|
||||
icon: 'none', // 显示纯文本时icon设为none
|
||||
duration: 2000
|
||||
});
|
||||
await initPage()
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
}))
|
||||
})
|
||||
// Promise.all(uploadImgs) //执行所有需请求的接口
|
||||
// .then((results) => {
|
||||
// uni.hideLoading();
|
||||
// })
|
||||
// .catch((res, object) => {
|
||||
// uni.hideLoading();
|
||||
// });
|
||||
}
|
||||
const showpicture = (pictureArray : []) => {
|
||||
let picture = JSON.stringify(pictureArray);
|
||||
console.log(picture)
|
||||
uni.navigateTo({
|
||||
url: './components/showpicture?picture=' + encodeURIComponent(picture)
|
||||
});
|
||||
}
|
||||
const detailId = ref()
|
||||
</script>
|
||||
<template>
|
||||
<view class="data-detail">
|
||||
@ -200,10 +439,12 @@ const handleStop = async () => {
|
||||
<view class="module">
|
||||
<view class="module-info">
|
||||
<view class="product-item">项目:{{detailInfo.projectName}}</view>
|
||||
<image src="/static/images/productionReport-page.png" class="product-img" mode="scaleToFill"></image>
|
||||
<image src="/static/images/productionReport-page.png" class="product-img" mode="scaleToFill">
|
||||
</image>
|
||||
<view :class="[detailInfo.pgType == 1 ? 'had' : 'unhad', 'product-status']">{{
|
||||
detailInfo.pgType == 1 ? '已完成' : '未完成' }}</view>
|
||||
<view class="product-item">子项目:{{ detailInfo.projectSubCode || '' }} {{' ' + detailInfo.projectSubName }}
|
||||
<view class="product-item">子项目:{{ detailInfo.projectSubCode || '' }}
|
||||
{{' ' + detailInfo.projectSubName }}
|
||||
</view>
|
||||
<view class="product-item">模具名称:{{detailInfo.mouldName}}</view>
|
||||
<view class="product-row">
|
||||
@ -229,9 +470,10 @@ const handleStop = async () => {
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="product-item">预计生产日期:{{ detailInfo.startTime }} ~ {{ detailInfo.entTime }}</view> -->
|
||||
<view class="finish" v-if="isShowStart && detailInfo.procedureStatus !== 2 && detailInfo.totalWorkTime"
|
||||
<view class="finish" v-if="isShowStart && historyList.length &&detailInfo.pgType != 1"
|
||||
@click="handleComplate">
|
||||
<image class="complate-img" src="/static/images/productionReport-detail-complate.png" mode="scaleToFill" />
|
||||
<image class="complate-img" src="/static/images/productionReport-detail-complate.png"
|
||||
mode="scaleToFill" />
|
||||
生产完成
|
||||
</view>
|
||||
</view>
|
||||
@ -263,8 +505,29 @@ const handleStop = async () => {
|
||||
<view class="val high-color">{{ item.amount }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="product-row">
|
||||
<view class="row-item">
|
||||
<view class="label">是否复检:</view>
|
||||
<view class="val high-color">{{ item.isRepre == 0 ? '是':'否' }}</view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<view class="label">是否合格:</view>
|
||||
<view class="val high-color">{{ item.isQua == 0?'合格':'不合格' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.fileUrlList">
|
||||
<htz-image-upload v-model="item.fileUrlList" :max="9" :remove="false"
|
||||
:add="false"></htz-image-upload>
|
||||
|
||||
<!-- <text class="blue" @click="showpicture(item.fileUrlList)">查看图片</text> -->
|
||||
</view>
|
||||
<view v-if="item.remark" class="product-item">异常描述:{{ item.remark }}</view>
|
||||
<view v-if="!item.fileUrlList">
|
||||
<text class="red">暂无图片</text>
|
||||
</view>
|
||||
<view class="tip-index">
|
||||
<image src="/static/images/productionReport-detail-index.png" class="icon-status" mode="scaleToFit">
|
||||
<image src="/static/images/productionReport-detail-index.png" class="icon-status"
|
||||
mode="scaleToFit">
|
||||
</image>
|
||||
<view class="text">{{historyList.length - index}}</view>
|
||||
</view>
|
||||
@ -274,8 +537,8 @@ const handleStop = async () => {
|
||||
</view>
|
||||
</view>
|
||||
<view class="action" v-if="detailInfo.pgType !== 1">
|
||||
<view class="action-item start" v-if="detailInfo.active != 'START'" @click="handleStart">开始报工</view>
|
||||
<view class="action-item stop" v-if="detailInfo.active == 'START'" @click="handleStop">结束报工</view>
|
||||
<view class="action-item start" v-if="isShowStart" @click="handleStart">开始生产</view>
|
||||
<view class="action-item stop" v-if="isShowEnd" @click="handleStop">结束生产</view>
|
||||
<!-- <view class="action-item start" v-if="detailInfo.pgType !== 1" @click="handleStart">终检报工</view>
|
||||
<view class="action-item stop" v-if="isShowEnd" @click="handleStop">结束生产</view> -->
|
||||
</view>
|
||||
@ -286,33 +549,53 @@ const handleStop = async () => {
|
||||
<view class="text">填写信息</view>
|
||||
<!-- <view class="close" @click="handleClose">X</view> -->
|
||||
</view>
|
||||
<scroll-view scroll-y="true" style="height: 100%;">
|
||||
|
||||
<view class="cont">
|
||||
<!-- <view class="item">
|
||||
<view class="label">终检开始时间:</view>
|
||||
<view class="val">{{ formObj.startTime }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label">终检结束时间:</view>
|
||||
<view class="val">{{ formObj.endTime }}</view>
|
||||
</view> -->
|
||||
<!---0-否 1是 -->
|
||||
<view class="label" style="display: flex;">复检:
|
||||
<uni-data-checkbox multiple @change="e => perep(e)" v-model="isRepreTemp"
|
||||
:localdata="quaRadio" />
|
||||
|
||||
</view>
|
||||
<view class="label" style="text-align: right;">不合格:</view>
|
||||
<uni-data-checkbox @change="e => noQua(e)" multiple v-model="isQuaTemp" :localdata="quaRadio" />
|
||||
|
||||
</view>
|
||||
|
||||
<view class="item">
|
||||
<view class="label"><span class="star">*</span>本次报工工时:</view>
|
||||
<uni-easyinput class="val" type="digit" v-model="workTime" placeholder="请输入本次报工工时"></uni-easyinput>
|
||||
<uni-easyinput class="val" type="digit" v-model="workTime"
|
||||
placeholder="请输入本次报工工时"></uni-easyinput>
|
||||
<view class="unit">小时</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label"><span class="star">*</span>本次报工数量:</view>
|
||||
<uni-easyinput class="val" type="number" v-model="amount" placeholder="请输入本次报工数量"></uni-easyinput>
|
||||
<uni-easyinput class="val" type="number" v-model="amount"
|
||||
placeholder="请输入本次报工数量"></uni-easyinput>
|
||||
<view class="unit"> {{ detailInfo.unit }}</view>
|
||||
</view>
|
||||
<view v-if="showUn" class="item">
|
||||
<view class="label">异常描述:</view>
|
||||
<uni-easyinput type="textarea" v-model="remark" placeholder="请输入情况描述" />
|
||||
|
||||
</view>
|
||||
<view v-if="showUn" class="item">
|
||||
<view class="label"><span class="star">*</span>图片上传:</view>
|
||||
<htz-image-upload v-model="imageDataType1" mediaType="image" :sourceType="['album','camera']"
|
||||
:max="19" :compress="true" :quality="80" :remove="true" :dataType="1" @imgDelete="imgDelete"
|
||||
@uploadFail="uploadImagFail" @chooseSuccess="choocessImag"></htz-image-upload>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="ok" @click="handleOk">确定</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss">
|
||||
// 订单列表
|
||||
.data-detail {
|
||||
// 订单列表
|
||||
.data-detail {
|
||||
border-radius: 10rpx;
|
||||
padding-bottom: 200rpx;
|
||||
|
||||
@ -344,10 +627,12 @@ const handleStop = async () => {
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
padding: 8rpx 12rpx;
|
||||
|
||||
&.had {
|
||||
background: #E8FFEA;
|
||||
color: #00B42A;
|
||||
}
|
||||
|
||||
&.unhad {
|
||||
background: #FFF7E8;
|
||||
color: #FF7D00;
|
||||
@ -385,6 +670,7 @@ const handleStop = async () => {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.finish {
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
@ -398,6 +684,7 @@ const handleStop = async () => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.complate-img {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
@ -439,10 +726,12 @@ const handleStop = async () => {
|
||||
|
||||
.product-item {
|
||||
margin: 10rpx 0;
|
||||
|
||||
.hight-color {
|
||||
color: #00B42A;
|
||||
}
|
||||
}
|
||||
|
||||
.product-row {
|
||||
margin: 20rpx 0;
|
||||
display: flex;
|
||||
@ -454,8 +743,10 @@ const handleStop = async () => {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.label {
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
&.high-color {
|
||||
color: #00B42A
|
||||
}
|
||||
@ -471,15 +762,18 @@ const handleStop = async () => {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.tip-index {
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
|
||||
.icon-status {
|
||||
width: 100rpx;
|
||||
height: 72rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
@ -588,6 +882,7 @@ const handleStop = async () => {
|
||||
.label {
|
||||
font-size: 32rpx;
|
||||
width: 260rpx;
|
||||
|
||||
.star {
|
||||
color: red
|
||||
}
|
||||
@ -597,6 +892,7 @@ const handleStop = async () => {
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.unit {
|
||||
width: 100rpx;
|
||||
margin-left: 4rpx;
|
||||
@ -616,5 +912,5 @@ const handleStop = async () => {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -86,3 +86,15 @@ export const postOperateAPIZF = (id: Number) => {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 操作生产任务-作废
|
||||
*/
|
||||
export const validExceed = (id: Number,amount:Number) => {
|
||||
return http<any[]>({
|
||||
method: 'GET',
|
||||
url: '/heli/bg-master-line/validExceed?id='+id+'&amount='+amount,
|
||||
|
||||
})
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import { http } from '@/utils/http'
|
||||
export const getNotificationPageAPI = (data: Object) => {
|
||||
return http<any[]>({
|
||||
method: 'GET',
|
||||
url: '/heli/unqualified-notification/page',
|
||||
url: '/heli/unqualified-notification/pageWx',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
@ -71,3 +71,13 @@ export const postOperateAPIZF = (id: number) => {
|
||||
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 操作生产任务-作废
|
||||
*/
|
||||
export const validExceed = (id: Number,amount:Number) => {
|
||||
return http<any[]>({
|
||||
method: 'GET',
|
||||
url: '/heli/zj-bg-master-line/validExceed?id='+id+'&amount='+amount,
|
||||
|
||||
})
|
||||
}
|
||||
|
BIN
mes-ui/mini-app/src/static/images/unqualifiedNotification.jpeg
Normal file
BIN
mes-ui/mini-app/src/static/images/unqualifiedNotification.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 383 KiB |
Loading…
Reference in New Issue
Block a user