销售出库通知

jg-waiwang-pro
vayne 8 months ago
parent c5e36a2041
commit ce1dd1d879

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.WarehousingNotificationMapper">
</mapper>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.WarehousingProductMapper">
</mapper>

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.WarehousingNotificationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* warehousingNotification
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-19
*/
public interface WarehousingNotificationMapper extends BaseMapper<WarehousingNotificationEntity> {
}

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.WarehousingProductEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* warehousingNotification
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-19
*/
public interface WarehousingProductMapper extends BaseMapper<WarehousingProductEntity> {
}

@ -0,0 +1,39 @@
package jnpf.service;
import jnpf.model.warehousingnotification.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingNotification
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-19
*/
public interface WarehousingNotificationService extends IService<WarehousingNotificationEntity> {
List<WarehousingNotificationEntity> getList(WarehousingNotificationPagination warehousingNotificationPagination);
List<WarehousingNotificationEntity> getTypeList(WarehousingNotificationPagination warehousingNotificationPagination,String dataType);
WarehousingNotificationEntity getInfo(String id);
void delete(WarehousingNotificationEntity entity);
void create(WarehousingNotificationEntity entity);
boolean update(String id, WarehousingNotificationEntity entity);
//子表方法
List<WarehousingProductEntity> getWarehousingProductList(String id,WarehousingNotificationPagination warehousingNotificationPagination);
List<WarehousingProductEntity> getWarehousingProductList(String id);
//副表数据方法
String checkForm(WarehousingNotificationForm form,int i);
void saveOrUpdate(WarehousingNotificationForm warehousingNotificationForm,String id, boolean isSave) throws Exception;
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.warehousingnotification.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingNotification
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-19
*/
public interface WarehousingProductService extends IService<WarehousingProductEntity> {
QueryWrapper<WarehousingProductEntity> getChild(WarehousingNotificationPagination pagination,QueryWrapper<WarehousingProductEntity> warehousingProductQueryWrapper);
}

@ -515,13 +515,13 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
if(isSave){ if(isSave){
String mainId = id ; String mainId = id ;
entity.setCode(generaterSwapUtil.getBillNumber("cgdj", false)); entity.setCode(generaterSwapUtil.getBillNumber("ssdj", false));
entity.setCreateOrderDate(DateUtil.getNowDate()); entity.setCreateOrderDate(DateUtil.getNowDate());
entity.setId(mainId); entity.setId(mainId);
entity.setFlowId(businessOrderForm.getFlowId()); entity.setFlowId(businessOrderForm.getFlowId());
entity.setVersion(0); entity.setVersion(0);
}else{ }else{
entity.setCode(generaterSwapUtil.getBillNumber("cgdj", false)); entity.setCode(generaterSwapUtil.getBillNumber("ssdj", false));
entity.setCreateOrderDate(DateUtil.getNowDate()); entity.setCreateOrderDate(DateUtil.getNowDate());
entity.setFlowId(businessOrderForm.getFlowId()); entity.setFlowId(businessOrderForm.getFlowId());
} }

@ -0,0 +1,367 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingNotificationMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousingnotification.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* warehousingNotification
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-19
*/
@Service
public class WarehousingNotificationServiceImpl extends ServiceImpl<WarehousingNotificationMapper, WarehousingNotificationEntity> implements WarehousingNotificationService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingProductService warehousingProductService;
@Override
public List<WarehousingNotificationEntity> getList(WarehousingNotificationPagination warehousingNotificationPagination){
return getTypeList(warehousingNotificationPagination,warehousingNotificationPagination.getDataType());
}
/** 列表查询 */
@Override
public List<WarehousingNotificationEntity> getTypeList(WarehousingNotificationPagination warehousingNotificationPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
List<List<String>> intersectionList =new ArrayList<>();
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String columnData = !isPc ? WarehousingNotificationConstant.getAppColumnData() : WarehousingNotificationConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int warehousingNotificationNum =0;
QueryWrapper<WarehousingNotificationEntity> warehousingNotificationQueryWrapper=new QueryWrapper<>();
int warehousingProductNum =0;
QueryWrapper<WarehousingProductEntity> warehousingProductQueryWrapper=new QueryWrapper<>();
long warehousingProductcount = warehousingProductService.count();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(warehousingNotificationPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = warehousingNotificationPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<WarehousingNotificationEntity> warehousingNotificationSuperWrapper = new QueryWrapper<>();
warehousingNotificationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingNotificationSuperWrapper,WarehousingNotificationEntity.class,queryJson,"0"));
int warehousingNotificationNum1 = warehousingNotificationSuperWrapper.getExpression().getNormal().size();
if (warehousingNotificationNum1>0){
List<String> warehousingNotificationList =this.list(warehousingNotificationSuperWrapper).stream().map(WarehousingNotificationEntity::getId).collect(Collectors.toList());
allSuperList.addAll(warehousingNotificationList);
intersectionSuperList.add(warehousingNotificationList);
superNum++;
}
String warehousingProductTable = "jg_warehousing_product";
boolean warehousingProductHasSql = queryJson.contains(warehousingProductTable);
List<String> warehousingProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingNotificationConstant.getTableList(), warehousingProductTable , queryJson, null);
if (warehousingProductHasSql){
allSuperList.addAll(warehousingProductList);
intersectionSuperList.add(warehousingProductList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if(superOp.equalsIgnoreCase("and")){
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
}else{
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<WarehousingNotificationEntity> warehousingNotificationSuperWrapper = new QueryWrapper<>();
warehousingNotificationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingNotificationSuperWrapper,WarehousingNotificationEntity.class,ruleJson,"0"));
int warehousingNotificationNum1 = warehousingNotificationSuperWrapper.getExpression().getNormal().size();
if (warehousingNotificationNum1>0){
List<String> warehousingNotificationList =this.list(warehousingNotificationSuperWrapper).stream().map(WarehousingNotificationEntity::getId).collect(Collectors.toList());
allRuleList.addAll(warehousingNotificationList);
intersectionRuleList.add(warehousingNotificationList);
ruleNum++;
}
String warehousingProductTable = "jg_warehousing_product";
boolean warehousingProductHasSql = ruleJson.contains(warehousingProductTable);
List<String> warehousingProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingNotificationConstant.getTableList(), warehousingProductTable , ruleJson, null);
if (warehousingProductHasSql){
allRuleList.addAll(warehousingProductList);
intersectionRuleList.add(warehousingProductList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = true;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehousingNotificationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingNotificationQueryWrapper,WarehousingNotificationEntity.class,warehousingNotificationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingNotificationObj)){
return new ArrayList<>();
} else {
warehousingNotificationQueryWrapper = (QueryWrapper<WarehousingNotificationEntity>)warehousingNotificationObj;
if( warehousingNotificationQueryWrapper.getExpression().getNormal().size()>0){
warehousingNotificationNum++;
}
}
Object warehousingProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingProductQueryWrapper,WarehousingProductEntity.class,warehousingNotificationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingProductObj)){
return new ArrayList<>();
} else {
warehousingProductQueryWrapper = (QueryWrapper<WarehousingProductEntity>)warehousingProductObj;
if( warehousingProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingProductNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehousingNotificationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingNotificationQueryWrapper,WarehousingNotificationEntity.class,warehousingNotificationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingNotificationObj)){
return new ArrayList<>();
} else {
warehousingNotificationQueryWrapper = (QueryWrapper<WarehousingNotificationEntity>)warehousingNotificationObj;
if( warehousingNotificationQueryWrapper.getExpression().getNormal().size()>0){
warehousingNotificationNum++;
}
}
Object warehousingProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingProductQueryWrapper,WarehousingProductEntity.class,warehousingNotificationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingProductObj)){
return new ArrayList<>();
} else {
warehousingProductQueryWrapper = (QueryWrapper<WarehousingProductEntity>)warehousingProductObj;
if( warehousingProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingProductNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(warehousingNotificationPagination.getWarehousingCode())){
warehousingNotificationNum++;
String value = warehousingNotificationPagination.getWarehousingCode() instanceof List ?
JsonUtil.getObjectToString(warehousingNotificationPagination.getWarehousingCode()) :
String.valueOf(warehousingNotificationPagination.getWarehousingCode());
warehousingNotificationQueryWrapper.lambda().like(WarehousingNotificationEntity::getWarehousingCode,value);
}
}
if(warehousingProductNum>0){
List<String> warehousingProductIdList = warehousingProductService.list(warehousingProductQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getWarehousingId())).map(t->t.getWarehousingId()).collect(Collectors.toList());
long count = warehousingProductService.count();
if (count>0){
intersectionList.add(warehousingProductIdList);
}
AllIdList.addAll(warehousingProductIdList);
}
total+=warehousingProductNum;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
warehousingNotificationQueryWrapper.lambda().in(WarehousingNotificationEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
warehousingNotificationQueryWrapper.lambda().and(t->t.in(WarehousingNotificationEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
warehousingNotificationQueryWrapper.lambda().and(t->t.in(WarehousingNotificationEntity::getId, finalAllRuleIDlist));
}
//假删除标志
warehousingNotificationQueryWrapper.lambda().isNull(WarehousingNotificationEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(warehousingNotificationPagination.getSidx())){
warehousingNotificationQueryWrapper.lambda().orderByDesc(WarehousingNotificationEntity::getId);
}else{
try {
String sidx = warehousingNotificationPagination.getSidx();
String[] strs= sidx.split("_name");
WarehousingNotificationEntity warehousingNotificationEntity = new WarehousingNotificationEntity();
Field declaredField = warehousingNotificationEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
warehousingNotificationQueryWrapper="asc".equals(warehousingNotificationPagination.getSort().toLowerCase())?warehousingNotificationQueryWrapper.orderByAsc(value):warehousingNotificationQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<WarehousingNotificationEntity> page=new Page<>(warehousingNotificationPagination.getCurrentPage(), warehousingNotificationPagination.getPageSize());
IPage<WarehousingNotificationEntity> userIPage=this.page(page, warehousingNotificationQueryWrapper);
return warehousingNotificationPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WarehousingNotificationEntity> list = new ArrayList();
return warehousingNotificationPagination.setData(list, list.size());
}
}else{
return this.list(warehousingNotificationQueryWrapper);
}
}
@Override
public WarehousingNotificationEntity getInfo(String id){
QueryWrapper<WarehousingNotificationEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingNotificationEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(WarehousingNotificationEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, WarehousingNotificationEntity entity){
return this.updateById(entity);
}
@Override
public void delete(WarehousingNotificationEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** WarehousingProduct子表方法 */
@Override
public List<WarehousingProductEntity> getWarehousingProductList(String id,WarehousingNotificationPagination warehousingNotificationPagination){
Map<String, Object> newtabMap=WarehousingNotificationConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="warehousingProduct";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<WarehousingProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = warehousingProductService.getChild(warehousingNotificationPagination,queryWrapper);
queryWrapper.lambda().eq(WarehousingProductEntity::getWarehousingId, id);
generaterSwapUtil.wrapperHandle(WarehousingNotificationConstant.getColumnData(), WarehousingNotificationConstant.getAppColumnData(), queryWrapper,WarehousingProductEntity.class,"sub",tableName);
return warehousingProductService.list(queryWrapper);
}
/** WarehousingProduct子表方法 */
@Override
public List<WarehousingProductEntity> getWarehousingProductList(String id){
QueryWrapper<WarehousingProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingProductEntity::getWarehousingId, id);
return warehousingProductService.list(queryWrapper);
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(WarehousingNotificationForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
//子表字段验证
if (form.getWarehousingProductList()!=null){
}
return countRecover;
}
/**
* ()
* @param id
* @param warehousingNotificationForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(WarehousingNotificationForm warehousingNotificationForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
warehousingNotificationForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WarehousingNotificationConstant.getFormData(),warehousingNotificationForm),WarehousingNotificationForm.class);
WarehousingNotificationEntity entity = JsonUtil.getJsonToBean(warehousingNotificationForm, WarehousingNotificationEntity.class);
if(isSave){
String mainId = id ;
entity.setWarehousingCode(generaterSwapUtil.getBillNumber("cktz", false));
entity.setPreparationTime(DateUtil.getNowDate());
entity.setId(mainId);
entity.setFlowId(warehousingNotificationForm.getFlowId());
entity.setVersion(0);
}else{
entity.setWarehousingCode(generaterSwapUtil.getBillNumber("cktz", false));
entity.setPreparationTime(DateUtil.getNowDate());
entity.setFlowId(warehousingNotificationForm.getFlowId());
}
this.saveOrUpdate(entity);
//WarehousingProduct子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingProductEntity> WarehousingProductqueryWrapper = new QueryWrapper<>();
WarehousingProductqueryWrapper.lambda().eq(WarehousingProductEntity::getWarehousingId, entity.getId());
warehousingProductService.remove(WarehousingProductqueryWrapper);
}
if (warehousingNotificationForm.getWarehousingProductList()!=null){
List<WarehousingProductEntity> tableField121 = JsonUtil.getJsonToList(warehousingNotificationForm.getWarehousingProductList(),WarehousingProductEntity.class);
for(WarehousingProductEntity entitys : tableField121){
entitys.setId(RandomUtil.uuId());
entitys.setWarehousingId(entity.getId());
if(isSave){
}else{
}
warehousingProductService.saveOrUpdate(entitys);
}
}
}
}

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingProductMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousingnotification.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* warehousingNotification
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-19
*/
@Service
public class WarehousingProductServiceImpl extends ServiceImpl<WarehousingProductMapper, WarehousingProductEntity> implements WarehousingProductService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<WarehousingProductEntity> getChild(WarehousingNotificationPagination pagination, QueryWrapper<WarehousingProductEntity> warehousingProductQueryWrapper){
boolean pcPermission = true;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?WarehousingNotificationConstant.getColumnData():WarehousingNotificationConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return warehousingProductQueryWrapper;
}
}

@ -0,0 +1,467 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.warehousingnotification.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.web.multipart.MultipartFile;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.File;
import jnpf.onlinedev.model.ExcelImFieldModel;
import jnpf.onlinedev.model.OnlineImport.ImportDataModel;
import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel;
import jnpf.onlinedev.model.OnlineImport.ExcelImportModel;
import jnpf.onlinedev.model.OnlineImport.VisualImportModel;
import cn.xuyanwu.spring.file.storage.FileInfo;
import lombok.Cleanup;
import jnpf.model.visualJson.config.HeaderModel;
import jnpf.base.model.ColumnDataModel;
import jnpf.base.util.VisualUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* warehousingNotification
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-19
*/
@Slf4j
@RestController
@Tag(name = "warehousingNotification" , description = "scm")
@RequestMapping("/api/scm/WarehousingNotification")
public class WarehousingNotificationController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingNotificationService warehousingNotificationService;
@Autowired
private WarehousingProductService warehousingProductService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param warehousingNotificationPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody WarehousingNotificationPagination warehousingNotificationPagination)throws IOException{
List<WarehousingNotificationEntity> list= warehousingNotificationService.getList(warehousingNotificationPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingNotificationEntity entity : list) {
Map<String, Object> warehousingNotificationMap=JsonUtil.entityToMap(entity);
warehousingNotificationMap.put("id", warehousingNotificationMap.get("id"));
//副表数据
//子表数据
List<WarehousingProductEntity> warehousingProductList = warehousingNotificationService.getWarehousingProductList(entity.getId(),warehousingNotificationPagination);
warehousingNotificationMap.put("tableField121",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingProductList)));
realList.add(warehousingNotificationMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingNotificationConstant.getFormData(), WarehousingNotificationConstant.getColumnData(), warehousingNotificationPagination.getModuleId(),false);
//流程状态添加
for(Map<String, Object> vo:realList){
FlowTaskEntity flowTaskEntity = generaterSwapUtil.getInfoSubmit(String.valueOf(vo.get("id")), FlowTaskEntity::getStatus);
if (flowTaskEntity!=null){
vo.put("flowState",flowTaskEntity.getStatus());
}else{
vo.put("flowState",null);
}
//添加流程id
String flowId="";
if(vo.get("flowid")!=null){
flowId = String.valueOf(vo.get("flowid"));
}
if(vo.get("flowid".toUpperCase())!=null){
flowId = String.valueOf(vo.get("flowid".toUpperCase()));
}
if(StringUtil.isNotEmpty(flowId)){
vo.put("flowId" ,flowId);
}
}
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(warehousingNotificationPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param warehousingNotificationForm
* @return
*/
@PostMapping("/{id}")
@Operation(summary = "创建")
public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid WarehousingNotificationForm warehousingNotificationForm) {
String b = warehousingNotificationService.checkForm(warehousingNotificationForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
warehousingNotificationService.saveOrUpdate(warehousingNotificationForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody WarehousingNotificationPagination warehousingNotificationPagination) throws IOException {
if (StringUtil.isEmpty(warehousingNotificationPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<WarehousingNotificationEntity> list= warehousingNotificationService.getList(warehousingNotificationPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingNotificationEntity entity : list) {
Map<String, Object> warehousingNotificationMap=JsonUtil.entityToMap(entity);
warehousingNotificationMap.put("id", warehousingNotificationMap.get("id"));
//副表数据
//子表数据
List<WarehousingProductEntity> warehousingProductList = warehousingNotificationService.getWarehousingProductList(entity.getId(),warehousingNotificationPagination);
warehousingNotificationMap.put("tableField121",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingProductList)));
realList.add(warehousingNotificationMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingNotificationConstant.getFormData(), WarehousingNotificationConstant.getColumnData(), warehousingNotificationPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(warehousingNotificationPagination.getSelectKey())?warehousingNotificationPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
return ActionResult.success(vo);
}
/**
*
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
ExcelExportEntity tableField121ExcelEntity = new ExcelExportEntity("","tableField121");
List<ExcelExportEntity> tableField121List = new ArrayList<>();
for(String key:keys){
switch(key){
case "warehousingType" :
entitys.add(new ExcelExportEntity("" ,"warehousingType"));
break;
case "warehousingCode" :
entitys.add(new ExcelExportEntity("通知编号" ,"warehousingCode"));
break;
case "preparationTime" :
entitys.add(new ExcelExportEntity("制单时间" ,"preparationTime"));
break;
case "businessId" :
entitys.add(new ExcelExportEntity("销售订单" ,"businessId"));
break;
case "subjectBasicId" :
entitys.add(new ExcelExportEntity("客户名称" ,"subjectBasicId"));
break;
case "shippingAddress" :
entitys.add(new ExcelExportEntity("收货地址" ,"shippingAddress"));
break;
case "enterpriseId" :
entitys.add(new ExcelExportEntity("机构名称" ,"enterpriseId"));
break;
case "warehouseId" :
entitys.add(new ExcelExportEntity("发货仓库" ,"warehouseId"));
break;
case "deliveryAddress" :
entitys.add(new ExcelExportEntity("发货地址" ,"deliveryAddress"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "tableField121-productName":
tableField121List.add(new ExcelExportEntity("商品名称" ,"productName"));
break;
case "tableField121-spec":
tableField121List.add(new ExcelExportEntity("规格" ,"spec"));
break;
case "tableField121-inventoryUnitId":
tableField121List.add(new ExcelExportEntity("库存单位" ,"inventoryUnitId"));
break;
case "tableField121-purchaseUnitId":
tableField121List.add(new ExcelExportEntity("销售单位" ,"purchaseUnitId"));
break;
case "tableField121-purchaseNum":
tableField121List.add(new ExcelExportEntity("销售数量" ,"purchaseNum"));
break;
case "tableField121-storageAreaId":
tableField121List.add(new ExcelExportEntity("出库货区" ,"storageAreaId"));
break;
case "tableField121-warehousingUnitId":
tableField121List.add(new ExcelExportEntity("出库单位" ,"warehousingUnitId"));
break;
case "tableField121-barCode":
tableField121List.add(new ExcelExportEntity("包装条码" ,"barCode"));
break;
case "tableField121-notificationStorageNumber":
tableField121List.add(new ExcelExportEntity("通知出库数量" ,"notificationStorageNumber"));
break;
case "tableField121-volume":
tableField121List.add(new ExcelExportEntity("体积" ,"volume"));
break;
case "tableField121-batchNo":
tableField121List.add(new ExcelExportEntity("批次号" ,"batchNo"));
break;
case "tableField121-produceDate":
tableField121List.add(new ExcelExportEntity("生产日期" ,"produceDate"));
break;
case "tableField121-remark":
tableField121List.add(new ExcelExportEntity("备注" ,"remark"));
break;
default:
break;
}
}
if(tableField121List.size() > 0){
tableField121ExcelEntity.setList(tableField121List);
entitys.add(tableField121ExcelEntity);
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//去除空数据
List<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> map : list) {
int i = 0;
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
for (Map<String, Object> childMap : childList) {
if (childMap.get(field) != null) {
i++;
}
}
}
} else {
Object o = map.get(key);
if (o != null) {
i++;
}
}
}
if (i > 0) {
dataList.add(map);
}
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(WarehousingNotificationConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
}
String fileName = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
*
* @param ids
* @return
*/
@DeleteMapping("/batchRemove")
@Transactional
@Operation(summary = "批量删除")
public ActionResult batchRemove(@RequestBody String ids){
List<String> idList = JsonUtil.getJsonToList(ids, String.class);
List<String> columnIdList = new ArrayList<>(20);
int i =0;
String errInfo = "";
for (String allId : idList){
FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(allId, FlowTaskEntity::getId, FlowTaskEntity::getStatus);
if (taskEntity==null){
columnIdList.add(allId);
this.delete(allId);
}else if (taskEntity.getStatus().equals(0) || taskEntity.getStatus().equals(4)){
try {
generaterSwapUtil.deleteFlowTask(taskEntity);
columnIdList.add(allId);
this.delete(allId);
i++;
} catch (WorkFlowException e) {
errInfo = e.getMessage();
e.printStackTrace();
}
}
}
if (i == 0 && columnIdList.size()==0){
return ActionResult.fail("流程已发起,无法删除");
}
if (StringUtil.isNotEmpty(errInfo)){
return ActionResult.fail(errInfo);
}
return ActionResult.success("删除成功");
}
/**
*
* @param id
* @param warehousingNotificationForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid WarehousingNotificationForm warehousingNotificationForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
warehousingNotificationForm.setId(id);
if (!isImport) {
String b = warehousingNotificationService.checkForm(warehousingNotificationForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
WarehousingNotificationEntity entity= warehousingNotificationService.getInfo(id);
if(entity!=null){
try{
warehousingNotificationService.saveOrUpdate(warehousingNotificationForm,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){
WarehousingNotificationEntity entity= warehousingNotificationService.getInfo(id);
if(entity!=null){
FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(id, FlowTaskEntity::getId, FlowTaskEntity::getStatus);
if (taskEntity != null) {
try {
generaterSwapUtil.deleteFlowTask(taskEntity);
} catch (WorkFlowException e) {
e.printStackTrace();
}
}
//假删除
entity.setDeleteMark(1);
warehousingNotificationService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
WarehousingNotificationEntity entity= warehousingNotificationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingNotificationMap=JsonUtil.entityToMap(entity);
warehousingNotificationMap.put("id", warehousingNotificationMap.get("id"));
//副表数据
//子表数据
List<WarehousingProductEntity> warehousingProductList = warehousingNotificationService.getWarehousingProductList(entity.getId());
warehousingNotificationMap.put("tableField121",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingProductList)));
warehousingNotificationMap = generaterSwapUtil.swapDataDetail(warehousingNotificationMap,WarehousingNotificationConstant.getFormData(),"529305238373400645",false);
return ActionResult.success(warehousingNotificationMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
WarehousingNotificationEntity entity= warehousingNotificationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingNotificationMap=JsonUtil.entityToMap(entity);
warehousingNotificationMap.put("id", warehousingNotificationMap.get("id"));
//副表数据
//子表数据
List<WarehousingProductEntity> warehousingProductList = warehousingNotificationService.getWarehousingProductList(entity.getId());
warehousingNotificationMap.put("warehousingProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingProductList)));
warehousingNotificationMap = generaterSwapUtil.swapDataForm(warehousingNotificationMap,WarehousingNotificationConstant.getFormData(),WarehousingNotificationConstant.TABLEFIELDKEY,WarehousingNotificationConstant.TABLERENAMES);
return ActionResult.success(warehousingNotificationMap);
}
}

@ -0,0 +1,91 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-19
*/
@Data
@TableName("jg_warehousing_notification")
public class WarehousingNotificationEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "WAREHOUSING_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String warehousingType;
@TableField("WAREHOUSING_STATUS")
private String warehousingStatus;
@TableField(value = "WAREHOUSING_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String warehousingCode;
@TableField("ORDER_SOURCE")
private String orderSource;
@TableField(value = "BUSINESS_ID" , updateStrategy = FieldStrategy.IGNORED)
private String businessId;
@TableField("PLANNED_WAREHOUSING_TIME_START")
private Date plannedWarehousingTimeStart;
@TableField("PLANNED_WAREHOUSING_TIME_END")
private Date plannedWarehousingTimeEnd;
@TableField(value = "SUBJECT_BASIC_ID" , updateStrategy = FieldStrategy.IGNORED)
private String subjectBasicId;
@TableField(value = "SHIPPING_ADDRESS" , updateStrategy = FieldStrategy.IGNORED)
private String shippingAddress;
@TableField(value = "ENTERPRISE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String enterpriseId;
@TableField(value = "DELIVERY_ADDRESS" , updateStrategy = FieldStrategy.IGNORED)
private String deliveryAddress;
@TableField(value = "WAREHOUSE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String warehouseId;
@TableField("PLAN_WAREHOUSING_NUM")
private String planWarehousingNum;
@TableField("CONFIRM_WAREHOUSING_NUM")
private String confirmWarehousingNum;
@TableField("WAIT_WAREHOUSING_NUM")
private String waitWarehousingNum;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark;
@TableField("RESERVED_FIELDS1")
private String reservedFields1;
@TableField("RESERVED_FIELDS2")
private String reservedFields2;
@TableField("RESERVED_FIELDS3")
private String reservedFields3;
@TableField("RESERVED_FIELDS4")
private String reservedFields4;
@TableField("REMARK2")
private String remark2;
@TableField("REMARK3")
private String remark3;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("F_FLOW_ID")
private String flowId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("F_FLOW_TASK_ID")
private String flowTaskId;
@TableField("F_VERSION")
private Integer version;
@TableField("PREPARATION_TIME")
private Date preparationTime;
}

@ -0,0 +1,80 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-19
*/
@Data
@TableName("jg_warehousing_product")
public class WarehousingProductEntity {
@TableId(value ="ID" )
private String id;
@TableField("WAREHOUSING_ID")
private String warehousingId;
@TableField("PRODUCT_ID")
private String productId;
@TableField(value = "PRODUCT_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String productName;
@TableField(value = "SPEC" , updateStrategy = FieldStrategy.IGNORED)
private String spec;
@TableField(value = "INVENTORY_UNIT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String inventoryUnitId;
@TableField(value = "PURCHASE_UNIT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String purchaseUnitId;
@TableField(value = "PURCHASE_NUM" , updateStrategy = FieldStrategy.IGNORED)
private String purchaseNum;
@TableField(value = "STORAGE_AREA_ID" , updateStrategy = FieldStrategy.IGNORED)
private String storageAreaId;
@TableField(value = "WAREHOUSING_UNIT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String warehousingUnitId;
@TableField("RECEIVED_QUANTITY")
private BigDecimal receivedQuantity;
@TableField("REMAINING_STOCKABLE_QUANTITY")
private BigDecimal remainingStockableQuantity;
@TableField(value = "NOTIFICATION_STORAGE_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal notificationStorageNumber;
@TableField(value = "VOLUME" , updateStrategy = FieldStrategy.IGNORED)
private String volume;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark;
@TableField("VOUCHER_ID")
private String voucherId;
@TableField("PURCHASE_ORDER_ID")
private String purchaseOrderId;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField(value = "BAR_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String barCode;
@TableField(value = "BATCH_NO" , updateStrategy = FieldStrategy.IGNORED)
private String batchNo;
@TableField(value = "PRODUCE_DATE" , updateStrategy = FieldStrategy.IGNORED)
private Date produceDate;
}

@ -60,4 +60,8 @@ public class SettlementInfoModel {
/** 申请逾期利率 **/ /** 申请逾期利率 **/
@JSONField(name = "applyForOverdueRatio") @JSONField(name = "applyForOverdueRatio")
private String applyForOverdueRatio; private String applyForOverdueRatio;
/** 业务类型 **/
@JSONField(name = "businessType")
private String businessType;
} }

@ -0,0 +1,59 @@
package jnpf.model.warehousingnotification;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* warehousingNotification
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-19
*/
@Data
public class WarehousingNotificationForm {
/** 主键 */
private String id;
/** 子表数据 **/
@JsonProperty("warehousingProductList")
private List<WarehousingProductModel> warehousingProductList;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 流程id **/
@JsonProperty("flowId")
private String flowId;
/** **/
@JsonProperty("warehousingType")
private String warehousingType;
/** 通知编号 **/
@JsonProperty("warehousingCode")
private String warehousingCode;
/** 制单时间 **/
@JsonProperty("preparationTime")
private String preparationTime;
/** 销售订单 **/
@JsonProperty("businessId")
private String businessId;
/** 客户名称 **/
@JsonProperty("subjectBasicId")
private String subjectBasicId;
/** 收货地址 **/
@JsonProperty("shippingAddress")
private String shippingAddress;
/** 机构名称 **/
@JsonProperty("enterpriseId")
private String enterpriseId;
/** 发货仓库 **/
@JsonProperty("warehouseId")
private String warehouseId;
/** 发货地址 **/
@JsonProperty("deliveryAddress")
private String deliveryAddress;
/** 备注 **/
@JsonProperty("remark")
private String remark;
}

@ -0,0 +1,33 @@
package jnpf.model.warehousingnotification;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* warehousingNotification
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-19
*/
@Data
public class WarehousingNotificationPagination 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;
/** 通知编号 */
@JsonProperty("warehousingCode")
private Object warehousingCode;
}

@ -0,0 +1,61 @@
package jnpf.model.warehousingnotification;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* warehousingNotification
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-02-19
*/
@Data
public class WarehousingProductModel {
/** 商品名称 **/
@JSONField(name = "productName")
private String productName;
/** 规格 **/
@JSONField(name = "spec")
private String spec;
/** 库存单位 **/
@JSONField(name = "inventoryUnitId")
private String inventoryUnitId;
/** 销售单位 **/
@JSONField(name = "purchaseUnitId")
private String purchaseUnitId;
/** 销售数量 **/
@JSONField(name = "purchaseNum")
private String purchaseNum;
/** 出库货区 **/
@JSONField(name = "storageAreaId")
private String storageAreaId;
/** 出库单位 **/
@JSONField(name = "warehousingUnitId")
private String warehousingUnitId;
/** 包装条码 **/
@JSONField(name = "barCode")
private String barCode;
/** 通知出库数量 **/
@JSONField(name = "notificationStorageNumber")
private String notificationStorageNumber;
/** 体积 **/
@JSONField(name = "volume")
private String volume;
/** 批次号 **/
@JSONField(name = "batchNo")
private String batchNo;
/** 生产日期 **/
@JSONField(name = "produceDate")
private Long produceDate;
/** 备注 **/
@JSONField(name = "remark")
private String remark;
}

@ -1,10 +1,3 @@
<template> <template>
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-center"> <div class="JNPF-common-layout-center">

@ -77,12 +77,12 @@
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="客户名称" prop="code"> <el-table-column label="客户名称" prop="firstSubjectBasicId">
<template slot="header" v-if="false"> <template slot="header" v-if="false">
<span class="required-sign">*</span>客户名称 <span class="required-sign">*</span>客户名称
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.code" <JnpfInput v-model="scope.row.firstSubjectBasicId"
@change="changeData('businessordervoucherrelational-voucherId',scope.$index)" @change="changeData('businessordervoucherrelational-voucherId',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}' readonly> placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</JnpfInput> </JnpfInput>

@ -102,7 +102,7 @@
</el-col> </el-col>
<el-col :span="12" v-if="judgeShow('contractId')"> <el-col :span="12" v-if="judgeShow('contractId')">
<jnpf-form-tip-item label="关联合同" v-if="judgeShow('contractId')" prop="contractId"> <jnpf-form-tip-item label="关联合同" v-if="judgeShow('contractId')" prop="contractId">
<JnpfPopupSelect v-model="dataForm.contractId" @change="changeData('contractId',-1)" <JnpfPopupSelect v-model="dataForm.contractId" @change="contractInfo"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.contractId" :rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.contractId"
placeholder="请选择" propsValue="id" popupWidth="800px" popupTitle="选择数据" placeholder="请选择" propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='contract_name' field='contractId' popupType="dialog" relationField='contract_name' field='contractId'
@ -111,31 +111,26 @@
</JnpfPopupSelect> </JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-table :data="dataForm.businessOrderProductRelationalList" size='mini'> <el-table :data="dataForm.contractList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="商品名称" <el-table-column label="合同名称" v-if="judgeShow('businessorderproductrelational-tax')"
v-if="judgeShow('businessorderproductrelational-productId')" prop="productId"> prop="tax">
<template slot="header"> <template slot="header">
<span class="required-sign" <span class="required-sign"
v-if="judgeRequired('businessorderproductrelationalList-productId')">*</span>合同名称 v-if="judgeRequired('businessorderproductrelationalList-tax')"></span>合同名称
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId" <JnpfInput v-model="scope.row.contractName"
@change="changeData('businessorderproductrelational-productId',scope.$index)" @change="changeData('businessorderproductrelational-tax',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm" placeholder="请输入"
:templateJson="interfaceRes.businessorderproductrelationalproductId" :disabled="judgeWrite('businessorderproductrelationalList')||judgeWrite('businessorderproductrelationalList-tax')"
placeholder="请选择" clearable :style='{"width":"100%"}'>
:disabled="judgeWrite('businessorderproductrelationalList')||judgeWrite('businessorderproductrelationalList-productId')" </JnpfInput>
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='commodity_name' :field="'productId'+scope.$index"
interfaceId="523160915206474309" :pageSize="20"
:columnOptions="businessorderproductrelationalproductIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</template> </template>
<template v-if="dataForm.orderType == 1">
<el-col :span="24"> <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle content="详细信息" contentPosition="left"> <JnpfGroupTitle content="详细信息" contentPosition="left">
@ -165,9 +160,10 @@
@change="changeData('correlatedOrderId',-1)" :rowIndex="null" :formData="dataForm" @change="changeData('correlatedOrderId',-1)" :rowIndex="null" :formData="dataForm"
:templateJson="interfaceRes.correlatedOrderId" placeholder="请选择" :templateJson="interfaceRes.correlatedOrderId" placeholder="请选择"
:disabled="judgeWrite('correlatedOrderId')" propsValue="id" popupWidth="800px" :disabled="judgeWrite('correlatedOrderId')" propsValue="id" popupWidth="800px"
popupTitle="选择数据" popupType="dialog" relationField='code' field='correlatedOrderId' popupTitle="选择数据" popupType="dialog" relationField='code'
interfaceId="522687073317030149" :pageSize="20" field='correlatedOrderId' interfaceId="522687073317030149" :pageSize="20"
:columnOptions="correlatedOrderIdcolumnOptions" clearable :style='{"width":"100%"}'> :columnOptions="correlatedOrderIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect> </JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -175,7 +171,8 @@
<jnpf-form-tip-item label="定价模式" v-if="judgeShow('fixPriceMode')" prop="fixPriceMode"> <jnpf-form-tip-item label="定价模式" v-if="judgeShow('fixPriceMode')" prop="fixPriceMode">
<JnpfSelect v-model="dataForm.fixPriceMode" @change="changeData('fixPriceMode',-1)" <JnpfSelect v-model="dataForm.fixPriceMode" @change="changeData('fixPriceMode',-1)"
placeholder="请选择" :disabled="judgeWrite('fixPriceMode')" clearable placeholder="请选择" :disabled="judgeWrite('fixPriceMode')" clearable
:style='{"width":"100%"}' :options="fixPriceModeOptions" :props="fixPriceModeProps"> :style='{"width":"100%"}' :options="fixPriceModeOptions"
:props="fixPriceModeProps">
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -193,6 +190,7 @@
</JnpfPopupSelect> </JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
</template>
<el-col :span="24"> <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle content="收货信息" contentPosition="left"> <JnpfGroupTitle content="收货信息" contentPosition="left">
@ -202,14 +200,13 @@
<el-col :span="8" v-if="judgeShow('firstSubjectBasicId')"> <el-col :span="8" v-if="judgeShow('firstSubjectBasicId')">
<jnpf-form-tip-item label="一级客户" v-if="judgeShow('firstSubjectBasicId')" <jnpf-form-tip-item label="一级客户" v-if="judgeShow('firstSubjectBasicId')"
prop="firstSubjectBasicId"> prop="firstSubjectBasicId">
<JnpfPopupSelect v-model="dataForm.firstSubjectBasicId" <JnpfPopupSelect v-model="dataForm.firstSubjectBasicId" :rowIndex="null"
@change="changeData('firstSubjectBasicId',-1)" :rowIndex="null" :formData="dataForm" :formData="dataForm" :templateJson="interfaceRes.firstSubjectBasicId"
:templateJson="interfaceRes.firstSubjectBasicId" placeholder="请选择" placeholder="请选择" :disabled="judgeWrite('firstSubjectBasicId')" propsValue="id"
:disabled="judgeWrite('firstSubjectBasicId')" propsValue="id" popupWidth="800px" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name'
popupTitle="选择数据" popupType="dialog" relationField='name'
field='firstSubjectBasicId' interfaceId="522693551289534725" :pageSize="20" field='firstSubjectBasicId' interfaceId="522693551289534725" :pageSize="20"
:columnOptions="firstSubjectBasicIdcolumnOptions" clearable :columnOptions="firstSubjectBasicIdcolumnOptions" clearable
:style='{"width":"100%"}' @click.native=getCustomName> :style='{"width":"100%"}' @change="getCustomName">
</JnpfPopupSelect> </JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -498,17 +495,17 @@
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="50" v-if="!judgeWrite('settlementinfoList')"> <!-- <el-table-column label="操作" width="50" v-if="!judgeWrite('settlementinfoList')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" <el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delsettlementinfoList(scope.$index)">删除</el-button> @click="delsettlementinfoList(scope.$index)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<div class="table-actions" @click="addsettlementinfoList()" <!-- <div class="table-actions" @click="addsettlementinfoList()"
v-if="!judgeWrite('settlementinfoList')"> v-if="!judgeWrite('settlementinfoList')">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div> -->
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -545,8 +542,7 @@
v-if="judgeRequired('businessorderproductrelationalList-productId')">*</span>商品名称 v-if="judgeRequired('businessorderproductrelationalList-productId')">*</span>商品名称
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId" <JnpfPopupSelect v-model="scope.row.productId" @change="productInfo"
@change="changeData('businessorderproductrelational-productId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm" :rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.businessorderproductrelationalproductId" :templateJson="interfaceRes.businessorderproductrelationalproductId"
placeholder="请选择" propsValue="id" popupWidth="800px" popupTitle="选择数据" placeholder="请选择" propsValue="id" popupWidth="800px" popupTitle="选择数据"
@ -558,21 +554,6 @@
</JnpfPopupSelect> </JnpfPopupSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="规格" v-if="judgeShow('businessorderproductrelational-spec')"
prop="spec">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businessorderproductrelationalList-spec')">*</span>规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.productId"
@change="changeData('businessorderproductrelational-spec',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businessorderproductrelationalList')||judgeWrite('businessorderproductrelationalList-spec')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="规格" v-if="judgeShow('businessorderproductrelational-spec')" <el-table-column label="规格" v-if="judgeShow('businessorderproductrelational-spec')"
prop="spec"> prop="spec">
<template slot="header"> <template slot="header">
@ -885,7 +866,7 @@ export default {
Vmodel: "", Vmodel: "",
currVmodel: "", currVmodel: "",
dataForm: { dataForm: {
orderType: "2", orderType: "1",
code: undefined, code: undefined,
businessLineId: undefined, businessLineId: undefined,
counterpartOrderCode: undefined, counterpartOrderCode: undefined,
@ -911,6 +892,7 @@ export default {
settlementInfoList: [], settlementInfoList: [],
businessOrderProductRelationalList: [], businessOrderProductRelationalList: [],
version: 0, version: 0,
contractList: [],
}, },
tableRequiredData: {}, tableRequiredData: {},
dataRule: dataRule:
@ -1133,15 +1115,30 @@ export default {
this.getFormById() this.getFormById()
if (this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) { if (this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) {
this.initDefaultData() this.initDefaultData()
this.dataForm.businessType = '2'
} }
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm)) this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
}, },
mounted() { }, mounted() { },
methods: { methods: {
getCustomName() { productInfo(val, val2) {
debugger debugger
const id = this.dataForm.firstSubjectBasicId // this.dataForm.businessOrderProductRelationalList = []
this.dataForm.settlementInfoList[0].subjectBasicId = id this.dataForm.businessOrderProductRelationalList.push(val2)
this.dataForm.businessOrderProductRelationalList.splice(0, 1)
},
contractInfo(val, val2) {
this.dataForm.contractList = []
this.dataForm.contractList[0] = val2
this.dataForm.firstSubjectBasicId = val2.customName
this.dataForm.enterpriseId = val2.enterpriseName
this.dataForm.receiveAddress = val2.delivery_location
this.dataForm.transportMode = val2.mode_transport
},
getCustomName(val, val2) {
this.dataForm.settlementInfoList = [];
val2.businessType = '2';
this.dataForm.settlementInfoList[0] = val2;
}, },
changeData(model, index) { changeData(model, index) {
this.isEdit = false this.isEdit = false

@ -548,6 +548,7 @@ export default {
return return
} }
const data = this.multipleSelectionItem const data = this.multipleSelectionItem
debugger
this.boundCheckVisible = true this.boundCheckVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.BoundCheck.init(data) this.$refs.BoundCheck.init(data)

File diff suppressed because one or more lines are too long

@ -0,0 +1,690 @@
<template>
<div :style="{margin: '0 auto',width:'100%'}">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" :disabled="setting.readonly" >
<template v-if="!loading && formOperates">
<!-- 具体表单 -->
<el-col :span="24" >
<jnpf-form-tip-item>
<JnpfGroupTitle
content="基本信息" contentPosition="left" >
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('warehousingType')" >
<jnpf-form-tip-item
label-width="0" prop="warehousingType" >
<JnpfRadio v-model="dataForm.warehousingType" @change="changeData('warehousingType',-1)"
:disabled="judgeWrite('warehousingType')" optionType="button" direction="horizontal" size="small" :options="warehousingTypeOptions" :props="warehousingTypeProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item>
<JnpfGroupTitle
content="基础信息" contentPosition="left" >
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('warehousingCode')" >
<jnpf-form-tip-item
label="通知编号" v-if="judgeShow('warehousingCode')" prop="warehousingCode" >
<JnpfInput v-model="dataForm.warehousingCode" @change="changeData('warehousingCode',-1)"
placeholder="系统自动生成" :disabled="judgeWrite('warehousingCode')" readonly :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('preparationTime')" >
<jnpf-form-tip-item
label="制单时间" v-if="judgeShow('preparationTime')" prop="preparationTime" >
<JnpfOpenData v-model="dataForm.preparationTime" @change="changeData('preparationTime',-1)"
placeholder="系统自动生成" :disabled="judgeWrite('preparationTime')" readonly :style='{"width":"100%"}' type="currTime" >
</JnpfOpenData>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item>
<JnpfGroupTitle
content="关联信息" contentPosition="left" >
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('businessId')" >
<jnpf-form-tip-item
label="销售订单" v-if="judgeShow('businessId')" prop="businessId" >
<JnpfPopupSelect v-model="dataForm.businessId" @change="changeData('businessId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.businessId" placeholder="请选择" :disabled="judgeWrite('businessId')" propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='code' field='businessId' interfaceId="529307088124379205" :pageSize="20" :columnOptions="businessIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item>
<JnpfGroupTitle
content="收货信息" contentPosition="left" >
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('subjectBasicId')" >
<jnpf-form-tip-item
label="客户名称" v-if="judgeShow('subjectBasicId')" prop="subjectBasicId" >
<JnpfPopupSelect v-model="dataForm.subjectBasicId" @change="changeData('subjectBasicId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.subjectBasicId" placeholder="请选择" :disabled="judgeWrite('subjectBasicId')" propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name' field='subjectBasicId' interfaceId="522693551289534725" :pageSize="20" :columnOptions="subjectBasicIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('shippingAddress')" >
<jnpf-form-tip-item
label="收货地址" v-if="judgeShow('shippingAddress')" prop="shippingAddress" >
<JnpfInput v-model="dataForm.shippingAddress" @change="changeData('shippingAddress',-1)"
placeholder="请输入" :disabled="judgeWrite('shippingAddress')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item>
<JnpfGroupTitle
content="发货信息" contentPosition="left" >
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('enterpriseId')" >
<jnpf-form-tip-item
label="机构名称" v-if="judgeShow('enterpriseId')" prop="enterpriseId" >
<JnpfPopupSelect v-model="dataForm.enterpriseId" @change="changeData('enterpriseId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.enterpriseId" placeholder="请选择" :disabled="judgeWrite('enterpriseId')" propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='f_full_name' field='enterpriseId' interfaceId="522729853024209157" :pageSize="20" :columnOptions="enterpriseIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('warehouseId')" >
<jnpf-form-tip-item
label="发货仓库" v-if="judgeShow('warehouseId')" prop="warehouseId" >
<JnpfPopupSelect v-model="dataForm.warehouseId" @change="changeData('warehouseId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.warehouseId" placeholder="请选择" :disabled="judgeWrite('warehouseId')" propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name' field='warehouseId' interfaceId="522701377537837317" :pageSize="20" :columnOptions="warehouseIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('deliveryAddress')" >
<jnpf-form-tip-item
label="发货地址" v-if="judgeShow('deliveryAddress')" prop="deliveryAddress" >
<JnpfPopupSelect v-model="dataForm.deliveryAddress" @change="changeData('deliveryAddress',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.deliveryAddress" placeholder="请选择" :disabled="judgeWrite('deliveryAddress')" propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='addressDetail' field='deliveryAddress' interfaceId="522724961224231173" :pageSize="20" :columnOptions="deliveryAddresscolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item>
<JnpfGroupTitle
content="其他信息" contentPosition="left" >
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('remark')" >
<jnpf-form-tip-item
label="备注" v-if="judgeShow('remark')" prop="remark" >
<JnpfTextarea v-model="dataForm.remark" @change="changeData('remark',-1)"
placeholder="请输入" :disabled="judgeWrite('remark')" :style='{"width":"100%"}' true type="textarea" :autosize='{"minRows":4,"maxRows":4}' >
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item>
<JnpfGroupTitle
content="商品信息" contentPosition="left" >
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('-${html.relationField}')" >
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.warehousingproductList" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column
label="商品名称" v-if="judgeShow('warehousingproduct-productName')" prop="productName" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-productName')" >*</span>商品名称
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.productName" @change="changeData('warehousingproduct-productName',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-productName')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column
label="规格" v-if="judgeShow('warehousingproduct-spec')" prop="spec" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-spec')" >*</span>规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.spec" @change="changeData('warehousingproduct-spec',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-spec')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column
label="库存单位" v-if="judgeShow('warehousingproduct-inventoryUnitId')" prop="inventoryUnitId" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-inventoryUnitId')" >*</span>库存单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.inventoryUnitId" @change="changeData('warehousingproduct-inventoryUnitId',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-inventoryUnitId')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column
label="销售单位" v-if="judgeShow('warehousingproduct-purchaseUnitId')" prop="purchaseUnitId" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-purchaseUnitId')" >*</span>销售单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.purchaseUnitId" @change="changeData('warehousingproduct-purchaseUnitId',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-purchaseUnitId')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column
label="销售数量" v-if="judgeShow('warehousingproduct-purchaseNum')" prop="purchaseNum" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-purchaseNum')" >*</span>销售数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.purchaseNum" @change="changeData('warehousingproduct-purchaseNum',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-purchaseNum')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column
label="出库货区" v-if="judgeShow('warehousingproduct-storageAreaId')" prop="storageAreaId" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-storageAreaId')" >*</span>出库货区
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.storageAreaId" @change="changeData('warehousingproduct-storageAreaId',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-storageAreaId')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column
label="出库单位" v-if="judgeShow('warehousingproduct-warehousingUnitId')" prop="warehousingUnitId" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-warehousingUnitId')" >*</span>出库单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.warehousingUnitId" @change="changeData('warehousingproduct-warehousingUnitId',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-warehousingUnitId')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column
label="包装条码" v-if="judgeShow('warehousingproduct-barCode')" prop="barCode" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-barCode')" >*</span>包装条码
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.barCode" @change="changeData('warehousingproduct-barCode',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-barCode')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column
label="通知出库数量" v-if="judgeShow('warehousingproduct-notificationStorageNumber')" prop="notificationStorageNumber" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-notificationStorageNumber')" >*</span>通知出库数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.notificationStorageNumber" @change="changeData('warehousingproduct-notificationStorageNumber',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-notificationStorageNumber')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column
label="体积" v-if="judgeShow('warehousingproduct-volume')" prop="volume" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-volume')" >*</span>体积
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.volume" @change="changeData('warehousingproduct-volume',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-volume')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column
label="批次号" v-if="judgeShow('warehousingproduct-batchNo')" prop="batchNo" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-batchNo')" >*</span>批次号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.batchNo" @change="changeData('warehousingproduct-batchNo',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-batchNo')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column
label="生产日期" v-if="judgeShow('warehousingproduct-produceDate')" prop="produceDate" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-produceDate')" >*</span>生产日期
</template>
<template slot-scope="scope">
<JnpfDatePicker v-model="scope.row.produceDate" @change="changeData('warehousingproduct-produceDate',scope.$index)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-produceDate')" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" >
</JnpfDatePicker>
</template>
</el-table-column>
<el-table-column
label="备注" v-if="judgeShow('warehousingproduct-remark')" prop="remark" >
<template slot="header" >
<span class="required-sign" v-if="judgeRequired('warehousingproductList-remark')" >*</span>备注
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.remark" @change="changeData('warehousingproduct-remark',scope.$index)"
placeholder="请输入" :disabled="judgeWrite('warehousingproductList')||judgeWrite('warehousingproductList-remark')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50" v-if="!judgeWrite('warehousingproductList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delwarehousingproductList(scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addwarehousingproductList()" v-if="!judgeWrite('warehousingproductList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/>
</el-form>
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
</div>
</template>
<script>
import request from '@/utils/request'
import {mapGetters} from "vuex";
import {getFormById} from '@/api/workFlow/FormDesign'
import comMixin from '@/views/workFlow/workFlowForm/mixin';
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"
export default {
mixins: [comMixin],
components: { },
props: [],
data() {
return {
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:{
warehousingproductList :{"popupType":"dialog","hasPage":true,"popupTitle":"选择数据","pageSize":20,"columnOptions":[],"interfaceId":"","interfaceName":"","relationOptions":[],"templateJson":[],"popupWidth":"800px"},
},
//
ableAll:{
},
tableRows:{
warehousingproductList:{
productName : '',
productNameOptions:[],
spec : '',
specOptions:[],
inventoryUnitId : '',
inventoryUnitIdOptions:[],
purchaseUnitId : '',
purchaseUnitIdOptions:[],
purchaseNum : '',
purchaseNumOptions:[],
storageAreaId : '',
storageAreaIdOptions:[],
warehousingUnitId : '',
warehousingUnitIdOptions:[],
barCode : '',
barCodeOptions:[],
notificationStorageNumber : '',
notificationStorageNumberOptions:[],
volume : '',
volumeOptions:[],
batchNo : '',
batchNoOptions:[],
produceDate : '',
produceDateOptions:[],
remark : '',
remarkOptions:[],
enabledmark:undefined
},
},
Vmodel:"",
currVmodel:"",
dataForm: {
warehousingType : "8",
warehousingCode : undefined,
preparationTime : undefined,
businessId : undefined,
subjectBasicId : undefined,
shippingAddress : undefined,
enterpriseId : undefined,
warehouseId : undefined,
deliveryAddress : undefined,
remark : undefined,
warehousingproductList:[],
version: 0,
},
tableRequiredData: {},
dataRule:
{
},
warehousingTypeOptions:[{"fullName":"销售出库","id":"8"}],
warehousingTypeProps:{"label":"fullName","value":"id" },
businessIdcolumnOptions:[ {"label":"订单编号","value":"code"},],
subjectBasicIdcolumnOptions:[ {"label":"名称","value":"name"},],
enterpriseIdcolumnOptions:[ {"label":"机构名称","value":"f_full_name"},],
warehouseIdcolumnOptions:[ {"label":"名称","value":"name"},],
deliveryAddresscolumnOptions:[ {"label":"地址详情","value":"addressDetail"},],
childIndex:-1,
isEdit:false,
interfaceRes: {
warehousingType:[] ,
warehousingCode:[] ,
preparationTime:[] ,
businessId:[] ,
subjectBasicId:[] ,
shippingAddress:[] ,
enterpriseId:[] ,
warehouseId:[{"dataType":"varchar","defaultValue":"","field":"businessLineId","fieldName":"","id":"PneOdw1","jnpfKey":null,"relationField":null,"required":"0"}] ,
deliveryAddress:[{"dataType":"varchar","defaultValue":"","field":"businessOrganizeId","fieldName":"","id":"AyAmdw1","jnpfKey":"popupSelect","relationField":"warehouseId","required":"0"}] ,
remark:[] ,
warehousingproductproductName: [] ,
warehousingproductspec: [] ,
warehousingproductinventoryUnitId: [] ,
warehousingproductpurchaseUnitId: [] ,
warehousingproductpurchaseNum: [] ,
warehousingproductstorageAreaId: [] ,
warehousingproductwarehousingUnitId: [] ,
warehousingproductbarCode: [] ,
warehousingproductnotificationStorageNumber: [] ,
warehousingproductvolume: [] ,
warehousingproductbatchNo: [] ,
warehousingproductproduceDate: [] ,
warehousingproductremark: [] ,
},
}
},
computed: {
formOperates() {
return this.setting.formOperates
}
},
watch: {},
created() {
this.getFormById()
if(this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) {
this.initDefaultData()
}
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
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)
}
}
}
}
},
changeDataFormData(type, data, model,index,defaultValue) {
if(!this.isEdit) {
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(){
},
selfGetInfo(dataForm) {
this.dataInfo(dataForm)
},
beforeSubmit(){
const _data =this.dataList()
return _data
},
selfInit() {
this.dataAll()
},
getFormById() {
getFormById("529305238373400645").then(res => {
this.dataForm.flowId = res.data&&res.data.flowId
// this.encode = res.data&&res.data.encode
})
},
exist() {
let isOk = true
for (let key in this.tableRequiredData) {
if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
for (let i = 0; i < this.dataForm[key].length; i++) {
let item = this.dataForm[key][i]
inner: for (let id in item) {
let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
if (!arr.length) continue inner
if (arr[0].required) {
let msg = `${arr[0].name}不能为空`
let boo = true
if (arr[0].dataType === 'array') {
boo = !this.jnpf.isEmptyArray(item[id])
} else {
boo = !this.jnpf.isEmpty(item[id])
}
if (!boo) {
this.$message({
message: msg,
type: 'error',
duration: 1000
})
isOk = false
break
}
}
}
}
}
}
if (!this.warehousingproductExist()) return
return isOk
},
warehousingproductExist() {
let isOk = true;
for(let i=0;i<this.dataForm.warehousingproductList.length;i++){
const e = this.dataForm.warehousingproductList[i];
}
return isOk;
},
goBack() {
this.$emit('refresh')
},
clearData(){
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
},
addwarehousingproductList(){
let item = {
productName:undefined,
spec:undefined,
inventoryUnitId:undefined,
purchaseUnitId:undefined,
purchaseNum:undefined,
storageAreaId:undefined,
warehousingUnitId:undefined,
barCode:undefined,
notificationStorageNumber:undefined,
volume:undefined,
batchNo:undefined,
produceDate:undefined,
remark:undefined,
}
this.getwarehousingproductList(item)
},
delwarehousingproductList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.warehousingproductList.splice(index, 1);
}).catch(() => {
});
},
getwarehousingproductList(value){
let item={...this.tableRows.warehousingproductList,...value}
this.dataForm.warehousingproductList.push(item)
this.childIndex=this.dataForm.warehousingproductList.length-1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
openSelectDialog(key) {
this.currTableConf=this.addTableConf[key]
this.currVmodel=key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if(this['get'+this.currVmodel]){
this['get'+this.currVmodel](t)
}
}
},
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(){
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for(let i=0;i<_dataAll.warehousingproductList.length;i++){
this.childIndex = i
}
this.childIndex=-1
},
},
}
</script>

@ -0,0 +1,589 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="通知编号">
<el-input v-model="query.warehousingCode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<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" v-has="'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>
<el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()" v-has="'btn_batchRemove'" >批量删除
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange"
:span-method="arraySpanMethod"
>
<el-table-column
prop="warehousingCode"
label="通知编号" align="left"
>
</el-table-column>
<el-table-column
prop="businessId"
label="销售订单" align="left"
>
</el-table-column>
<el-table-column
prop="subjectBasicId"
label="客户名称" align="left"
>
</el-table-column>
<el-table-column
prop="shippingAddress"
label="收货地址" align="left"
>
</el-table-column>
<el-table-column
prop="enterpriseId"
label="机构名称" align="left"
>
</el-table-column>
<el-table-column
prop="warehouseId"
label="发货仓库" align="left"
>
</el-table-column>
<el-table-column
prop="deliveryAddress"
label="发货地址" align="left"
>
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100" >
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
<el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==4">流程撤回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==5">审核终止</el-tag>
<el-tag type="warning" v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="操作"
fixed="right" width="150" >
<template slot-scope="scope" >
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'" >编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" :disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1" v-has="'btn_remove'" @click="handleDel(scope.row.id)">
</el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)"
>详情</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"/>
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<el-dialog title="请选择流程" :close-on-click-modal="false" append-to-body
:visible.sync="flowListVisible" class="JNPF-dialog template-dialog JNPF-dialog_center"
lock-scroll width="400px">
<el-scrollbar class="template-list">
<div class="template-item" v-for="item in flowList" :key="item.id"
@click="selectFlow(item)">{{item.fullName}}
</div>
</el-scrollbar>
</el-dialog>
<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 {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import { getFormById } from '@/api/workFlow/FormDesign'
import { getFlowList } from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox'
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 { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
FlowBox,
ExportBox,ToFormDetail , SuperQuery
},
data() {
return {
keyword:'',
expandsTree: true,
refreshTree: true,
toFormDetailVisible:false,
expandObj:{},
columnOptions: [],
mergeList: [],
exportList:[],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
warehousingCode:undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
multipleSelection: [], total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
warehousingTypeOptions:[{"fullName":"销售出库","id":"8"}],
warehousingTypeProps:{"label":"fullName","value":"id" },
interfaceRes: {
businessId:[] ,
subjectBasicId:[] ,
enterpriseId:[] ,
warehouseId:[{"dataType":"varchar","defaultValue":"","field":"businessLineId","fieldName":"","id":"PneOdw1","jnpfKey":null,"relationField":null,"required":"0"}] ,
deliveryAddress:[{"dataType":"varchar","defaultValue":"","field":"businessOrganizeId","fieldName":"","id":"AyAmdw1","jnpfKey":"popupSelect","relationField":"warehouseId","required":"0"}] ,
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
getFormById("529305238373400645").then(res1 => {
let flowId = res1.data&&res1.data.id
getFlowList(flowId,'1').then(res2 => {
this.flowList = res2.data
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
}).catch((e) => {
this.$message({ type: 'error', message: e.message });
this.$router.push('/404');
})
})
},
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.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
},
goDetail(id){
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({column, prop, order}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId:this.menuId,
moduleId:'529305238373400645',
type:1,
};
request({
url: `/api/scm/WarehousingNotification/getList`,
method: 'post',
data: _query
}).then(res => {
var _list =res.data.list;
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/scm/WarehousingNotification/${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("","scm/WarehousingNotification")
})
},
handleSelectionChange(val) {
const res = val.map(item => item.id)
this.multipleSelection = res
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
const ids = this.multipleSelection
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/WarehousingNotification/batchRemove`,
data: ids,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row,flowState) {
if(!row){
this.addHandle();
}else {
this.updateHandle(row,flowState)
}
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
request({
url: `/api/scm/WarehousingNotification/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.listQuery.sort="desc"
this.listQuery.sidx=""
this.initData()
},
//
updateHandle(row,flowState) {
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
opType: flowState ? 0 : '-1',
status: flowState
}
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
toApprovalDetail(row) {
let data = {
id: row.id,
flowId: row.flowId,
opType: 0,
status: row.currentState
}
this.formVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
addHandle() {
if (!this.flowList.length) {
this.$message({ type: 'error', message: '流程不存在' });
} else if (this.flowList.length === 1) {
this.selectFlow(this.flowList[0])
} else {
this.flowListVisible = true
}
},
//
selectFlow(item) {
let data = {
id: '',
formType: 1,
flowId: item.id,
opType: '-1'
}
this.flowListVisible = false
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save