jg-waiwang-pro
XI_TENG\xixi_ 8 months ago
parent fbf5eb9fc4
commit 712e300e79

@ -0,0 +1,18 @@
<?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.WarehousingInventoryMapper">
<select id="queryProductNum" resultType="String">
SELECT COUNT(product_id) AS productNum FROM jg_warehousing_inventory_product t1
LEFT JOIN jg_warehousing_inventory t2 ON t2.id=t1.inventory_id
WHERE t1.f_delete_mark IS NULL AND t2.id = #{id}
</select>
<select id="queryProductSum" resultType="String">
SELECT SUM(firm_offer_quantity) AS productSum FROM jg_warehousing_inventory_product t1
LEFT JOIN jg_warehousing_inventory t2 ON t2.id=t1.inventory_id
WHERE t1.f_delete_mark IS NULL AND t2.id = #{id}
</select>
</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.WarehousingInventoryProductMapper">
</mapper>

@ -0,0 +1,20 @@
<?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.WarehousingOutboundMapper">
<select id="queryOutboundNumber" resultType="String">
SELECT SUM(outbound_number) AS outNumber FROM jg_warehousing_outbound_product t1
LEFT JOIN jg_warehousing_outbound t2 ON t1.warehousing_outbound_id = t2.id
WHERE t1.f_delete_mark IS NULL AND t2.id = #{id}
</select>
<select id="querySalesNo" resultType="String">
SELECT t3.code AS orderCode FROM jg_warehousing_outbound t1
LEFT JOIN jg_warehousing_notification t2 ON t2.id=t1.warehousing_id
LEFT JOIN jg_business_order t3 ON t2.business_id=t3.id
WHERE t1.f_delete_mark IS NULL AND t1.id = #{id}
</select>
</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.WarehousingOutboundPoundlistMapper">
</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.WarehousingOutboundProductMapper">
</mapper>

@ -3,5 +3,18 @@
<mapper namespace="jnpf.mapper.WarehousingStorageMapper"> <mapper namespace="jnpf.mapper.WarehousingStorageMapper">
<select id="queryrealityNumber" resultType="String">
SELECT SUM(storage_number) AS realityNumber FROM jg_warehousing_storage_product t1
LEFT JOIN jg_warehousing_storage t2 ON t1.warehousing_storage_id = t2.id
WHERE t1.f_delete_mark IS NULL AND t2.id = #{id}
</select>
<select id="queryPurchaseNo" resultType="String">
SELECT t3.code AS orderCode FROM jg_warehousing_storage t1
LEFT JOIN jg_warehousing_notification t2 ON t2.id=t1.warehousing_id
LEFT JOIN jg_business_order t3 ON t2.business_id=t3.id
WHERE t1.f_delete_mark IS NULL AND t1.id = #{id}
</select>
</mapper> </mapper>

@ -0,0 +1,18 @@
package jnpf.mapper;
import jnpf.entity.WarehousingInventoryEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* warehousingInventory
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
public interface WarehousingInventoryMapper extends BaseMapper<WarehousingInventoryEntity> {
String queryProductNum(String id);
String queryProductSum(String id);
}

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

@ -0,0 +1,22 @@
package jnpf.mapper;
import jnpf.entity.WarehousingOutboundEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* warehousingOutbound
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
public interface WarehousingOutboundMapper extends BaseMapper<WarehousingOutboundEntity> {
//查询实际出库数量
String queryOutboundNumber(String id);
//关联销售单号
String querySalesNo(String id);
}

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

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

@ -12,5 +12,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* 2024-02-20 * 2024-02-20
*/ */
public interface WarehousingStorageMapper extends BaseMapper<WarehousingStorageEntity> { public interface WarehousingStorageMapper extends BaseMapper<WarehousingStorageEntity> {
//查询实际入库数量
String queryrealityNumber(String id);
//关联采购单号
String queryPurchaseNo(String id);
} }

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.warehousinginventory.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingInventory
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
public interface WarehousingInventoryProductService extends IService<WarehousingInventoryProductEntity> {
QueryWrapper<WarehousingInventoryProductEntity> getChild(WarehousingInventoryPagination pagination,QueryWrapper<WarehousingInventoryProductEntity> warehousingInventoryProductQueryWrapper);
}

@ -0,0 +1,44 @@
package jnpf.service;
import jnpf.model.warehousinginventory.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingInventory
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
public interface WarehousingInventoryService extends IService<WarehousingInventoryEntity> {
List<WarehousingInventoryEntity> getList(WarehousingInventoryPagination warehousingInventoryPagination);
List<WarehousingInventoryEntity> getTypeList(WarehousingInventoryPagination warehousingInventoryPagination,String dataType);
WarehousingInventoryEntity getInfo(String id);
void delete(WarehousingInventoryEntity entity);
void create(WarehousingInventoryEntity entity);
boolean update(String id, WarehousingInventoryEntity entity);
//子表方法
List<WarehousingInventoryProductEntity> getWarehousingInventoryProductList(String id,WarehousingInventoryPagination warehousingInventoryPagination);
List<WarehousingInventoryProductEntity> getWarehousingInventoryProductList(String id);
//副表数据方法
String checkForm(WarehousingInventoryForm form,int i);
void saveOrUpdate(WarehousingInventoryForm warehousingInventoryForm,String id, boolean isSave) throws Exception;
//查询商品种类数
String selectProductNum(String id);
//查询商品总数
String selectProductSum(String id);
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.warehousingoutbound.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingOutbound
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
public interface WarehousingOutboundPoundlistService extends IService<WarehousingOutboundPoundlistEntity> {
QueryWrapper<WarehousingOutboundPoundlistEntity> getChild(WarehousingOutboundPagination pagination,QueryWrapper<WarehousingOutboundPoundlistEntity> warehousingOutboundPoundlistQueryWrapper);
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.warehousingoutbound.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingOutbound
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
public interface WarehousingOutboundProductService extends IService<WarehousingOutboundProductEntity> {
QueryWrapper<WarehousingOutboundProductEntity> getChild(WarehousingOutboundPagination pagination,QueryWrapper<WarehousingOutboundProductEntity> warehousingOutboundProductQueryWrapper);
}

@ -0,0 +1,49 @@
package jnpf.service;
import jnpf.model.warehousingoutbound.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingOutbound
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
public interface WarehousingOutboundService extends IService<WarehousingOutboundEntity> {
List<WarehousingOutboundEntity> getList(WarehousingOutboundPagination warehousingOutboundPagination);
List<WarehousingOutboundEntity> getTypeList(WarehousingOutboundPagination warehousingOutboundPagination,String dataType);
WarehousingOutboundEntity getInfo(String id);
void delete(WarehousingOutboundEntity entity);
void create(WarehousingOutboundEntity entity);
boolean update(String id, WarehousingOutboundEntity entity);
//子表方法
List<WarehousingOutboundPoundlistEntity> getWarehousingOutboundPoundlistList(String id,WarehousingOutboundPagination warehousingOutboundPagination);
List<WarehousingOutboundPoundlistEntity> getWarehousingOutboundPoundlistList(String id);
List<WarehousingOutboundProductEntity> getWarehousingOutboundProductList(String id,WarehousingOutboundPagination warehousingOutboundPagination);
List<WarehousingOutboundProductEntity> getWarehousingOutboundProductList(String id);
//副表数据方法
String checkForm(WarehousingOutboundForm form,int i);
void saveOrUpdate(WarehousingOutboundForm warehousingOutboundForm,String id, boolean isSave) throws Exception;
//查询实际出库数量
String queryOutboundNumber(String id);
//关联销售单号
String querySalesNo(String id);
}

@ -40,4 +40,9 @@ public interface WarehousingStorageService extends IService<WarehousingStorageEn
void saveOrUpdate(WarehousingStorageForm warehousingStorageForm,String id, boolean isSave) throws Exception; void saveOrUpdate(WarehousingStorageForm warehousingStorageForm,String id, boolean isSave) throws Exception;
//查询实际入库数量
String queryRealityNumber(String id);
//关联采购单号
String queryPurchaseNo(String id);
} }

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingInventoryProductMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousinginventory.*;
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;
/**
*
* warehousingInventory
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
@Service
public class WarehousingInventoryProductServiceImpl extends ServiceImpl<WarehousingInventoryProductMapper, WarehousingInventoryProductEntity> implements WarehousingInventoryProductService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<WarehousingInventoryProductEntity> getChild(WarehousingInventoryPagination pagination, QueryWrapper<WarehousingInventoryProductEntity> warehousingInventoryProductQueryWrapper){
boolean pcPermission = true;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?WarehousingInventoryConstant.getColumnData():WarehousingInventoryConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return warehousingInventoryProductQueryWrapper;
}
}

@ -0,0 +1,425 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingInventoryMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousinginventory.*;
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;
/**
*
* warehousingInventory
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
@Service
public class WarehousingInventoryServiceImpl extends ServiceImpl<WarehousingInventoryMapper, WarehousingInventoryEntity> implements WarehousingInventoryService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingInventoryProductService warehousingInventoryProductService;
@Autowired
private WarehousingInventoryMapper warehousingInventoryMapper;
@Override
public List<WarehousingInventoryEntity> getList(WarehousingInventoryPagination warehousingInventoryPagination){
return getTypeList(warehousingInventoryPagination,warehousingInventoryPagination.getDataType());
}
/** 列表查询 */
@Override
public List<WarehousingInventoryEntity> getTypeList(WarehousingInventoryPagination warehousingInventoryPagination,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 ? WarehousingInventoryConstant.getAppColumnData() : WarehousingInventoryConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int warehousingInventoryNum =0;
QueryWrapper<WarehousingInventoryEntity> warehousingInventoryQueryWrapper=new QueryWrapper<>();
int warehousingInventoryProductNum =0;
QueryWrapper<WarehousingInventoryProductEntity> warehousingInventoryProductQueryWrapper=new QueryWrapper<>();
long warehousingInventoryProductcount = warehousingInventoryProductService.count();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(warehousingInventoryPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = warehousingInventoryPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<WarehousingInventoryEntity> warehousingInventorySuperWrapper = new QueryWrapper<>();
warehousingInventorySuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingInventorySuperWrapper,WarehousingInventoryEntity.class,queryJson,"0"));
int warehousingInventoryNum1 = warehousingInventorySuperWrapper.getExpression().getNormal().size();
if (warehousingInventoryNum1>0){
List<String> warehousingInventoryList =this.list(warehousingInventorySuperWrapper).stream().map(WarehousingInventoryEntity::getId).collect(Collectors.toList());
allSuperList.addAll(warehousingInventoryList);
intersectionSuperList.add(warehousingInventoryList);
superNum++;
}
String warehousingInventoryProductTable = "jg_warehousing_inventory_product";
boolean warehousingInventoryProductHasSql = queryJson.contains(warehousingInventoryProductTable);
List<String> warehousingInventoryProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingInventoryConstant.getTableList(), warehousingInventoryProductTable , queryJson, null);
if (warehousingInventoryProductHasSql){
allSuperList.addAll(warehousingInventoryProductList);
intersectionSuperList.add(warehousingInventoryProductList);
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<WarehousingInventoryEntity> warehousingInventorySuperWrapper = new QueryWrapper<>();
warehousingInventorySuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingInventorySuperWrapper,WarehousingInventoryEntity.class,ruleJson,"0"));
int warehousingInventoryNum1 = warehousingInventorySuperWrapper.getExpression().getNormal().size();
if (warehousingInventoryNum1>0){
List<String> warehousingInventoryList =this.list(warehousingInventorySuperWrapper).stream().map(WarehousingInventoryEntity::getId).collect(Collectors.toList());
allRuleList.addAll(warehousingInventoryList);
intersectionRuleList.add(warehousingInventoryList);
ruleNum++;
}
String warehousingInventoryProductTable = "jg_warehousing_inventory_product";
boolean warehousingInventoryProductHasSql = ruleJson.contains(warehousingInventoryProductTable);
List<String> warehousingInventoryProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingInventoryConstant.getTableList(), warehousingInventoryProductTable , ruleJson, null);
if (warehousingInventoryProductHasSql){
allRuleList.addAll(warehousingInventoryProductList);
intersectionRuleList.add(warehousingInventoryProductList);
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 warehousingInventoryObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInventoryQueryWrapper,WarehousingInventoryEntity.class,warehousingInventoryPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInventoryObj)){
return new ArrayList<>();
} else {
warehousingInventoryQueryWrapper = (QueryWrapper<WarehousingInventoryEntity>)warehousingInventoryObj;
if( warehousingInventoryQueryWrapper.getExpression().getNormal().size()>0){
warehousingInventoryNum++;
}
}
Object warehousingInventoryProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInventoryProductQueryWrapper,WarehousingInventoryProductEntity.class,warehousingInventoryPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInventoryProductObj)){
return new ArrayList<>();
} else {
warehousingInventoryProductQueryWrapper = (QueryWrapper<WarehousingInventoryProductEntity>)warehousingInventoryProductObj;
if( warehousingInventoryProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingInventoryProductNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehousingInventoryObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInventoryQueryWrapper,WarehousingInventoryEntity.class,warehousingInventoryPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInventoryObj)){
return new ArrayList<>();
} else {
warehousingInventoryQueryWrapper = (QueryWrapper<WarehousingInventoryEntity>)warehousingInventoryObj;
if( warehousingInventoryQueryWrapper.getExpression().getNormal().size()>0){
warehousingInventoryNum++;
}
}
Object warehousingInventoryProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInventoryProductQueryWrapper,WarehousingInventoryProductEntity.class,warehousingInventoryPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInventoryProductObj)){
return new ArrayList<>();
} else {
warehousingInventoryProductQueryWrapper = (QueryWrapper<WarehousingInventoryProductEntity>)warehousingInventoryProductObj;
if( warehousingInventoryProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingInventoryProductNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(warehousingInventoryPagination.getInventoryType())){
warehousingInventoryNum++;
warehousingInventoryQueryWrapper.lambda().eq(WarehousingInventoryEntity::getInventoryType,warehousingInventoryPagination.getInventoryType());
}
if(ObjectUtil.isNotEmpty(warehousingInventoryPagination.getInventoryTimeStart())){
warehousingInventoryNum++;
List InventoryTimeStartList = JsonUtil.getJsonToList(warehousingInventoryPagination.getInventoryTimeStart(),String.class);
Long fir = Long.valueOf(String.valueOf(InventoryTimeStartList.get(0)));
Long sec = Long.valueOf(String.valueOf(InventoryTimeStartList.get(1)));
warehousingInventoryQueryWrapper.lambda().ge(WarehousingInventoryEntity::getInventoryTimeStart, new Date(fir))
.le(WarehousingInventoryEntity::getInventoryTimeStart, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if(ObjectUtil.isNotEmpty(warehousingInventoryPagination.getDocumentNo())){
warehousingInventoryNum++;
String value = warehousingInventoryPagination.getDocumentNo() instanceof List ?
JsonUtil.getObjectToString(warehousingInventoryPagination.getDocumentNo()) :
String.valueOf(warehousingInventoryPagination.getDocumentNo());
warehousingInventoryQueryWrapper.lambda().like(WarehousingInventoryEntity::getDocumentNo,value);
}
if(ObjectUtil.isNotEmpty(warehousingInventoryPagination.getCreatorUserId())){
warehousingInventoryNum++;
warehousingInventoryQueryWrapper.lambda().eq(WarehousingInventoryEntity::getCreatorUserId,warehousingInventoryPagination.getCreatorUserId());
}
if(ObjectUtil.isNotEmpty(warehousingInventoryPagination.getCreatorTime())){
warehousingInventoryNum++;
List CreatorTimeList = JsonUtil.getJsonToList(warehousingInventoryPagination.getCreatorTime(),String.class);
Long fir = Long.valueOf(String.valueOf(CreatorTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(CreatorTimeList.get(1)));
warehousingInventoryQueryWrapper.lambda().ge(WarehousingInventoryEntity::getCreatorTime, new Date(fir))
.le(WarehousingInventoryEntity::getCreatorTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
}
if(warehousingInventoryProductNum>0){
List<String> warehousingInventoryProductIdList = warehousingInventoryProductService.list(warehousingInventoryProductQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getInventoryId())).map(t->t.getInventoryId()).collect(Collectors.toList());
long count = warehousingInventoryProductService.count();
if (count>0){
intersectionList.add(warehousingInventoryProductIdList);
}
AllIdList.addAll(warehousingInventoryProductIdList);
}
total+=warehousingInventoryProductNum;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
warehousingInventoryQueryWrapper.lambda().in(WarehousingInventoryEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
warehousingInventoryQueryWrapper.lambda().and(t->t.in(WarehousingInventoryEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
warehousingInventoryQueryWrapper.lambda().and(t->t.in(WarehousingInventoryEntity::getId, finalAllRuleIDlist));
}
//假删除标志
warehousingInventoryQueryWrapper.lambda().isNull(WarehousingInventoryEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(warehousingInventoryPagination.getSidx())){
warehousingInventoryQueryWrapper.lambda().orderByDesc(WarehousingInventoryEntity::getId);
}else{
try {
String sidx = warehousingInventoryPagination.getSidx();
String[] strs= sidx.split("_name");
WarehousingInventoryEntity warehousingInventoryEntity = new WarehousingInventoryEntity();
Field declaredField = warehousingInventoryEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
warehousingInventoryQueryWrapper="asc".equals(warehousingInventoryPagination.getSort().toLowerCase())?warehousingInventoryQueryWrapper.orderByAsc(value):warehousingInventoryQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<WarehousingInventoryEntity> page=new Page<>(warehousingInventoryPagination.getCurrentPage(), warehousingInventoryPagination.getPageSize());
IPage<WarehousingInventoryEntity> userIPage=this.page(page, warehousingInventoryQueryWrapper);
return warehousingInventoryPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WarehousingInventoryEntity> list = new ArrayList();
return warehousingInventoryPagination.setData(list, list.size());
}
}else{
return this.list(warehousingInventoryQueryWrapper);
}
}
@Override
public WarehousingInventoryEntity getInfo(String id){
QueryWrapper<WarehousingInventoryEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingInventoryEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(WarehousingInventoryEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, WarehousingInventoryEntity entity){
return this.updateById(entity);
}
@Override
public void delete(WarehousingInventoryEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** WarehousingInventoryProduct子表方法 */
@Override
public List<WarehousingInventoryProductEntity> getWarehousingInventoryProductList(String id,WarehousingInventoryPagination warehousingInventoryPagination){
Map<String, Object> newtabMap=WarehousingInventoryConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="warehousingInventoryProduct";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<WarehousingInventoryProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = warehousingInventoryProductService.getChild(warehousingInventoryPagination,queryWrapper);
queryWrapper.lambda().eq(WarehousingInventoryProductEntity::getInventoryId, id);
generaterSwapUtil.wrapperHandle(WarehousingInventoryConstant.getColumnData(), WarehousingInventoryConstant.getAppColumnData(), queryWrapper,WarehousingInventoryProductEntity.class,"sub",tableName);
return warehousingInventoryProductService.list(queryWrapper);
}
/** WarehousingInventoryProduct子表方法 */
@Override
public List<WarehousingInventoryProductEntity> getWarehousingInventoryProductList(String id){
QueryWrapper<WarehousingInventoryProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingInventoryProductEntity::getInventoryId, id);
return warehousingInventoryProductService.list(queryWrapper);
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(WarehousingInventoryForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
//子表字段验证
if (form.getWarehousingInventoryProductList()!=null){
}
return countRecover;
}
/**
* ()
* @param id
* @param warehousingInventoryForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(WarehousingInventoryForm warehousingInventoryForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
warehousingInventoryForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WarehousingInventoryConstant.getFormData(),warehousingInventoryForm),WarehousingInventoryForm.class);
WarehousingInventoryEntity entity = JsonUtil.getJsonToBean(warehousingInventoryForm, WarehousingInventoryEntity.class);
if(isSave){
String mainId = id ;
entity.setDocumentNo(generaterSwapUtil.getBillNumber("warehousingInventory", false));
entity.setCreatorUserId(userInfo.getUserId());
entity.setCreatorTime(DateUtil.getNowDate());
entity.setLastModifyUserId(null);
entity.setLastModifyTime(null);
entity.setId(mainId);
entity.setFlowId(warehousingInventoryForm.getFlowId());
entity.setVersion(0);
}else{
entity.setDocumentNo(generaterSwapUtil.getBillNumber("warehousingInventory", false));
entity.setCreatorUserId(userInfo.getUserId());
entity.setCreatorTime(DateUtil.getNowDate());
entity.setLastModifyUserId(null);
entity.setLastModifyTime(null);
entity.setFlowId(warehousingInventoryForm.getFlowId());
}
this.saveOrUpdate(entity);
//WarehousingInventoryProduct子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingInventoryProductEntity> WarehousingInventoryProductqueryWrapper = new QueryWrapper<>();
WarehousingInventoryProductqueryWrapper.lambda().eq(WarehousingInventoryProductEntity::getInventoryId, entity.getId());
warehousingInventoryProductService.remove(WarehousingInventoryProductqueryWrapper);
}
if (warehousingInventoryForm.getWarehousingInventoryProductList()!=null){
List<WarehousingInventoryProductEntity> tableField112 = JsonUtil.getJsonToList(warehousingInventoryForm.getWarehousingInventoryProductList(),WarehousingInventoryProductEntity.class);
for(WarehousingInventoryProductEntity entitys : tableField112){
entitys.setId(RandomUtil.uuId());
entitys.setInventoryId(entity.getId());
if(isSave){
}else{
}
warehousingInventoryProductService.saveOrUpdate(entitys);
}
}
}
@Override
public String selectProductNum(String id) {
return warehousingInventoryMapper.queryProductNum(id);
}
@Override
public String selectProductSum(String id) {
return warehousingInventoryMapper.queryProductSum(id);
}
}

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingOutboundPoundlistMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousingoutbound.*;
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;
/**
*
* warehousingOutbound
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
@Service
public class WarehousingOutboundPoundlistServiceImpl extends ServiceImpl<WarehousingOutboundPoundlistMapper, WarehousingOutboundPoundlistEntity> implements WarehousingOutboundPoundlistService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<WarehousingOutboundPoundlistEntity> getChild(WarehousingOutboundPagination pagination, QueryWrapper<WarehousingOutboundPoundlistEntity> warehousingOutboundPoundlistQueryWrapper){
boolean pcPermission = true;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?WarehousingOutboundConstant.getColumnData():WarehousingOutboundConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return warehousingOutboundPoundlistQueryWrapper;
}
}

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingOutboundProductMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousingoutbound.*;
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;
/**
*
* warehousingOutbound
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
@Service
public class WarehousingOutboundProductServiceImpl extends ServiceImpl<WarehousingOutboundProductMapper, WarehousingOutboundProductEntity> implements WarehousingOutboundProductService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<WarehousingOutboundProductEntity> getChild(WarehousingOutboundPagination pagination, QueryWrapper<WarehousingOutboundProductEntity> warehousingOutboundProductQueryWrapper){
boolean pcPermission = true;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?WarehousingOutboundConstant.getColumnData():WarehousingOutboundConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return warehousingOutboundProductQueryWrapper;
}
}

@ -0,0 +1,550 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingOutboundMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousingoutbound.*;
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;
/**
*
* warehousingOutbound
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
@Service
public class WarehousingOutboundServiceImpl extends ServiceImpl<WarehousingOutboundMapper, WarehousingOutboundEntity> implements WarehousingOutboundService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingOutboundPoundlistService warehousingOutboundPoundlistService;
@Autowired
private WarehousingOutboundProductService warehousingOutboundProductService;
@Autowired
private WarehousingOutboundMapper warehousingOutboundMapper;
@Override
public List<WarehousingOutboundEntity> getList(WarehousingOutboundPagination warehousingOutboundPagination){
return getTypeList(warehousingOutboundPagination,warehousingOutboundPagination.getDataType());
}
/** 列表查询 */
@Override
public List<WarehousingOutboundEntity> getTypeList(WarehousingOutboundPagination warehousingOutboundPagination,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 ? WarehousingOutboundConstant.getAppColumnData() : WarehousingOutboundConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int warehousingOutboundNum =0;
QueryWrapper<WarehousingOutboundEntity> warehousingOutboundQueryWrapper=new QueryWrapper<>();
int warehousingOutboundPoundlistNum =0;
QueryWrapper<WarehousingOutboundPoundlistEntity> warehousingOutboundPoundlistQueryWrapper=new QueryWrapper<>();
int warehousingOutboundProductNum =0;
QueryWrapper<WarehousingOutboundProductEntity> warehousingOutboundProductQueryWrapper=new QueryWrapper<>();
long warehousingOutboundPoundlistcount = warehousingOutboundPoundlistService.count();
long warehousingOutboundProductcount = warehousingOutboundProductService.count();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(warehousingOutboundPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = warehousingOutboundPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<WarehousingOutboundEntity> warehousingOutboundSuperWrapper = new QueryWrapper<>();
warehousingOutboundSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingOutboundSuperWrapper,WarehousingOutboundEntity.class,queryJson,"0"));
int warehousingOutboundNum1 = warehousingOutboundSuperWrapper.getExpression().getNormal().size();
if (warehousingOutboundNum1>0){
List<String> warehousingOutboundList =this.list(warehousingOutboundSuperWrapper).stream().map(WarehousingOutboundEntity::getId).collect(Collectors.toList());
allSuperList.addAll(warehousingOutboundList);
intersectionSuperList.add(warehousingOutboundList);
superNum++;
}
String warehousingOutboundPoundlistTable = "jg_warehousing_outbound_poundlist";
boolean warehousingOutboundPoundlistHasSql = queryJson.contains(warehousingOutboundPoundlistTable);
List<String> warehousingOutboundPoundlistList = generaterSwapUtil.selectIdsByChildCondition(WarehousingOutboundConstant.getTableList(), warehousingOutboundPoundlistTable , queryJson, null);
if (warehousingOutboundPoundlistHasSql){
allSuperList.addAll(warehousingOutboundPoundlistList);
intersectionSuperList.add(warehousingOutboundPoundlistList);
superNum++;
}
String warehousingOutboundProductTable = "jg_warehousing_outbound_product";
boolean warehousingOutboundProductHasSql = queryJson.contains(warehousingOutboundProductTable);
List<String> warehousingOutboundProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingOutboundConstant.getTableList(), warehousingOutboundProductTable , queryJson, null);
if (warehousingOutboundProductHasSql){
allSuperList.addAll(warehousingOutboundProductList);
intersectionSuperList.add(warehousingOutboundProductList);
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<WarehousingOutboundEntity> warehousingOutboundSuperWrapper = new QueryWrapper<>();
warehousingOutboundSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingOutboundSuperWrapper,WarehousingOutboundEntity.class,ruleJson,"0"));
int warehousingOutboundNum1 = warehousingOutboundSuperWrapper.getExpression().getNormal().size();
if (warehousingOutboundNum1>0){
List<String> warehousingOutboundList =this.list(warehousingOutboundSuperWrapper).stream().map(WarehousingOutboundEntity::getId).collect(Collectors.toList());
allRuleList.addAll(warehousingOutboundList);
intersectionRuleList.add(warehousingOutboundList);
ruleNum++;
}
String warehousingOutboundPoundlistTable = "jg_warehousing_outbound_poundlist";
boolean warehousingOutboundPoundlistHasSql = ruleJson.contains(warehousingOutboundPoundlistTable);
List<String> warehousingOutboundPoundlistList = generaterSwapUtil.selectIdsByChildCondition(WarehousingOutboundConstant.getTableList(), warehousingOutboundPoundlistTable , ruleJson, null);
if (warehousingOutboundPoundlistHasSql){
allRuleList.addAll(warehousingOutboundPoundlistList);
intersectionRuleList.add(warehousingOutboundPoundlistList);
ruleNum++;
}
String warehousingOutboundProductTable = "jg_warehousing_outbound_product";
boolean warehousingOutboundProductHasSql = ruleJson.contains(warehousingOutboundProductTable);
List<String> warehousingOutboundProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingOutboundConstant.getTableList(), warehousingOutboundProductTable , ruleJson, null);
if (warehousingOutboundProductHasSql){
allRuleList.addAll(warehousingOutboundProductList);
intersectionRuleList.add(warehousingOutboundProductList);
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 warehousingOutboundObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingOutboundQueryWrapper,WarehousingOutboundEntity.class,warehousingOutboundPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingOutboundObj)){
return new ArrayList<>();
} else {
warehousingOutboundQueryWrapper = (QueryWrapper<WarehousingOutboundEntity>)warehousingOutboundObj;
if( warehousingOutboundQueryWrapper.getExpression().getNormal().size()>0){
warehousingOutboundNum++;
}
}
Object warehousingOutboundPoundlistObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingOutboundPoundlistQueryWrapper,WarehousingOutboundPoundlistEntity.class,warehousingOutboundPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingOutboundPoundlistObj)){
return new ArrayList<>();
} else {
warehousingOutboundPoundlistQueryWrapper = (QueryWrapper<WarehousingOutboundPoundlistEntity>)warehousingOutboundPoundlistObj;
if( warehousingOutboundPoundlistQueryWrapper.getExpression().getNormal().size()>0){
warehousingOutboundPoundlistNum++;
}
}
Object warehousingOutboundProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingOutboundProductQueryWrapper,WarehousingOutboundProductEntity.class,warehousingOutboundPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingOutboundProductObj)){
return new ArrayList<>();
} else {
warehousingOutboundProductQueryWrapper = (QueryWrapper<WarehousingOutboundProductEntity>)warehousingOutboundProductObj;
if( warehousingOutboundProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingOutboundProductNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehousingOutboundObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingOutboundQueryWrapper,WarehousingOutboundEntity.class,warehousingOutboundPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingOutboundObj)){
return new ArrayList<>();
} else {
warehousingOutboundQueryWrapper = (QueryWrapper<WarehousingOutboundEntity>)warehousingOutboundObj;
if( warehousingOutboundQueryWrapper.getExpression().getNormal().size()>0){
warehousingOutboundNum++;
}
}
Object warehousingOutboundPoundlistObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingOutboundPoundlistQueryWrapper,WarehousingOutboundPoundlistEntity.class,warehousingOutboundPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingOutboundPoundlistObj)){
return new ArrayList<>();
} else {
warehousingOutboundPoundlistQueryWrapper = (QueryWrapper<WarehousingOutboundPoundlistEntity>)warehousingOutboundPoundlistObj;
if( warehousingOutboundPoundlistQueryWrapper.getExpression().getNormal().size()>0){
warehousingOutboundPoundlistNum++;
}
}
Object warehousingOutboundProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingOutboundProductQueryWrapper,WarehousingOutboundProductEntity.class,warehousingOutboundPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingOutboundProductObj)){
return new ArrayList<>();
} else {
warehousingOutboundProductQueryWrapper = (QueryWrapper<WarehousingOutboundProductEntity>)warehousingOutboundProductObj;
if( warehousingOutboundProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingOutboundProductNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(warehousingOutboundPagination.getTableField119_batchNumber())){
warehousingOutboundProductNum++;
String value = warehousingOutboundPagination.getTableField119_batchNumber() instanceof List ?
JsonUtil.getObjectToString(warehousingOutboundPagination.getTableField119_batchNumber()) :
String.valueOf(warehousingOutboundPagination.getTableField119_batchNumber());
warehousingOutboundProductQueryWrapper.lambda().like(WarehousingOutboundProductEntity::getBatchNumber,value);
}
if(ObjectUtil.isNotEmpty(warehousingOutboundPagination.getDocumentNo())){
warehousingOutboundNum++;
String value = warehousingOutboundPagination.getDocumentNo() instanceof List ?
JsonUtil.getObjectToString(warehousingOutboundPagination.getDocumentNo()) :
String.valueOf(warehousingOutboundPagination.getDocumentNo());
warehousingOutboundQueryWrapper.lambda().like(WarehousingOutboundEntity::getDocumentNo,value);
}
if(ObjectUtil.isNotEmpty(warehousingOutboundPagination.getWarehousingStorageType())){
warehousingOutboundNum++;
List<String> idList = new ArrayList<>();
try {
String[][] warehousingStorageType = JsonUtil.getJsonToBean(warehousingOutboundPagination.getWarehousingStorageType(),String[][].class);
for(int i=0;i<warehousingStorageType.length;i++){
if(warehousingStorageType[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(warehousingStorageType[i])));
}
}
}catch (Exception e1){
try {
List<String> warehousingStorageType = JsonUtil.getJsonToList(warehousingOutboundPagination.getWarehousingStorageType(),String.class);
if(warehousingStorageType.size()>0){
idList.addAll(warehousingStorageType);
}
}catch (Exception e2){
idList.add(String.valueOf(warehousingOutboundPagination.getWarehousingStorageType()));
}
}
warehousingOutboundQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(WarehousingOutboundEntity::getWarehousingOutboundType, tt).or();
});
});
}
if(ObjectUtil.isNotEmpty(warehousingOutboundPagination.getWarehousingTime())){
warehousingOutboundNum++;
List WarehousingTimeList = JsonUtil.getJsonToList(warehousingOutboundPagination.getWarehousingTime(),String.class);
Long fir = Long.valueOf(String.valueOf(WarehousingTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(WarehousingTimeList.get(1)));
warehousingOutboundQueryWrapper.lambda().ge(WarehousingOutboundEntity::getWarehousingTime, new Date(fir))
.le(WarehousingOutboundEntity::getWarehousingTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if(ObjectUtil.isNotEmpty(warehousingOutboundPagination.getCreatorUserId())){
warehousingOutboundNum++;
warehousingOutboundQueryWrapper.lambda().eq(WarehousingOutboundEntity::getCreatorUserId,warehousingOutboundPagination.getCreatorUserId());
}
if(ObjectUtil.isNotEmpty(warehousingOutboundPagination.getCreatorTime())){
warehousingOutboundNum++;
List CreatorTimeList = JsonUtil.getJsonToList(warehousingOutboundPagination.getCreatorTime(),String.class);
Long fir = Long.valueOf(String.valueOf(CreatorTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(CreatorTimeList.get(1)));
warehousingOutboundQueryWrapper.lambda().ge(WarehousingOutboundEntity::getCreatorTime, new Date(fir))
.le(WarehousingOutboundEntity::getCreatorTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
}
if(warehousingOutboundPoundlistNum>0){
List<String> warehousingOutboundPoundlistIdList = warehousingOutboundPoundlistService.list(warehousingOutboundPoundlistQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getWarehousingOutboundId())).map(t->t.getWarehousingOutboundId()).collect(Collectors.toList());
long count = warehousingOutboundPoundlistService.count();
if (count>0){
intersectionList.add(warehousingOutboundPoundlistIdList);
}
AllIdList.addAll(warehousingOutboundPoundlistIdList);
}
total+=warehousingOutboundPoundlistNum;
if(warehousingOutboundProductNum>0){
List<String> warehousingOutboundProductIdList = warehousingOutboundProductService.list(warehousingOutboundProductQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getWarehousingOutboundId())).map(t->t.getWarehousingOutboundId()).collect(Collectors.toList());
long count = warehousingOutboundProductService.count();
if (count>0){
intersectionList.add(warehousingOutboundProductIdList);
}
AllIdList.addAll(warehousingOutboundProductIdList);
}
total+=warehousingOutboundProductNum;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
warehousingOutboundQueryWrapper.lambda().in(WarehousingOutboundEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
warehousingOutboundQueryWrapper.lambda().and(t->t.in(WarehousingOutboundEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
warehousingOutboundQueryWrapper.lambda().and(t->t.in(WarehousingOutboundEntity::getId, finalAllRuleIDlist));
}
//假删除标志
warehousingOutboundQueryWrapper.lambda().isNull(WarehousingOutboundEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(warehousingOutboundPagination.getSidx())){
warehousingOutboundQueryWrapper.lambda().orderByDesc(WarehousingOutboundEntity::getId);
}else{
try {
String sidx = warehousingOutboundPagination.getSidx();
String[] strs= sidx.split("_name");
WarehousingOutboundEntity warehousingOutboundEntity = new WarehousingOutboundEntity();
Field declaredField = warehousingOutboundEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
warehousingOutboundQueryWrapper="asc".equals(warehousingOutboundPagination.getSort().toLowerCase())?warehousingOutboundQueryWrapper.orderByAsc(value):warehousingOutboundQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<WarehousingOutboundEntity> page=new Page<>(warehousingOutboundPagination.getCurrentPage(), warehousingOutboundPagination.getPageSize());
IPage<WarehousingOutboundEntity> userIPage=this.page(page, warehousingOutboundQueryWrapper);
return warehousingOutboundPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WarehousingOutboundEntity> list = new ArrayList();
return warehousingOutboundPagination.setData(list, list.size());
}
}else{
return this.list(warehousingOutboundQueryWrapper);
}
}
@Override
public WarehousingOutboundEntity getInfo(String id){
QueryWrapper<WarehousingOutboundEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingOutboundEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(WarehousingOutboundEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, WarehousingOutboundEntity entity){
return this.updateById(entity);
}
@Override
public void delete(WarehousingOutboundEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** WarehousingOutboundPoundlist子表方法 */
@Override
public List<WarehousingOutboundPoundlistEntity> getWarehousingOutboundPoundlistList(String id,WarehousingOutboundPagination warehousingOutboundPagination){
Map<String, Object> newtabMap=WarehousingOutboundConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="warehousingOutboundPoundlist";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<WarehousingOutboundPoundlistEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = warehousingOutboundPoundlistService.getChild(warehousingOutboundPagination,queryWrapper);
queryWrapper.lambda().eq(WarehousingOutboundPoundlistEntity::getWarehousingOutboundId, id);
generaterSwapUtil.wrapperHandle(WarehousingOutboundConstant.getColumnData(), WarehousingOutboundConstant.getAppColumnData(), queryWrapper,WarehousingOutboundPoundlistEntity.class,"sub",tableName);
return warehousingOutboundPoundlistService.list(queryWrapper);
}
/** WarehousingOutboundPoundlist子表方法 */
@Override
public List<WarehousingOutboundPoundlistEntity> getWarehousingOutboundPoundlistList(String id){
QueryWrapper<WarehousingOutboundPoundlistEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingOutboundPoundlistEntity::getWarehousingOutboundId, id);
return warehousingOutboundPoundlistService.list(queryWrapper);
}
/** WarehousingOutboundProduct子表方法 */
@Override
public List<WarehousingOutboundProductEntity> getWarehousingOutboundProductList(String id,WarehousingOutboundPagination warehousingOutboundPagination){
Map<String, Object> newtabMap=WarehousingOutboundConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="warehousingOutboundProduct";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<WarehousingOutboundProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = warehousingOutboundProductService.getChild(warehousingOutboundPagination,queryWrapper);
queryWrapper.lambda().eq(WarehousingOutboundProductEntity::getWarehousingOutboundId, id);
generaterSwapUtil.wrapperHandle(WarehousingOutboundConstant.getColumnData(), WarehousingOutboundConstant.getAppColumnData(), queryWrapper,WarehousingOutboundProductEntity.class,"sub",tableName);
return warehousingOutboundProductService.list(queryWrapper);
}
/** WarehousingOutboundProduct子表方法 */
@Override
public List<WarehousingOutboundProductEntity> getWarehousingOutboundProductList(String id){
QueryWrapper<WarehousingOutboundProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingOutboundProductEntity::getWarehousingOutboundId, id);
return warehousingOutboundProductService.list(queryWrapper);
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(WarehousingOutboundForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
if(StringUtil.isEmpty(form.getOutboundReason())){
return "出库原因不能为空";
}
//子表字段验证
if (form.getWarehousingOutboundPoundlistList()!=null){
}
if (form.getWarehousingOutboundProductList()!=null){
}
return countRecover;
}
/**
* ()
* @param id
* @param warehousingOutboundForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(WarehousingOutboundForm warehousingOutboundForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
warehousingOutboundForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WarehousingOutboundConstant.getFormData(),warehousingOutboundForm),WarehousingOutboundForm.class);
WarehousingOutboundEntity entity = JsonUtil.getJsonToBean(warehousingOutboundForm, WarehousingOutboundEntity.class);
if(isSave){
String mainId = id ;
entity.setDocumentNo(generaterSwapUtil.getBillNumber("chukudanbianhao", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setId(mainId);
entity.setFlowId(warehousingOutboundForm.getFlowId());
entity.setVersion(0);
}else{
entity.setDocumentNo(generaterSwapUtil.getBillNumber("chukudanbianhao", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setFlowId(warehousingOutboundForm.getFlowId());
}
this.saveOrUpdate(entity);
//WarehousingOutboundPoundlist子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingOutboundPoundlistEntity> WarehousingOutboundPoundlistqueryWrapper = new QueryWrapper<>();
WarehousingOutboundPoundlistqueryWrapper.lambda().eq(WarehousingOutboundPoundlistEntity::getWarehousingOutboundId, entity.getId());
warehousingOutboundPoundlistService.remove(WarehousingOutboundPoundlistqueryWrapper);
}
if (warehousingOutboundForm.getWarehousingOutboundPoundlistList()!=null){
List<WarehousingOutboundPoundlistEntity> tableField114 = JsonUtil.getJsonToList(warehousingOutboundForm.getWarehousingOutboundPoundlistList(),WarehousingOutboundPoundlistEntity.class);
for(WarehousingOutboundPoundlistEntity entitys : tableField114){
entitys.setId(RandomUtil.uuId());
entitys.setWarehousingOutboundId(entity.getId());
if(isSave){
}else{
}
warehousingOutboundPoundlistService.saveOrUpdate(entitys);
}
}
//WarehousingOutboundProduct子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingOutboundProductEntity> WarehousingOutboundProductqueryWrapper = new QueryWrapper<>();
WarehousingOutboundProductqueryWrapper.lambda().eq(WarehousingOutboundProductEntity::getWarehousingOutboundId, entity.getId());
warehousingOutboundProductService.remove(WarehousingOutboundProductqueryWrapper);
}
if (warehousingOutboundForm.getWarehousingOutboundProductList()!=null){
List<WarehousingOutboundProductEntity> tableField119 = JsonUtil.getJsonToList(warehousingOutboundForm.getWarehousingOutboundProductList(),WarehousingOutboundProductEntity.class);
for(WarehousingOutboundProductEntity entitys : tableField119){
entitys.setId(RandomUtil.uuId());
entitys.setWarehousingOutboundId(entity.getId());
if(isSave){
}else{
}
warehousingOutboundProductService.saveOrUpdate(entitys);
}
}
}
@Override
public String queryOutboundNumber(String id) {
return warehousingOutboundMapper.queryOutboundNumber(id);
}
@Override
public String querySalesNo(String id) {
return warehousingOutboundMapper.querySalesNo(id);
}
}

@ -50,6 +50,8 @@ public class WarehousingStorageServiceImpl extends ServiceImpl<WarehousingStorag
private WarehousingStoragePoundlistService warehousingStoragePoundlistService; private WarehousingStoragePoundlistService warehousingStoragePoundlistService;
@Autowired @Autowired
private WarehousingStorageProductService warehousingStorageProductService; private WarehousingStorageProductService warehousingStorageProductService;
@Autowired
private WarehousingStorageMapper warehousingStorageMapper;
@Override @Override
public List<WarehousingStorageEntity> getList(WarehousingStoragePagination warehousingStoragePagination){ public List<WarehousingStorageEntity> getList(WarehousingStoragePagination warehousingStoragePagination){
return getTypeList(warehousingStoragePagination,warehousingStoragePagination.getDataType()); return getTypeList(warehousingStoragePagination,warehousingStoragePagination.getDataType());
@ -534,4 +536,14 @@ public class WarehousingStorageServiceImpl extends ServiceImpl<WarehousingStorag
} }
} }
} }
@Override
public String queryRealityNumber(String id) {
return warehousingStorageMapper.queryrealityNumber(id);
}
@Override
public String queryPurchaseNo(String id) {
return warehousingStorageMapper.queryPurchaseNo(id);
}
} }

@ -0,0 +1,443 @@
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.warehousinginventory.*;
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;
/**
* warehousingInventory
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-21
*/
@Slf4j
@RestController
@Tag(name = "warehousingInventory" , description = "scm")
@RequestMapping("/api/scm/WarehousingInventory")
public class WarehousingInventoryController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingInventoryService warehousingInventoryService;
@Autowired
private WarehousingInventoryProductService warehousingInventoryProductService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param warehousingInventoryPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody WarehousingInventoryPagination warehousingInventoryPagination)throws IOException{
List<WarehousingInventoryEntity> list= warehousingInventoryService.getList(warehousingInventoryPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingInventoryEntity entity : list) {
//获取商品种类数和商品总数
entity.setProductNum(warehousingInventoryService.selectProductNum(entity.getId()));
entity.setProductSum(warehousingInventoryService.selectProductSum(entity.getId()));
Map<String, Object> warehousingInventoryMap=JsonUtil.entityToMap(entity);
warehousingInventoryMap.put("id", warehousingInventoryMap.get("id"));
//副表数据
//子表数据
List<WarehousingInventoryProductEntity> warehousingInventoryProductList = warehousingInventoryService.getWarehousingInventoryProductList(entity.getId(),warehousingInventoryPagination);
warehousingInventoryMap.put("tableField112",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInventoryProductList)));
realList.add(warehousingInventoryMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingInventoryConstant.getFormData(), WarehousingInventoryConstant.getColumnData(), warehousingInventoryPagination.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(warehousingInventoryPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param warehousingInventoryForm
* @return
*/
@PostMapping("/{id}")
@Operation(summary = "创建")
public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid WarehousingInventoryForm warehousingInventoryForm) {
String b = warehousingInventoryService.checkForm(warehousingInventoryForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
warehousingInventoryService.saveOrUpdate(warehousingInventoryForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody WarehousingInventoryPagination warehousingInventoryPagination) throws IOException {
if (StringUtil.isEmpty(warehousingInventoryPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<WarehousingInventoryEntity> list= warehousingInventoryService.getList(warehousingInventoryPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingInventoryEntity entity : list) {
Map<String, Object> warehousingInventoryMap=JsonUtil.entityToMap(entity);
warehousingInventoryMap.put("id", warehousingInventoryMap.get("id"));
//副表数据
//子表数据
List<WarehousingInventoryProductEntity> warehousingInventoryProductList = warehousingInventoryService.getWarehousingInventoryProductList(entity.getId(),warehousingInventoryPagination);
warehousingInventoryMap.put("tableField112",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInventoryProductList)));
realList.add(warehousingInventoryMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingInventoryConstant.getFormData(), WarehousingInventoryConstant.getColumnData(), warehousingInventoryPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(warehousingInventoryPagination.getSelectKey())?warehousingInventoryPagination.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 tableField112ExcelEntity = new ExcelExportEntity("","tableField112");
List<ExcelExportEntity> tableField112List = new ArrayList<>();
for(String key:keys){
switch(key){
case "inventoryType" :
entitys.add(new ExcelExportEntity("业务类型" ,"inventoryType"));
break;
case "warehouseId" :
entitys.add(new ExcelExportEntity("仓库名称" ,"warehouseId"));
break;
case "inventoryTimeStart" :
entitys.add(new ExcelExportEntity("盘点开始时间" ,"inventoryTimeStart"));
break;
case "documentNo" :
entitys.add(new ExcelExportEntity("单据编号" ,"documentNo"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "creatorUserId" :
entitys.add(new ExcelExportEntity("创建用户" ,"creatorUserId"));
break;
case "creatorTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime"));
break;
case "lastModifyUserId" :
entitys.add(new ExcelExportEntity("修改用户" ,"lastModifyUserId"));
break;
case "lastModifyTime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime"));
break;
case "stocktakingMode" :
entitys.add(new ExcelExportEntity("盘点方式" ,"stocktakingMode"));
break;
case "missingDiskRule" :
entitys.add(new ExcelExportEntity("漏盘规则" ,"missingDiskRule"));
break;
case "duplicateInventoryRule" :
entitys.add(new ExcelExportEntity("重复盘点规则" ,"duplicateInventoryRule"));
break;
case "tableField112-productId":
tableField112List.add(new ExcelExportEntity("商品名称" ,"productId"));
break;
case "tableField112-firmOfferQuantity":
tableField112List.add(new ExcelExportEntity("实盘数量" ,"firmOfferQuantity"));
break;
default:
break;
}
}
if(tableField112List.size() > 0){
tableField112ExcelEntity.setList(tableField112List);
entitys.add(tableField112ExcelEntity);
}
}
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(WarehousingInventoryConstant.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 warehousingInventoryForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid WarehousingInventoryForm warehousingInventoryForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
warehousingInventoryForm.setId(id);
if (!isImport) {
String b = warehousingInventoryService.checkForm(warehousingInventoryForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
WarehousingInventoryEntity entity= warehousingInventoryService.getInfo(id);
if(entity!=null){
try{
warehousingInventoryService.saveOrUpdate(warehousingInventoryForm,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){
WarehousingInventoryEntity entity= warehousingInventoryService.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);
warehousingInventoryService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
WarehousingInventoryEntity entity= warehousingInventoryService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingInventoryMap=JsonUtil.entityToMap(entity);
warehousingInventoryMap.put("id", warehousingInventoryMap.get("id"));
//副表数据
//子表数据
List<WarehousingInventoryProductEntity> warehousingInventoryProductList = warehousingInventoryService.getWarehousingInventoryProductList(entity.getId());
warehousingInventoryMap.put("tableField112",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInventoryProductList)));
warehousingInventoryMap = generaterSwapUtil.swapDataDetail(warehousingInventoryMap,WarehousingInventoryConstant.getFormData(),"529993401664295493",false);
return ActionResult.success(warehousingInventoryMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
WarehousingInventoryEntity entity= warehousingInventoryService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingInventoryMap=JsonUtil.entityToMap(entity);
warehousingInventoryMap.put("id", warehousingInventoryMap.get("id"));
//副表数据
//子表数据
List<WarehousingInventoryProductEntity> warehousingInventoryProductList = warehousingInventoryService.getWarehousingInventoryProductList(entity.getId());
warehousingInventoryMap.put("warehousingInventoryProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInventoryProductList)));
warehousingInventoryMap = generaterSwapUtil.swapDataForm(warehousingInventoryMap,WarehousingInventoryConstant.getFormData(),WarehousingInventoryConstant.TABLEFIELDKEY,WarehousingInventoryConstant.TABLERENAMES);
return ActionResult.success(warehousingInventoryMap);
}
}

@ -0,0 +1,470 @@
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.warehousingoutbound.*;
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;
/**
* warehousingOutbound
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-21
*/
@Slf4j
@RestController
@Tag(name = "warehousingOutbound" , description = "scm")
@RequestMapping("/api/scm/WarehousingOutbound")
public class WarehousingOutboundController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingOutboundService warehousingOutboundService;
@Autowired
private WarehousingOutboundPoundlistService warehousingOutboundPoundlistService;
@Autowired
private WarehousingOutboundProductService warehousingOutboundProductService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param warehousingOutboundPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody WarehousingOutboundPagination warehousingOutboundPagination)throws IOException{
List<WarehousingOutboundEntity> list= warehousingOutboundService.getList(warehousingOutboundPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingOutboundEntity entity : list) {
entity.setOutNumber(warehousingOutboundService.queryOutboundNumber(entity.getId()));
entity.setSalesNo(warehousingOutboundService.querySalesNo(entity.getId()));
Map<String, Object> warehousingOutboundMap=JsonUtil.entityToMap(entity);
warehousingOutboundMap.put("id", warehousingOutboundMap.get("id"));
//副表数据
//子表数据
List<WarehousingOutboundPoundlistEntity> warehousingOutboundPoundlistList = warehousingOutboundService.getWarehousingOutboundPoundlistList(entity.getId(),warehousingOutboundPagination);
warehousingOutboundMap.put("tableField114",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingOutboundPoundlistList)));
List<WarehousingOutboundProductEntity> warehousingOutboundProductList = warehousingOutboundService.getWarehousingOutboundProductList(entity.getId(),warehousingOutboundPagination);
warehousingOutboundMap.put("tableField119",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingOutboundProductList)));
realList.add(warehousingOutboundMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingOutboundConstant.getFormData(), WarehousingOutboundConstant.getColumnData(), warehousingOutboundPagination.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(warehousingOutboundPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param warehousingOutboundForm
* @return
*/
@PostMapping("/{id}")
@Operation(summary = "创建")
public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid WarehousingOutboundForm warehousingOutboundForm) {
String b = warehousingOutboundService.checkForm(warehousingOutboundForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
warehousingOutboundService.saveOrUpdate(warehousingOutboundForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody WarehousingOutboundPagination warehousingOutboundPagination) throws IOException {
if (StringUtil.isEmpty(warehousingOutboundPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<WarehousingOutboundEntity> list= warehousingOutboundService.getList(warehousingOutboundPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingOutboundEntity entity : list) {
Map<String, Object> warehousingOutboundMap=JsonUtil.entityToMap(entity);
warehousingOutboundMap.put("id", warehousingOutboundMap.get("id"));
//副表数据
//子表数据
List<WarehousingOutboundPoundlistEntity> warehousingOutboundPoundlistList = warehousingOutboundService.getWarehousingOutboundPoundlistList(entity.getId(),warehousingOutboundPagination);
warehousingOutboundMap.put("tableField114",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingOutboundPoundlistList)));
List<WarehousingOutboundProductEntity> warehousingOutboundProductList = warehousingOutboundService.getWarehousingOutboundProductList(entity.getId(),warehousingOutboundPagination);
warehousingOutboundMap.put("tableField119",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingOutboundProductList)));
realList.add(warehousingOutboundMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingOutboundConstant.getFormData(), WarehousingOutboundConstant.getColumnData(), warehousingOutboundPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(warehousingOutboundPagination.getSelectKey())?warehousingOutboundPagination.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 tableField114ExcelEntity = new ExcelExportEntity("出库凭证","tableField114");
List<ExcelExportEntity> tableField114List = new ArrayList<>();
ExcelExportEntity tableField119ExcelEntity = new ExcelExportEntity("","tableField119");
List<ExcelExportEntity> tableField119List = new ArrayList<>();
for(String key:keys){
switch(key){
case "documentNo" :
entitys.add(new ExcelExportEntity("单据编号" ,"documentNo"));
break;
case "warehousingOutboundType" :
entitys.add(new ExcelExportEntity("单据类型" ,"warehousingOutboundType"));
break;
case "warehousingId" :
entitys.add(new ExcelExportEntity("关联单号" ,"warehousingId"));
break;
case "warehouseId" :
entitys.add(new ExcelExportEntity("出库仓库" ,"warehouseId"));
break;
case "warehousingTime" :
entitys.add(new ExcelExportEntity("出库时间" ,"warehousingTime"));
break;
case "outboundReason" :
entitys.add(new ExcelExportEntity("出库原因" ,"outboundReason"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "creatorTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime"));
break;
case "creatorUserId" :
entitys.add(new ExcelExportEntity("创建用户" ,"creatorUserId"));
break;
case "lastModifyTime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime"));
break;
case "lastModifyUserId" :
entitys.add(new ExcelExportEntity("修改用户" ,"lastModifyUserId"));
break;
case "tableField114-voucherId":
tableField114List.add(new ExcelExportEntity("关联凭证" ,"voucherId"));
break;
case "tableField119-productId":
tableField119List.add(new ExcelExportEntity("商品名称" ,"productId"));
break;
case "tableField119-outboundUnit":
tableField119List.add(new ExcelExportEntity("出库单位" ,"outboundUnit"));
break;
case "tableField119-outboundAreaId":
tableField119List.add(new ExcelExportEntity("出库货区id" ,"outboundAreaId"));
break;
case "tableField119-outboundNumber":
tableField119List.add(new ExcelExportEntity("出库数量" ,"outboundNumber"));
break;
case "tableField119-batchNumber":
tableField119List.add(new ExcelExportEntity("批次号" ,"batchNumber"));
break;
case "tableField119-dateManufacture":
tableField119List.add(new ExcelExportEntity("生产日期" ,"dateManufacture"));
break;
default:
break;
}
}
if(tableField114List.size() > 0){
tableField114ExcelEntity.setList(tableField114List);
entitys.add(tableField114ExcelEntity);
}
if(tableField119List.size() > 0){
tableField119ExcelEntity.setList(tableField119List);
entitys.add(tableField119ExcelEntity);
}
}
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(WarehousingOutboundConstant.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 warehousingOutboundForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid WarehousingOutboundForm warehousingOutboundForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
warehousingOutboundForm.setId(id);
if (!isImport) {
String b = warehousingOutboundService.checkForm(warehousingOutboundForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
WarehousingOutboundEntity entity= warehousingOutboundService.getInfo(id);
if(entity!=null){
try{
warehousingOutboundService.saveOrUpdate(warehousingOutboundForm,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){
WarehousingOutboundEntity entity= warehousingOutboundService.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);
warehousingOutboundService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
WarehousingOutboundEntity entity= warehousingOutboundService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingOutboundMap=JsonUtil.entityToMap(entity);
warehousingOutboundMap.put("id", warehousingOutboundMap.get("id"));
//副表数据
//子表数据
List<WarehousingOutboundPoundlistEntity> warehousingOutboundPoundlistList = warehousingOutboundService.getWarehousingOutboundPoundlistList(entity.getId());
warehousingOutboundMap.put("tableField114",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingOutboundPoundlistList)));
List<WarehousingOutboundProductEntity> warehousingOutboundProductList = warehousingOutboundService.getWarehousingOutboundProductList(entity.getId());
warehousingOutboundMap.put("tableField119",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingOutboundProductList)));
warehousingOutboundMap = generaterSwapUtil.swapDataDetail(warehousingOutboundMap,WarehousingOutboundConstant.getFormData(),"529923232405409989",false);
return ActionResult.success(warehousingOutboundMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
WarehousingOutboundEntity entity= warehousingOutboundService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingOutboundMap=JsonUtil.entityToMap(entity);
warehousingOutboundMap.put("id", warehousingOutboundMap.get("id"));
//副表数据
//子表数据
List<WarehousingOutboundPoundlistEntity> warehousingOutboundPoundlistList = warehousingOutboundService.getWarehousingOutboundPoundlistList(entity.getId());
warehousingOutboundMap.put("warehousingOutboundPoundlistList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingOutboundPoundlistList)));
List<WarehousingOutboundProductEntity> warehousingOutboundProductList = warehousingOutboundService.getWarehousingOutboundProductList(entity.getId());
warehousingOutboundMap.put("warehousingOutboundProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingOutboundProductList)));
warehousingOutboundMap = generaterSwapUtil.swapDataForm(warehousingOutboundMap,WarehousingOutboundConstant.getFormData(),WarehousingOutboundConstant.TABLEFIELDKEY,WarehousingOutboundConstant.TABLERENAMES);
return ActionResult.success(warehousingOutboundMap);
}
}

@ -92,6 +92,8 @@ public class WarehousingStorageController {
List<WarehousingStorageEntity> list= warehousingStorageService.getList(warehousingStoragePagination); List<WarehousingStorageEntity> list= warehousingStorageService.getList(warehousingStoragePagination);
List<Map<String, Object>> realList=new ArrayList<>(); List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingStorageEntity entity : list) { for (WarehousingStorageEntity entity : list) {
entity.setRealityNumber(warehousingStorageService.queryRealityNumber(entity.getId()));
entity.setPurchaseNo(warehousingStorageService.queryPurchaseNo(entity.getId()));
Map<String, Object> warehousingStorageMap=JsonUtil.entityToMap(entity); Map<String, Object> warehousingStorageMap=JsonUtil.entityToMap(entity);
warehousingStorageMap.put("id", warehousingStorageMap.get("id")); warehousingStorageMap.put("id", warehousingStorageMap.get("id"));
//副表数据 //副表数据

@ -0,0 +1,69 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-21
*/
@Data
@TableName("jg_warehousing_inventory")
public class WarehousingInventoryEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "DOCUMENT_NO" , updateStrategy = FieldStrategy.IGNORED)
private String documentNo;
@TableField(value = "INVENTORY_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String inventoryType;
@TableField("INVENTORY_STATUS")
private String inventoryStatus;
@TableField(value = "WAREHOUSE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String warehouseId;
@TableField(value = "INVENTORY_TIME_START" , updateStrategy = FieldStrategy.IGNORED)
private Date inventoryTimeStart;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark;
@TableField(value = "STOCKTAKING_MODE" , updateStrategy = FieldStrategy.IGNORED)
private String stocktakingMode;
@TableField(value = "MISSING_DISK_RULE" , updateStrategy = FieldStrategy.IGNORED)
private String missingDiskRule;
@TableField(value = "DUPLICATE_INVENTORY_RULE" , updateStrategy = FieldStrategy.IGNORED)
private String duplicateInventoryRule;
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("F_VERSION")
private Integer version;
@TableField("F_FLOW_TASK_ID")
private String flowTaskId;
@TableField("F_FLOW_ID")
private String flowId;
@TableField(exist = false)
private String productNum; //商品种类数
@TableField(exist = false)
private String productSum; //商品总数
}

@ -0,0 +1,75 @@
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-21
*/
@Data
@TableName("jg_warehousing_inventory_product")
public class WarehousingInventoryProductEntity {
@TableId(value ="ID" )
private String id;
@TableField("INVENTORY_ID")
private String inventoryId;
@TableField(value = "PRODUCT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String productId;
@TableField("BOOK_INVENTORY")
private BigDecimal bookInventory;
@TableField(value = "FIRM_OFFER_QUANTITY" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal firmOfferQuantity;
@TableField("PROFIT_AND_LOSS_QUANTITY")
private BigDecimal profitAndLossQuantity;
@TableField("BATCH_NUMBER")
private Long batchNumber;
@TableField("DATE_MANUFACTURE")
private Date dateManufacture;
@TableField("EXPIRATION_DATE")
private Date expirationDate;
@TableField("REMARK")
private String remark;
// @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(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
}

@ -60,19 +60,34 @@ public class WarehousingNotificationEntity {
private String remark2; private String remark2;
@TableField("REMARK3") @TableField("REMARK3")
private String remark3; private String remark3;
@TableField("F_CREATOR_TIME") // @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(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime; private Date creatorTime;
@TableField("F_CREATOR_USER_ID") @TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId; private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME") @TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime; private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID") @TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId; private String lastModifyUserId;
@TableField("F_DELETE_TIME") @TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime; private Date deleteTime;
@TableField("F_DELETE_USER_ID") @TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId; private String deleteUserId;
@TableField("F_DELETE_MARK") @TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark; private Integer deleteMark;
@TableField("F_TENANT_ID") @TableField("F_TENANT_ID")
private String tenantId; private String tenantId;

@ -0,0 +1,81 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-21
*/
@Data
@TableName("jg_warehousing_outbound")
public class WarehousingOutboundEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "DOCUMENT_NO" , updateStrategy = FieldStrategy.IGNORED)
private String documentNo;
@TableField(value = "WAREHOUSING_OUTBOUND_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String warehousingOutboundType;
@TableField("WAREHOUSING_OUTBOUND_STATUS")
private String warehousingOutboundStatus;
@TableField(value = "WAREHOUSING_ID" , updateStrategy = FieldStrategy.IGNORED)
private String warehousingId;
@TableField(value = "WAREHOUSE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String warehouseId;
@TableField(value = "WAREHOUSING_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date warehousingTime;
@TableField(value = "OUTBOUND_REASON" , updateStrategy = FieldStrategy.IGNORED)
private String outboundReason;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark;
// @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(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("F_FLOW_ID")
private String flowId;
@TableField("F_VERSION")
private Integer version;
@TableField(exist = false) //实际出库数量
private String outNumber;
@TableField(exist = false) //销售单号
private String salesNo;
}

@ -0,0 +1,60 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-21
*/
@Data
@TableName("jg_warehousing_outbound_poundlist")
public class WarehousingOutboundPoundlistEntity {
@TableId(value ="ID" )
private String id;
@TableField("WAREHOUSING_OUTBOUND_ID")
private String warehousingOutboundId;
@TableField(value = "VOUCHER_ID" , updateStrategy = FieldStrategy.IGNORED)
private String voucherId;
@TableField("REMARK")
private String remark;
// @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(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
}

@ -0,0 +1,79 @@
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;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-21
*/
@Data
@TableName("jg_warehousing_outbound_product")
public class WarehousingOutboundProductEntity {
@TableId(value ="ID" )
private String id;
@TableField("WAREHOUSING_OUTBOUND_ID")
private String warehousingOutboundId;
@TableField(value = "PRODUCT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String productId;
@TableField(value = "OUTBOUND_AREA_ID" , updateStrategy = FieldStrategy.IGNORED)
private String outboundAreaId;
@TableField(value = "OUTBOUND_UNIT" , updateStrategy = FieldStrategy.IGNORED)
private String outboundUnit;
@TableField("OUTBOUND_UNIT_SPEC")
private String outboundUnitSpec;
@TableField("EXPECTED_RECEIPT_QUANTITY")
private BigDecimal expectedReceiptQuantity;
@TableField("RECEIVED_QUANTITY")
private BigDecimal receivedQuantity;
@TableField("REMAINING_STOCKABLE_QUANTITY")
private BigDecimal remainingStockableQuantity;
@TableField(value = "OUTBOUND_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal outboundNumber;
@TableField(value = "BATCH_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String batchNumber;
@TableField(value = "DATE_MANUFACTURE" , updateStrategy = FieldStrategy.IGNORED)
private Date dateManufacture;
// @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(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
}

@ -30,20 +30,36 @@ public class WarehousingStorageEntity {
private Date warehousingTime; private Date warehousingTime;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark; private String remark;
@TableField("F_CREATOR_TIME") // @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(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime; private Date creatorTime;
@TableField("F_CREATOR_USER_ID") @TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId; private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME") @TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime; private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID") @TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId; private String lastModifyUserId;
@TableField("F_DELETE_TIME") @TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime; private Date deleteTime;
@TableField("F_DELETE_USER_ID") @TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId; private String deleteUserId;
@TableField("F_DELETE_MARK") @TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark; private Integer deleteMark;
@TableField("F_TENANT_ID") @TableField("F_TENANT_ID")
private String tenantId; private String tenantId;
@TableField("COMPANY_ID") @TableField("COMPANY_ID")
@ -54,4 +70,12 @@ public class WarehousingStorageEntity {
private String flowId; private String flowId;
@TableField("F_VERSION") @TableField("F_VERSION")
private Integer version; private Integer version;
@TableField(exist = false) //实际入库数量
private String realityNumber;
@TableField(exist = false) //采购单号
private String purchaseNo;
} }

@ -22,19 +22,33 @@ public class WarehousingStoragePoundlistEntity {
private String voucherId; private String voucherId;
@TableField("REMARK") @TableField("REMARK")
private String remark; private String remark;
@TableField("F_CREATOR_TIME") // @TableField("F_CREATOR_TIME")
private Date creatorTime; // private Date creatorTime;
@TableField("F_CREATOR_USER_ID") // @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(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId; private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME") @TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime; private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID") @TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId; private String lastModifyUserId;
@TableField("F_DELETE_TIME") @TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime; private Date deleteTime;
@TableField("F_DELETE_USER_ID") @TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId; private String deleteUserId;
@TableField("F_DELETE_MARK") @TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark; private Integer deleteMark;
@TableField("F_TENANT_ID") @TableField("F_TENANT_ID")
private String tenantId; private String tenantId;

@ -42,19 +42,33 @@ public class WarehousingStorageProductEntity {
private String batchNumber; private String batchNumber;
@TableField(value = "DATE_MANUFACTURE" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "DATE_MANUFACTURE" , updateStrategy = FieldStrategy.IGNORED)
private Date dateManufacture; private Date dateManufacture;
@TableField("F_CREATOR_TIME") // @TableField("F_CREATOR_TIME")
private Date creatorTime; // private Date creatorTime;
@TableField("F_CREATOR_USER_ID") // @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(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId; private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME") @TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime; private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID") @TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId; private String lastModifyUserId;
@TableField("F_DELETE_TIME") @TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime; private Date deleteTime;
@TableField("F_DELETE_USER_ID") @TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId; private String deleteUserId;
@TableField("F_DELETE_MARK") @TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark; private Integer deleteMark;
@TableField("F_TENANT_ID") @TableField("F_TENANT_ID")
private String tenantId; private String tenantId;

@ -0,0 +1,65 @@
package jnpf.model.warehousinginventory;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* warehousingInventory
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-21
*/
@Data
public class WarehousingInventoryForm {
/** 主键 */
private String id;
/** 子表数据 **/
@JsonProperty("warehousingInventoryProductList")
private List<WarehousingInventoryProductModel> warehousingInventoryProductList;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 流程id **/
@JsonProperty("flowId")
private String flowId;
/** 业务类型 **/
@JsonProperty("inventoryType")
private String inventoryType;
/** 仓库名称 **/
@JsonProperty("warehouseId")
private String warehouseId;
/** 盘点开始时间 **/
@JsonProperty("inventoryTimeStart")
private String inventoryTimeStart;
/** 单据编号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 创建用户 **/
@JsonProperty("creatorUserId")
private String creatorUserId;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 修改用户 **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 盘点方式 **/
@JsonProperty("stocktakingMode")
private String stocktakingMode;
/** 漏盘规则 **/
@JsonProperty("missingDiskRule")
private String missingDiskRule;
/** 重复盘点规则 **/
@JsonProperty("duplicateInventoryRule")
private String duplicateInventoryRule;
}

@ -0,0 +1,45 @@
package jnpf.model.warehousinginventory;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* warehousingInventory
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-21
*/
@Data
public class WarehousingInventoryPagination 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("inventoryType")
private Object inventoryType;
/** 盘点开始时间 */
@JsonProperty("inventoryTimeStart")
private Object inventoryTimeStart;
/** 单据编号 */
@JsonProperty("documentNo")
private Object documentNo;
/** 创建用户 */
@JsonProperty("creatorUserId")
private Object creatorUserId;
/** 创建时间 */
@JsonProperty("creatorTime")
private Object creatorTime;
}

@ -0,0 +1,27 @@
package jnpf.model.warehousinginventory;
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;
/**
*
* warehousingInventory
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
@Data
public class WarehousingInventoryProductModel {
/** 商品名称 **/
@JSONField(name = "productId")
private String productId;
/** 实盘数量 **/
@JSONField(name = "firmOfferQuantity")
private String firmOfferQuantity;
}

@ -0,0 +1,65 @@
package jnpf.model.warehousingoutbound;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* warehousingOutbound
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-21
*/
@Data
public class WarehousingOutboundForm {
/** 主键 */
private String id;
/** 子表数据 **/
@JsonProperty("warehousingOutboundPoundlistList")
private List<WarehousingOutboundPoundlistModel> warehousingOutboundPoundlistList;
/** 子表数据 **/
@JsonProperty("warehousingOutboundProductList")
private List<WarehousingOutboundProductModel> warehousingOutboundProductList;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 流程id **/
@JsonProperty("flowId")
private String flowId;
/** 单据编号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 单据类型 **/
@JsonProperty("warehousingOutboundType")
private Object warehousingOutboundType;
/** 关联单号 **/
@JsonProperty("warehousingId")
private String warehousingId;
/** 出库仓库 **/
@JsonProperty("warehouseId")
private String warehouseId;
/** 出库时间 **/
@JsonProperty("warehousingTime")
private String warehousingTime;
/** 出库原因 **/
@JsonProperty("outboundReason")
private String outboundReason;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 创建用户 **/
@JsonProperty("creatorUserId")
private String creatorUserId;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 修改用户 **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
}

@ -0,0 +1,48 @@
package jnpf.model.warehousingoutbound;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* warehousingOutbound
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-21
*/
@Data
public class WarehousingOutboundPagination 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("documentNo")
private Object documentNo;
/** 业务类型 */
@JsonProperty("warehousingStorageType")
private Object warehousingStorageType;
/** 入库时间 */
@JsonProperty("warehousingTime")
private Object warehousingTime;
/** -批次号 */
@JsonProperty("tableField119_batchNumber")
private Object tableField119_batchNumber;
/** 创建用户 */
@JsonProperty("creatorUserId")
private Object creatorUserId;
/** 创建时间 */
@JsonProperty("creatorTime")
private Object creatorTime;
}

@ -0,0 +1,24 @@
package jnpf.model.warehousingoutbound;
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;
/**
*
* warehousingOutbound
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
@Data
public class WarehousingOutboundPoundlistModel {
/** 关联凭证 **/
@JSONField(name = "voucherId")
private String voucherId;
}

@ -0,0 +1,40 @@
package jnpf.model.warehousingoutbound;
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;
/**
*
* warehousingOutbound
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-02-21
*/
@Data
public class WarehousingOutboundProductModel {
/** 商品名称 **/
@JSONField(name = "productId")
private String productId;
/** 出库单位 **/
@JSONField(name = "outboundUnit")
private String outboundUnit;
/** 出库货区id **/
@JSONField(name = "outboundAreaId")
private String outboundAreaId;
/** 出库数量 **/
@JSONField(name = "outboundNumber")
private String outboundNumber;
/** 批次号 **/
@JSONField(name = "batchNumber")
private String batchNumber;
/** 生产日期 **/
@JSONField(name = "dateManufacture")
private Long dateManufacture;
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,677 @@
<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('inventoryType')">
<jnpf-form-tip-item label="业务类型" v-if="judgeShow('inventoryType')" prop="inventoryType">
<JnpfRadio v-model="dataForm.inventoryType" @change="changeData('inventoryType',-1)"
:disabled="judgeWrite('inventoryType')" optionType="default" direction="horizontal"
size="small" :options="inventoryTypeOptions" :props="inventoryTypeProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" 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')" hasPage propsValue="id"
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name'
field='warehouseId' interfaceId="529617754022498181" :pageSize="20"
:columnOptions="warehouseIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" v-if="judgeShow('inventoryTimeStart')">
<jnpf-form-tip-item label="盘点开始时间" v-if="judgeShow('inventoryTimeStart')"
label-width="120px" prop="inventoryTimeStart">
<JnpfDatePicker v-model="dataForm.inventoryTimeStart"
@change="changeData('inventoryTimeStart',-1)" :startTime="dateTime(false,1,1,'','')"
:endTime="dateTime(false,1,1,'','')" placeholder="请选择"
:disabled="judgeWrite('inventoryTimeStart')" clearable :style='{"width":"100%"}'
type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('documentNo')">
<jnpf-form-tip-item label="单据编号" v-if="judgeShow('documentNo')" prop="documentNo">
<JnpfInput v-model="dataForm.documentNo" @change="changeData('documentNo',-1)"
placeholder="系统自动生成" :disabled="judgeWrite('documentNo')" readonly
:style='{"width":"100%"}'>
</JnpfInput>
</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">
<JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)"
placeholder="请输入" :disabled="judgeWrite('remark')" 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="24" v-if="judgeShow('stocktakingMode')">
<jnpf-form-tip-item label="盘点方式" v-if="judgeShow('stocktakingMode')"
prop="stocktakingMode">
<JnpfRadio v-model="dataForm.stocktakingMode"
@change="changeData('stocktakingMode',-1)" :disabled="judgeWrite('stocktakingMode')"
optionType="default" direction="horizontal" size="small"
:options="stocktakingModeOptions" :props="stocktakingModeProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('missingDiskRule')">
<jnpf-form-tip-item label="漏盘规则" v-if="judgeShow('missingDiskRule')"
prop="missingDiskRule">
<JnpfRadio v-model="dataForm.missingDiskRule"
@change="changeData('missingDiskRule',-1)" :disabled="judgeWrite('missingDiskRule')"
optionType="default" direction="horizontal" size="small"
:options="missingDiskRuleOptions" :props="missingDiskRuleProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('duplicateInventoryRule')">
<jnpf-form-tip-item label="重复盘点规则" v-if="judgeShow('duplicateInventoryRule')"
label-width="120px" prop="duplicateInventoryRule">
<JnpfRadio v-model="dataForm.duplicateInventoryRule"
@change="changeData('duplicateInventoryRule',-1)"
:disabled="judgeWrite('duplicateInventoryRule')" optionType="default"
direction="horizontal" size="small" :options="duplicateInventoryRuleOptions"
:props="duplicateInventoryRuleProps">
</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="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.warehousingInventoryProductList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="商品名称"
v-if="judgeShow('warehousinginventoryproduct-productId')" prop="productId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginventoryproductList-productId')">*</span>商品名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId" @change="productBatch"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.warehousinginventoryproductproductId"
placeholder="请选择"
:disabled="judgeWrite('warehousinginventoryproductList')||judgeWrite('warehousinginventoryproductList-productId')"
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='name' :field="'productId'+scope.$index"
interfaceId="529994958833209925" :pageSize="20"
:columnOptions="warehousinginventoryproductproductIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="规格" v-if="judgeShow('warehousinginventoryproduct-spec')"
prop="spec">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginventoryproductList-spec')">*</span>规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.spec"
@change="changeData('warehousinginventoryproduct-spec',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginventoryproductList')||judgeWrite('warehousinginventoryproductList-spec')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="库存单位"
v-if="judgeShow('warehousinginventoryproduct-inventoryUnitIds')"
prop="inventoryUnitIds">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginventoryproductList-inventoryUnitIds')">*</span>库存单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.inventoryUnitIds"
@change="changeData('warehousinginventoryproduct-inventoryUnitIds',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginventoryproductList')||judgeWrite('warehousinginventoryproductList-inventoryUnitIds')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="商品分类"
v-if="judgeShow('warehousinginventoryproduct-categoryName')" prop="categoryName">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginventoryproductList-categoryName')">*</span>商品分类
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.categoryName"
@change="changeData('warehousinginventoryproduct-categoryName',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginventoryproductList')||judgeWrite('warehousinginventoryproductList-categoryName')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="品牌"
v-if="judgeShow('warehousinginventoryproduct-brandName')" prop="brandName">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginventoryproductList-brandName')">*</span>品牌
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.brandName"
@change="changeData('warehousinginventoryproduct-brandName',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginventoryproductList')||judgeWrite('warehousinginventoryproductList-brandName')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="实盘数量"
v-if="judgeShow('warehousinginventoryproduct-firmOfferQuantity')"
prop="firmOfferQuantity">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginventoryproductList-firmOfferQuantity')">*</span>实盘数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.firmOfferQuantity"
@change="changeData('warehousinginventoryproduct-firmOfferQuantity',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginventoryproductList')||judgeWrite('warehousinginventoryproductList-firmOfferQuantity')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="批次号"
v-if="judgeShow('warehousinginventoryproduct-batchNumber')" prop="batchNumber">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginventoryproductList-batchNumber')">*</span>批次号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.batchNumber"
@change="changeData('warehousinginventoryproduct-batchNumber',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginventoryproductList')||judgeWrite('warehousinginventoryproductList-batchNumber')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="生产日期"
v-if="judgeShow('warehousinginventoryproduct-dateManufacture')"
prop="dateManufacture">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginventoryproductList-dateManufacture')">*</span>生产日期
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.dateManufacture"
@change="changeData('warehousinginventoryproduct-dateManufacture',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginventoryproductList')||judgeWrite('warehousinginventoryproductList-dateManufacture')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50"
v-if="!judgeWrite('warehousinginventoryproductList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delwarehousinginventoryproductList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addwarehousinginventoryproductList()"
v-if="!judgeWrite('warehousinginventoryproductList')">
<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: {
warehousingInventoryProductList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
warehousingInventoryProductList: {
productId: '',
spec: '',
code: '',
batchNumber: '',
brandName: '',
categoryName: '',
inventoryUnitIds: '',
dateManufacture: '',
productIdOptions: [],
firmOfferQuantity: '',
firmOfferQuantityOptions: [],
enabledmark: undefined
},
},
Vmodel: "",
currVmodel: "",
dataForm: {
inventoryType: undefined,
warehouseId: undefined,
inventoryTimeStart: undefined,
documentNo: undefined,
remark: undefined,
creatorUserId: undefined,
creatorTime: undefined,
lastModifyUserId: undefined,
lastModifyTime: undefined,
stocktakingMode: undefined,
missingDiskRule: undefined,
duplicateInventoryRule: undefined,
warehousingInventoryProductList: [],
version: 0,
},
tableRequiredData: {},
dataRule:
{
inventoryType: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
warehouseId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
inventoryTimeStart: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
stocktakingMode: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
missingDiskRule: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
duplicateInventoryRule: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
},
inventoryTypeOptions: [{ "fullName": "日常盘点单", "id": "1" }, { "fullName": "业务盘点单", "id": "2" }],
inventoryTypeProps: { "label": "fullName", "value": "id" },
warehouseIdcolumnOptions: [{ "label": "仓库名称", "value": "name" }, { "label": "仓库编码", "value": "code" },],
stocktakingModeOptions: [{ "fullName": "静态盘点", "id": "1" }, { "fullName": "动态盘点", "id": "2" }],
stocktakingModeProps: { "label": "fullName", "value": "id" },
missingDiskRuleOptions: [{ "fullName": "漏盘商品不做盈亏调整", "id": "1" }, { "fullName": "漏盘商品账面库存自动清零", "id": "2" }],
missingDiskRuleProps: { "label": "fullName", "value": "id" },
duplicateInventoryRuleOptions: [{ "fullName": "累加汇总", "id": "1" }, { "fullName": "覆盖更新", "id": "2" }],
duplicateInventoryRuleProps: { "label": "fullName", "value": "id" },
warehousinginventoryproductproductIdcolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "商品编码", "value": "code" }, { "label": "批次号", "value": "batch_number" },],
childIndex: -1,
isEdit: false,
interfaceRes: {
inventoryType: [],
warehouseId: [],
inventoryTimeStart: [],
documentNo: [],
remark: [],
creatorUserId: [],
creatorTime: [],
lastModifyUserId: [],
lastModifyTime: [],
stocktakingMode: [],
missingDiskRule: [],
duplicateInventoryRule: [],
warehousinginventoryproductproductId: [],
warehousinginventoryproductfirmOfferQuantity: [],
},
}
},
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: {
productBatch(model, row) {
this.dataForm.warehousingInventoryProductList.push(row)
this.dataForm.warehousingInventoryProductList.splice(0, 1)
},
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("529993401664295493").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.warehousinginventoryproductExist()) return
return isOk
},
warehousinginventoryproductExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.warehousingInventoryProductList.length; i++) {
const e = this.dataForm.warehousingInventoryProductList[i];
if (!e.productId) {
this.$message({
message: '商品名称不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
}
return isOk;
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
this.dataForm.inventoryTimeStart = new Date().getTime()
},
addwarehousinginventoryproductList() {
let item = {
productId: '',
firmOfferQuantity: undefined,
}
this.getwarehousinginventoryproductList(item)
},
delwarehousinginventoryproductList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.warehousingInventoryProductList.splice(index, 1);
}).catch(() => {
});
},
getwarehousinginventoryproductList(value) {
let item = { ...this.tableRows.warehousingInventoryProductList, ...value }
this.dataForm.warehousingInventoryProductList.push(item)
this.childIndex = this.dataForm.warehousingInventoryProductList.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.warehousingInventoryProductList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
},
},
}
</script>

@ -0,0 +1,639 @@
<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="业务类型">
<JnpfSelect v-model="query.inventoryType" placeholder="请选择" clearable
:options="inventoryTypeOptions"
:props="inventoryTypeProps" >
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="盘点开始时间">
<JnpfDateRangePicker v-model="query.inventoryTimeStart"
format="yyyy-MM-dd" startPlaceholder="开始日期"
endPlaceholder="结束日期" >
</JnpfDateRangePicker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单据编号">
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="创建用户">
<JnpfUserSelect v-model="query.creatorUserId" placeholder="请选择" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="创建时间">
<JnpfDateRangePicker v-model="query.creatorTime" format="yyyy-MM-dd"
startPlaceholder="开始日期" endPlaceholder="结束日期" />
</el-form-item>
</el-col>
</template>
<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-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">
展开
</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
收起
</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 label="业务类型" prop="inventoryType" algin="left"
>
<template slot-scope="scope">
{{ scope.row.inventoryType}}
</template>
</el-table-column>
<el-table-column
prop="warehouseId"
label="仓库名称" align="left"
>
</el-table-column>
<el-table-column
prop="inventoryTimeStart"
label="盘点开始时间" align="left"
>
</el-table-column>
<el-table-column
prop="documentNo"
label="单据编号" align="left"
>
</el-table-column>
<el-table-column
prop="creatorUserId"
label="创建用户" align="left"
>
</el-table-column>
<el-table-column
prop="creatorTime"
label="创建时间" align="left"
>
</el-table-column>
<el-table-column
prop="lastModifyUserId"
label="修改用户" align="left"
>
</el-table-column>
<el-table-column
prop="lastModifyTime"
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,
showAll: false,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
inventoryType:undefined,
inventoryTimeStart:undefined,
documentNo:undefined,
creatorUserId:undefined,
creatorTime: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,
inventoryTypeOptions:[{"fullName":"日常盘点单","id":"1"},{"fullName":"业务盘点单","id":"2"}],
inventoryTypeProps:{"label":"fullName","value":"id" },
stocktakingModeOptions:[{"fullName":"静态盘点","id":"1"},{"fullName":"动态盘点","id":"2"}],
stocktakingModeProps:{"label":"fullName","value":"id" },
missingDiskRuleOptions:[{"fullName":"漏盘商品不做盈亏调整","id":"1"},{"fullName":"漏盘商品账面库存自动清零","id":"2"}],
missingDiskRuleProps:{"label":"fullName","value":"id" },
duplicateInventoryRuleOptions:[{"fullName":"累加汇总","id":"1"},{"fullName":"覆盖更新","id":"2"}],
duplicateInventoryRuleProps:{"label":"fullName","value":"id" },
tableField112_productIdcolumnOptions:[ {"label":"商品名称","value":"name"}, {"label":"商品编码","value":"code"}, {"label":"批次号","value":"batch_number"},],
interfaceRes: {
warehouseId:[] ,
tableField112_productId: [] ,
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
getFormById("529993401664295493").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:'529993401664295493',
type:1,
};
request({
url: `/api/scm/WarehousingInventory/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/WarehousingInventory/${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/WarehousingInventory")
})
},
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/WarehousingInventory/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/WarehousingInventory/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>

@ -0,0 +1,630 @@
<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.documentNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务类型">
<JnpfSelect v-model="query.warehousingStorageType" placeholder="请选择" clearable
:options="warehousingStorageTypeOptions" :props="warehousingStorageTypeProps"
multiple>
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="入库时间">
<JnpfDateRangePicker v-model="query.warehousingTime" format="yyyy-MM-dd"
startPlaceholder="开始日期" endPlaceholder="结束日期">
</JnpfDateRangePicker>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="-批次号">
<el-input v-model="query.tableField119_batchNumber" placeholder="请输入" clearable>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="创建用户">
<JnpfUserSelect v-model="query.creatorUserId" placeholder="请选择" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="创建时间">
<JnpfDateRangePicker v-model="query.creatorTime" format="yyyy-MM-dd"
startPlaceholder="开始日期" endPlaceholder="结束日期" />
</el-form-item>
</el-col>
</template>
<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-button type="text" icon="el-icon-arrow-down" @click="showAll=true"
v-if="!showAll">
展开
</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
收起
</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="documentNo" label="单据编号" align="left">
</el-table-column>
<el-table-column label="业务类型" prop="warehousingStorageType" algin="left">
<template slot-scope="scope">
{{ scope.row.warehousingStorageType}}
</template>
</el-table-column>
<el-table-column prop="warehousingId" label="关联出库通知单号" align="left">
</el-table-column>
<el-table-column prop="warehouseId" label="出库仓库" align="left">
</el-table-column>
<el-table-column prop="salesNo" label="关联销售单号" align="left">
</el-table-column>
<el-table-column prop="receivedQuantity" label="实际出库数量" align="left">
</el-table-column>
<el-table-column prop="creatorTime" label="创建时间" align="left">
</el-table-column>
<el-table-column prop="creatorUserId" label="创建人" align="left">
</el-table-column>
<el-table-column prop="lastModifyTime" label="更新时间" align="left">
</el-table-column>
<el-table-column prop="lastModifyUserId" 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,
showAll: false,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
documentNo: undefined,
warehousingStorageType: undefined,
warehousingTime: undefined,
tableField119_batchNumber: undefined,
creatorUserId: undefined,
creatorTime: 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,
warehousingOutboundTypeOptions: [{ "fullName": "全部", "id": "1" }, { "fullName": "盘盈入库", "id": "2" }, { "fullName": "采购入库", "id": "3" }, { "fullName": "调拨入库", "id": "4" }, { "fullName": "退货入库", "id": "5" }, { "fullName": "其他入库", "id": "6" }, { "fullName": "差异调整入库", "id": "7" }, { "fullName": "领用返库", "id": "8" }, { "fullName": "货权转移入库", "id": "9" }, { "fullName": "其他出库", "id": "10" }, { "fullName": "库存初始化", "id": "11" }, { "fullName": "调拨出库撤回", "id": "12" }, { "fullName": "其他出库撤回", "id": "13" }],
warehousingOutboundTypeProps: { "label": "fullName", "value": "id" },
tableField114_voucherIdcolumnOptions: [{ "label": "凭证编号", "value": "voucher_code" }, { "label": "凭证类型", "value": "voucher_type" }, { "label": "车牌号", "value": "vehicle_number" }, { "label": "商品名称", "value": "product_name" },],
tableField119_productIdcolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "商品编码", "value": "code" }, { "label": "商品规格", "value": "spec" },],
tableField119_outboundUnitcolumnOptions: [{ "label": "单位名称", "value": "unit_name" }, { "label": "单位类型", "value": "unit_type" },],
tableField119_outboundAreaIdcolumnOptions: [{ "label": "货区名称", "value": "name" }, { "label": "货区编码", "value": "code" },],
tableField119_batchNumbercolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "批次号", "value": "batch_number" },],
interfaceRes: {
warehousingId: [],
warehouseId: [],
tableField114_voucherId: [],
tableField119_productId: [],
tableField119_outboundUnit: [],
tableField119_outboundAreaId: [{ "fieldName": "", "field": "warehouseId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "Y4nIRy1", "relationField": "warehouseId", "required": "0" }],
tableField119_batchNumber: [{ "fieldName": "", "field": "productId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "g0G0Wy1", "relationField": "warehousingoutboundproductList-productId", "required": "0" }],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
getFormById("529923232405409989").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: '529923232405409989',
type: 1,
};
request({
url: `/api/scm/WarehousingOutbound/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/WarehousingOutbound/${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/WarehousingOutbound")
})
},
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/WarehousingOutbound/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/WarehousingOutbound/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>

@ -0,0 +1,2 @@
const columnList = [{"jnpfKey":"billRule","fullName":"单据编号","label":"单据编号","sortable":false,"align":"left","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"billRule","defaultValue":null,"noShow":false,"tipLabel":"","dragDisabled":false,"rule":"rukudanbianhao","className":[],"label":"单据编号","trigger":"change","showLabel":true,"required":false,"tableName":"jg_warehousing_storage","renderKey":1708406291790,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-documents","ruleName":"入库单编号","tag":"JnpfInput","span":8},"readonly":true,"prop":"documentNo","width":0,"__vModel__":"documentNo","fixed":"none","style":{"width":"100%"},"id":"documentNo","placeholder":"系统自动生成"},{"filterable":false,"clearable":true,"jnpfKey":"select","multiple":false,"fullName":"业务类型","label":"业务类型","sortable":false,"align":"left","props":{"label":"fullName","value":"id"},"__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"select","defaultValue":"3","noShow":false,"dataType":"static","dictionaryType":"","tipLabel":"","dragDisabled":false,"className":[],"label":"业务类型","trigger":"change","propsUrl":"","templateJson":[],"showLabel":true,"required":true,"tableName":"jg_warehousing_storage","renderKey":1708406384094,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","propsName":"","tag":"JnpfSelect","regList":[],"span":8},"prop":"warehousingStorageType","width":0,"options":[{"fullName":"全部","id":"1"},{"fullName":"盘盈入库","id":"2"},{"fullName":"采购入库","id":"3"},{"fullName":"调拨入库","id":"4"},{"fullName":"退货入库","id":"5"},{"fullName":"其他入库","id":"6"},{"fullName":"差异调整入库","id":"7"},{"fullName":"领用返库","id":"8"},{"fullName":"货权转移入库","id":"9"},{"fullName":"其他出库","id":"10"},{"fullName":"库存初始化","id":"11"},{"fullName":"调拨出库撤回","id":"12"},{"fullName":"其他出库撤回","id":"13"}],"__vModel__":"warehousingStorageType","fixed":"none","style":{"width":"100%"},"disabled":false,"interfaceHasPage":false,"id":"warehousingStorageType","placeholder":"请选择","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"popupType":"dialog","hasPage":false,"pageSize":20,"columnOptions":[{"label":"通知编号","value":"warehousing_code"},{"label":"供应商id","value":"subject_basic_id"},{"label":"仓库id","value":"warehouse_id"}],"align":"left","templateJson":[],"__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"popupSelect","defaultValue":"","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"关联单号","trigger":"change","showLabel":true,"required":true,"tableName":"jg_warehousing_storage","renderKey":1708406648706,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-popup","tag":"JnpfPopupSelect","regList":[],"span":8},"prop":"warehousingId","__vModel__":"warehousingId","disabled":false,"id":"warehousingId","placeholder":"请选择","interfaceName":"入库单-查询入库通知","popupWidth":"800px","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"clearable":true,"jnpfKey":"popupSelect","fullName":"关联单号","label":"关联单号","sortable":false,"relationField":"warehousing_code","popupTitle":"选择数据","width":0,"fixed":"none","style":{"width":"100%"},"interfaceHasPage":false,"interfaceId":"529616482762510213","propsValue":"id"},{"popupType":"dialog","hasPage":false,"pageSize":20,"columnOptions":[{"label":"仓库编号","value":"code"},{"label":"仓库名称","value":"name"},{"label":"仓库简称","value":"simple_name"}],"align":"left","templateJson":[],"__config__":{"formId":105,"visibility":["pc","app"],"jnpfKey":"popupSelect","defaultValue":"","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"入库仓库","trigger":"change","showLabel":true,"required":true,"tableName":"jg_warehousing_storage","renderKey":1708406959225,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-popup","tag":"JnpfPopupSelect","regList":[],"span":8},"prop":"warehouseId","__vModel__":"warehouseId","disabled":false,"id":"warehouseId","placeholder":"请选择","interfaceName":"入库单-查询仓库","popupWidth":"800px","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"clearable":true,"jnpfKey":"popupSelect","fullName":"入库仓库","label":"入库仓库","sortable":false,"relationField":"name","popupTitle":"选择数据","width":0,"fixed":"none","style":{"width":"100%"},"interfaceHasPage":false,"interfaceId":"529617754022498181","propsValue":"id"}]
export default columnList

@ -97,10 +97,17 @@
{{ scope.row.warehousingStorageType}} {{ scope.row.warehousingStorageType}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="warehousingId" label="关联单号" align="left">
</el-table-column>
<el-table-column prop="warehouseId" label="入库仓库" align="left"> <el-table-column prop="warehouseId" label="入库仓库" align="left">
</el-table-column> </el-table-column>
<el-table-column prop="warehousingId" label="关联入库通知单号" align="left">
</el-table-column>
<el-table-column prop="purchaseNo" label="关联采购单号" align="left">
</el-table-column>
<el-table-column prop="realityNumber" label="实际入库数量" align="left">
</el-table-column>
<el-table-column prop="creatorTime" label="创建时间" align="left"> <el-table-column prop="creatorTime" label="创建时间" align="left">
</el-table-column> </el-table-column>
@ -206,6 +213,8 @@ export default {
detailVisible: false, detailVisible: false,
query: { query: {
documentNo: undefined, documentNo: undefined,
realityNumber: undefined,
purchaseNo: undefined,
warehousingStorageType: undefined, warehousingStorageType: undefined,
warehousingTime: undefined, warehousingTime: undefined,
tableField119_batchNumber: undefined, tableField119_batchNumber: undefined,

File diff suppressed because one or more lines are too long

@ -0,0 +1,976 @@
<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="getSaleOrder" :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" v-if="judgeShow('-${html.relationField}')">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.saleOrderInfo" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="销售订单" v-if="judgeShow('warehousingproduct-productName')"
prop="code">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingproductList-productName')">*</span>销售订单
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.code"
@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>
</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="f_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="529573170819104773" :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: [],
saleOrderInfo: [],
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: {
getSaleOrder(val, val2) {
debugger
this.dataForm.saleOrderInfo[0] = val2
this.dataForm.subjectBasicId = val2.first_subject_basic_id
this.dataForm.shippingAddress = val2.receiveAddress
this.dataForm.enterpriseId = val2.enterprise_id
this.dataForm.warehouseId = val2.delivery_warehouse
this.dataForm.deliveryAddress = val2.delivery_address
},
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>
Loading…
Cancel
Save