过程检app报工界面增加;过程检报工和终检报工作废功能添加
This commit is contained in:
parent
e2b651ce0a
commit
52e80f2739
@ -98,7 +98,8 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode TASK_DISPATCH_NOT_EXISTS = new ErrorCode(1_009_001, "派工单不存在");
|
||||
ErrorCode TASK_REPORT_NOT_EXISTS = new ErrorCode(1_009_002, "任务报工不存在");
|
||||
ErrorCode TASK_REPORT_PARAMS_ERROR = new ErrorCode(1_009_003, "报工数量或报工工时不能为空");
|
||||
ErrorCode TASK_REPORT_PARAMS_ERRORS = new ErrorCode(1_009_003, "报工数量超出派工数量");
|
||||
ErrorCode TASK_REPORT_PARAMS_ERRORS = new ErrorCode(1_009_007, "报工数量超出派工数量");
|
||||
ErrorCode TASK_REPORT_PARAMS_ERRORSZF = new ErrorCode(1_009_008, "已经报工不允许作废");
|
||||
ErrorCode TASK_DISPATCH_TASK_NOT_EXISTS = new ErrorCode(1_009_004, "任务不存在或已完成");
|
||||
ErrorCode TASK_DISPATCH_TASK_NO_PERMISSION_FOR_OPERATE = new ErrorCode(1_009_005, "任务不满足操作条件");
|
||||
ErrorCode TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS = new ErrorCode(1_009_006, "无法超额报工");
|
||||
|
@ -2,6 +2,7 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.pgmaster;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo.PlanSubRespVO;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchDetailPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.zjpgmaster.vo.ZjPgMasterSaveReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||
@ -45,6 +46,8 @@ public class PgMasterController {
|
||||
private PgMasterService pgMasterService;
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/getBomMx")
|
||||
@Operation(summary = "查询BOM明细")
|
||||
@Parameter(name = "names", description = "负责人", required = true)
|
||||
@ -55,6 +58,13 @@ public class PgMasterController {
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/zfPgMaster")
|
||||
@Operation(summary = "作废过程检验派工单")
|
||||
@PreAuthorize("@ss.hasPermission('heli:pg-master:create')")
|
||||
public CommonResult<Integer> zfPgMaster(@Valid @RequestBody PgMasterSaveReqVO createReqVO) {
|
||||
return success(pgMasterService.zfPgMaster(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建质量过程检派工单主")
|
||||
@PreAuthorize("@ss.hasPermission('heli:pg-master:create')")
|
||||
|
@ -104,4 +104,7 @@ public class PgMasterLinePageReqVO extends PageParam {
|
||||
@Schema(description = "总报工工时")
|
||||
private BigDecimal workTime;
|
||||
|
||||
@Schema(description = "派工状态")
|
||||
private Integer dispatchStatus;
|
||||
|
||||
}
|
@ -1,95 +1,98 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.zjbgmasterline.ZjBgMasterLineService;
|
||||
|
||||
@Tag(name = "管理后台 - 终检报工")
|
||||
@RestController
|
||||
@RequestMapping("/heli/zj-bg-master-line")
|
||||
@Validated
|
||||
public class ZjBgMasterLineController {
|
||||
|
||||
@Resource
|
||||
private ZjBgMasterLineService zjBgMasterLineService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建终检报工")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:create')")
|
||||
public CommonResult<Integer> createZjBgMasterLine(@Valid @RequestBody ZjBgMasterLineSaveReqVO createReqVO) {
|
||||
return success(zjBgMasterLineService.createZjBgMasterLine(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新终检报工")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:update')")
|
||||
public CommonResult<Boolean> updateZjBgMasterLine(@Valid @RequestBody ZjBgMasterLineSaveReqVO updateReqVO) {
|
||||
zjBgMasterLineService.updateZjBgMasterLine(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@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) {
|
||||
zjBgMasterLineService.deleteZjBgMasterLine(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@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) {
|
||||
ZjBgMasterLineDO zjBgMasterLine = zjBgMasterLineService.getZjBgMasterLine(id);
|
||||
return success(BeanUtils.toBean(zjBgMasterLine, ZjBgMasterLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得终检报工分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:query')")
|
||||
public CommonResult<PageResult<ZjBgMasterLineRespVO>> getZjBgMasterLinePage(@Valid ZjBgMasterLinePageReqVO pageReqVO) {
|
||||
PageResult<ZjBgMasterLineDO> pageResult = zjBgMasterLineService.getZjBgMasterLinePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ZjBgMasterLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出终检报工 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportZjBgMasterLineExcel(@Valid ZjBgMasterLinePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ZjBgMasterLineDO> list = zjBgMasterLineService.getZjBgMasterLinePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "终检报工.xls", "数据", ZjBgMasterLineRespVO.class,
|
||||
BeanUtils.toBean(list, ZjBgMasterLineRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.zjbgmasterline.ZjBgMasterLineService;
|
||||
|
||||
@Tag(name = "管理后台 - 终检报工")
|
||||
@RestController
|
||||
@RequestMapping("/heli/zj-bg-master-line")
|
||||
@Validated
|
||||
public class ZjBgMasterLineController {
|
||||
|
||||
@Resource
|
||||
private ZjBgMasterLineService zjBgMasterLineService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建终检报工")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:create')")
|
||||
public CommonResult<Integer> createZjBgMasterLine(@Valid @RequestBody ZjBgMasterLineSaveReqVO createReqVO) {
|
||||
return success(zjBgMasterLineService.createZjBgMasterLine(createReqVO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新终检报工")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:update')")
|
||||
public CommonResult<Boolean> updateZjBgMasterLine(@Valid @RequestBody ZjBgMasterLineSaveReqVO updateReqVO) {
|
||||
zjBgMasterLineService.updateZjBgMasterLine(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@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) {
|
||||
zjBgMasterLineService.deleteZjBgMasterLine(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@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) {
|
||||
ZjBgMasterLineDO zjBgMasterLine = zjBgMasterLineService.getZjBgMasterLine(id);
|
||||
return success(BeanUtils.toBean(zjBgMasterLine, ZjBgMasterLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得终检报工分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:query')")
|
||||
public CommonResult<PageResult<ZjBgMasterLineRespVO>> getZjBgMasterLinePage(@Valid ZjBgMasterLinePageReqVO pageReqVO) {
|
||||
PageResult<ZjBgMasterLineDO> pageResult = zjBgMasterLineService.getZjBgMasterLinePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ZjBgMasterLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出终检报工 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-bg-master-line:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportZjBgMasterLineExcel(@Valid ZjBgMasterLinePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ZjBgMasterLineDO> list = zjBgMasterLineService.getZjBgMasterLinePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "终检报工.xls", "数据", ZjBgMasterLineRespVO.class,
|
||||
BeanUtils.toBean(list, ZjBgMasterLineRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,4 +40,6 @@ public class ZjBgMasterLinePageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private BigDecimal[] workTime;
|
||||
|
||||
|
||||
|
||||
}
|
@ -52,6 +52,13 @@ public class ZjPgMasterController {
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/zfZjPgMaster")
|
||||
@Operation(summary = "作废终检派工单")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-pg-master:create')")
|
||||
public CommonResult<Integer> zfZjPgMaster(@Valid @RequestBody ZjPgMasterSaveReqVO createReqVO) {
|
||||
return success(zjPgMasterService.zfZjPgMaster(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建质量终检派工单主")
|
||||
@PreAuthorize("@ss.hasPermission('heli:zj-pg-master:create')")
|
||||
|
@ -70,4 +70,8 @@ public class ZjPgMasterLinePageReqVO extends PageParam {
|
||||
@Schema(description = "模具名称", example = "芋艿")
|
||||
private String mouldName;
|
||||
|
||||
|
||||
@Schema(description = "派工状态", example = "1-2-3")
|
||||
private Integer dispatchStatus;
|
||||
|
||||
}
|
@ -119,6 +119,11 @@ public class PgMasterLineDO extends BaseDO {
|
||||
*/
|
||||
private Integer pgType;
|
||||
|
||||
/**
|
||||
* 是否完成 0未完成 1已完成
|
||||
*/
|
||||
private Integer dispatchStatus;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String pgNumber;
|
||||
|
||||
|
@ -91,6 +91,11 @@ public class ZjPgMasterLineDO extends BaseDO {
|
||||
*/
|
||||
private String mouldName;
|
||||
|
||||
/**
|
||||
* 派工状态 已保存|已提交|已终止 1|2|3
|
||||
*/
|
||||
private Integer dispatchStatus;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String pgNumber;
|
||||
|
||||
|
@ -68,6 +68,8 @@ public interface PgMasterLineMapper extends BaseMapperX<PgMasterLineDO> {
|
||||
|
||||
query.eq(reqVO.getDetilUser() != null, PgMasterLineDO::getDetilUser, reqVO.getDetilUser())
|
||||
.eq(reqVO.getPgType() != null, PgMasterLineDO::getPgType, reqVO.getPgType())
|
||||
.eq(reqVO.getDispatchStatus() != null, PgMasterLineDO::getDispatchStatus, reqVO.getDispatchStatus())
|
||||
|
||||
|
||||
;
|
||||
|
||||
|
@ -19,6 +19,8 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.*;
|
||||
@Mapper
|
||||
public interface ZjBgMasterLineMapper extends BaseMapperX<ZjBgMasterLineDO> {
|
||||
|
||||
|
||||
|
||||
default PageResult<ZjBgMasterLineDO> selectPage(ZjBgMasterLinePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ZjBgMasterLineDO>()
|
||||
.betweenIfPresent(ZjBgMasterLineDO::getCreateTime, reqVO.getCreateTime())
|
||||
|
@ -61,6 +61,7 @@ public interface ZjPgMasterLineMapper extends BaseMapperX<ZjPgMasterLineDO> {
|
||||
|
||||
query.eq(reqVO.getDetilUser() != null, ZjPgMasterLineDO::getDetilUser, reqVO.getDetilUser())
|
||||
.eq(reqVO.getPgType() != null, ZjPgMasterLineDO::getPgType, reqVO.getPgType())
|
||||
.eq(reqVO.getDispatchStatus()!=null,ZjPgMasterLineDO::getDispatchStatus, reqVO.getDispatchStatus())
|
||||
|
||||
;
|
||||
|
||||
|
@ -17,6 +17,13 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatch
|
||||
*/
|
||||
public interface PgMasterService {
|
||||
|
||||
/**
|
||||
* 创建质量过程检派工单主
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer zfPgMaster(@Valid PgMasterSaveReqVO createReqVO);
|
||||
/**
|
||||
* 创建质量过程检派工单主
|
||||
*
|
||||
|
@ -1,9 +1,13 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.pgmaster;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchDetailPageReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjpgmaster.ZjPgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.bgmasterline.BgMasterLineMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.pgmaster.PgMasterLineMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.TaskDispatchTypeEnum;
|
||||
@ -37,6 +41,9 @@ import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||
@Validated
|
||||
public class PgMasterServiceImpl implements PgMasterService {
|
||||
|
||||
@Resource
|
||||
private BgMasterLineMapper bgMasterLineMapper;
|
||||
|
||||
@Resource
|
||||
private PgMasterMapper pgMasterMapper;
|
||||
@Resource
|
||||
@ -78,6 +85,27 @@ public class PgMasterServiceImpl implements PgMasterService {
|
||||
return pgMasterLineDOList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer zfPgMaster(PgMasterSaveReqVO createReqVO) {
|
||||
|
||||
//作废先判断是否已经报工
|
||||
BgMasterLineDO bgMasterLineDO = bgMasterLineMapper.selectSum(createReqVO.getId());
|
||||
|
||||
//判断是否有报工数量
|
||||
if(bgMasterLineDO != null){
|
||||
//已报工的情况下返回,不允许作废
|
||||
throw exception(TASK_REPORT_PARAMS_ERRORSZF);
|
||||
}else{
|
||||
//没有报工的情况下执行作废
|
||||
PgMasterLineDO pgMasterLineDO = pgMasterLineMapper.selectById(createReqVO.getId());
|
||||
pgMasterLineDO.setDispatchStatus(3);
|
||||
int a = pgMasterLineMapper.updateById(pgMasterLineDO);
|
||||
// 返回
|
||||
return a;
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer createPgMaster(PgMasterSaveReqVO createReqVO) {
|
||||
|
@ -1,55 +1,57 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.zjbgmasterline;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 终检报工 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface ZjBgMasterLineService {
|
||||
|
||||
/**
|
||||
* 创建终检报工
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createZjBgMasterLine(@Valid ZjBgMasterLineSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新终检报工
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateZjBgMasterLine(@Valid ZjBgMasterLineSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除终检报工
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteZjBgMasterLine(Integer id);
|
||||
|
||||
/**
|
||||
* 获得终检报工
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 终检报工
|
||||
*/
|
||||
ZjBgMasterLineDO getZjBgMasterLine(Integer id);
|
||||
|
||||
/**
|
||||
* 获得终检报工分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 终检报工分页
|
||||
*/
|
||||
PageResult<ZjBgMasterLineDO> getZjBgMasterLinePage(ZjBgMasterLinePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
package com.chanko.yunxi.mes.module.heli.service.zjbgmasterline;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.zjbgmasterline.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 终检报工 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface ZjBgMasterLineService {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 创建终检报工
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createZjBgMasterLine(@Valid ZjBgMasterLineSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新终检报工
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateZjBgMasterLine(@Valid ZjBgMasterLineSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除终检报工
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteZjBgMasterLine(Integer id);
|
||||
|
||||
/**
|
||||
* 获得终检报工
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 终检报工
|
||||
*/
|
||||
ZjBgMasterLineDO getZjBgMasterLine(Integer id);
|
||||
|
||||
/**
|
||||
* 获得终检报工分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 终检报工分页
|
||||
*/
|
||||
PageResult<ZjBgMasterLineDO> getZjBgMasterLinePage(ZjBgMasterLinePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
|
@ -43,6 +43,8 @@ public class ZjBgMasterLineServiceImpl implements ZjBgMasterLineService {
|
||||
private ZjPgMasterLineMapper zjPgMasterLineMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Integer createZjBgMasterLine(ZjBgMasterLineSaveReqVO createReqVO) {
|
||||
|
||||
|
@ -19,6 +19,13 @@ import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
*/
|
||||
public interface ZjPgMasterService {
|
||||
|
||||
/**
|
||||
* 作废
|
||||
*
|
||||
* @param createReqVO 作废
|
||||
* @return 编号
|
||||
*/
|
||||
Integer zfZjPgMaster(@Valid ZjPgMasterSaveReqVO createReqVO);
|
||||
/**
|
||||
* 创建质量终检派工单主
|
||||
*
|
||||
|
@ -6,8 +6,10 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjbgmasterline.ZjBgMasterLineDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.mouldtype.MouldTypeMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.plan.PlanMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.zjbgmasterline.ZjBgMasterLineMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.TaskDispatchTypeEnum;
|
||||
import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -39,6 +41,9 @@ import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||
@Validated
|
||||
public class ZjPgMasterServiceImpl implements ZjPgMasterService {
|
||||
|
||||
@Resource
|
||||
private ZjBgMasterLineMapper zjBgMasterLineMapper;
|
||||
|
||||
@Resource
|
||||
private ZjPgMasterMapper zjPgMasterMapper;
|
||||
@Resource
|
||||
@ -93,6 +98,29 @@ public class ZjPgMasterServiceImpl implements ZjPgMasterService {
|
||||
return zjPgMasterLineDOList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer zfZjPgMaster(ZjPgMasterSaveReqVO createReqVO) {
|
||||
//作废先判断是否已经报工
|
||||
ZjBgMasterLineDO zjBgMasterLineDOS = zjBgMasterLineMapper.selectSum(createReqVO.getId());
|
||||
|
||||
//判断是否有报工数量
|
||||
if(zjBgMasterLineDOS != null){
|
||||
//已报工的情况下返回,不允许作废
|
||||
throw exception(TASK_REPORT_PARAMS_ERRORSZF);
|
||||
}else{
|
||||
//没有报工的情况下执行作废
|
||||
ZjPgMasterLineDO zjPgMasterLineDO = zjPgMasterLineMapper.selectById(createReqVO.getId());
|
||||
zjPgMasterLineDO.setDispatchStatus(3);
|
||||
int a = zjPgMasterLineMapper.updateById(zjPgMasterLineDO);
|
||||
// 返回
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer createZjPgMaster(ZjPgMasterSaveReqVO createReqVO) {
|
||||
|
@ -78,6 +78,18 @@
|
||||
"navigationBarTitleText": "报工详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/pgMaster/pgMaster",
|
||||
"style": {
|
||||
"navigationBarTitleText": "过程检报工"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/pgMaster/pgMaster-detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "报工详情"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/my/my",
|
||||
|
@ -51,7 +51,7 @@ const categoryList = ref([
|
||||
imgUrl: "/static/images/zhongjian.png",
|
||||
defaultImgUrl: "/static/images/assembleReport-default.png"
|
||||
},
|
||||
])
|
||||
])
|
||||
const loginStore = useLoginStore()
|
||||
const isLogin = computed(() => {
|
||||
const accessToken = loginStore.userInfo?.accessToken
|
||||
|
448
mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue
Normal file
448
mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue
Normal file
@ -0,0 +1,448 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, computed, ref } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { getListAPI, getDictAPI,postOperateAPIZF } from '@/services/pgMaster'
|
||||
import { useLoginStore } from '@/stores/modules/login'
|
||||
import { formatDate } from '@/utils/index'
|
||||
|
||||
const userStore = useLoginStore()
|
||||
const userId = userStore.userInfo.userId
|
||||
|
||||
// 是否分页结束
|
||||
const isFinish = ref(false)
|
||||
// 是否触发下拉刷新
|
||||
const isTriggered = ref(false)
|
||||
// 定义 porps
|
||||
const props = defineProps<{
|
||||
orderState: string
|
||||
}>()
|
||||
|
||||
const statusText = computed(() => {
|
||||
const text = props.orderState == '0,1' ? '处理' : '查看'
|
||||
return text
|
||||
})
|
||||
// 是否加载中标记,用于防止滚动触底触发多次请求
|
||||
const isLoading = ref(false)
|
||||
// 请求参数
|
||||
const queryParams: Required<any> = {
|
||||
pageNo: 1,
|
||||
pageSize: 5,
|
||||
detilUser: userId,
|
||||
//
|
||||
pgType: 0,
|
||||
// 工序完成状态列表
|
||||
dispatchType: "ASSEMBLE",
|
||||
// 派工类型
|
||||
isReport: 1,
|
||||
// 是否需要报工
|
||||
dispatchStatus:2
|
||||
}
|
||||
const dataList = ref([])
|
||||
const getListData = async () => {
|
||||
console.log("props.orderState");
|
||||
console.log(props.orderState);
|
||||
queryParams.pgType = props.orderState;
|
||||
// 如果数据出于加载中,退出函数
|
||||
if (isLoading.value) return
|
||||
if (isFinish.value === true) {
|
||||
return uni.showToast({ icon: 'none', title: '没有更多数据~' })
|
||||
}
|
||||
isLoading.value = true
|
||||
// 发送请求
|
||||
const data = await getListAPI(queryParams)
|
||||
isLoading.value = false
|
||||
data.list.forEach((e) => {
|
||||
e.orderTime = formatDate(e.orderTime, 'YYYY-MM-DD')
|
||||
e.startTime = formatDate(e.startTime, 'YYYY-MM-DD')
|
||||
e.entTime = formatDate(e.entTime, 'YYYY-MM-DD')
|
||||
})
|
||||
// 数组追加
|
||||
dataList.value.push(...data.list)
|
||||
// 分页条件
|
||||
if (queryParams.pageNo < data.total) {
|
||||
// 页码累加
|
||||
queryParams.pageNo++
|
||||
} else {
|
||||
// 分页已结束
|
||||
isFinish.value = true
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getListData()
|
||||
})
|
||||
|
||||
onShow(async () => {
|
||||
isFinish.value = false
|
||||
isLoading.value = false
|
||||
queryParams.pageNo = 1
|
||||
dataList.value = []
|
||||
await getListData()
|
||||
})
|
||||
|
||||
const viewClick = async (item) => {
|
||||
const params = {
|
||||
id: item.id
|
||||
};
|
||||
const data = await postOperateAPIZF(params);
|
||||
console.log('返回数据');
|
||||
console.log(data.id);
|
||||
console.log(data);
|
||||
if(data >0){
|
||||
const url = `/pages/pgMaster/pgMaster`
|
||||
uni.navigateTo({ url })
|
||||
}
|
||||
};
|
||||
|
||||
const handleDetail = (item) => {
|
||||
const url = `/pages/pgMaster/pgMaster-detail?id=${item.id}`
|
||||
uni.navigateTo({ url })
|
||||
}
|
||||
|
||||
// 自定义下拉刷新被触发
|
||||
const onRefresherrefresh = async () => {
|
||||
// 开始动画
|
||||
isTriggered.value = true
|
||||
// 重置数据
|
||||
queryParams.pageNo = 1
|
||||
dataList.value = []
|
||||
isFinish.value = false
|
||||
// 加载数据
|
||||
await getListData()
|
||||
// 关闭动画
|
||||
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">
|
||||
<!-- <view class="search" v-if="dataList.length > 5">
|
||||
<view class="title"></view>
|
||||
<input class="uni-input" v-model="searchVal" @change="handleSearch" placeholder="根据编号搜索" />
|
||||
</view> -->
|
||||
<scroll-view enable-back-to-top scroll-y class="data-list" refresher-enabled :refresher-triggered="isTriggered"
|
||||
@refresherrefresh="onRefresherrefresh" @scrolltolower="getListData">
|
||||
<view class="item" v-for="item in dataList" :key="item.id" >
|
||||
<view class="hd">
|
||||
<view class="num">派工单:</view>
|
||||
<view class="statusLabel">( 单号:{{ item.pgNumber }} )</view>
|
||||
<view class="statusLabelzf" @click="viewClick(item)" v-if="item.pgType == 0" >
|
||||
作废
|
||||
</view>
|
||||
</view>
|
||||
<view class="md">
|
||||
<view class="product-item">项目名称:{{ item.projectName }}</view>
|
||||
<view class="product-item">子项目:{{ item.projectSubCode || '' }} {{' ' + item.projectSubName }}</view>
|
||||
<view class="product-item">模型名称:{{ item.mouldName }}</view>
|
||||
<!-- <view class="product-row">
|
||||
<view class="row-item">
|
||||
<view class="label">模型名称: {{ item.mouldName }}</view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<view class="label">派工工序: {{ item.procedureName }}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="product-row">
|
||||
<view class="row-item">
|
||||
<view class="label">派工数量</view>
|
||||
<view class="val">{{item.amount}}</view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<view class="label">总报工数量</view>
|
||||
<view class="val high-color">{{item.amounts}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="product-row">
|
||||
<!-- <view class="row-item">
|
||||
<view class="label">预计工时</view>
|
||||
<view class="val">{{ item.gongShi }}</view>
|
||||
</view> -->
|
||||
<view class="row-item">
|
||||
<view class="label">总报工工时</view>
|
||||
<view class="val high-color">{{ item.workTime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="product-item">预计生产日期:{{ item.startTime }} ~ {{ item.entTime }}</view>
|
||||
</view>
|
||||
<view class="statusText" @click="handleDetail(item)">{{ statusText }}</view>
|
||||
</view>
|
||||
<!-- 底部提示文字 -->
|
||||
<view class="loading-text" :style="{ paddingBottom: safeAreaInsets?.bottom + 'px' }">
|
||||
{{ isFinish ? '没有更多数据~' : '正在加载...' }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
// 订单列表
|
||||
.search {
|
||||
padding: 4rpx;
|
||||
width: 80%;
|
||||
margin: 30rpx auto;
|
||||
|
||||
.uni-input {
|
||||
border: 1px solid #D1D6DB;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding: 4rpx 10rpx;
|
||||
font-size: 32rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.data-list {
|
||||
height: 90vh;
|
||||
.item {
|
||||
position: relative;
|
||||
padding: 20rpx 0;
|
||||
margin: 20rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.hd {
|
||||
padding: 10rpx;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
|
||||
.statusLabel {
|
||||
font-size: 24rpx;
|
||||
color: #737D88;
|
||||
}
|
||||
.statusLabelzf {
|
||||
font-size: 24rpx;
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 15rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
background: linear-gradient(149deg, #ffff00 4%, #cfcf00 98%);
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.md {
|
||||
position: relative;
|
||||
padding: 10rpx;
|
||||
min-height: 100rpx;
|
||||
font-size: 28rpx;
|
||||
border-top: 2rpx solid #F2F2F2;
|
||||
|
||||
.product-item {
|
||||
margin: 20rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #737D88
|
||||
}
|
||||
.product-row {
|
||||
margin: 20rpx 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
color: #737D88;
|
||||
.row-item {
|
||||
flex: 1;
|
||||
.label {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.val {
|
||||
color: #1D2129;
|
||||
&.high-color {
|
||||
color: #00B42A
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.statusText {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 100rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
background: linear-gradient(149deg, #2DACE6 4%, #356899 98%);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-bottom: 15rpx;
|
||||
|
||||
.date {
|
||||
color: #666;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.primary {
|
||||
color: #ff9240;
|
||||
}
|
||||
|
||||
.icon-delete {
|
||||
line-height: 1;
|
||||
margin-left: 10rpx;
|
||||
padding-left: 10rpx;
|
||||
border-left: 1rpx solid #e3e3e3;
|
||||
}
|
||||
}
|
||||
|
||||
.goods {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.cover {
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.image {
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.quantity {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
line-height: 1;
|
||||
padding: 6rpx 4rpx 6rpx 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx 0 0 0;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.meta {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.name {
|
||||
height: 80rpx;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.type {
|
||||
line-height: 1.8;
|
||||
padding: 0 15rpx;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
align-self: flex-start;
|
||||
border-radius: 4rpx;
|
||||
color: #888;
|
||||
background-color: #f7f7f8;
|
||||
}
|
||||
|
||||
.more {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.payment {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
padding: 20rpx 0;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
|
||||
.quantity {
|
||||
font-size: 24rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.amount {
|
||||
color: #444;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
.symbol {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 20rpx;
|
||||
|
||||
.button {
|
||||
width: 180rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 20rpx;
|
||||
border-radius: 60rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.secondary {
|
||||
color: #3775F6;
|
||||
border-color: #3775F6;
|
||||
}
|
||||
|
||||
.primary {
|
||||
color: #fff;
|
||||
background-color: #3775F6;
|
||||
border-color: #3775F6;
|
||||
}
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
}
|
||||
</style>import type { stringify } from 'querystring';
|
570
mes-ui/mini-app/src/pages/pgMaster/pgMaster-detail.vue
Normal file
570
mes-ui/mini-app/src/pages/pgMaster/pgMaster-detail.vue
Normal file
@ -0,0 +1,570 @@
|
||||
<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 } 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) {
|
||||
// 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,
|
||||
bgUser: userId,
|
||||
zjMxId: detailInfo.value.id,
|
||||
}
|
||||
const data = await getTaskRepotPageAPI(params)
|
||||
data.list.forEach((e) => {
|
||||
e.startTimeStr = e.startTime && formatDate(e.startTime, 'YYYY-MM-DD HH:mm')
|
||||
e.endTimeStr = e.endTime && formatDate(e.endTime, 'YYYY-MM-DD HH:mm')
|
||||
e.bgTime = e.bgTime && formatDate(e.bgTime, 'YYYY-MM-DD HH:mm')
|
||||
})
|
||||
if (data.list[0]) {
|
||||
formObj.value = data.list[0]
|
||||
const time = formObj.value.endTime - formObj.value.startTime //时间差秒
|
||||
const leave1 = time % (24 * 3600 * 1000) //计算天数后剩余的毫秒数
|
||||
workTime.value = Math.floor(leave1 / (3600 * 1000))
|
||||
}
|
||||
historyList.value = data.list
|
||||
isLoading.value = false
|
||||
}
|
||||
// 详情
|
||||
const getDetailData = async (id) => {
|
||||
// 发送请求
|
||||
// isLoading.value = true
|
||||
const params = {
|
||||
id,
|
||||
}
|
||||
const data = await getTaskDetailAPI(params)
|
||||
data.startTime = formatDate(data.startTime, 'YYYY-MM-DD')
|
||||
data.entTime = formatDate(data.entTime, 'YYYY-MM-DD')
|
||||
|
||||
|
||||
// 单位枚举
|
||||
const lineObj = unitDictData.find((q) => q.value == data.unit) || {}
|
||||
data.unit = lineObj.label
|
||||
detailInfo.value = data || {}
|
||||
isLoading.value = false
|
||||
}
|
||||
onLoad(async (options: any) => {
|
||||
await getDetailData(options.id)
|
||||
await getData()
|
||||
const obj = historyList.value[0]
|
||||
// 最新的报工是否完成
|
||||
if (obj && obj?.workTime == null && obj.endTime) {
|
||||
popup.value?.open()
|
||||
}
|
||||
})
|
||||
|
||||
// 生产完成
|
||||
const handleComplate = async () => {
|
||||
/* const params = {
|
||||
id: detailInfo.value?.id,
|
||||
active: 'FINISH',
|
||||
ownerId: userId,
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
}) */
|
||||
}
|
||||
// 提交报工
|
||||
const handleOk = async (active) => {
|
||||
const params = {
|
||||
zjMxId: detailInfo.value?.id,
|
||||
amount: amount.value,
|
||||
workTime: workTime.value,
|
||||
bgUser: userId,
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
})
|
||||
}
|
||||
// 开始生产
|
||||
const handleStart = async () => {
|
||||
popup.value.open();
|
||||
/* const params = {
|
||||
id: detailInfo.value.id,
|
||||
active: 'START',
|
||||
ownerId: userId,
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
})
|
||||
productionTitle.value = '生产中' */
|
||||
}
|
||||
// 结束生产
|
||||
const handleStop = async () => {
|
||||
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,
|
||||
})
|
||||
popup.value?.open()
|
||||
}
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<view class="data-detail">
|
||||
<template v-if="!isLoading">
|
||||
<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>
|
||||
<view :class="[detailInfo.pgType == 1 ? 'had' : 'unhad', 'product-status']">{{
|
||||
detailInfo.pgType == 1 ? '已完成' : '未完成' }}</view>
|
||||
<view class="product-item">子项目:{{ detailInfo.projectSubCode || '' }} {{' ' + detailInfo.projectSubName }}
|
||||
</view>
|
||||
<view class="product-item">模具名称:{{detailInfo.mouldName}}</view>
|
||||
<view class="product-row">
|
||||
<view class="row-item">
|
||||
<view class="label">派工数量</view>
|
||||
<view class="val">{{ detailInfo.amount }}</view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<view class="label">总报工数量</view>
|
||||
<view class="val high-color">{{ detailInfo.amounts }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="product-row">
|
||||
<view class="row-item">
|
||||
<view class="label">预计工时</view>
|
||||
<view class="val">{{ detailInfo.gongShi }}</view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<view class="label">总报工工时</view>
|
||||
<view class="val high-color">{{ detailInfo.workTime }}</view>
|
||||
</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>
|
||||
</view>
|
||||
</view>
|
||||
<view class="module-list">
|
||||
<view class="module-title">历史报工明细</view>
|
||||
<view class="history-list">
|
||||
<view class="no-data" v-if="!historyList.length">
|
||||
无数据...
|
||||
</view>
|
||||
<template v-else>
|
||||
<view class="item" v-for="(item, index) in historyList" :key="item.id">
|
||||
<view class="product-item">报工时间:{{ item.bgTime }}</view>
|
||||
<!-- <view class="product-item">生产结束时间:{{ item.endTimeStr }}</view> -->
|
||||
|
||||
<view class="product-row">
|
||||
<view class="row-item">
|
||||
<view class="label">报工工时:</view>
|
||||
<view class="val high-color">{{ item.workTime }}</view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<view class="label">报工数量:</view>
|
||||
<view class="val high-color">{{ item.amount }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip-index">
|
||||
<image src="/static/images/productionReport-detail-index.png" class="icon-status" mode="scaleToFit">
|
||||
</image>
|
||||
<view class="text">{{historyList.length - index}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action" v-if="detailInfo.pgType !== 1">
|
||||
<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>
|
||||
</template>
|
||||
<view class="loading-text" v-else>加载中..</view>
|
||||
<uni-popup class="popup" ref="popup" :mask-click="false" type="bottom" background-color="#fff">
|
||||
<view class="title">
|
||||
<view class="text">填写信息</view>
|
||||
<!-- <view class="close" @click="handleClose">X</view> -->
|
||||
</view>
|
||||
<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>
|
||||
<view class="item">
|
||||
<view class="label"><span class="star">*</span>本次报工工时:</view>
|
||||
<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>
|
||||
<view class="unit"> {{ detailInfo.unit }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ok" @click="handleOk">确定</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss">
|
||||
// 订单列表
|
||||
.data-detail {
|
||||
border-radius: 10rpx;
|
||||
padding-bottom: 200rpx;
|
||||
|
||||
.module {
|
||||
background: linear-gradient(178deg, #356899 7%, #356899 57%, #F4F6F9 94%);
|
||||
padding: 20rpx;
|
||||
|
||||
.module-info {
|
||||
padding: 20rpx 20rpx 80rpx;
|
||||
border-radius: 10rpx;
|
||||
min-height: 100rpx;
|
||||
font-size: 28rpx;
|
||||
border-bottom: 2rpx solid #F2F2F2;
|
||||
background: linear-gradient(215deg, #C7D3E5 8%, rgba(222, 228, 236, 0) 13%), linear-gradient(162deg, #FFFFFF 25%, #E4EFFD 106%);
|
||||
position: relative;
|
||||
border-top-right-radius: 100rpx;
|
||||
|
||||
.product-img {
|
||||
position: absolute;
|
||||
right: 0rpx;
|
||||
top: 0;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
.product-status {
|
||||
|
||||
width: 140rpx;
|
||||
border-raduis: 10rpx;
|
||||
text-align: center;
|
||||
padding: 8rpx 12rpx;
|
||||
&.had {
|
||||
background: #E8FFEA;
|
||||
color: #00B42A;
|
||||
}
|
||||
&.unhad {
|
||||
background: #FFF7E8;
|
||||
color: #FF7D00;
|
||||
}
|
||||
}
|
||||
|
||||
.product-item {
|
||||
margin: 20rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #737D88
|
||||
}
|
||||
|
||||
.product-row {
|
||||
margin: 20rpx 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
color: #737D88;
|
||||
|
||||
.row-item {
|
||||
flex: 1;
|
||||
|
||||
.label {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.val {
|
||||
color: #1D2129;
|
||||
|
||||
&.high-color {
|
||||
color: #00B42A
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.finish {
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
bottom: 30rpx;
|
||||
background: linear-gradient(142deg, #FEB34A 14%, #FE9B12 83%);
|
||||
color: #fff;
|
||||
width: 200rpx;
|
||||
text-align: center;
|
||||
padding: 10rpx;
|
||||
border-radius: 31rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.complate-img {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.module-list {
|
||||
padding: 20rpx 20rpx;
|
||||
// box-shadow: 0px 0px 8px 0px rgba(161, 161, 177, 0.12);
|
||||
|
||||
.module-title {
|
||||
color: #0D0D26;
|
||||
font-size: 36rpx;
|
||||
margin: 20rpx 0;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.history-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
min-height: 200rpx;
|
||||
justify-content: center;
|
||||
padding: 0rpx 10rpx;
|
||||
|
||||
.item {
|
||||
margin: 10rpx 0;
|
||||
background: #EAEEF4;
|
||||
font-size: 28rpx;
|
||||
padding: 20rpx;
|
||||
width: 100%;
|
||||
border-radius: 10rpx;
|
||||
color: #737D88;
|
||||
position: relative;
|
||||
|
||||
.product-item {
|
||||
margin: 10rpx 0;
|
||||
.hight-color {
|
||||
color: #00B42A;
|
||||
}
|
||||
}
|
||||
.product-row {
|
||||
margin: 20rpx 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
color: #737D88;
|
||||
|
||||
.row-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.label {
|
||||
margin-bottom: 10rpx;
|
||||
&.high-color {
|
||||
color: #00B42A
|
||||
}
|
||||
}
|
||||
|
||||
.val {
|
||||
color: #1D2129;
|
||||
|
||||
&.high-color {
|
||||
color: #00B42A
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.tip-index {
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
.icon-status {
|
||||
width: 100rpx;
|
||||
height: 72rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
.text {
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: 4rpx;
|
||||
right: 30rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no-data {
|
||||
font-size: 28rpx;
|
||||
color: #444;
|
||||
}
|
||||
}
|
||||
|
||||
.table-cont {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.button {
|
||||
color: #356899;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
bottom: 0rpx;
|
||||
border-radius: 18rpx;
|
||||
padding: 30rpx 30rpx;
|
||||
background: #FFFFFF;
|
||||
margin: 0 auto;
|
||||
width: 100vw;
|
||||
box-shadow: 0px -4px 10px 0px rgba(121, 153, 183, 0.2);
|
||||
|
||||
.action-item {
|
||||
width: 272rpx;
|
||||
height: 86rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 0 20rpx;
|
||||
font-size: 40rpx;
|
||||
color: #fff;
|
||||
width: 272rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 24rpx;
|
||||
|
||||
&.start {
|
||||
background: linear-gradient(157deg, #2EACE6 -3%, #356899 90%);
|
||||
}
|
||||
|
||||
&.stop {
|
||||
background: linear-gradient(167deg, #FEA97B -2%, #F75E40 87%);
|
||||
}
|
||||
|
||||
&.finish {
|
||||
background: linear-gradient(142deg, #FEB34A 14%, #FE9B12 83%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
.popup {
|
||||
.title {
|
||||
line-height: 1;
|
||||
padding: 40rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: normal;
|
||||
border-bottom: 1rpx solid #ddd;
|
||||
color: #444;
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
right: 24rpx;
|
||||
top: 40rpx;
|
||||
height: 60rpx;
|
||||
width: 60rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.cont {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 40rpx;
|
||||
height: 50vh;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 20rpx 0;
|
||||
color: #737D88;
|
||||
width: 94%;
|
||||
|
||||
.label {
|
||||
font-size: 32rpx;
|
||||
width: 260rpx;
|
||||
.star {
|
||||
color: red
|
||||
}
|
||||
}
|
||||
|
||||
.val {
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.unit {
|
||||
width: 100rpx;
|
||||
margin-left: 4rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ok {
|
||||
font-size: 32rpx;
|
||||
margin: 20rpx auto 80rpx;
|
||||
text-align: center;
|
||||
width: 200rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 8rpx 0;
|
||||
background-color: #3C8AF7;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
151
mes-ui/mini-app/src/pages/pgMaster/pgMaster.vue
Normal file
151
mes-ui/mini-app/src/pages/pgMaster/pgMaster.vue
Normal file
@ -0,0 +1,151 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import dataItem from './components/dataItem.vue'
|
||||
// 定义 porps
|
||||
const props = defineProps<{
|
||||
state: string
|
||||
}>()
|
||||
// tabs 数据
|
||||
const orderTabs = ref([
|
||||
{ orderState: '0', title: '未完成', isRender: false },
|
||||
{ orderState: '1', title: '已完成', isRender: false },
|
||||
])
|
||||
// 高亮下标
|
||||
const activeIndex = ref(0)
|
||||
const handleIndexChange = (index: any) => {
|
||||
orderTabs.value.forEach((e) => {
|
||||
e.isRender = false
|
||||
})
|
||||
activeIndex.value = index
|
||||
orderTabs.value[index].isRender = true
|
||||
}
|
||||
onLoad(async (options) => {
|
||||
if (options.state) {
|
||||
// 高亮下标
|
||||
orderTabs.value.forEach((e, index) => {
|
||||
e.isRender = e.orderState == options.state
|
||||
if (e.isRender) {
|
||||
activeIndex.value = index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
orderTabs.value.forEach((e, index) => {
|
||||
e.isRender = e.orderState == '0'
|
||||
if (e.isRender) {
|
||||
activeIndex.value = index
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="viewport">
|
||||
<view class="tabs">
|
||||
<text class="item" :class="{ active: activeIndex == index }" v-for="(item, index) in orderTabs" :key="item.title"
|
||||
@tap="handleIndexChange(index)">
|
||||
{{ item.title }}
|
||||
</text>
|
||||
<!-- 游标 -->
|
||||
<view class="cursor" :style="{ left: activeIndex ? '65%' : '14%' }"></view>
|
||||
</view>
|
||||
<!-- 滑动容器 -->
|
||||
<swiper class="swiper" :current="activeIndex" @change="handleIndexChange($event.detail.current)">
|
||||
<!-- 滑动项 -->
|
||||
<swiper-item v-for="item in orderTabs" :key="item.title">
|
||||
<dataItem v-if="item.isRender" :order-state="item.orderState" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.viewport {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
// background-color: #3775F6;
|
||||
.navbar {
|
||||
width: 750rpx;
|
||||
color: #000;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 9;
|
||||
/* background-color: #f8f8f8; */
|
||||
background-color: #3775f6;
|
||||
|
||||
.wrap {
|
||||
position: relative;
|
||||
background-color: #3775f6;
|
||||
|
||||
.title {
|
||||
height: 44px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
/* color: #000; */
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.back {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
height: 44px;
|
||||
width: 44px;
|
||||
font-size: 44rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
/* color: #000; */
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
line-height: 60rpx;
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
width: 100%;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #1D2129;
|
||||
|
||||
&.active {
|
||||
color: #356899;
|
||||
}
|
||||
}
|
||||
|
||||
.cursor {
|
||||
position: absolute;
|
||||
left: 13%;
|
||||
bottom: 0;
|
||||
width: 20%;
|
||||
height: 6rpx;
|
||||
padding: 0 50rpx;
|
||||
background-color: #356899;
|
||||
/* 过渡效果 */
|
||||
transition: all 0.4s;
|
||||
}
|
||||
}
|
||||
|
||||
// swiper
|
||||
.swiper {
|
||||
background-color: #f7f7f8;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, computed, ref } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { getListAPI, getDictAPI } from '@/services/zjPgMaster'
|
||||
import { getListAPI, getDictAPI,postOperateAPIZF } from '@/services/zjPgMaster'
|
||||
import { useLoginStore } from '@/stores/modules/login'
|
||||
import { formatDate } from '@/utils/index'
|
||||
|
||||
@ -33,8 +33,9 @@ pgType: 0,
|
||||
// 工序完成状态列表
|
||||
dispatchType: "ASSEMBLE",
|
||||
// 派工类型
|
||||
isReport: 1
|
||||
isReport: 1,
|
||||
// 是否需要报工
|
||||
dispatchStatus:2
|
||||
}
|
||||
const dataList = ref([])
|
||||
const getListData = async () => {
|
||||
@ -84,6 +85,27 @@ const handleDetail = (item) => {
|
||||
uni.navigateTo({ url })
|
||||
}
|
||||
|
||||
/* const viewClick = (item) => {
|
||||
const params = {
|
||||
id: item.id
|
||||
}
|
||||
const data = await postOperateAPIZF(params);
|
||||
await getListData();
|
||||
} */
|
||||
//作废
|
||||
const viewClick = async (item) => {
|
||||
const params = {
|
||||
id: item.id
|
||||
};
|
||||
const data = await postOperateAPIZF(params);
|
||||
if(data >0){
|
||||
const url = `/pages/zjPgMaster/zjPgMaster`
|
||||
|
||||
uni.navigateTo({ url })
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 自定义下拉刷新被触发
|
||||
const onRefresherrefresh = async () => {
|
||||
// 开始动画
|
||||
@ -119,10 +141,14 @@ const onRefresherrefresh = async () => {
|
||||
</view> -->
|
||||
<scroll-view enable-back-to-top scroll-y class="data-list" refresher-enabled :refresher-triggered="isTriggered"
|
||||
@refresherrefresh="onRefresherrefresh" @scrolltolower="getListData">
|
||||
<view class="item" v-for="item in dataList" :key="item.id" @click="handleDetail(item)">
|
||||
<view class="item" v-for="item in dataList" :key="item.id" >
|
||||
<view class="hd">
|
||||
<view class="num">派工单:</view>
|
||||
<view class="statusLabel">( 单号:{{ item.pgNumber }} )</view>
|
||||
<view class="statusLabelzf" @click="viewClick(item)" v-if="item.pgType == 0" >
|
||||
作废
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="md">
|
||||
<view class="product-item">项目名称:{{ item.projectName }}</view>
|
||||
@ -141,17 +167,21 @@ const onRefresherrefresh = async () => {
|
||||
<view class="label">派工数量</view>
|
||||
<view class="val">{{item.amount}}</view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<!-- <view class="row-item">
|
||||
<view class="label">总报工数量</view>
|
||||
<view class="val high-color">{{item.amounts}}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<view class="product-row">
|
||||
<view class="row-item">
|
||||
<!-- <view class="row-item">
|
||||
<view class="label">预计工时</view>
|
||||
<view class="val">{{ item.gongShi }}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="row-item">
|
||||
<view class="label">总报工数量</view>
|
||||
<view class="val high-color">{{item.amounts}}</view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<view class="label">总报工工时</view>
|
||||
<view class="val high-color">{{ item.workTime }}</view>
|
||||
@ -159,7 +189,7 @@ const onRefresherrefresh = async () => {
|
||||
</view>
|
||||
<view class="product-item">预计生产日期:{{ item.startTime }} ~ {{ item.entTime }}</view>
|
||||
</view>
|
||||
<view class="statusText">{{ statusText }}</view>
|
||||
<view class="statusText" @click="handleDetail(item)">{{ statusText }}</view>
|
||||
</view>
|
||||
<!-- 底部提示文字 -->
|
||||
<view class="loading-text" :style="{ paddingBottom: safeAreaInsets?.bottom + 'px' }">
|
||||
@ -204,6 +234,20 @@ const onRefresherrefresh = async () => {
|
||||
font-size: 24rpx;
|
||||
color: #737D88;
|
||||
}
|
||||
.statusLabelzf {
|
||||
font-size: 24rpx;
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 15rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
background: linear-gradient(149deg, #ffff00 4%, #cfcf00 98%);
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.md {
|
||||
|
@ -171,16 +171,18 @@ const handleStop = async () => {
|
||||
<view class="label">派工数量</view>
|
||||
<view class="val">{{ detailInfo.amount }}</view>
|
||||
</view>
|
||||
<view class="row-item">
|
||||
<view class="label">总报工数量</view>
|
||||
<view class="val high-color">{{ detailInfo.amounts }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="product-row">
|
||||
<view class="row-item">
|
||||
<!-- <view class="row-item">
|
||||
<view class="label">预计工时</view>
|
||||
<view class="val">{{ detailInfo.gongShi }}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="product-row">
|
||||
|
||||
<view class="row-item">
|
||||
<view class="label">总报工数量</view>
|
||||
<view class="val high-color">{{ detailInfo.amounts }}</view>
|
||||
</view>
|
||||
|
||||
<view class="row-item">
|
||||
<view class="label">总报工工时</view>
|
||||
<view class="val high-color">{{ detailInfo.workTime }}</view>
|
||||
|
72
mes-ui/mini-app/src/services/pgMaster.ts
Normal file
72
mes-ui/mini-app/src/services/pgMaster.ts
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* @Author: 王文杰
|
||||
* @Date: 2024-01-04 12:54:56
|
||||
* @LastEditors: 王文杰
|
||||
* @LastEditTime: 2024-03-29 15:44:53
|
||||
* @FilePath: /app-nx-personal/src/services/home.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
import { http } from '@/utils/http'
|
||||
// 获取工序分页
|
||||
export const getListAPI = (data: Object) => {
|
||||
return http<any[]>({
|
||||
method: 'GET',
|
||||
url: '/heli/pg-master/task-dispatch-detail/page',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作生产任务(开始/结束/提交/完成)
|
||||
*/
|
||||
export const updateBaoGong = (zid,progress,imageLink) => {
|
||||
const data = {
|
||||
zid: zid,
|
||||
progress: progress,
|
||||
imageLink: imageLink
|
||||
};
|
||||
return http<any[]>({
|
||||
method: 'POST',
|
||||
url: '/heli/process-design/updateBaoGong',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 报工记录分页查询
|
||||
export const getTaskRepotPageAPI = (data: Object) => {
|
||||
return http<any[]>({
|
||||
method: 'GET',
|
||||
url: '/heli/bg-master-line/page',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 派工任务详情
|
||||
export const getTaskDetailAPI = (data: Object) => {
|
||||
return http<any[]>({
|
||||
method: 'GET',
|
||||
url: '/heli/pg-master/task-dispatch-detail/get',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作生产任务(开始/结束/提交/完成)
|
||||
*/
|
||||
export const postOperateAPI = (data: Object) => {
|
||||
return http<any[]>({
|
||||
method: 'POST',
|
||||
url: '/heli/bg-master-line/create',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作生产任务-作废
|
||||
*/
|
||||
export const postOperateAPIZF = (data: Object) => {
|
||||
return http<any[]>({
|
||||
method: 'POST',
|
||||
url: '/heli/pg-master/zfPgMaster',
|
||||
data,
|
||||
})
|
||||
}
|
@ -42,3 +42,14 @@ export const postOperateAPI = (data: Object) => {
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作生产任务-作废
|
||||
*/
|
||||
export const postOperateAPIZF = (data: Object) => {
|
||||
return http<any[]>({
|
||||
method: 'POST',
|
||||
url: '/heli/zj-pg-master/zfZjPgMaster',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user