前后端模块

This commit is contained in:
z 2026-04-08 14:24:28 +08:00
parent 4e32d0b1d6
commit 90f2b72822
24 changed files with 2999 additions and 2 deletions

View File

@ -0,0 +1,142 @@
package jnpf.database.config;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import jnpf.base.UserInfo;
import jnpf.constant.PermissionConst;
import jnpf.permission.entity.OrganizeEntity;
import jnpf.permission.service.OrganizeService;
import jnpf.util.DateUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import jnpf.util.context.SpringContext;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* MybatisPlus配置类
*
* @author Allen Pan
* @version V3.4.1
* @copyright 长江云息
* @date 2019年9月27日 上午9:18
*/
@Component
@Slf4j
//@Configuration
//@Intercepts({@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})})
public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
//@Autowired
private static ApplicationContext applicationContext;
private UserProvider userProvider;
private OrganizeService organizeService;
@Override
public void insertFill(MetaObject metaObject) {
Map<String, Object> map = BeanUtil.toBean(metaObject.getOriginalObject(), Map.class);
String companyId = "";
// userProvider= applicationContext.getBean(UserProvider.class);
UserProvider userProvider = SpringContext.getBean(UserProvider.class);
OrganizeService organizeService = SpringContext.getBean(OrganizeService.class);
UserInfo userInfo= userProvider.get();
List<String> organizeIdList = new ArrayList<>();
if(userInfo != null && StringUtil.isNotEmpty(userInfo.getOrganizeId())){
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
organizeIdList.add(organizeEntity.getId());
if(PermissionConst.DEPARTMENT.equals(organizeEntity.getCategory())){
userInfo.setDepartmentId(organizeEntity.getId());
do {
//获取父组织
organizeEntity = organizeService.getInfo(organizeEntity.getParentId());
organizeIdList.add(organizeEntity.getId());
}while (PermissionConst.DEPARTMENT.equals(organizeEntity.getCategory()));
companyId = organizeEntity.getId();
}else{
companyId = organizeEntity.getId();
}
organizeEntity = organizeService.getInfo(organizeEntity.getParentId());
if(organizeEntity != null){
organizeIdList.add(organizeEntity.getId());
}
}
Collections.reverse(organizeIdList);
String organizeId = JSON.toJSONString(organizeIdList);
// 可以在这里填充编码查询到编码规则自动填充
// TableInfo tableInfo = this.findTableInfo(metaObject);
// String tableName = tableInfo.getTableName();
log.info("start insert fill ....");
System.out.println(userInfo);
// if(map.get("creatorUserId") == null || StringUtil.isEmpty(map.get("creatorUserId").toString())){
this.setFieldValByName("creatorUserId", userInfo.getUserId(), metaObject);
// }
this.setFieldValByName("creatorTime", DateUtil.getNowDate(), metaObject);
this.setFieldValByName("creatorUserName", userInfo.getUserName(), metaObject);
this.setFieldValByName("creatoruserid", userInfo.getUserId(), metaObject);
this.setFieldValByName("creatortime", DateUtil.getNowDate(), metaObject);
this.setFieldValByName("creatorusername", userInfo.getUserName(), metaObject);
this.setFieldValByName("lastModifyUserId", userInfo.getUserId(), metaObject);
this.setFieldValByName("lastModifyTime", DateUtil.getNowDate(), metaObject);
this.setFieldValByName("lastModifyUserName", userInfo.getUserName(), metaObject);
if(map.get("organizeJsonId") == null || StringUtil.isEmpty(map.get("organizeJsonId").toString())){
this.setFieldValByName("organizeJsonId", organizeId, metaObject);
}
if(map.get("companyId") == null || StringUtil.isEmpty(map.get("companyId").toString())){
this.setFieldValByName("companyId", companyId, metaObject);
}
if(map.get("departmentId") == null || StringUtil.isEmpty(map.get("departmentId").toString())){
this.setFieldValByName("departmentId", userInfo.getDepartmentId(), metaObject);
}
// System.out.println(userProvider.getDepartmentId(userInfo.getUserId()));
/*if (userInfo.getUserId()!=null){
this.setFieldValByName("departmentId", userProvider.getDepartmentId(userInfo.getUserId()), metaObject);
}*/
}
@Override
public void updateFill(MetaObject metaObject) {
log.info("start update fill ....");
UserProvider userProvider = SpringContext.getBean(UserProvider.class);
System.out.println(userProvider.get());
// userProvider= applicationContext.getBean(UserProvider.class);
UserInfo userInfo = userProvider.get();
this.setFieldValByName("lastModifyTime", DateUtil.getNowDate(), metaObject);
this.setFieldValByName("lastModifyUserId", userInfo.getUserId(), metaObject);
this.setFieldValByName("lastModifyUserName", userInfo.getUserName(), metaObject);
this.setFieldValByName("deleteTime", DateUtil.getNowDate(), metaObject);
this.setFieldValByName("deleteUserId", userInfo.getUserId(), metaObject);
this.setFieldValByName("deleteUserName", userInfo.getUserName(), metaObject);
}
}

View File

@ -0,0 +1,16 @@
package jnpf.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.entity.OrderDetailEntity;
/**
* 业务订单明细 Mapper
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
public interface OrderDetailMapper extends BaseMapper<OrderDetailEntity> {
}

View File

@ -0,0 +1,16 @@
package jnpf.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.entity.OrderEntity;
/**
* 业务订单 Mapper
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
public interface OrderMapper extends BaseMapper<OrderEntity> {
}

View File

@ -0,0 +1,36 @@
package jnpf.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.base.service.SuperService;
import jnpf.entity.OrderDetailEntity;
import jnpf.model.orderdetail.OrderDetailPagination;
import java.util.List;
/**
* 业务订单明细 Service
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
public interface OrderDetailService extends IService<OrderDetailEntity> {
/**
* 获取订单明细列表
*
* @param orderDetailPagination 分页查询对象
* @return 订单明细列表
*/
List<OrderDetailEntity> getList(OrderDetailPagination orderDetailPagination);
/**
* 根据订单ID获取明细列表
*
* @param saleOrdId 销售订单ID
* @return 订单明细列表
*/
List<OrderDetailEntity> getListByOrderId(Integer saleOrdId);
}

View File

@ -0,0 +1,33 @@
package jnpf.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.base.service.SuperService;
import jnpf.entity.OrderEntity;
import jnpf.model.order.OrderForm;
import jnpf.model.order.OrderPagination;
import java.util.List;
/**
* 业务订单 Service
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
public interface OrderService extends IService<OrderEntity> {
List<OrderEntity> getList(OrderPagination orderPagination);
OrderEntity getInfo(String id);
void delete(OrderEntity entity);
void create(OrderEntity entity);
boolean update(String id, OrderEntity entity);
String checkForm(OrderForm form, int i);
void saveOrUpdate(OrderForm orderForm,String id, boolean isSave) throws Exception;
}

View File

@ -0,0 +1,39 @@
package jnpf.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.base.service.SuperServiceImpl;
import jnpf.entity.OrderDetailEntity;
import jnpf.mapper.OrderDetailMapper;
import jnpf.model.orderdetail.OrderDetailPagination;
import jnpf.service.OrderDetailService;
import jnpf.util.StringUtil;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 业务订单明细 ServiceImpl
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetailEntity> implements OrderDetailService {
@Override
public List<OrderDetailEntity> getList(OrderDetailPagination orderDetailPagination) {
return null;
}
@Override
public List<OrderDetailEntity> getListByOrderId(Integer saleOrdId) {
QueryWrapper<OrderDetailEntity> query = new QueryWrapper<>();
query.lambda().eq(OrderDetailEntity::getSaleOrdId, saleOrdId);
query.lambda().orderByAsc(OrderDetailEntity::getId);
return this.list(query);
}
}

View File

@ -0,0 +1,159 @@
package jnpf.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.base.UserInfo;
import jnpf.base.service.SuperServiceImpl;
import jnpf.entity.OrderDetailEntity;
import jnpf.entity.OrderEntity;
import jnpf.mapper.OrderMapper;
import jnpf.model.order.OrderForm;
import jnpf.model.order.OrderPagination;
import jnpf.permission.entity.UserEntity;
import jnpf.permission.service.UserService;
import jnpf.service.OrderDetailService;
import jnpf.service.OrderService;
import jnpf.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 业务订单 ServiceImpl
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> implements OrderService {
@Resource
private UserService userService;
@Resource
private GeneraterSwapUtil generaterSwapUtil;
@Resource
private UserProvider userProvider;
@Resource
private OrderDetailService orderDetailService;
@Override
public List<OrderEntity> getList(OrderPagination orderPagination) {
LambdaQueryWrapper<OrderEntity> OrderWrapper=new LambdaQueryWrapper<>();
if(ObjectUtil.isNotEmpty(orderPagination.getOrdDate())){
List inParkTimeList = JsonUtil.getJsonToList(orderPagination.getOrdDate(),String.class);
Long fir = Long.valueOf(String.valueOf(inParkTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(inParkTimeList.get(1)));
OrderWrapper.ge(OrderEntity::getOrdDate, new Date(fir))
.le(OrderEntity::getOrdDate, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if(ObjectUtil.isNotEmpty(orderPagination.getSaleOrdNo())){
OrderWrapper.like(OrderEntity::getSaleOrdNo,orderPagination.getSaleOrdNo());
}
if(ObjectUtil.isNotEmpty(orderPagination.getProjectName())){
OrderWrapper.like(OrderEntity::getProjectName,orderPagination.getProjectName());
}
if(ObjectUtil.isNotEmpty(orderPagination.getIsUrgent())){
OrderWrapper.eq(OrderEntity::getIsUrgent,orderPagination.getIsUrgent());
}
if(ObjectUtil.isNotEmpty(orderPagination.getOrdStatus())){
OrderWrapper.eq(OrderEntity::getOrdStatus,orderPagination.getOrdStatus());
}
if(ObjectUtil.isNotEmpty(orderPagination.getSaleManName())){
List<UserEntity> userList = userService.getUserByName(orderPagination.getSaleManName());
List<String> ids = userList.stream().map(UserEntity::getId).collect(Collectors.toList());
if (ObjectUtil.isNotEmpty(ids)){
OrderWrapper.in(OrderEntity::getSaleMan,ids);
}
}
OrderWrapper.isNull(OrderEntity::getDeleteMark);
OrderWrapper.orderByDesc(OrderEntity::getCreatorTime);
if("0".equals(orderPagination.getDataType())){
Page<OrderEntity> page=new Page<>(orderPagination.getCurrentPage(), orderPagination.getPageSize());
IPage<OrderEntity> userIPage=this.page(page, OrderWrapper);
return orderPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else {
return this.list(OrderWrapper);
}
}
@Override
public OrderEntity getInfo(String id){
QueryWrapper<OrderEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(OrderEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(OrderEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, OrderEntity entity){
return this.updateById(entity);
}
@Override
public void delete(OrderEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(OrderForm form, int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
return countRecover;
}
/**
* 新增修改数据(事务回滚)
* @param id
* @param OrderForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(OrderForm OrderForm, String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
OrderEntity entity = JsonUtil.getJsonToBean(OrderForm, OrderEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
entity.setSaleOrdNo(generaterSwapUtil.getBillNumber("order", false));
}
this.saveOrUpdate(entity);
if(!isSave){
QueryWrapper<OrderDetailEntity> orderDetailEntityWrapper = new QueryWrapper<>();
orderDetailEntityWrapper.lambda().eq(OrderDetailEntity::getSaleOrdId, entity.getId());
orderDetailService.remove(orderDetailEntityWrapper);
}
if (ObjectUtil.isNotEmpty(OrderForm.getOrderDetailList())){
List<OrderDetailEntity> orderDetailEntityList = JsonUtil.getJsonToList(OrderForm.getOrderDetailList(),OrderDetailEntity.class);
for(OrderDetailEntity entitys : orderDetailEntityList){
entitys.setId(RandomUtil.uuId());
entitys.setSaleOrdId(entity.getId());
if(isSave){
}else{
}
orderDetailService.saveOrUpdate(entitys);
}
}
}
}

View File

@ -0,0 +1,108 @@
package jnpf.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.entity.OrderEntity;
import jnpf.model.order.OrderForm;
import jnpf.model.order.OrderPagination;
import jnpf.service.OrderService;
import jnpf.util.JsonUtil;
import jnpf.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 业务订单 控制类
*
*/
@Tag(name = "业务订单", description = "exampleOrder")
@RestController
@RequestMapping("/api/example/exampleOrder")
public class ExampleOrderController {
@Autowired
private OrderService orderService;
/**
* 列表
* @param orderPagination 分页查询对象
* @return 列表结果集
*/
@Operation(summary = "获取订单列表")
@PostMapping("/getList")
public ActionResult getList(OrderPagination orderPagination) {
List<OrderEntity> list= orderService.getList(orderPagination);
List<Map<String, Object>> realList = list.stream()
.map(JsonUtil::entityToMap)
.collect(Collectors.toList());
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(orderPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
* 编辑
* @param id
* @param orderForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid OrderForm orderForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
orderForm.setId(id);
if (!isImport) {
String b = orderService.checkForm(orderForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
OrderEntity entity= orderService.getInfo(id);
if(entity!=null){
try{
orderService.saveOrUpdate(orderForm,id,false);
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
* 删除
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
OrderEntity entity = orderService.getInfo(id);
if (entity != null) {
//假删除
entity.setDeleteMark(1);
orderService.update(id, entity);
}
return ActionResult.success("删除成功");
}
}

View File

@ -0,0 +1,142 @@
package jnpf.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.vo.ListVO;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.constant.MsgCode;
import jnpf.entity.OrderDetailEntity;
import jnpf.model.orderdetail.OrderDetailForm;
import jnpf.model.orderdetail.OrderDetailPagination;
import jnpf.model.orderdetail.OrderDetailVO;
import jnpf.service.OrderDetailService;
import jnpf.util.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 业务订单明细 控制类
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
@Tag(name = "业务订单明细", description = "example")
@RestController
@RequestMapping("/api/example/OrderDetail")
public class OrderDetailController {
@Autowired
private OrderDetailService orderDetailService;
/**
* 列表
*
* @param orderDetailPagination 分页查询对象
* @return 列表结果集
*/
@Operation(summary = "获取订单明细列表")
@PostMapping("/getList")
public ActionResult<PageListVO<OrderDetailVO>> getList(OrderDetailPagination orderDetailPagination) {
List<OrderDetailEntity> entityList = orderDetailService.getList(orderDetailPagination);
List<OrderDetailVO> voList = JsonUtil.getJsonToList(entityList, OrderDetailVO.class);
return ActionResult.page(voList, JsonUtil.getJsonToBean(orderDetailPagination, PaginationVO.class));
}
/**
* 根据订单ID获取明细列表
*
* @param saleOrdId 销售订单ID
* @return 明细列表
*/
@Operation(summary = "根据订单ID获取明细列表")
@Parameter(name = "saleOrdId", description = "销售订单ID", required = true)
@GetMapping("/byOrder/{saleOrdId}")
public ActionResult<ListVO<OrderDetailVO>> getListByOrderId(@PathVariable Integer saleOrdId) {
List<OrderDetailEntity> entityList = orderDetailService.getListByOrderId(saleOrdId);
List<OrderDetailVO> voList = JsonUtil.getJsonToList(entityList, OrderDetailVO.class);
return ActionResult.success(new ListVO<>(voList));
}
/**
* 获取信息
*
* @param id 主键
* @return
*/
@Operation(summary = "获取订单明细信息")
@Parameter(name = "id", description = "主键", required = true)
@SaCheckPermission("example.orderDetail")
@GetMapping("/{id}")
public ActionResult<OrderDetailVO> getInfo(@PathVariable Integer id) {
OrderDetailEntity entity = orderDetailService.getById(id);
OrderDetailVO vo = JsonUtil.getJsonToBean(entity, OrderDetailVO.class);
return ActionResult.success(vo);
}
/**
* 新建
*
* @param orderDetailForm 实体模型
* @return
*/
@Operation(summary = "新建订单明细")
@SaCheckPermission("example.orderDetail")
@Parameter(name = "orderDetailForm", description = "实体模型", required = true)
@PostMapping()
public ActionResult<OrderDetailForm> create(@RequestBody OrderDetailForm orderDetailForm) {
OrderDetailEntity entity = JsonUtil.getJsonToBean(orderDetailForm, OrderDetailEntity.class);
orderDetailService.save(entity);
return ActionResult.success(MsgCode.SU001.get());
}
/**
* 修改
*
* @param orderDetailForm 实体模型
* @return
*/
@Operation(summary = "修改订单明细")
@SaCheckPermission("example.orderDetail")
@Parameters({
@Parameter(name = "orderDetailForm", description = "实体模型", required = true)
})
@PutMapping("/{id}")
public ActionResult<OrderDetailForm> update(@RequestBody OrderDetailForm orderDetailForm) {
OrderDetailEntity entity = JsonUtil.getJsonToBean(orderDetailForm, OrderDetailEntity.class);
entity.setId(orderDetailForm.getId());
orderDetailService.updateById(entity);
return ActionResult.success(MsgCode.SU004.get());
}
/**
* 删除
*
* @param id 主键
* @return
*/
@Operation(summary = "删除订单明细")
@SaCheckPermission("example.orderDetail")
@Parameters({
@Parameter(name = "id", description = "主键", required = true)
})
@DeleteMapping("/{id}")
public ActionResult<OrderDetailForm> delete(@PathVariable Integer id) {
// 对象存在判断
if (orderDetailService.getById(id) != null) {
orderDetailService.removeById(id);
return ActionResult.success(MsgCode.SU003.get());
} else {
return ActionResult.fail(MsgCode.FA003.get());
}
}
}

View File

@ -0,0 +1,63 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 业务订单明细表
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
@Data
@TableName("tso_order_detail")
public class OrderDetailEntity {
@TableId(value = "id", type = IdType.AUTO)
private String id;
@TableField(value = "f_creator_user_id", fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "f_creator_time", fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_last_modify_user_id", fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "f_last_modify_time", fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField(value = "f_delete_user_id", fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField(value = "f_delete_time", fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField(value = "f_delete_mark", updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField(value = "f_flow_id")
private String flowId;
@TableField(value = "f_flow_task_id")
private String flowTaskId;
@TableField(value = "sale_ord_id", updateStrategy = FieldStrategy.IGNORED)
private String saleOrdId;
@TableField(value = "material_id", updateStrategy = FieldStrategy.IGNORED)
private Integer materialId;
@TableField("material_code")
private String materialCode;
@TableField("material_name")
private String materialName;
@TableField("spec")
private String spec;
@TableField("unit")
private String unit;
@TableField("ord_qty")
private BigDecimal ordQty;
@TableField("price_tax")
private BigDecimal priceTax;
@TableField("material_use")
private String materialUse;
@TableField("delivered_qty")
private BigDecimal deliveredQty;
@TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED)
private String remark;
}

View File

@ -0,0 +1,85 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 业务订单表
*
*/
@Data
@TableName("tso_order")
public class OrderEntity {
@TableId(value = "id", type = IdType.AUTO)
private String id;
@TableField(value = "f_creator_user_id", fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "f_creator_time", fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_last_modify_user_id", fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "f_last_modify_time", fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField(value = "f_delete_user_id", fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField(value = "f_delete_time", fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField(value = "f_delete_mark", updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField(value = "f_flow_id")
private String flowId;
@TableField(value = "f_flow_task_id")
private String flowTaskId;
@TableField(value = "sale_ord_no", updateStrategy = FieldStrategy.IGNORED)
private String saleOrdNo;
@TableField("ord_date")
private Date ordDate;
@TableField(value = "cust_id", updateStrategy = FieldStrategy.IGNORED)
private String custId;
@TableField("cust_name")
private String custName;
@TableField("project_name")
private String projectName;
@TableField("contact")
private String contact;
@TableField("con_phone")
private String conPhone;
@TableField("sale_man")
private Long saleMan;
@TableField("sale_dept_id")
private Long saleDeptId;
@TableField("ord_type")
private String ordType;
@TableField(value = "payment_terms", updateStrategy = FieldStrategy.IGNORED)
private String paymentTerms;
@TableField("tax_rate")
private BigDecimal taxRate;
@TableField("total_amount")
private BigDecimal totalAmount;
@TableField(value = "req_delivery_date", updateStrategy = FieldStrategy.IGNORED)
private Date reqDeliveryDate;
@TableField(value = "is_urgent", updateStrategy = FieldStrategy.IGNORED)
private String isUrgent;
@TableField(value = "is_change", updateStrategy = FieldStrategy.IGNORED)
private String isChange;
@TableField(value = "ord_status", updateStrategy = FieldStrategy.IGNORED)
private String ordStatus;
@TableField(value = "contract_no", updateStrategy = FieldStrategy.IGNORED)
private String contractNo;
@TableField(value = "pack_req", updateStrategy = FieldStrategy.IGNORED)
private String packReq;
@TableField(value = "quality_req", updateStrategy = FieldStrategy.IGNORED)
private String qualityReq;
@TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED)
private String remark;
@TableField("audit_id")
private String auditId;
@TableField("audit_time")
private Date auditTime;
@TableField(value = "att_file", updateStrategy = FieldStrategy.IGNORED)
private String attFile;
}

View File

@ -0,0 +1,128 @@
package jnpf.model.order;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jnpf.entity.OrderDetailEntity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 业务订单 Form
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
@Data
public class OrderForm {
@Schema(description = "主键")
private String id;
@Schema(description = "销售订单编号")
private String saleOrdNo;
@Schema(description = "下单日期")
private Date ordDate;
@Schema(description = "客户ID")
private Integer custId;
@Schema(description = "客户名称")
private String custName;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "联系人")
private String contact;
@Schema(description = "联系电话")
private String conPhone;
@Schema(description = "业务员ID")
private Long saleMan;
@Schema(description = "业务部门ID")
private Long saleDeptId;
@Schema(description = "订单类型")
private String ordType;
@Schema(description = "付款方式")
private String paymentTerms;
@Schema(description = "税率")
private BigDecimal taxRate;
@Schema(description = "含税总金额")
private BigDecimal totalAmount;
@Schema(description = "要求交货日期")
private Date reqDeliveryDate;
@Schema(description = "是否急单")
private String isUrgent;
@Schema(description = "是否变更")
private String isChange;
@Schema(description = "订单状态")
private String ordStatus;
@Schema(description = "合同编号")
private String contractNo;
@Schema(description = "包装要求")
private String packReq;
@Schema(description = "质量要求")
private String qualityReq;
@Schema(description = "备注")
private String remark;
@Schema(description = "审核人ID")
private String auditId;
@Schema(description = "审核时间")
private Date auditTime;
@Schema(description = "附件信息")
private String attFile;
@Schema(description = "创建时间")
private Date creatorTime;
@Schema(description = "创建用户ID")
private String creatorUserId;
@Schema(description = "最后修改时间")
private Date lastModifyTime;
@Schema(description = "最后修改用户ID")
private String lastModifyUserId;
@Schema(description = "删除时间")
private Date deleteTime;
@Schema(description = "删除用户ID")
private String deleteUserId;
@Schema(description = "删除标记")
private Integer deleteMark;
@Schema(description = "流程ID")
private String flowId;
@Schema(description = "流程任务ID")
private String flowTaskId;
@JsonProperty("OrderDetailList")
private List<OrderDetailEntity> OrderDetailList;
}

View File

@ -0,0 +1,48 @@
package jnpf.model.order;
import jnpf.base.Pagination;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
* 业务订单分页查询
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
@Data
public class OrderPagination extends Pagination {
/** 查询key */
private String[] selectKey;
/** json */
private String json;
/** 数据类型 0-当前页1-全部数据 */
private String dataType;
/** 高级查询 */
private String superQueryJson;
/** 功能id */
private String moduleId;
/** 菜单id */
private String menuId;
@Schema(description = "销售订单编号")
private String saleOrdNo;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "是否急单")
private Integer isUrgent;
@Schema(description = "订单状态")
private String ordStatus;
@Schema(description = "业务员")
private String saleManName;
@Schema(description = "下单日期")
private Object ordDate;
}

View File

@ -0,0 +1,85 @@
package jnpf.model.orderdetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 业务订单明细 Form
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
@Data
@Schema(description = "OrderDetailForm对象", name = "业务订单明细表单对象")
public class OrderDetailForm implements Serializable {
@Schema(description = "主键")
private String id;
@Schema(description = "销售订单主表ID")
private Integer saleOrdId;
@Schema(description = "物料ID")
private Integer materialId;
@Schema(description = "物料编码")
private String materialCode;
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "规格型号")
private String spec;
@Schema(description = "单位")
private String unit;
@Schema(description = "订单数量")
private BigDecimal ordQty;
@Schema(description = "含税单价")
private BigDecimal priceTax;
@Schema(description = "用途")
private String materialUse;
@Schema(description = "已发货数量")
private BigDecimal deliveredQty;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
private Date creatorTime;
@Schema(description = "创建用户ID")
private String creatorUserId;
@Schema(description = "最后修改时间")
private Date lastModifyTime;
@Schema(description = "最后修改用户ID")
private String lastModifyUserId;
@Schema(description = "删除时间")
private Date deleteTime;
@Schema(description = "删除用户ID")
private String deleteUserId;
@Schema(description = "删除标记")
private Integer deleteMark;
@Schema(description = "流程ID")
private String flowId;
@Schema(description = "流程任务ID")
private String flowTaskId;
}

View File

@ -0,0 +1,41 @@
package jnpf.model.orderdetail;
import jnpf.base.Pagination;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 业务订单明细分页查询
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
@Data
public class OrderDetailPagination extends Pagination {
@Schema(description = "销售订单主表ID")
private Integer saleOrdId;
@Schema(description = "物料ID")
private Integer materialId;
@Schema(description = "物料编码")
private String materialCode;
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "规格型号")
private String spec;
@Schema(description = "用途")
private String materialUse;
@Schema(description = "关键词")
private String keyword;
}

View File

@ -0,0 +1,85 @@
package jnpf.model.orderdetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 业务订单明细 VO
*
* @版本 V3.5
* @版权 引迈信息技术有限公司https://www.jnpfsoft.com
* @作者 JNPF开发平台组
* @日期 2024-02-04
*/
@Data
@Schema(description = "OrderDetail对象", name = "业务订单明细")
public class OrderDetailVO implements Serializable {
@Schema(description = "主键")
private Integer id;
@Schema(description = "销售订单主表ID")
private Integer saleOrdId;
@Schema(description = "物料ID")
private Integer materialId;
@Schema(description = "物料编码")
private String materialCode;
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "规格型号")
private String spec;
@Schema(description = "单位")
private String unit;
@Schema(description = "订单数量")
private BigDecimal ordQty;
@Schema(description = "含税单价")
private BigDecimal priceTax;
@Schema(description = "用途")
private String materialUse;
@Schema(description = "已发货数量")
private BigDecimal deliveredQty;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
private Date creatorTime;
@Schema(description = "创建用户ID")
private String creatorUserId;
@Schema(description = "最后修改时间")
private Date lastModifyTime;
@Schema(description = "最后修改用户ID")
private String lastModifyUserId;
@Schema(description = "删除时间")
private Date deleteTime;
@Schema(description = "删除用户ID")
private String deleteUserId;
@Schema(description = "删除标记")
private Integer deleteMark;
@Schema(description = "流程ID")
private String flowId;
@Schema(description = "流程任务ID")
private String flowTaskId;
}

View File

@ -2,6 +2,7 @@ package jnpf.permission.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.page.PageMethod;
import jnpf.base.service.SuperServiceImpl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
@ -52,6 +53,8 @@ import java.util.stream.Collectors;
import jnpf.base.UserInfo;
import jnpf.permission.model.user.mod.UserConditionModel;
import javax.annotation.Resource;
import static jnpf.consts.AuthConsts.TOKEN_PREFIX;
/**
@ -90,7 +93,7 @@ public class UserServiceImpl extends SuperServiceImpl<UserMapper, UserEntity> im
private OrganizeRelationService organizeRelationService;
@Autowired
private AuthorizeService authorizeService;
@Autowired
@Resource
private UserMapper userMapper;
@Autowired
private OrganizeAdministratorService organizeAdministratorService;
@ -1706,6 +1709,14 @@ public class UserServiceImpl extends SuperServiceImpl<UserMapper, UserEntity> im
return list;
}
@Override
public List<UserEntity> getUserByName(String saleManName) {
LambdaQueryWrapper<UserEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(UserEntity::getRealName, saleManName);
queryWrapper.isNull(UserEntity::getDeleteMark);
return this.list(queryWrapper);
}
@Override
public Boolean delCurRoleUser(List<String> objectIdAll) {
// 判断角色下面的人

View File

@ -396,4 +396,6 @@ public interface UserService extends SuperService<UserEntity> {
* @return
*/
List<UserIdListVo> selectedByIds(List<String> ids);
List<UserEntity> getUserByName(String saleManName);
}

View File

@ -120,7 +120,6 @@ export const inputComponents = [
style: { width: "100%" },
maxlength: null,
showWordLimit: true,
readonly: false,
disabled: false,
readonly: false,
},

View File

@ -0,0 +1,206 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" content="详情" />
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class="main" :style="{ margin: '0 auto', width: '100%' }">
<el-form ref="formRef" :model="dataForm" size="small" label-width="150px" label-position="right">
<template v-if="!loading">
<el-col :span="12">
<jnpf-form-tip-item label="供应商" prop="supplierId">
<p>{{ dataForm.supplierId }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="物料编码" prop="materialCode">
<p>{{ dataForm.materialCode }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="规格">
<p>{{ dataForm.materialCode_device_code }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="生产日期(批号)" prop="productLot">
<JnpfInput v-model="dataForm.productLot" placeholder="请输入" disabled detailed clearable :style="{ width: '100%' }"> </JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="到货日期" prop="recieveDate">
<p>{{ dataForm.recieveDate }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="检验日期" prop="checkDate">
<p>{{ dataForm.checkDate }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="到货数量(kg)" prop="recieveKg">
<JnpfNumber v-model="dataForm.recieveKg" placeholder="数字文本" disabled :step="10"> </JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="到货数量(件)" prop="recievePiece">
<JnpfNumber v-model="dataForm.recievePiece" placeholder="数字文本" disabled :step="10"> </JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="抽检数量(件)" prop="sampleQty">
<JnpfNumber v-model="dataForm.sampleQty" placeholder="数字文本" disabled :step="10"> </JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="检验结果" prop="checkResult">
<p>{{ dataForm.checkResult }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="处理结果" prop="processResult">
<p>{{ dataForm.processResult }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="问题原因" prop="problemReason">
<p>{{ dataForm.problemReason }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="备注" prop="remark">
<p>{{ dataForm.remark }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>检验数据明细</h2>
</div>
<el-table :data="dataForm.tableField120" size="mini">
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
<el-table-column prop="avgValue" label="平均值" align="" fixed="${config.tableFixed}">
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.avgValue" placeholder="数字文本" disabled :step="1"> </JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" align="" fixed="${config.tableFixed}">
<template slot-scope="scope">
<JnpfInput v-model="scope.row.remark" placeholder="请输入" disabled detailed clearable :style="{ width: '100%' }"> </JnpfInput>
</template>
</el-table-column>
<el-table-column prop="checkResult" label="判定结果" align="" fixed="${config.tableFixed}">
<template slot-scope="scope">
<p>{{ scope.row.checkResult }}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>样品数据</h2>
</div>
<el-table :data="dataForm.tableField126" size="mini">
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
<el-table-column prop="actValue" label="实际的检验值" align="" fixed="${config.tableFixed}">
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.actValue" placeholder="数字文本" disabled :step="1"> </JnpfNumber>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request';
import { getConfigData } from '@/api/onlineDev/visualDev';
import jnpf from '@/utils/jnpf';
import Detail from '@/views/basic/dynamicModel/list/detail';
import { thousandsFormat } from '@/components/Generator/utils/index';
export default {
components: { Detail },
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
//
maskConfig: {
productLot: {},
qa_material_check_data_twremark: {},
},
//
locationScope: {},
dataForm: {},
checkResultOptions: [
{ fullName: '合格', id: '1' },
{ fullName: '不合格', id: '0' },
],
checkResultProps: { label: 'fullName', value: 'id' },
checkResultOptions: [
{ fullName: '合格', id: '1' },
{ fullName: '不合格', id: '0' },
],
checkResultProps: { label: 'fullName', value: 'id' },
};
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return;
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return;
let formData = JSON.parse(res.data.formData);
formData.popupType = 'general';
this.detailVisible = true;
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue);
});
});
},
dataInfo(dataAll) {
let _dataAll = dataAll;
this.dataForm = _dataAll;
},
goBack() {
this.$emit('refresh');
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true;
request({
url: '/api/example/Qa_material_check_data/detail/' + this.dataForm.id,
method: 'get',
}).then(res => {
this.dataInfo(res.data);
this.loading = false;
});
}
});
},
},
};
</script>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,938 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" :content="!dataForm.id ? '新建' : '编辑'" />
<div class="options">
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled="continueBtnLoading"
v-if="dataForm.checkStatus != 2">
</el-button>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class="main" :style="{ margin: '0 auto', width: '100%' }">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="auto"
label-position="right">
<template v-if="!loading">
<el-col :span="24" :sm="24" :md="24" :xl="24" :xs="24">
<el-form-item class="testNum" label="第">
<el-input v-model="dataForm.testTime" placeholder="次数"></el-input>
<span>次抽检,</span>
<el-input v-model="dataForm.testTimeContent" placeholder=""></el-input>
<span>项目符合产品质量验收标准</span>
</el-form-item>
</el-col>
<!-- 具体表单 -->
<el-col :span="16" :sm="24" :md="24" :xl="16" :xs="24">
<jnpf-form-tip-item label="产品名称" align="" fixed="${config.tableFixed}" prop="materialId">
<JnpfPopupSelect v-model="dataForm.materialId" @change="changeMaterialData" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.materialCode" placeholder="请选择" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField="materialName"
field="materialCode" interfaceId="741298687854011000" :pageSize="20"
:columnOptions="checkSeqcolumnOptions" clearable :multiple="true" :style="{ width: '100%' }">
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" :sm="24" :md="24" :xl="8" :xs="24">
<jnpf-form-tip-item label="规格" align="" fixed="${config.tableFixed}" prop="model">
<JnpfInput v-model="dataForm.model" @change="changeData('model', -1)" placeholder=""
:controls="true">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" :sm="24" :md="8" :xl="8" :xs="24" :lg="8">
<jnpf-form-tip-item label="生产批号" align="" fixed="${config.tableFixed}" prop="productLot">
<JnpfInput v-model="dataForm.productLot" @change="changeData('productLot', -1)" placeholder="请输入"
clearable :style="{ width: '100%' }">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" :sm="24" :md="8" :xl="8" :xs="24" :lg="8">
<jnpf-form-tip-item label="批量(箱)" align="" fixed="${config.tableFixed}" prop="recievePiece">
<el-input v-model="dataForm.recievePiece">
</el-input>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" :sm="24" :md="8" :xl="8" :xs="24" :lg="8">
<jnpf-form-tip-item label="样本量(片)" align="" fixed="${config.tableFixed}" prop="sampleQty">
<JnpfInput v-model="dataForm.sampleQty" @change="changeData('sampleQty', -1)" placeholder=""
:controls="false">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" :sm="24" :md="8" :xl="8" :xs="24" :lg="8">
<jnpf-form-tip-item label="检验日期" align="" fixed="${config.tableFixed}" prop="checkDate">
<JnpfDatePicker v-model="dataForm.checkDate" @change="changeData('checkDate', -1)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择"
clearable :style="{ width: '100%' }" type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" :sm="24" :md="8" :xl="8" :xs="24" :lg="8">
<jnpf-form-tip-item label="环境温度(℃)" align="" fixed="${config.tableFixed}" prop="ambTmp">
<JnpfInput v-model="dataForm.ambTmp" @change="changeData('ambTmp', -1)" placeholder=""
:controls="false">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" :sm="24" :md="8" :xl="8" :xs="24" :lg="8">
<jnpf-form-tip-item label="环境湿度" align="" fixed="${config.tableFixed}" prop="ambHum">
<JnpfInput v-model="dataForm.ambHum" @change="changeData('ambHum', -1)" placeholder=""
:controls="false">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" :sm="24" :md="8" :xl="8" :xs="24" :lg="8">
<jnpf-form-tip-item label="品项号" align="" fixed="${config.tableFixed}" prop="sku">
<JnpfInput v-model="dataForm.sku" @change="changeData('ambHum', -1)" placeholder=""
:controls="false">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" :sm="24" :md="8" :xl="8" :xs="24" :lg="8">
<jnpf-form-tip-item label="实测数量" align="" fixed="${config.tableFixed}" prop="testNum">
<JnpfInput v-model="dataForm.testNum" @change="changeData('testNum', -1)" placeholder=""
:controls="false">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" :sm="24" :md="8" :xl="8" :xs="24" :lg="8">
<jnpf-form-tip-item label="是否提交" align="" fixed="${config.tableFixed}" prop="checkStatus">
<el-select v-model="dataForm.checkStatus" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" :sm="24" :md="24" :xl="24" :xs="24" :lg="24">
<jnpf-form-tip-item label="备注" align="" fixed="${config.tableFixed}" prop="remark">
<JnpfTextarea v-model="dataForm.remark" @change="changeData('remark', -1)" placeholder="请输入"
:style="{ width: '100%' }" true type="textarea" :autoSize="{ minRows: 4, maxRows: 4 }">
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="dataForm.isAttDet == 'Y'">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>属性检测</h2>
</div>
<el-table :data="itemData" size="mini" :span-method="objectSpanMethod">
<el-table-column prop="type" label="类别" align="center" width="100px"> </el-table-column>
<el-table-column prop="qxjsxd" label="缺陷接收限定" align="center" width="150px"> </el-table-column>
<el-table-column prop="qxl" label="缺陷率(0%)" align="center" width="150px"> </el-table-column>
<el-table-column label="缺陷描述" align="" prop="qxms">
<template slot="header"> 缺陷描述 </template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.qxms" clearable :style="{ width: '100%' }">
</JnpfInput>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>审核日志</h2>
</div>
<el-table :data="itemData1" size="mini" >
<el-table-column prop="operation" label="操作" align="center"> </el-table-column>
<el-table-column prop="checkRemark" label="审核原因" align="center"> </el-table-column>
<el-table-column prop="checkExUserName" label="审核人" align="center"> </el-table-column>
<el-table-column prop="checkExDate" label="审核时间" align="center" :formatter="jnpf.tableDateFormat2"> </el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="closeForSelect" />
</el-row>
<el-dialog title="输入样本值" :visible.sync="itemCenterDialog" append-to-body width="30%">
<el-button @click="addDomain">添加</el-button>
<el-button @click.prevent="removeDomain">删除</el-button>
<el-table :data="productItemList" size="mini" @selection-change="getqa_material_check_data_twRowSelection"
max-height="650">
<el-table-column label="实测数据" align="center" prop="actValue">
<template slot="header"> 实测数据 </template>
<template slot-scope="scope">
<JnpfInputNumber v-model="scope.row.actValue"
@change="changeData('qa_material_check_data_tw-avgValue', scope.$index)" placeholder="" :step="1"
:controls="false">
</JnpfInputNumber>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="calValue" type="primary">确定</el-button>
<el-button @click.prevent="itemCenterDialog = false">取消</el-button>
</span>
</el-dialog>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from 'vuex'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from '@/components/Generator/utils/index'
import SelectDialog from '@/components/SelectDialog'
import { options } from 'runjs'
export default {
components: { SelectDialog },
props: [],
data() {
return {
calRow: {},
productItemList: [],
itemCenterDialog: false,
itemData: [
{ type: '产品', qxjsxd: '安全0%', qxl: '0%', qxms: '', prop: 'proSafe' },
{ type: '产品', qxjsxd: '功能1%', qxl: '0%', qxms: '', prop: 'proFun' },
{ type: '产品', qxjsxd: '外观5%', qxl: '0%', qxms: '', prop: 'proApp' },
{ type: '包装', qxjsxd: '安全0%', qxl: '0%', qxms: '', prop: 'packSafe' },
{ type: '包装', qxjsxd: '功能1%', qxl: '0%', qxms: '', prop: 'packFun' },
{ type: '包装', qxjsxd: '外观5%', qxl: '0%', qxms: '', prop: 'packApp' },
],
itemData1:[],
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting: {},
eventType: '',
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {},
//
ableAll: {},
tableRows: {
qa_material_check_data_twList: {
avgValue: undefined,
avgValueOptions: [],
remark: '',
remarkOptions: [],
checkResultOptions: [],
enabledmark: undefined,
},
qa_material_check_data_thList: {
actValue: undefined,
actValueOptions: [],
enabledmark: undefined,
},
},
Vmodel: '',
currVmodel: '',
dataForm: {
member: '',
materialCode: '',
checkSeq: undefined,
productNumber: undefined,
productLot: undefined,
checkUserName: undefined,
checkDate: undefined,
sampleQty: undefined,
checkResult: 1,
remark: undefined,
qa_material_check_data_twList: [],
qa_material_check_data_thList: [],
itemList: [],
},
tableRequiredData: {},
dataRule: {
materialCode: [
{
required: true,
message: '请选择',
trigger: 'change',
},
],
},
checkSeqcolumnOptions: [
// { label: '', value: 'piece_id' },
// { label: '', value: 'piece_name' },
// { label: '', value: 'models' },
// { label: '', value: 'unit' },
// { label: '', value: 'version_code' },
{ label: '产品名称', value: 'materialName' },
{ label: '产品编码', value: 'materialCode' },
{ label: '规格', value: 'model' },
],
checkResultOptions: [
{ fullName: '合格', id: 1 },
{ fullName: '不合格', id: 0 },
],
checkResultProps: { label: 'fullName', value: 'id' },
qa_material_check_data_twcheckResultOptions: [
{ fullName: '合格', id: 1 },
{ fullName: '不合格', id: 0 },
],
qa_material_check_data_twcheckResultProps: { label: 'fullName', value: 'id' },
childIndex: -1,
isEdit: false,
interfaceRes: {
supplierId: [],
materialCode: [],
productLot: [],
recieveDate: [],
checkDate: [],
recieveKg: [],
recievePiece: [],
sampleQty: [],
checkResult: [],
processResult: [],
problemReason: [],
remark: [],
creatorUserId: [],
creatorTime: [],
lastModifyUserId: [],
lastModifyTime: [],
qa_material_check_data_twavgValue: [],
qa_material_check_data_twremark: [],
qa_material_check_data_twcheckResult: [],
qa_material_check_data_thactValue: [],
},
//
maskConfig: {
productLot: {},
qa_material_check_data_twremark: {},
},
//
locationScope: {},
selectedqa_material_check_data_twRowKeys: [],
selectedqa_material_check_data_thRowKeys: [],
options: [],
}
},
computed: {
...mapGetters(['userInfo']),
getqa_material_check_data_twHasBatchBtn() {
let flist = []
return flist.some(o => ['batchRemove'].includes(o.value) && o.show)
},
getqa_material_check_data_thHasBatchBtn() {
let flist = []
return flist.some(o => ['batchRemove'].includes(o.value) && o.show)
},
},
watch: {
},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {
getDictionaryDataSelector("743848488864868101").then(res => {
this.options = res.data.list.map(c => {
return {
label: c.fullName,
value: c.enCode
}
});
if (!this.dataForm.id) {
const value = this.options.find(c => c.label == "未提交").value;
this.$set(this.dataForm, 'checkStatus', value);
}
})
},
methods: {
startCal(val) {
this.itemCenterDialog = true
this.calRow = val
if (!this.dataForm.id) {
this.productItemList = []
for (let i = 0; i < this.dataForm.sampleQty; i++) {
this.productItemList.push({ actValue: 0 })
}
} else {
if (val.hasOwnProperty('itemList')) {
this.productItemList = val.itemList
}
}
},
calValue() {
//todo
if (this.productItemList.length == 0) return
let total = 0
this.productItemList.forEach(num => {
total += num.actValue
})
let val = Math.floor((total / this.productItemList.length) * 100) / 100
this.calRow.avgValue = val
this.calRow.itemList = this.productItemList
// this.calRow.remark = '-'
console.log(this.calRow.lowerLimit)
console.log(this.calRow.upperLimit)
if (this.calRow.lowerLimit != null && this.calRow.upperLimit == null) {
if (val >= this.calRow.lowerLimit) {
this.calRow.checkResult = 1
} else {
this.calRow.checkResult = 0
}
} else if (this.calRow.lowerLimit == null && this.calRow.upperLimit != null) {
if (val <= this.calRow.upperLimit) {
this.calRow.checkResult = 1
} else {
this.calRow.checkResult = 0
}
} else {
if (!isNaN(parseFloat(this.calRow.lowerLimit)) && isFinite(this.calRow.upperLimit)) {
let lowerLimit = Number(this.calRow.lowerLimit)
let upperLimit = Number(this.calRow.upperLimit)
if (val >= lowerLimit && val <= upperLimit) {
this.calRow.checkResult = 1
} else {
this.calRow.checkResult = 0
}
}
}
this.itemCenterDialog = false
},
addDomain() {
this.productItemList.push({ actValue: 0 })
},
removeDomain() {
this.productItemList.pop()
},
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index]
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index]
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/example/QaFinalCheckData/' + id,
method: 'get',
}).then(res => {
console.log('JSON.stringify(this.dataForm)' + JSON.stringify(res))
this.dataInfo(res.data)
})
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split('-')
let faceMode = ''
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i]
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options'
if (this[options]) {
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeMaterialData(model, obj) {
console.log('model >>> ' + model + ' index >>> ' + obj)
this.dataForm.model = obj.model;
this.dataForm.materialCode = obj.materialCode;
this.dataForm.materialName = obj.materialName;
this.dataForm.formCode = obj.formCode;
this.dataForm.qaSchemeBaseId = obj.qaSchemeBaseId;
this.dataForm.testNum = obj.testNum;
this.$set(this.dataForm, 'isAttDet', (obj && obj.isAttDet) ? obj.isAttDet : 'N');
},
changeDataFormData(type, data, model, index, defaultValue, edit) {
if (!edit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll() { },
qa_material_check_data_twExist() {
let isOk = true
for (let i = 0; i < this.dataForm.qa_material_check_data_twList.length; i++) {
const e = this.dataForm.qa_material_check_data_twList[i]
}
return isOk
},
qa_material_check_data_thExist() {
let isOk = true
for (let i = 0; i < this.dataForm.qa_material_check_data_thList.length; i++) {
const e = this.dataForm.qa_material_check_data_thList[i]
}
return isOk
},
goBack() {
this.$emit('refresh', true)
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList, leftTreeActiveInfo) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
}
} else {
this.prevDis = true
this.nextDis = true
}
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/example/QaProMaterialCheck/' + this.dataForm.id,
method: 'get',
}).then(res => {
this.dataInfo(res.data)
this.loading = false;
if (this.dataForm.isAttDet === 'Y') {
this.itemData = [
{ type: '产品', qxjsxd: '安全0%', qxl: '0%', qxms: this.dataForm.proSafe, prop: 'proSafe' },
{ type: '产品', qxjsxd: '功能1%', qxl: '0%', qxms: this.dataForm.proFun, prop: 'proFun' },
{ type: '产品', qxjsxd: '外观5%', qxl: '0%', qxms: this.dataForm.proApp, prop: 'proApp' },
{ type: '包装', qxjsxd: '安全0%', qxl: '0%', qxms: this.dataForm.packSafe, prop: 'packSafe' },
{ type: '包装', qxjsxd: '功能1%', qxl: '0%', qxms: this.dataForm.packFun, prop: 'packFun' },
{ type: '包装', qxjsxd: '外观5%', qxl: '0%', qxms: this.dataForm.packApp, prop: 'packApp' },
]
}
})
let _query = {
checkId: this.dataForm.id,
dataType: 1,
menuId: this.menuId,
checkType: 2,
}
request({
url: `/api/example/QaMaterialCheckLog/getList`,
method: 'post',
data: _query,
}).then(res => {
var _list = []
for (let i = 0; i < res.data.list.length; i++) {
let _data = res.data.list[i]
_list.push(_data)
}
this.itemData1 = _list.map(o => ({
...o,
...this.expandObj,
}))
})
} else {
this.clearData()
this.initDefaultData()
this.dataForm = { ...this.dataForm, ...leftTreeActiveInfo };
}
})
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
this.dataForm.recieveDate = new Date().getTime()
this.dataForm.checkDate = new Date().getTime()
},
//
dataFormSubmit(type) {
if(this.dataForm.qaSchemeBaseId==null|| this.dataForm.qaSchemeBaseId==''){
this.$message.warning("成品" + this.dataForm.materialName + "缺少质检方案");
return;
}
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate(valid => {
if (valid) {
this.request()
}
})
},
request() {
let _data = this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/example/QaProMaterialCheck',
method: 'post',
data: _data,
})
.then(res => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
},
})
})
.catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
} else {
request({
url: '/api/example/QaProMaterialCheck/' + this.dataForm.id,
method: 'PUT',
data: _data,
})
.then(res => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return (this.continueBtnLoading = false)
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
},
})
})
.catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
addqa_material_check_data_twRow() {
let item = {
avgValue: undefined,
remark: undefined,
checkResult: '',
}
this.getqa_material_check_data_twList(item)
},
removeqa_material_check_data_twRow(index, showConfirm = false) {
if (showConfirm) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning',
})
.then(() => {
this.dataForm.qa_material_check_data_twList.splice(index, 1)
})
.catch(() => { })
} else {
this.dataForm.qa_material_check_data_twList.splice(index, 1)
}
},
copyqa_material_check_data_twRow(index) {
let item = JSON.parse(JSON.stringify(this.dataForm.qa_material_check_data_twList[index]))
item.length && item.map(o => delete o.rowData)
this.dataForm.qa_material_check_data_twList.push(item)
},
getqa_material_check_data_twList(value, select) {
let item = { ...this.tableRows.qa_material_check_data_twList, ...value }
this.dataForm.qa_material_check_data_twList.push(JSON.parse(JSON.stringify(item)))
if (!select) {
}
this.childIndex = this.dataForm.qa_material_check_data_twList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
//
getqa_material_check_data_twRowSelection(value) {
this.selectedqa_material_check_data_twRowKeys = value
},
//
batchRemoveqa_material_check_data_twRow(showConfirm = false) {
if (!this.selectedqa_material_check_data_twRowKeys.length) return this.$messages.error('请选择一条数据')
const handleRemove = () => {
this.selectedqa_material_check_data_twRowKeys.forEach(row => {
const index = this.dataForm.qa_material_check_data_twList.indexOf(row)
this.dataForm.qa_material_check_data_twList.splice(index, 1)
})
}
if (showConfirm) {
this.$confirm('确定删除该数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
handleRemove()
})
.catch(() => { })
} else {
handleRemove()
}
},
addqa_material_check_data_thRow() {
let item = {
actValue: undefined,
}
this.getqa_material_check_data_thList(item)
},
removeqa_material_check_data_thRow(index, showConfirm = false) {
if (showConfirm) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning',
})
.then(() => {
this.dataForm.qa_material_check_data_thList.splice(index, 1)
})
.catch(() => { })
} else {
this.dataForm.qa_material_check_data_thList.splice(index, 1)
}
},
copyqa_material_check_data_thRow(index) {
let item = JSON.parse(JSON.stringify(this.dataForm.qa_material_check_data_thList[index]))
item.length && item.map(o => delete o.rowData)
this.dataForm.qa_material_check_data_thList.push(item)
},
getqa_material_check_data_thList(value, select) {
let item = { ...this.tableRows.qa_material_check_data_thList, ...value }
this.dataForm.qa_material_check_data_thList.push(JSON.parse(JSON.stringify(item)))
if (!select) {
}
this.childIndex = this.dataForm.qa_material_check_data_thList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
//
getqa_material_check_data_thRowSelection(value) {
this.selectedqa_material_check_data_thRowKeys = value
},
//
batchRemoveqa_material_check_data_thRow(showConfirm = false) {
if (!this.selectedqa_material_check_data_thRowKeys.length) return this.$messages.error('请选择一条数据')
const handleRemove = () => {
this.selectedqa_material_check_data_thRowKeys.forEach(row => {
const index = this.dataForm.qa_material_check_data_thList.indexOf(row)
this.dataForm.qa_material_check_data_thList.splice(index, 1)
})
}
if (showConfirm) {
this.$confirm('确定删除该数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
handleRemove()
})
.catch(() => { })
} else {
handleRemove()
}
},
openSelectDialog(key, value) {
this.currTableConf = this.addTableConf[key + value]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
this.closeForSelect()
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t, true)
}
}
},
closeForSelect() {
this.selectDialogVisible = false
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = ''
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = ''
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = ''
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = ''
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue
},
dataList() {
// this.dataForm.itemList = this.itemData
// console.log(' this.dataForm.itemList >>>>> ' + JSON.stringify(this.dataForm.itemList))
if (this.dataForm.isAttDet == 'Y') {
this.itemData.forEach(item => {
this.dataForm[item.prop] = item.qxms
});
}
var _data = this.dataForm
console.log(' this.dataForm >>>>> ' + JSON.stringify(this.dataForm))
return _data
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
if (_dataAll.qa_material_check_data_twList) {
for (let i = 0; i < _dataAll.qa_material_check_data_twList.length; i++) {
this.childIndex = i
}
}
if (_dataAll.qa_material_check_data_thList) {
for (let i = 0; i < _dataAll.qa_material_check_data_thList.length; i++) {
this.childIndex = i
}
}
this.childIndex = -1
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
if (rowIndex === 0) {
return [3, 1];
}
if (rowIndex === 3) {
return [3, 1];
}
if (rowIndex === 6) {
return [3, 1];
}
return [0, 0];
}
}
},
}
</script>
<style lang="scss" scoped>
.JNPF-preview-main .testNum {
.el-input {
width: 80px;
}
span {
margin: 0 5px;
}
}
</style>

View File

@ -0,0 +1,611 @@
<template>
<div class="JNPF-common-layout finalcheckdata_new">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="14">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="下单日期">
<JnpfDateRangePicker v-model="query.ordDate" format="yyyy-MM-dd"
startPlaceholder="开始日期" endPlaceholder="结束日期" />
</el-form-item>
</el-col>
<el-col :span="6" >
<el-form-item label="订单编号">
<el-input v-model="query.saleOrdNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6" >
<el-form-item label="项目名称">
<el-input v-model="query.projectName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否急单">
<JnpfSelect v-model="query.isUrgent" placeholder="请选择" clearable :options="isUrgentOptions"
:props="isUrgentProps">
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="订单状态">
<JnpfSelect v-model="query.ordStatus" placeholder="请选择" clearable :options="ordStatusOptions"
:props="ordStatusProps">
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6" >
<el-form-item label="业务员">
<el-input v-model="query.saleManName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6" >
<el-form-item class="btn">
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">新建
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()"
v-has="'btn_download'">导出
</el-button>
</div>
<div class="JNPF-common-head-right">
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list"
:span-method="arraySpanMethod">
<el-table-column prop="saleOrdNo" label="订单编码" align="center"/>
<el-table-column prop="ordDate" label="下单日期" align="center" :formatter="jnpf.tableDateFormat1"/>
<el-table-column prop="custName" label="客户名称" align="center"/>
<el-table-column prop="projectName" label="项目名称" align="center"/>
<el-table-column prop="ordType" label="订单类型" align="left">
<template slot-scope="scope">
{{ scope.row.ordType == 1 ? '常规' : scope.row.ordType == 2 ? '定制' : scope.row.ordType }}
</template>
</el-table-column>
<el-table-column prop="reqDeliveryDate" label="要求交货日期" align="center" :formatter="jnpf.tableDateFormat1"/>
<el-table-column prop="isUrgent" label="是否急单" align="left">
<template slot-scope="scope">
{{ scope.row.isUrgent == 0 ? '是' : scope.row.isUrgent == 1 ? '否' : scope.row.isUrgent }}
</template>
</el-table-column>
<el-table-column prop="contractNo" label="合同编号" align="center"/>
<el-table-column prop="saleManName" label="业务人员" align="center"/>
<el-table-column prop="isChange" label="是否变更" align="left">
<template slot-scope="scope">
{{ scope.row.isChange == 0 ? '是' : scope.row.isChange == 1 ? '否' : scope.row.isChange }}
</template>
</el-table-column>
<el-table-column prop="qualityReq" label="质量要求" align="center"/>
<el-table-column prop="packReq" label="包装要求" align="center"/>
<el-table-column label="操作" fixed="right" align="center" width="170">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)">编辑</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible = false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
</div>
</template>
<script>
import request from "@/utils/request";
import { mapGetters } from "vuex";
import JNPFForm from "./form";
import Detail from "./Detail";
import ExportBox from "@/components/ExportBox";
import ToFormDetail from "@/views/basic/dynamicModel/list/detail";
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import { getConfigData } from "@/api/onlineDev/visualDev";
import columnList from "./columnList";
import SuperQuery from "@/components/SuperQuery";
import superQueryJson from "./superQueryJson";
import { noGroupList } from "@/components/Generator/generator/comConfig";
import {getDictionaryDataSelector} from "@/api/systemData/dictionary";
import {formatDate} from "element-ui";
import {toDate} from "@/filters";
import jnpf from "@/utils/jnpf";
export default {
name: "zpzj_new",
components: {
JNPFForm,
Detail,
ExportBox,
ToFormDetail,
SuperQuery,
},
data() {
return {
keyword: "",
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
hasBatchBtn: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
saleOrdNo: undefined,
ordDate: undefined,
projectName: undefined,
isUrgent: undefined,
ordStatus: undefined,
saleManName:undefined,
},
defListQuery: {
sort: "desc",
sidx: "",
},
//
list: [],
listLoading: false,
multipleSelection: [],
total: 0,
queryData: {},
listQuery: {
superQueryJson: "",
currentPage: 1,
pageSize: 20,
sort: "",
sidx: "",
},
//
ordersList: [],
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
isUrgentOptions: [
{ fullName: "是", id: "0" },
{ fullName: "否", id: "1" },
],
isUrgentProps: { label: "fullName", value: "id" },
ordStatusOptions: [
],
ordStatusProps: { label: "fullName", value: "enCode" },
};
},
computed: {
jnpf() {
return jnpf
},
...mapGetters(["userInfo"]),
menuId() {
return this.$route.meta.modelId || "";
},
},
created() {
this.getColumnList(),
this.getOrdStatusOptions(),
this.initSearchDataAndListData();
this.queryData = JSON.parse(JSON.stringify(this.query));
},
methods: {
// excel
exportExcel(row) {
request({
url: `/api/example/QaProMaterialCheck/exportExcel`,
method: "post",
data: {
id: row.id,
checkCode: row.printCode,
// checkCode: 2
}
}).then((res) => {
if (!res.data || !res.data.url) {
this.$message.error('导出失败:未返回下载地址');
return;
}
this.jnpf.downloadFile(res.data.url);
//
if (this.$refs.ExportBox) {
this.$refs.ExportBox.visible = false;
}
this.exportBoxVisible = false;
}).catch(err => {
console.error('导出Excel失败:', err);
this.$message.error(err.message || '导出Excel失败请重试');
});
},
getOrdStatusOptions() {
getDictionaryDataSelector("811520443046428805").then(res => {
this.ordStatusOptions = res.data.list;
});
},
handleSelectionChange() { },
treeRefresh() {
this.keyword = "";
this.treeActiveId = "";
this.leftTreeActiveInfo = {};
this.$refs.treeBox.setCurrentKey(null);
this.getTreeView();
},
toDetail(defaultValue, modelId) {
if (!defaultValue) return;
getConfigData(modelId).then((res) => {
if (!res.data || !res.data.formData) return;
let formData = JSON.parse(res.data.formData);
formData.popupType = "general";
this.toFormDetailVisible = true;
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue);
});
});
},
toggleTreeExpand(expands) {
this.refreshTree = false;
this.expandsTree = expands;
this.$nextTick(() => {
this.refreshTree = true;
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null);
});
});
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data;
const config = {
treeInterfaceId: "",
treeTemplateJson: [],
};
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || "";
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
};
//
getDataInterfaceRes(config.treeInterfaceId, query).then((res) => {
let data = res.data;
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
});
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList);
},
transformColumnList(columnList) {
let list = [];
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes("-")) {
list.push(e);
} else {
let prop = e.prop.split("-")[0];
let label = e.label.split("-")[0];
let vModel = e.prop.split("-")[1];
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: [],
};
e.vModel = vModel;
if (!this.expandObj.hasOwnProperty(`${prop}Expand`))
this.$set(this.expandObj, `${prop}Expand`, false);
if (!list.some((o) => o.prop === prop)) list.push(newItem);
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e);
break;
}
}
}
}
this.getMergeList(list);
// this.getExportList(list);
return list;
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan];
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list));
newList.forEach((item) => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + "-child-first",
};
item.children.unshift(child);
}
});
newList.forEach((item) => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length,
});
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0,
});
}
});
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1,
});
}
});
},
getExportList(list) {
let exportList = [];
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === "table") {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j]);
}
} else {
exportList.push(list[i]);
}
}
this.exportList = exportList.filter(
(o) => !noGroupList.includes(o.__config__.jnpfKey)
);
},
goDetail(id) {
this.detailVisible = true;
this.$nextTick(() => {
this.$refs.Detail.init(id);
});
},
async initSearchDataAndListData() {
await this.initSearchData();
// this.initData();
},
//
async initSearchData() {
let date = new Date();
let dateWithoutTime = new Date(date.getFullYear(), date.getMonth(), date.getDate());
this.query.ordDate = [dateWithoutTime.getTime(), dateWithoutTime.getTime()]
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
dataType: 0,
};
request({
url: `/api/example/exampleOrder/getList`,
method: "post",
data: _query,
}).then((res) => {
var _list = [];
for (let i = 0; i < res.data.list.length; i++) {
let _data = res.data.list[i];
_list.push(_data);
}
this.list = _list.map((o) => ({
...o,
...this.expandObj,
}));
this.total = res.data.pagination.total;
this.listLoading = false;
});
},
handleDel(id) {
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
type: "warning",
})
.then(() => {
request({
url: `/api/example/QaProMaterialCheck/${id}`,
method: "DELETE",
}).then((res) => {
this.$message({
type: "success",
message: res.msg,
onClose: () => {
this.initData();
},
});
});
})
.catch(() => { });
},
handelUpload() {
this.uploadBoxVisible = true;
this.$nextTick(() => {
this.$refs.UploadBox.init(
"",
"example/QaFinalCheckData",
0,
this.flowList
);
});
},
openSuperQuery() {
this.superQueryVisible = true;
this.$nextTick(() => {
this.$refs.SuperQuery.init();
});
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson;
this.listQuery.currentPage = 1;
this.initData();
},
addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : "";
this.formVisible = true;
if (!this.treeActiveId) {
this.leftTreeActiveInfo = {};
}
this.$nextTick(() => {
this.$refs.JNPFForm.init(
id,
isDetail,
this.list,
this.leftTreeActiveInfo
);
});
},
exportData() {
let temp = [
{ label: "产品名称", prop: "productName" },
{ label: "产品货号", prop: "productNumber" },
{ label: "生产批号", prop: "productLot" },
{ label: "检验人员", prop: "checkUserName" },
{ label: "检验日期", prop: "checkDate" },
{ label: "抽检数量(件)", prop: "sampleQty" },
{ label: "检验结果", prop: "checkResult" },
{ label: "备注", prop: "remark" },
];
this.exportBoxVisible = true;
this.$nextTick(() => {
this.$refs.ExportBox.init(temp);
});
},
download(data) {
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId,
};
request({
url: `/api/example/QaFinalCheckData/Actions/Export`,
method: "post",
data: query,
}).then((res) => {
if (!res.data.url) return;
this.jnpf.downloadFile(res.data.url);
this.$refs.ExportBox.visible = false;
this.exportBoxVisible = false;
});
},
search() {
this.listQuery.currentPage = 1;
this.listQuery.pageSize = 20;
this.initData();
this.update_count += 1;
},
refresh(isrRefresh) {
this.formVisible = false;
if (isrRefresh) this.search();
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData));
this.search();
},
colseFlow(isrRefresh) {
this.flowVisible = false;
if (isrRefresh) this.reset();
},
//
handleHeaderClass({ column }) {
column.order = column.multiOrder;
},
handleTableSort({ column }) {
if (column.sortable !== "custom") return;
column.multiOrder =
column.multiOrder === "descending"
? "ascending"
: column.multiOrder
? ""
: "descending";
this.handleOrderChange(column.property, column.multiOrder);
},
handleOrderChange(orderColumn, orderState) {
let index = this.ordersList.findIndex((e) => e.field === orderColumn);
let sort =
orderState === "ascending"
? "asc"
: orderState === "descending"
? "desc"
: "";
if (index > -1) {
this.ordersList[index].sort = orderState;
} else {
this.ordersList.push({ field: orderColumn, sort });
}
this.ordersList = this.ordersList.filter((e) => e.sort);
this.ordersList.length
? this.setDefaultQuery(this.ordersList)
: this.setDefaultQuery(this.defaultSortConfig);
this.initData();
},
handleJY(row) {
this.$set(this, 'currentRow', row || {})
this.currentRow && this.$refs.jyxm.open(row);
},
handleSH(row) {
this.$set(this, 'currentRow', row || {})
this.currentRow && this.$refs.sh.open(row);
},
handleDelete(row) {
this.handleDel(row.id);
}
},
};
</script>

File diff suppressed because one or more lines are too long