# Conflicts:
#	jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/WarehousingNotificationController.java
jg-waiwang-pro
vayne 8 months ago
commit 7270cb646f

@ -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>

@ -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.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>

@ -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.WarehousingStoragePoundlistMapper">
</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.WarehousingStorageProductMapper">
</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> {
}

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-19
* 2024-02-20
*/
public interface WarehousingNotificationMapper extends BaseMapper<WarehousingNotificationEntity> {

@ -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> {
}

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-19
* 2024-02-20
*/
public interface WarehousingProductMapper extends BaseMapper<WarehousingProductEntity> {

@ -0,0 +1,21 @@
package jnpf.mapper;
import jnpf.entity.WarehousingStorageEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* warehousingStorage
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-20
*/
public interface WarehousingStorageMapper extends BaseMapper<WarehousingStorageEntity> {
//查询实际入库数量
String queryrealityNumber(String id);
//关联采购单号
String queryPurchaseNo(String id);
}

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

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

@ -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);
}

@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-19
* 2024-02-20
*/
public interface WarehousingProductService extends IService<WarehousingProductEntity> {
QueryWrapper<WarehousingProductEntity> getChild(WarehousingNotificationPagination pagination,QueryWrapper<WarehousingProductEntity> warehousingProductQueryWrapper);

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.warehousingstorage.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingStorage
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-20
*/
public interface WarehousingStoragePoundlistService extends IService<WarehousingStoragePoundlistEntity> {
QueryWrapper<WarehousingStoragePoundlistEntity> getChild(WarehousingStoragePagination pagination,QueryWrapper<WarehousingStoragePoundlistEntity> warehousingStoragePoundlistQueryWrapper);
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.warehousingstorage.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingStorage
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-20
*/
public interface WarehousingStorageProductService extends IService<WarehousingStorageProductEntity> {
QueryWrapper<WarehousingStorageProductEntity> getChild(WarehousingStoragePagination pagination,QueryWrapper<WarehousingStorageProductEntity> warehousingStorageProductQueryWrapper);
}

@ -0,0 +1,48 @@
package jnpf.service;
import jnpf.model.warehousingstorage.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingStorage
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-20
*/
public interface WarehousingStorageService extends IService<WarehousingStorageEntity> {
List<WarehousingStorageEntity> getList(WarehousingStoragePagination warehousingStoragePagination);
List<WarehousingStorageEntity> getTypeList(WarehousingStoragePagination warehousingStoragePagination,String dataType);
WarehousingStorageEntity getInfo(String id);
void delete(WarehousingStorageEntity entity);
void create(WarehousingStorageEntity entity);
boolean update(String id, WarehousingStorageEntity entity);
//子表方法
List<WarehousingStoragePoundlistEntity> getWarehousingStoragePoundlistList(String id,WarehousingStoragePagination warehousingStoragePagination);
List<WarehousingStoragePoundlistEntity> getWarehousingStoragePoundlistList(String id);
List<WarehousingStorageProductEntity> getWarehousingStorageProductList(String id,WarehousingStoragePagination warehousingStoragePagination);
List<WarehousingStorageProductEntity> getWarehousingStorageProductList(String id);
//副表数据方法
String checkForm(WarehousingStorageForm form,int i);
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);
}
}

@ -229,7 +229,7 @@ public class WarehousingNotificationServiceImpl extends ServiceImpl<WarehousingN
warehousingNotificationQueryWrapper.lambda().and(t->t.in(WarehousingNotificationEntity::getId, finalAllRuleIDlist));
}
//假删除标志
warehousingNotificationQueryWrapper.lambda().isNull(WarehousingNotificationEntity::getDeleteMark);
warehousingNotificationQueryWrapper.lambda().isNull(WarehousingNotificationEntity::getDeletemark);
//排序
if(StringUtil.isEmpty(warehousingNotificationPagination.getSidx())){

@ -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);
}
}

@ -33,7 +33,7 @@ import jnpf.permission.entity.UserEntity;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-19
* 2024-02-20
*/
@Service
public class WarehousingProductServiceImpl extends ServiceImpl<WarehousingProductMapper, WarehousingProductEntity> implements WarehousingProductService{

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

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

@ -0,0 +1,549 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingStorageMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousingstorage.*;
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;
/**
*
* warehousingStorage
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-20
*/
@Service
public class WarehousingStorageServiceImpl extends ServiceImpl<WarehousingStorageMapper, WarehousingStorageEntity> implements WarehousingStorageService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingStoragePoundlistService warehousingStoragePoundlistService;
@Autowired
private WarehousingStorageProductService warehousingStorageProductService;
@Autowired
private WarehousingStorageMapper warehousingStorageMapper;
@Override
public List<WarehousingStorageEntity> getList(WarehousingStoragePagination warehousingStoragePagination){
return getTypeList(warehousingStoragePagination,warehousingStoragePagination.getDataType());
}
/** 列表查询 */
@Override
public List<WarehousingStorageEntity> getTypeList(WarehousingStoragePagination warehousingStoragePagination,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 ? WarehousingStorageConstant.getAppColumnData() : WarehousingStorageConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int warehousingStorageNum =0;
QueryWrapper<WarehousingStorageEntity> warehousingStorageQueryWrapper=new QueryWrapper<>();
int warehousingStoragePoundlistNum =0;
QueryWrapper<WarehousingStoragePoundlistEntity> warehousingStoragePoundlistQueryWrapper=new QueryWrapper<>();
int warehousingStorageProductNum =0;
QueryWrapper<WarehousingStorageProductEntity> warehousingStorageProductQueryWrapper=new QueryWrapper<>();
long warehousingStoragePoundlistcount = warehousingStoragePoundlistService.count();
long warehousingStorageProductcount = warehousingStorageProductService.count();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(warehousingStoragePagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = warehousingStoragePagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<WarehousingStorageEntity> warehousingStorageSuperWrapper = new QueryWrapper<>();
warehousingStorageSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingStorageSuperWrapper,WarehousingStorageEntity.class,queryJson,"0"));
int warehousingStorageNum1 = warehousingStorageSuperWrapper.getExpression().getNormal().size();
if (warehousingStorageNum1>0){
List<String> warehousingStorageList =this.list(warehousingStorageSuperWrapper).stream().map(WarehousingStorageEntity::getId).collect(Collectors.toList());
allSuperList.addAll(warehousingStorageList);
intersectionSuperList.add(warehousingStorageList);
superNum++;
}
String warehousingStoragePoundlistTable = "jg_warehousing_storage_poundlist";
boolean warehousingStoragePoundlistHasSql = queryJson.contains(warehousingStoragePoundlistTable);
List<String> warehousingStoragePoundlistList = generaterSwapUtil.selectIdsByChildCondition(WarehousingStorageConstant.getTableList(), warehousingStoragePoundlistTable , queryJson, null);
if (warehousingStoragePoundlistHasSql){
allSuperList.addAll(warehousingStoragePoundlistList);
intersectionSuperList.add(warehousingStoragePoundlistList);
superNum++;
}
String warehousingStorageProductTable = "jg_warehousing_storage_product";
boolean warehousingStorageProductHasSql = queryJson.contains(warehousingStorageProductTable);
List<String> warehousingStorageProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingStorageConstant.getTableList(), warehousingStorageProductTable , queryJson, null);
if (warehousingStorageProductHasSql){
allSuperList.addAll(warehousingStorageProductList);
intersectionSuperList.add(warehousingStorageProductList);
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<WarehousingStorageEntity> warehousingStorageSuperWrapper = new QueryWrapper<>();
warehousingStorageSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingStorageSuperWrapper,WarehousingStorageEntity.class,ruleJson,"0"));
int warehousingStorageNum1 = warehousingStorageSuperWrapper.getExpression().getNormal().size();
if (warehousingStorageNum1>0){
List<String> warehousingStorageList =this.list(warehousingStorageSuperWrapper).stream().map(WarehousingStorageEntity::getId).collect(Collectors.toList());
allRuleList.addAll(warehousingStorageList);
intersectionRuleList.add(warehousingStorageList);
ruleNum++;
}
String warehousingStoragePoundlistTable = "jg_warehousing_storage_poundlist";
boolean warehousingStoragePoundlistHasSql = ruleJson.contains(warehousingStoragePoundlistTable);
List<String> warehousingStoragePoundlistList = generaterSwapUtil.selectIdsByChildCondition(WarehousingStorageConstant.getTableList(), warehousingStoragePoundlistTable , ruleJson, null);
if (warehousingStoragePoundlistHasSql){
allRuleList.addAll(warehousingStoragePoundlistList);
intersectionRuleList.add(warehousingStoragePoundlistList);
ruleNum++;
}
String warehousingStorageProductTable = "jg_warehousing_storage_product";
boolean warehousingStorageProductHasSql = ruleJson.contains(warehousingStorageProductTable);
List<String> warehousingStorageProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingStorageConstant.getTableList(), warehousingStorageProductTable , ruleJson, null);
if (warehousingStorageProductHasSql){
allRuleList.addAll(warehousingStorageProductList);
intersectionRuleList.add(warehousingStorageProductList);
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 warehousingStorageObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingStorageQueryWrapper,WarehousingStorageEntity.class,warehousingStoragePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingStorageObj)){
return new ArrayList<>();
} else {
warehousingStorageQueryWrapper = (QueryWrapper<WarehousingStorageEntity>)warehousingStorageObj;
if( warehousingStorageQueryWrapper.getExpression().getNormal().size()>0){
warehousingStorageNum++;
}
}
Object warehousingStoragePoundlistObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingStoragePoundlistQueryWrapper,WarehousingStoragePoundlistEntity.class,warehousingStoragePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingStoragePoundlistObj)){
return new ArrayList<>();
} else {
warehousingStoragePoundlistQueryWrapper = (QueryWrapper<WarehousingStoragePoundlistEntity>)warehousingStoragePoundlistObj;
if( warehousingStoragePoundlistQueryWrapper.getExpression().getNormal().size()>0){
warehousingStoragePoundlistNum++;
}
}
Object warehousingStorageProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingStorageProductQueryWrapper,WarehousingStorageProductEntity.class,warehousingStoragePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingStorageProductObj)){
return new ArrayList<>();
} else {
warehousingStorageProductQueryWrapper = (QueryWrapper<WarehousingStorageProductEntity>)warehousingStorageProductObj;
if( warehousingStorageProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingStorageProductNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehousingStorageObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingStorageQueryWrapper,WarehousingStorageEntity.class,warehousingStoragePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingStorageObj)){
return new ArrayList<>();
} else {
warehousingStorageQueryWrapper = (QueryWrapper<WarehousingStorageEntity>)warehousingStorageObj;
if( warehousingStorageQueryWrapper.getExpression().getNormal().size()>0){
warehousingStorageNum++;
}
}
Object warehousingStoragePoundlistObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingStoragePoundlistQueryWrapper,WarehousingStoragePoundlistEntity.class,warehousingStoragePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingStoragePoundlistObj)){
return new ArrayList<>();
} else {
warehousingStoragePoundlistQueryWrapper = (QueryWrapper<WarehousingStoragePoundlistEntity>)warehousingStoragePoundlistObj;
if( warehousingStoragePoundlistQueryWrapper.getExpression().getNormal().size()>0){
warehousingStoragePoundlistNum++;
}
}
Object warehousingStorageProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingStorageProductQueryWrapper,WarehousingStorageProductEntity.class,warehousingStoragePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingStorageProductObj)){
return new ArrayList<>();
} else {
warehousingStorageProductQueryWrapper = (QueryWrapper<WarehousingStorageProductEntity>)warehousingStorageProductObj;
if( warehousingStorageProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingStorageProductNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(warehousingStoragePagination.getTableField119_batchNumber())){
warehousingStorageProductNum++;
String value = warehousingStoragePagination.getTableField119_batchNumber() instanceof List ?
JsonUtil.getObjectToString(warehousingStoragePagination.getTableField119_batchNumber()) :
String.valueOf(warehousingStoragePagination.getTableField119_batchNumber());
warehousingStorageProductQueryWrapper.lambda().like(WarehousingStorageProductEntity::getBatchNumber,value);
}
if(ObjectUtil.isNotEmpty(warehousingStoragePagination.getDocumentNo())){
warehousingStorageNum++;
String value = warehousingStoragePagination.getDocumentNo() instanceof List ?
JsonUtil.getObjectToString(warehousingStoragePagination.getDocumentNo()) :
String.valueOf(warehousingStoragePagination.getDocumentNo());
warehousingStorageQueryWrapper.lambda().like(WarehousingStorageEntity::getDocumentNo,value);
}
if(ObjectUtil.isNotEmpty(warehousingStoragePagination.getWarehousingStorageType())){
warehousingStorageNum++;
List<String> idList = new ArrayList<>();
try {
String[][] warehousingStorageType = JsonUtil.getJsonToBean(warehousingStoragePagination.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(warehousingStoragePagination.getWarehousingStorageType(),String.class);
if(warehousingStorageType.size()>0){
idList.addAll(warehousingStorageType);
}
}catch (Exception e2){
idList.add(String.valueOf(warehousingStoragePagination.getWarehousingStorageType()));
}
}
warehousingStorageQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(WarehousingStorageEntity::getWarehousingStorageType, tt).or();
});
});
}
if(ObjectUtil.isNotEmpty(warehousingStoragePagination.getWarehousingTime())){
warehousingStorageNum++;
List WarehousingTimeList = JsonUtil.getJsonToList(warehousingStoragePagination.getWarehousingTime(),String.class);
Long fir = Long.valueOf(String.valueOf(WarehousingTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(WarehousingTimeList.get(1)));
warehousingStorageQueryWrapper.lambda().ge(WarehousingStorageEntity::getWarehousingTime, new Date(fir))
.le(WarehousingStorageEntity::getWarehousingTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if(ObjectUtil.isNotEmpty(warehousingStoragePagination.getCreatorUserId())){
warehousingStorageNum++;
warehousingStorageQueryWrapper.lambda().eq(WarehousingStorageEntity::getCreatorUserId,warehousingStoragePagination.getCreatorUserId());
}
if(ObjectUtil.isNotEmpty(warehousingStoragePagination.getCreatorTime())){
warehousingStorageNum++;
List CreatorTimeList = JsonUtil.getJsonToList(warehousingStoragePagination.getCreatorTime(),String.class);
Long fir = Long.valueOf(String.valueOf(CreatorTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(CreatorTimeList.get(1)));
warehousingStorageQueryWrapper.lambda().ge(WarehousingStorageEntity::getCreatorTime, new Date(fir))
.le(WarehousingStorageEntity::getCreatorTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
}
if(warehousingStoragePoundlistNum>0){
List<String> warehousingStoragePoundlistIdList = warehousingStoragePoundlistService.list(warehousingStoragePoundlistQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getWarehousingStorageId())).map(t->t.getWarehousingStorageId()).collect(Collectors.toList());
long count = warehousingStoragePoundlistService.count();
if (count>0){
intersectionList.add(warehousingStoragePoundlistIdList);
}
AllIdList.addAll(warehousingStoragePoundlistIdList);
}
total+=warehousingStoragePoundlistNum;
if(warehousingStorageProductNum>0){
List<String> warehousingStorageProductIdList = warehousingStorageProductService.list(warehousingStorageProductQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getWarehousingStorageId())).map(t->t.getWarehousingStorageId()).collect(Collectors.toList());
long count = warehousingStorageProductService.count();
if (count>0){
intersectionList.add(warehousingStorageProductIdList);
}
AllIdList.addAll(warehousingStorageProductIdList);
}
total+=warehousingStorageProductNum;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
warehousingStorageQueryWrapper.lambda().in(WarehousingStorageEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
warehousingStorageQueryWrapper.lambda().and(t->t.in(WarehousingStorageEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
warehousingStorageQueryWrapper.lambda().and(t->t.in(WarehousingStorageEntity::getId, finalAllRuleIDlist));
}
//假删除标志
warehousingStorageQueryWrapper.lambda().isNull(WarehousingStorageEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(warehousingStoragePagination.getSidx())){
warehousingStorageQueryWrapper.lambda().orderByDesc(WarehousingStorageEntity::getId);
}else{
try {
String sidx = warehousingStoragePagination.getSidx();
String[] strs= sidx.split("_name");
WarehousingStorageEntity warehousingStorageEntity = new WarehousingStorageEntity();
Field declaredField = warehousingStorageEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
warehousingStorageQueryWrapper="asc".equals(warehousingStoragePagination.getSort().toLowerCase())?warehousingStorageQueryWrapper.orderByAsc(value):warehousingStorageQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<WarehousingStorageEntity> page=new Page<>(warehousingStoragePagination.getCurrentPage(), warehousingStoragePagination.getPageSize());
IPage<WarehousingStorageEntity> userIPage=this.page(page, warehousingStorageQueryWrapper);
return warehousingStoragePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WarehousingStorageEntity> list = new ArrayList();
return warehousingStoragePagination.setData(list, list.size());
}
}else{
return this.list(warehousingStorageQueryWrapper);
}
}
@Override
public WarehousingStorageEntity getInfo(String id){
QueryWrapper<WarehousingStorageEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingStorageEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(WarehousingStorageEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, WarehousingStorageEntity entity){
return this.updateById(entity);
}
@Override
public void delete(WarehousingStorageEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** WarehousingStoragePoundlist子表方法 */
@Override
public List<WarehousingStoragePoundlistEntity> getWarehousingStoragePoundlistList(String id,WarehousingStoragePagination warehousingStoragePagination){
Map<String, Object> newtabMap=WarehousingStorageConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="warehousingStoragePoundlist";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<WarehousingStoragePoundlistEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = warehousingStoragePoundlistService.getChild(warehousingStoragePagination,queryWrapper);
queryWrapper.lambda().eq(WarehousingStoragePoundlistEntity::getWarehousingStorageId, id);
generaterSwapUtil.wrapperHandle(WarehousingStorageConstant.getColumnData(), WarehousingStorageConstant.getAppColumnData(), queryWrapper,WarehousingStoragePoundlistEntity.class,"sub",tableName);
return warehousingStoragePoundlistService.list(queryWrapper);
}
/** WarehousingStoragePoundlist子表方法 */
@Override
public List<WarehousingStoragePoundlistEntity> getWarehousingStoragePoundlistList(String id){
QueryWrapper<WarehousingStoragePoundlistEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingStoragePoundlistEntity::getWarehousingStorageId, id);
return warehousingStoragePoundlistService.list(queryWrapper);
}
/** WarehousingStorageProduct子表方法 */
@Override
public List<WarehousingStorageProductEntity> getWarehousingStorageProductList(String id,WarehousingStoragePagination warehousingStoragePagination){
Map<String, Object> newtabMap=WarehousingStorageConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="warehousingStorageProduct";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<WarehousingStorageProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = warehousingStorageProductService.getChild(warehousingStoragePagination,queryWrapper);
queryWrapper.lambda().eq(WarehousingStorageProductEntity::getWarehousingStorageId, id);
generaterSwapUtil.wrapperHandle(WarehousingStorageConstant.getColumnData(), WarehousingStorageConstant.getAppColumnData(), queryWrapper,WarehousingStorageProductEntity.class,"sub",tableName);
return warehousingStorageProductService.list(queryWrapper);
}
/** WarehousingStorageProduct子表方法 */
@Override
public List<WarehousingStorageProductEntity> getWarehousingStorageProductList(String id){
QueryWrapper<WarehousingStorageProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingStorageProductEntity::getWarehousingStorageId, id);
return warehousingStorageProductService.list(queryWrapper);
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(WarehousingStorageForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
//子表字段验证
if (form.getWarehousingStoragePoundlistList()!=null){
}
if (form.getWarehousingStorageProductList()!=null){
}
return countRecover;
}
/**
* ()
* @param id
* @param warehousingStorageForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(WarehousingStorageForm warehousingStorageForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
warehousingStorageForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WarehousingStorageConstant.getFormData(),warehousingStorageForm),WarehousingStorageForm.class);
WarehousingStorageEntity entity = JsonUtil.getJsonToBean(warehousingStorageForm, WarehousingStorageEntity.class);
if(isSave){
String mainId = id ;
entity.setDocumentNo(generaterSwapUtil.getBillNumber("rukudanbianhao", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setId(mainId);
entity.setFlowId(warehousingStorageForm.getFlowId());
entity.setVersion(0);
}else{
entity.setDocumentNo(generaterSwapUtil.getBillNumber("rukudanbianhao", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setFlowId(warehousingStorageForm.getFlowId());
}
this.saveOrUpdate(entity);
//WarehousingStoragePoundlist子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingStoragePoundlistEntity> WarehousingStoragePoundlistqueryWrapper = new QueryWrapper<>();
WarehousingStoragePoundlistqueryWrapper.lambda().eq(WarehousingStoragePoundlistEntity::getWarehousingStorageId, entity.getId());
warehousingStoragePoundlistService.remove(WarehousingStoragePoundlistqueryWrapper);
}
if (warehousingStorageForm.getWarehousingStoragePoundlistList()!=null){
List<WarehousingStoragePoundlistEntity> tableField114 = JsonUtil.getJsonToList(warehousingStorageForm.getWarehousingStoragePoundlistList(),WarehousingStoragePoundlistEntity.class);
for(WarehousingStoragePoundlistEntity entitys : tableField114){
entitys.setId(RandomUtil.uuId());
entitys.setWarehousingStorageId(entity.getId());
if(isSave){
}else{
}
warehousingStoragePoundlistService.saveOrUpdate(entitys);
}
}
//WarehousingStorageProduct子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingStorageProductEntity> WarehousingStorageProductqueryWrapper = new QueryWrapper<>();
WarehousingStorageProductqueryWrapper.lambda().eq(WarehousingStorageProductEntity::getWarehousingStorageId, entity.getId());
warehousingStorageProductService.remove(WarehousingStorageProductqueryWrapper);
}
if (warehousingStorageForm.getWarehousingStorageProductList()!=null){
List<WarehousingStorageProductEntity> tableField119 = JsonUtil.getJsonToList(warehousingStorageForm.getWarehousingStorageProductList(),WarehousingStorageProductEntity.class);
for(WarehousingStorageProductEntity entitys : tableField119){
entitys.setId(RandomUtil.uuId());
entitys.setWarehousingStorageId(entity.getId());
if(isSave){
entitys.setBatchNumber(generaterSwapUtil.getBillNumber("picihao", false));
}else{
entitys.setBatchNumber(generaterSwapUtil.getBillNumber("picihao", false));
}
warehousingStorageProductService.saveOrUpdate(entitys);
}
}
}
@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);
}
}

@ -27,26 +27,6 @@ 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;
/**
@ -54,7 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-19
* @ 2024-02-20
*/
@Slf4j
@RestController
@ -71,12 +51,7 @@ public class WarehousingNotificationController {
@Autowired
private WarehousingNotificationService warehousingNotificationService;
@Autowired
private WarehousingProductService warehousingProductService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
@ -94,8 +69,6 @@ public class WarehousingNotificationController {
warehousingNotificationMap.put("id", warehousingNotificationMap.get("id"));
//副表数据
//子表数据
List<WarehousingProductEntity> warehousingProductList = warehousingNotificationService.getWarehousingProductList(entity.getId(),warehousingNotificationPagination);
warehousingNotificationMap.put("tableField121",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingProductList)));
realList.add(warehousingNotificationMap);
}
//数据转换
@ -149,223 +122,6 @@ public class WarehousingNotificationController {
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody WarehousingNotificationPagination warehousingNotificationPagination) throws IOException {
if (StringUtil.isEmpty(warehousingNotificationPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<WarehousingNotificationEntity> list= warehousingNotificationService.getList(warehousingNotificationPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingNotificationEntity entity : list) {
Map<String, Object> warehousingNotificationMap=JsonUtil.entityToMap(entity);
warehousingNotificationMap.put("id", warehousingNotificationMap.get("id"));
//副表数据
//子表数据
List<WarehousingProductEntity> warehousingProductList = warehousingNotificationService.getWarehousingProductList(entity.getId(),warehousingNotificationPagination);
warehousingNotificationMap.put("tableField121",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingProductList)));
realList.add(warehousingNotificationMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingNotificationConstant.getFormData(), WarehousingNotificationConstant.getColumnData(), warehousingNotificationPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(warehousingNotificationPagination.getSelectKey())?warehousingNotificationPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
return ActionResult.success(vo);
}
/**
*
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
ExcelExportEntity tableField121ExcelEntity = new ExcelExportEntity("","tableField121");
List<ExcelExportEntity> tableField121List = new ArrayList<>();
for(String key:keys){
switch(key){
case "warehousingType" :
entitys.add(new ExcelExportEntity("" ,"warehousingType"));
break;
case "warehousingCode" :
entitys.add(new ExcelExportEntity("通知编号" ,"warehousingCode"));
break;
case "preparationTime" :
entitys.add(new ExcelExportEntity("制单时间" ,"preparationTime"));
break;
case "businessId" :
entitys.add(new ExcelExportEntity("销售订单" ,"businessId"));
break;
case "subjectBasicId" :
entitys.add(new ExcelExportEntity("客户名称" ,"subjectBasicId"));
break;
case "shippingAddress" :
entitys.add(new ExcelExportEntity("收货地址" ,"shippingAddress"));
break;
case "enterpriseId" :
entitys.add(new ExcelExportEntity("机构名称" ,"enterpriseId"));
break;
case "warehouseId" :
entitys.add(new ExcelExportEntity("发货仓库" ,"warehouseId"));
break;
case "deliveryAddress" :
entitys.add(new ExcelExportEntity("发货地址" ,"deliveryAddress"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "tableField121-productName":
tableField121List.add(new ExcelExportEntity("商品名称" ,"productName"));
break;
case "tableField121-spec":
tableField121List.add(new ExcelExportEntity("规格" ,"spec"));
break;
case "tableField121-inventoryUnitId":
tableField121List.add(new ExcelExportEntity("库存单位" ,"inventoryUnitId"));
break;
case "tableField121-purchaseUnitId":
tableField121List.add(new ExcelExportEntity("销售单位" ,"purchaseUnitId"));
break;
case "tableField121-purchaseNum":
tableField121List.add(new ExcelExportEntity("销售数量" ,"purchaseNum"));
break;
case "tableField121-storageAreaId":
tableField121List.add(new ExcelExportEntity("出库货区" ,"storageAreaId"));
break;
case "tableField121-warehousingUnitId":
tableField121List.add(new ExcelExportEntity("出库单位" ,"warehousingUnitId"));
break;
case "tableField121-barCode":
tableField121List.add(new ExcelExportEntity("包装条码" ,"barCode"));
break;
case "tableField121-notificationStorageNumber":
tableField121List.add(new ExcelExportEntity("通知出库数量" ,"notificationStorageNumber"));
break;
case "tableField121-volume":
tableField121List.add(new ExcelExportEntity("体积" ,"volume"));
break;
case "tableField121-batchNo":
tableField121List.add(new ExcelExportEntity("批次号" ,"batchNo"));
break;
case "tableField121-produceDate":
tableField121List.add(new ExcelExportEntity("生产日期" ,"produceDate"));
break;
case "tableField121-remark":
tableField121List.add(new ExcelExportEntity("备注" ,"remark"));
break;
default:
break;
}
}
if(tableField121List.size() > 0){
tableField121ExcelEntity.setList(tableField121List);
entitys.add(tableField121ExcelEntity);
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//去除空数据
List<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> map : list) {
int i = 0;
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
for (Map<String, Object> childMap : childList) {
if (childMap.get(field) != null) {
i++;
}
}
}
} else {
Object o = map.get(key);
if (o != null) {
i++;
}
}
}
if (i > 0) {
dataList.add(map);
}
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(WarehousingNotificationConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
}
String fileName = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
*
* @param ids
* @return
*/
@DeleteMapping("/batchRemove")
@Transactional
@Operation(summary = "批量删除")
public ActionResult batchRemove(@RequestBody String ids){
List<String> idList = JsonUtil.getJsonToList(ids, String.class);
List<String> columnIdList = new ArrayList<>(20);
int i =0;
String errInfo = "";
for (String allId : idList){
FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(allId, FlowTaskEntity::getId, FlowTaskEntity::getStatus);
if (taskEntity==null){
columnIdList.add(allId);
this.delete(allId);
}else if (taskEntity.getStatus().equals(0) || taskEntity.getStatus().equals(4)){
try {
generaterSwapUtil.deleteFlowTask(taskEntity);
columnIdList.add(allId);
this.delete(allId);
i++;
} catch (WorkFlowException e) {
errInfo = e.getMessage();
e.printStackTrace();
}
}
}
if (i == 0 && columnIdList.size()==0){
return ActionResult.fail("流程已发起,无法删除");
}
if (StringUtil.isNotEmpty(errInfo)){
return ActionResult.fail(errInfo);
}
return ActionResult.success("删除成功");
}
/**
*
* @param id
* @param warehousingNotificationForm
@ -443,6 +199,7 @@ public class WarehousingNotificationController {
}else if(entity.getWarehousingType().equals("1")){
warehousingNotificationMap = generaterSwapUtil.swapDataDetail(warehousingNotificationMap,WarehousingNotificationConstant.getFormData(),"1760244414589886466",false);
}
return ActionResult.success(warehousingNotificationMap);
}
/**
@ -462,8 +219,6 @@ public class WarehousingNotificationController {
warehousingNotificationMap.put("id", warehousingNotificationMap.get("id"));
//副表数据
//子表数据
List<WarehousingProductEntity> warehousingProductList = warehousingNotificationService.getWarehousingProductList(entity.getId());
warehousingNotificationMap.put("warehousingProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingProductList)));
warehousingNotificationMap = generaterSwapUtil.swapDataForm(warehousingNotificationMap,WarehousingNotificationConstant.getFormData(),WarehousingNotificationConstant.TABLEFIELDKEY,WarehousingNotificationConstant.TABLERENAMES);
return ActionResult.success(warehousingNotificationMap);
}

@ -0,0 +1,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);
}
}

@ -0,0 +1,467 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.warehousingstorage.*;
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;
/**
* warehousingStorage
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-20
*/
@Slf4j
@RestController
@Tag(name = "warehousingStorage" , description = "scm")
@RequestMapping("/api/scm/WarehousingStorage")
public class WarehousingStorageController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingStorageService warehousingStorageService;
@Autowired
private WarehousingStoragePoundlistService warehousingStoragePoundlistService;
@Autowired
private WarehousingStorageProductService warehousingStorageProductService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param warehousingStoragePagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody WarehousingStoragePagination warehousingStoragePagination)throws IOException{
List<WarehousingStorageEntity> list= warehousingStorageService.getList(warehousingStoragePagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingStorageEntity entity : list) {
entity.setRealityNumber(warehousingStorageService.queryRealityNumber(entity.getId()));
entity.setPurchaseNo(warehousingStorageService.queryPurchaseNo(entity.getId()));
Map<String, Object> warehousingStorageMap=JsonUtil.entityToMap(entity);
warehousingStorageMap.put("id", warehousingStorageMap.get("id"));
//副表数据
//子表数据
List<WarehousingStoragePoundlistEntity> warehousingStoragePoundlistList = warehousingStorageService.getWarehousingStoragePoundlistList(entity.getId(),warehousingStoragePagination);
warehousingStorageMap.put("tableField114",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingStoragePoundlistList)));
List<WarehousingStorageProductEntity> warehousingStorageProductList = warehousingStorageService.getWarehousingStorageProductList(entity.getId(),warehousingStoragePagination);
warehousingStorageMap.put("tableField119",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingStorageProductList)));
realList.add(warehousingStorageMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingStorageConstant.getFormData(), WarehousingStorageConstant.getColumnData(), warehousingStoragePagination.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(warehousingStoragePagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param warehousingStorageForm
* @return
*/
@PostMapping("/{id}")
@Operation(summary = "创建")
public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid WarehousingStorageForm warehousingStorageForm) {
String b = warehousingStorageService.checkForm(warehousingStorageForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
warehousingStorageService.saveOrUpdate(warehousingStorageForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody WarehousingStoragePagination warehousingStoragePagination) throws IOException {
if (StringUtil.isEmpty(warehousingStoragePagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<WarehousingStorageEntity> list= warehousingStorageService.getList(warehousingStoragePagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingStorageEntity entity : list) {
Map<String, Object> warehousingStorageMap=JsonUtil.entityToMap(entity);
warehousingStorageMap.put("id", warehousingStorageMap.get("id"));
//副表数据
//子表数据
List<WarehousingStoragePoundlistEntity> warehousingStoragePoundlistList = warehousingStorageService.getWarehousingStoragePoundlistList(entity.getId(),warehousingStoragePagination);
warehousingStorageMap.put("tableField114",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingStoragePoundlistList)));
List<WarehousingStorageProductEntity> warehousingStorageProductList = warehousingStorageService.getWarehousingStorageProductList(entity.getId(),warehousingStoragePagination);
warehousingStorageMap.put("tableField119",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingStorageProductList)));
realList.add(warehousingStorageMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingStorageConstant.getFormData(), WarehousingStorageConstant.getColumnData(), warehousingStoragePagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(warehousingStoragePagination.getSelectKey())?warehousingStoragePagination.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 "warehousingStorageType" :
entitys.add(new ExcelExportEntity("业务类型" ,"warehousingStorageType"));
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 "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("关联凭证id" ,"voucherId"));
break;
case "tableField119-productId":
tableField119List.add(new ExcelExportEntity("商品名称" ,"productId"));
break;
case "tableField119-storageUnit":
tableField119List.add(new ExcelExportEntity("入库单位" ,"storageUnit"));
break;
case "tableField119-storageAreaId":
tableField119List.add(new ExcelExportEntity("入库货区id" ,"storageAreaId"));
break;
case "tableField119-storageNumber":
tableField119List.add(new ExcelExportEntity("入库数量" ,"storageNumber"));
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(WarehousingStorageConstant.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 warehousingStorageForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid WarehousingStorageForm warehousingStorageForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
warehousingStorageForm.setId(id);
if (!isImport) {
String b = warehousingStorageService.checkForm(warehousingStorageForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
WarehousingStorageEntity entity= warehousingStorageService.getInfo(id);
if(entity!=null){
try{
warehousingStorageService.saveOrUpdate(warehousingStorageForm,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){
WarehousingStorageEntity entity= warehousingStorageService.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);
warehousingStorageService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
WarehousingStorageEntity entity= warehousingStorageService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingStorageMap=JsonUtil.entityToMap(entity);
warehousingStorageMap.put("id", warehousingStorageMap.get("id"));
//副表数据
//子表数据
List<WarehousingStoragePoundlistEntity> warehousingStoragePoundlistList = warehousingStorageService.getWarehousingStoragePoundlistList(entity.getId());
warehousingStorageMap.put("tableField114",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingStoragePoundlistList)));
List<WarehousingStorageProductEntity> warehousingStorageProductList = warehousingStorageService.getWarehousingStorageProductList(entity.getId());
warehousingStorageMap.put("tableField119",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingStorageProductList)));
warehousingStorageMap = generaterSwapUtil.swapDataDetail(warehousingStorageMap,WarehousingStorageConstant.getFormData(),"529614060577116037",false);
return ActionResult.success(warehousingStorageMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
WarehousingStorageEntity entity= warehousingStorageService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingStorageMap=JsonUtil.entityToMap(entity);
warehousingStorageMap.put("id", warehousingStorageMap.get("id"));
//副表数据
//子表数据
List<WarehousingStoragePoundlistEntity> warehousingStoragePoundlistList = warehousingStorageService.getWarehousingStoragePoundlistList(entity.getId());
warehousingStorageMap.put("warehousingStoragePoundlistList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingStoragePoundlistList)));
List<WarehousingStorageProductEntity> warehousingStorageProductList = warehousingStorageService.getWarehousingStorageProductList(entity.getId());
warehousingStorageMap.put("warehousingStorageProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingStorageProductList)));
warehousingStorageMap = generaterSwapUtil.swapDataForm(warehousingStorageMap,WarehousingStorageConstant.getFormData(),WarehousingStorageConstant.TABLEFIELDKEY,WarehousingStorageConstant.TABLERENAMES);
return ActionResult.success(warehousingStorageMap);
}
}

@ -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;
}

@ -9,7 +9,7 @@ import java.util.Date;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-19
* @ 2024-02-20
*/
@Data
@TableName("jg_warehousing_notification")
@ -26,9 +26,9 @@ public class WarehousingNotificationEntity {
private String orderSource;
@TableField(value = "BUSINESS_ID" , updateStrategy = FieldStrategy.IGNORED)
private String businessId;
@TableField("PLANNED_WAREHOUSING_TIME_START")
@TableField(value = "PLANNED_WAREHOUSING_TIME_START" , updateStrategy = FieldStrategy.IGNORED)
private Date plannedWarehousingTimeStart;
@TableField("PLANNED_WAREHOUSING_TIME_END")
@TableField(value = "PLANNED_WAREHOUSING_TIME_END" , updateStrategy = FieldStrategy.IGNORED)
private Date plannedWarehousingTimeEnd;
@TableField(value = "SUBJECT_BASIC_ID" , updateStrategy = FieldStrategy.IGNORED)
private String subjectBasicId;
@ -36,9 +36,9 @@ public class WarehousingNotificationEntity {
private String shippingAddress;
@TableField(value = "ENTERPRISE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String enterpriseId;
@TableField(value = "DELIVERY_ADDRESS" , updateStrategy = FieldStrategy.IGNORED)
@TableField("DELIVERY_ADDRESS")
private String deliveryAddress;
@TableField(value = "WAREHOUSE_ID" , updateStrategy = FieldStrategy.IGNORED)
@TableField("WAREHOUSE_ID")
private String warehouseId;
@TableField("PLAN_WAREHOUSING_NUM")
private String planWarehousingNum;
@ -46,7 +46,7 @@ public class WarehousingNotificationEntity {
private String confirmWarehousingNum;
@TableField("WAIT_WAREHOUSING_NUM")
private String waitWarehousingNum;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
@TableField("REMARK")
private String remark;
@TableField("RESERVED_FIELDS1")
private String reservedFields1;
@ -60,19 +60,34 @@ public class WarehousingNotificationEntity {
private String remark2;
@TableField("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;
@TableField("F_CREATOR_USER_ID")
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField("F_DELETE_MARK")
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
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;
}

@ -12,7 +12,7 @@ import java.math.BigDecimal;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-19
* @ 2024-02-20
*/
@Data
@TableName("jg_warehousing_product")
@ -23,29 +23,29 @@ public class WarehousingProductEntity {
private String warehousingId;
@TableField("PRODUCT_ID")
private String productId;
@TableField(value = "PRODUCT_NAME" , updateStrategy = FieldStrategy.IGNORED)
@TableField("PRODUCT_NAME")
private String productName;
@TableField(value = "SPEC" , updateStrategy = FieldStrategy.IGNORED)
@TableField("SPEC")
private String spec;
@TableField(value = "INVENTORY_UNIT_ID" , updateStrategy = FieldStrategy.IGNORED)
@TableField("INVENTORY_UNIT_ID")
private String inventoryUnitId;
@TableField(value = "PURCHASE_UNIT_ID" , updateStrategy = FieldStrategy.IGNORED)
@TableField("PURCHASE_UNIT_ID")
private String purchaseUnitId;
@TableField(value = "PURCHASE_NUM" , updateStrategy = FieldStrategy.IGNORED)
@TableField("PURCHASE_NUM")
private String purchaseNum;
@TableField(value = "STORAGE_AREA_ID" , updateStrategy = FieldStrategy.IGNORED)
@TableField("STORAGE_AREA_ID")
private String storageAreaId;
@TableField(value = "WAREHOUSING_UNIT_ID" , updateStrategy = FieldStrategy.IGNORED)
@TableField("WAREHOUSING_UNIT_ID")
private String warehousingUnitId;
@TableField("RECEIVED_QUANTITY")
private BigDecimal receivedQuantity;
@TableField("REMAINING_STOCKABLE_QUANTITY")
private BigDecimal remainingStockableQuantity;
@TableField(value = "NOTIFICATION_STORAGE_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
@TableField("NOTIFICATION_STORAGE_NUMBER")
private BigDecimal notificationStorageNumber;
@TableField(value = "VOLUME" , updateStrategy = FieldStrategy.IGNORED)
@TableField("VOLUME")
private String volume;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
@TableField("REMARK")
private String remark;
@TableField("VOUCHER_ID")
private String voucherId;
@ -71,10 +71,10 @@ public class WarehousingProductEntity {
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField(value = "BAR_CODE" , updateStrategy = FieldStrategy.IGNORED)
@TableField("BAR_CODE")
private String barCode;
@TableField(value = "BATCH_NO" , updateStrategy = FieldStrategy.IGNORED)
@TableField("BATCH_NO")
private String batchNo;
@TableField(value = "PRODUCE_DATE" , updateStrategy = FieldStrategy.IGNORED)
@TableField("PRODUCE_DATE")
private Date produceDate;
}

@ -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-20
*/
@Data
@TableName("jg_warehousing_storage")
public class WarehousingStorageEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "DOCUMENT_NO" , updateStrategy = FieldStrategy.IGNORED)
private String documentNo;
@TableField(value = "WAREHOUSING_STORAGE_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String warehousingStorageType;
@TableField("WAREHOUSING_STORAGE_STATUS")
private String warehousingStorageStatus;
@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 = "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 realityNumber;
@TableField(exist = false) //采购单号
private String purchaseNo;
}

@ -0,0 +1,59 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-20
*/
@Data
@TableName("jg_warehousing_storage_poundlist")
public class WarehousingStoragePoundlistEntity {
@TableId(value ="ID" )
private String id;
@TableField("WAREHOUSING_STORAGE_ID")
private String warehousingStorageId;
@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-20
*/
@Data
@TableName("jg_warehousing_storage_product")
public class WarehousingStorageProductEntity {
@TableId(value ="ID" )
private String id;
@TableField("WAREHOUSING_STORAGE_ID")
private String warehousingStorageId;
@TableField(value = "PRODUCT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String productId;
@TableField(value = "STORAGE_AREA_ID" , updateStrategy = FieldStrategy.IGNORED)
private String storageAreaId;
@TableField(value = "STORAGE_UNIT" , updateStrategy = FieldStrategy.IGNORED)
private String storageUnit;
@TableField("STORAGE_UNIT_SPEC")
private String storageUnitSpec;
@TableField("EXPECTED_RECEIPT_QUANTITY")
private BigDecimal expectedReceiptQuantity;
@TableField("RECEIVED_QUANTITY")
private BigDecimal receivedQuantity;
@TableField("REMAINING_STOCKABLE_QUANTITY")
private BigDecimal remainingStockableQuantity;
@TableField(value = "STORAGE_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal storageNumber;
@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;
}

@ -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;
}

@ -10,15 +10,12 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-19
* @ 2024-02-20
*/
@Data
public class WarehousingNotificationForm {
/** 主键 */
private String id;
/** 子表数据 **/
@JsonProperty("warehousingProductList")
private List<WarehousingProductModel> warehousingProductList;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
@ -26,34 +23,34 @@ public class WarehousingNotificationForm {
@JsonProperty("flowId")
private String flowId;
/** **/
/** 业务类型 **/
@JsonProperty("warehousingType")
private String warehousingType;
/** 通知编号 **/
@JsonProperty("warehousingCode")
private String warehousingCode;
/** 制单时间 **/
@JsonProperty("preparationTime")
private String preparationTime;
/** 销售订单 **/
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 创建用户 **/
@JsonProperty("creatorUserId")
private String creatorUserId;
/** 关联采购订单 **/
@JsonProperty("businessId")
private String businessId;
/** 客户名称 **/
/** 计划入库时间开始 **/
@JsonProperty("plannedWarehousingTimeStart")
private String plannedWarehousingTimeStart;
/** 计划入库时间结束 **/
@JsonProperty("plannedWarehousingTimeEnd")
private String plannedWarehousingTimeEnd;
/** 供应商名称 **/
@JsonProperty("subjectBasicId")
private String subjectBasicId;
/** 收货地址 **/
/** 货地址 **/
@JsonProperty("shippingAddress")
private String shippingAddress;
/** 机构名称 **/
@JsonProperty("enterpriseId")
private String enterpriseId;
/** 发货仓库 **/
@JsonProperty("warehouseId")
private String warehouseId;
/** 发货地址 **/
@JsonProperty("deliveryAddress")
private String deliveryAddress;
/** 备注 **/
@JsonProperty("remark")
private String remark;
private Object enterpriseId;
}

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-19
* @ 2024-02-20
*/
@Data
public class WarehousingNotificationPagination extends Pagination {
@ -27,7 +27,19 @@ public class WarehousingNotificationPagination extends Pagination {
private String moduleId;
/** 菜单id */
private String menuId;
/** 业务类型 */
@JsonProperty("warehousingType")
private Object warehousingType;
/** 通知编号 */
@JsonProperty("warehousingCode")
private Object warehousingCode;
/** 创建用户 */
@JsonProperty("creatorUserId")
private Object creatorUserId;
/** 机构名称 */
@JsonProperty("enterpriseId")
private Object enterpriseId;
/** 发货地址 */
@JsonProperty("shippingAddress")
private Object shippingAddress;
}

@ -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;
}

@ -0,0 +1,62 @@
package jnpf.model.warehousingstorage;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* warehousingStorage
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-20
*/
@Data
public class WarehousingStorageForm {
/** 主键 */
private String id;
/** 子表数据 **/
@JsonProperty("warehousingStoragePoundlistList")
private List<WarehousingStoragePoundlistModel> warehousingStoragePoundlistList;
/** 子表数据 **/
@JsonProperty("warehousingStorageProductList")
private List<WarehousingStorageProductModel> warehousingStorageProductList;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 流程id **/
@JsonProperty("flowId")
private String flowId;
/** 单据编号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 业务类型 **/
@JsonProperty("warehousingStorageType")
private Object warehousingStorageType;
/** 关联单号 **/
@JsonProperty("warehousingId")
private String warehousingId;
/** 入库仓库 **/
@JsonProperty("warehouseId")
private String warehouseId;
/** 入库时间 **/
@JsonProperty("warehousingTime")
private String warehousingTime;
/** 备注 **/
@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.warehousingstorage;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* warehousingStorage
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-20
*/
@Data
public class WarehousingStoragePagination 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.warehousingstorage;
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;
/**
*
* warehousingStorage
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-02-20
*/
@Data
public class WarehousingStoragePoundlistModel {
/** 关联凭证id **/
@JSONField(name = "voucherId")
private String voucherId;
}

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

@ -436,8 +436,8 @@ export default {
// },
productSelect(model, row) {
console.log(model);
console.log(row);
// console.log(model);
// console.log(row);
this.dataForm.spec = row.spec
this.dataForm.inventoryType = row.inventory_types
@ -449,7 +449,7 @@ export default {
// console.log(row.spec);
console.log(this.dataForm.inventoryType);
// console.log(this.dataForm.inventoryType);
},
changeData(model, index) {
this.isEdit = false

@ -144,7 +144,7 @@
{{ scope.row.bomStatus}}
</template>
</el-table-column>
<el-table-column prop="bomCode" label="库存单位" align="left" min-width="120">
<el-table-column prop="inventoryUnitId" label="库存单位" align="left" min-width="120">
</el-table-column>
<el-table-column prop="productSpec" label="规格" align="left" min-width="120">
</el-table-column>

@ -105,8 +105,7 @@
<span class="required-sign">*</span>班次名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.timeId"
@change="changeData('classplanitem-timeId',scope.$index)"
<JnpfPopupSelect v-model="scope.row.timeId" @change="changeDataTimeList"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.classplanitemtimeId" placeholder="请选择" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
@ -117,24 +116,24 @@
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="creatorTime">
<el-table-column label="开始时间" prop="startTime">
<template slot="header" v-if="false">
<span class="required-sign">*</span>创建时间
<span class="required-sign">*</span>开始时间
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.creatorTime"
@change="changeData('classplanitem-creatorTime',scope.$index)"
<JnpfInput v-model="dataForm.startTime"
@change="changeData('classplanitem-creatorTime',scope.$index)" disabled
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="创建用户" prop="creatorUserId">
<el-table-column label="结束时间" prop="endTime">
<template slot="header" v-if="false">
<span class="required-sign">*</span>创建用户
<span class="required-sign">*</span>结束时间
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.creatorUserId"
@change="changeData('classplanitem-creatorUserId',scope.$index)"
<JnpfInput v-model="dataForm.endTime"
@change="changeData('classplanitem-creatorUserId',scope.$index)" disabled
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
@ -180,8 +179,7 @@
<span class="required-sign">*</span>班组名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.teamId"
@change="changeData('classplanteam-teamId',scope.$index)"
<JnpfPopupSelect v-model="scope.row.teamId" @change="changeDataList"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.classplanteamteamId" placeholder="请选择" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
@ -206,28 +204,42 @@
</template> -->
</el-table-column>
<el-table-column label="删除时间" prop="deleteTime">
<el-table-column label="类型" prop="types">
<template slot="header" v-if="false">
<span class="required-sign">*</span>删除时间
<span class="required-sign">*</span>类型
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.deleteTime"
@change="changeData('classplanteam-deleteTime',scope.$index)"
<JnpfInput v-model="dataForm.types"
@change="changeData('classplanteam-deleteTime',scope.$index)" disabled
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="creatorTime">
<el-table-column label="负责人" prop="fRealName">
<template slot="header" v-if="false">
<span class="required-sign">*</span>创建时间
<span class="required-sign">*</span>负责人
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.creatorTime"
@change="changeData('classplanteam-creatorTime',scope.$index)"
<JnpfInput v-model="dataForm.fRealName"
@change="changeData('classplanteam-creatorTime',scope.$index)" disabled
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="联系手机" prop="fMobilePhone">
<template slot="header" v-if="false">
<span class="required-sign">*</span>联系手机
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.fMobilePhone"
@change="changeData('classplanteam-creatorTime',scope.$index)" disabled
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template slot="header" v-if="false">
<span class="required-sign">*</span>备注
@ -467,6 +479,17 @@ export default {
this.visible = false
this.$emit('refreshDataList', true)
},
changeDataTimeList(model, row) {
this.dataForm.startTime = row.start_time
this.dataForm.endTime = row.end_time
},
changeDataList(model, row) {
this.dataForm.fRealName = row.f_real_name
this.dataForm.types = row.types
this.dataForm.fCreatorTime = row.f_creator_time
this.dataForm.fMobilePhone = row.f_mobile_phone
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index

@ -189,15 +189,46 @@
<template slot="header" v-if="false">
<span class="required-sign">*</span>员工姓名
</template>
<template slot-scope="scope">
<!-- <template slot-scope="scope">
<JnpfUserSelect v-model="scope.row.belongUserId"
@change="changeData('classteamuse-belongUserId',scope.$index)"
placeholder="请选择" selectType="all"
:ableIds="ableAll.classteamusebelongUserIdableIds" clearable
:style='{"width":"100%"}'>
</JnpfUserSelect>
</template> -->
<template slot-scope="scope">
<JnpfUserSelect v-model="scope.row.belongUserId" @change="changeDataList"
placeholder="请选择" selectType="all"
:ableIds="ableAll.classteamusebelongUserIdableIds" clearable
:style='{"width":"100%"}'>
</JnpfUserSelect>
</template>
</el-table-column>
<el-table-column label="手机" prop="mobilePhone">
<template slot="header">
<span class="required-sign">*</span>手机
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.mobilePhone" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="组织部门" prop="organize">
<template slot="header">
<span class="required-sign">*</span>组织部门
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.organize" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@ -428,6 +459,12 @@ export default {
this.visible = false
this.$emit('refreshDataList', true)
},
changeDataList(model, row) {
this.dataForm.mobilePhone = row.mobilePhone
this.dataForm.organize = row.organize
debugger
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index

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,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

@ -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

@ -0,0 +1,938 @@
<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="8" 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="8" v-if="judgeShow('warehousingStorageType')">
<jnpf-form-tip-item label="业务类型" v-if="judgeShow('warehousingStorageType')"
prop="warehousingStorageType">
<JnpfSelect v-model="dataForm.warehousingStorageType"
@change="changeData('warehousingStorageType',-1)" placeholder="请选择"
:disabled="judgeWrite('warehousingStorageType')" clearable :style='{"width":"100%"}'
:options="warehousingStorageTypeOptions" :props="warehousingStorageTypeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('warehousingId')">
<jnpf-form-tip-item label="关联单号" v-if="judgeShow('warehousingId')" prop="warehousingId">
<JnpfPopupSelect v-model="dataForm.warehousingId"
@change="changeData('warehousingId',-1)" :rowIndex="null" :formData="dataForm"
:templateJson="interfaceRes.warehousingId" placeholder="请选择"
:disabled="judgeWrite('warehousingId')" propsValue="id" popupWidth="800px"
popupTitle="选择数据" popupType="dialog" relationField='warehousing_code'
field='warehousingId' interfaceId="529616482762510213" :pageSize="20"
:columnOptions="warehousingIdcolumnOptions" 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="529617754022498181" :pageSize="20"
:columnOptions="warehouseIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
{{ dataForm.warehouseId }}
<el-col :span="8" v-if="judgeShow('warehousingTime')">
<jnpf-form-tip-item label="入库时间" v-if="judgeShow('warehousingTime')"
prop="warehousingTime">
<JnpfDatePicker v-model="dataForm.warehousingTime"
@change="changeData('warehousingTime',-1)" :startTime="dateTime(false,1,1,'','')"
:endTime="dateTime(false,1,1,'','')" placeholder="请选择"
:disabled="judgeWrite('warehousingTime')" clearable :style='{"width":"100%"}'
type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</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('-${html.relationField}')">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>入库凭证</h2>
</div>
<el-table :data="dataForm.warehousingStoragePoundlistList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="关联凭证"
v-if="judgeShow('warehousingstoragepoundlist-voucherId')" prop="voucherId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingstoragepoundlistList-voucherId')">*</span>关联凭证
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.voucherId" @change="changeDataVoucher"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.warehousingstoragepoundlistvoucherId"
placeholder="请选择"
:disabled="judgeWrite('warehousingstoragepoundlistList')||judgeWrite('warehousingstoragepoundlistList-voucherId')"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='voucher_code'
:field="'voucherId'+scope.$index" interfaceId="529621469341175685"
:pageSize="20"
:columnOptions="warehousingstoragepoundlistvoucherIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="单据类型" prop="documentTypes">
<template slot="header">
<span class="required-sign"></span>单据类型
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.documentTypes" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="凭证类型" prop="voucherType">
<template slot="header">
<span class="required-sign"></span>凭证类型
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.voucherType" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="磅单编号" prop="poundCode">
<template slot="header">
<span class="required-sign"></span>磅单编号
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.poundCode" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="磅单时间" prop="poundlistTime">
<template slot="header">
<span class="required-sign"></span>磅单时间
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.poundlistTime" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="车辆信息" prop="vehicleNumber">
<template slot="header">
<span class="required-sign"></span>车辆信息
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.vehicleNumber" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="商品名称" prop="productName">
<template slot="header">
<span class="required-sign"></span>商品名称
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.productName" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="规格" prop="productSpec">
<template slot="header">
<span class="required-sign"></span>规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.productSpec" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="单位" prop="unit">
<template slot="header">
<span class="required-sign"></span>单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.unit" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="毛重" prop="grossWeight">
<template slot="header">
<span class="required-sign"></span>毛重
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.grossWeight" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="皮重" prop="tareWeight">
<template slot="header">
<span class="required-sign"></span>皮重
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.tareWeight" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="扣重" prop="buckleWeight">
<template slot="header">
<span class="required-sign"></span>扣重
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.buckleWeight" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="净重" prop="netWeight">
<template slot="header">
<span class="required-sign"></span>净重
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.netWeight" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template slot="header">
<span class="required-sign"></span>备注
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.remark" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50"
v-if="!judgeWrite('warehousingstoragepoundlistList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delwarehousingstoragepoundlistList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addwarehousingstoragepoundlistList()"
v-if="!judgeWrite('warehousingstoragepoundlistList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</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">
<jnpf-form-tip-item>
<JnpfText
:textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":12,"line-height":32,"font-style":"normal","text-align":"left"}'
content="默认展示关联单据的商品信息,可直接修改商品数量。">
</JnpfText>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('warehousingstoragepoundlist-voucher_code')">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.warehousingStorageProductList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="商品名称"
v-if="judgeShow('warehousingstorageproduct-productId')" prop="productId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingstorageproductList-productId')">*</span>商品名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId" @change="changeDataProduct"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.warehousingstorageproductproductId"
placeholder="请选择"
:disabled="judgeWrite('warehousingstorageproductList')||judgeWrite('warehousingstorageproductList-productId')"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' :field="'productId'+scope.$index"
interfaceId="529622659227471749" :pageSize="20"
:columnOptions="warehousingstorageproductproductIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="规格" prop="spec">
<template slot="header">
<span class="required-sign"></span>规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.spec" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="库存单位" prop="inventoryUnitIds">
<template slot="header">
<span class="required-sign"></span>库存单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.inventoryUnitIds" placeholder="请输入" disabled
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="入库单位"
v-if="judgeShow('warehousingstorageproduct-storageUnit')" prop="storageUnit">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingstorageproductList-storageUnit')">*</span>入库单位
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.storageUnit"
@change="changeData('warehousingstorageproduct-storageUnit',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.warehousingstorageproductstorageUnit"
placeholder="请选择"
:disabled="judgeWrite('warehousingstorageproductList')||judgeWrite('warehousingstorageproductList-storageUnit')"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='unit_name'
:field="'storageUnit'+scope.$index" interfaceId="523054191598383685"
:pageSize="20"
:columnOptions="warehousingstorageproductstorageUnitcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="入库单位规格" prop="111">
<template slot="header">
<span class="required-sign"></span>入库单位规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.storageNumber" placeholder="请输入" disabled
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="入库货区"
v-if="judgeShow('warehousingstorageproduct-storageAreaId')" prop="storageAreaId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingstorageproductList-storageAreaId')">*</span>入库货区
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.storageAreaId"
@change="changeData('warehousingstorageproduct-storageAreaId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.warehousingstorageproductstorageAreaId"
placeholder="请选择"
:disabled="judgeWrite('warehousingstorageproductList')||judgeWrite('warehousingstorageproductList-storageAreaId')"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' :field="'storageAreaId'+scope.$index"
interfaceId="529624294691458949" :pageSize="20"
:columnOptions="warehousingstorageproductstorageAreaIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="入库数量"
v-if="judgeShow('warehousingstorageproduct-storageNumber')" prop="storageNumber">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingstorageproductList-storageNumber')">*</span>入库数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.storageNumber"
@change="changeData('warehousingstorageproduct-storageNumber',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousingstorageproductList')||judgeWrite('warehousingstorageproductList-storageNumber')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="批次号"
v-if="judgeShow('warehousingstorageproduct-batchNumber')" prop="batchNumber">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingstorageproductList-batchNumber')">*</span>批次号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.batchNumber"
@change="changeData('warehousingstorageproduct-batchNumber',scope.$index)"
placeholder="系统自动生成" disabled readonly :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="生产日期"
v-if="judgeShow('warehousingstorageproduct-dateManufacture')"
prop="dateManufacture">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingstorageproductList-dateManufacture')">*</span>生产日期
</template>
<template slot-scope="scope">
<JnpfDatePicker v-model="scope.row.dateManufacture"
@change="changeData('warehousingstorageproduct-dateManufacture',scope.$index)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')"
placeholder="请选择"
:disabled="judgeWrite('warehousingstorageproductList')||judgeWrite('warehousingstorageproductList-dateManufacture')"
clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</template>
</el-table-column>
<el-table-column label="操作" width="50"
v-if="!judgeWrite('warehousingstorageproductList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delwarehousingstorageproductList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addwarehousingstorageproductList()"
v-if="!judgeWrite('warehousingstorageproductList')">
<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: {
warehousingStoragePoundlistList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
warehousingStorageProductList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
warehousingStoragePoundlistList: {
voucherId: '',
voucherIdOptions: [],
enabledmark: undefined
},
warehousingStorageProductList: {
productId: '',
productIdOptions: [],
storageUnit: '',
storageUnitOptions: [],
storageAreaId: '',
storageAreaIdOptions: [],
storageNumber: '',
storageNumberOptions: [],
batchNumber: '',
batchNumberOptions: [],
dateManufacture: '',
dateManufactureOptions: [],
enabledmark: undefined
},
},
Vmodel: "",
currVmodel: "",
dataForm: {
documentNo: undefined,
warehousingStorageType: "3",
warehousingId: undefined,
warehouseId: undefined,
warehousingTime: undefined,
remark: undefined,
creatorTime: undefined,
creatorUserId: undefined,
lastModifyTime: undefined,
lastModifyUserId: undefined,
warehousingStoragePoundlistList: [],
warehousingStorageProductList: [],
version: 0,
},
tableRequiredData: {},
dataRule:
{
warehousingStorageType: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
warehousingId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
warehouseId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
warehousingTime: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
},
warehousingStorageTypeOptions: [{ "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" }],
warehousingStorageTypeProps: { "label": "fullName", "value": "id" },
warehousingIdcolumnOptions: [{ "label": "通知编号", "value": "warehousing_code" }, { "label": "供应商id", "value": "subject_basic_id" }, { "label": "仓库id", "value": "warehouse_id" },],
warehouseIdcolumnOptions: [{ "label": "仓库编号", "value": "code" }, { "label": "仓库名称", "value": "name" }, { "label": "仓库简称", "value": "simple_name" },],
warehousingstoragepoundlistvoucherIdcolumnOptions: [{ "label": "凭证编号", "value": "voucher_code" }, { "label": "凭证类型", "value": "voucher_type" }, { "label": "车牌号", "value": "vehicle_number" }, { "label": "商品名称", "value": "product_name" },],
warehousingstorageproductproductIdcolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "商品编码", "value": "code" }, { "label": "商品规格", "value": "spec" },],
warehousingstorageproductstorageUnitcolumnOptions: [{ "label": "单位名称", "value": "unit_name" }, { "label": "单位类型", "value": "unit_type" },],
warehousingstorageproductstorageAreaIdcolumnOptions: [{ "label": "货区名称", "value": "name" }, { "label": "货区编码", "value": "code" },],
childIndex: -1,
isEdit: false,
interfaceRes: {
documentNo: [],
warehousingStorageType: [],
warehousingId: [],
warehouseId: [],
warehousingTime: [],
remark: [],
creatorTime: [],
creatorUserId: [],
lastModifyTime: [],
lastModifyUserId: [],
warehousingstoragepoundlistvoucherId: [],
warehousingstorageproductproductId: [],
warehousingstorageproductstorageUnit: [],
warehousingstorageproductstorageAreaId: [{ "fieldName": "", "field": "warehouseId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "Y4nIRy1", "relationField": "warehouseId", "required": "0" }],
warehousingstorageproductstorageNumber: [],
warehousingstorageproductbatchNumber: [],
warehousingstorageproductdateManufacture: [],
},
}
},
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: {
changeDataVoucher(model, row) {
this.dataForm.documentTypes = row.documentTypes
this.dataForm.voucherType = row.voucherType
this.dataForm.poundCode = row.pound_code
this.dataForm.vehicleNumber = row.vehicle_number
this.dataForm.vehicleNames = row.vehicle_names
this.dataForm.productName = row.product_name
this.dataForm.productSpec = row.product_spec
this.dataForm.unit = row.unit
this.dataForm.grossWeight = row.gross_weight
this.dataForm.tareWeight = row.tare_weight
this.dataForm.buckleWeight = row.buckle_weight
this.dataForm.netWeight = row.net_weight
this.dataForm.remark = row.remark
},
changeDataProduct(model, row) {
this.dataForm.spec = row.spec
this.dataForm.inventoryType = row.inventory_types
this.dataForm.inventoryUnitIds = row.inventory_unit_ids
this.dataForm.salesMainUnitIds = row.sales_main_unit_ids
this.dataForm.barCode = row.bar_code
this.dataForm.operateUnitIds = row.operate_unit_ids
this.dataForm.productTypeIds = row.product_type_ids
},
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("529614060577116037").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.warehousingstoragepoundlistExist()) return
if (!this.warehousingstorageproductExist()) return
return isOk
},
warehousingstoragepoundlistExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.warehousingStoragePoundlistList.length; i++) {
const e = this.dataForm.warehousingStoragePoundlistList[i];
if (!e.voucherId) {
this.$message({
message: '关联凭证id不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
}
return isOk;
},
warehousingstorageproductExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.warehousingStorageProductList.length; i++) {
const e = this.dataForm.warehousingStorageProductList[i];
if (!e.productId) {
this.$message({
message: '商品名称不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.storageUnit) {
this.$message({
message: '入库单位不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.storageAreaId) {
this.$message({
message: '入库货区id不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
}
return isOk;
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
this.dataForm.warehousingTime = new Date().getTime()
},
addwarehousingstoragepoundlistList() {
let item = {
voucherId: '',
}
this.getwarehousingstoragepoundlistList(item)
},
delwarehousingstoragepoundlistList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.warehousingStoragePoundlistList.splice(index, 1);
}).catch(() => {
});
},
getwarehousingstoragepoundlistList(value) {
let item = { ...this.tableRows.warehousingStoragePoundlistList, ...value }
this.dataForm.warehousingStoragePoundlistList.push(item)
this.childIndex = this.dataForm.warehousingStoragePoundlistList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
addwarehousingstorageproductList() {
let item = {
productId: '',
storageUnit: '',
storageAreaId: '',
storageNumber: undefined,
batchNumber: undefined,
dateManufacture: new Date().getTime(),
}
this.getwarehousingstorageproductList(item)
},
delwarehousingstorageproductList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.warehousingStorageProductList.splice(index, 1);
}).catch(() => {
});
},
getwarehousingstorageproductList(value) {
let item = { ...this.tableRows.warehousingStorageProductList, ...value }
this.dataForm.warehousingStorageProductList.push(item)
this.dataForm.warehousingStorageProductList[this.dataForm.warehousingStorageProductList.length - 1].dateManufacture = new Date().getTime()
this.childIndex = this.dataForm.warehousingStorageProductList.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.warehousingStoragePoundlistList.length; i++) {
this.childIndex = i
}
for (let i = 0; i < _dataAll.warehousingStorageProductList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
},
},
}
</script>

@ -0,0 +1,637 @@
<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="warehouseId" label="入库仓库" align="left">
</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>
<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,
realityNumber: undefined,
purchaseNo: 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,
warehousingStorageTypeOptions: [{ "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" }],
warehousingStorageTypeProps: { "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_storageUnitcolumnOptions: [{ "label": "单位名称", "value": "unit_name" }, { "label": "单位类型", "value": "unit_type" },],
tableField119_storageAreaIdcolumnOptions: [{ "label": "货区名称", "value": "name" }, { "label": "货区编码", "value": "code" },],
interfaceRes: {
warehousingId: [],
warehouseId: [],
tableField114_voucherId: [],
tableField119_productId: [],
tableField119_storageUnit: [],
tableField119_storageAreaId: [],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
getFormById("529614060577116037").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: '529614060577116037',
type: 1,
};
request({
url: `/api/scm/WarehousingStorage/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/WarehousingStorage/${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/WarehousingStorage")
})
},
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/WarehousingStorage/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/WarehousingStorage/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
//
updateHandle(row, flowState) {
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
opType: flowState ? 0 : '-1',
status: flowState
}
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
toApprovalDetail(row) {
let data = {
id: row.id,
flowId: row.flowId,
opType: 0,
status: row.currentState
}
this.formVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
addHandle() {
if (!this.flowList.length) {
this.$message({ type: 'error', message: '流程不存在' });
} else if (this.flowList.length === 1) {
this.selectFlow(this.flowList[0])
} else {
this.flowListVisible = true
}
},
//
selectFlow(item) {
let data = {
id: '',
formType: 1,
flowId: item.id,
opType: '-1'
}
this.flowListVisible = false
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,448 @@
<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="业务类型" v-if="judgeShow('warehousingType')" prop="warehousingType" >
<JnpfRadio v-model="dataForm.warehousingType" @change="changeData('warehousingType',-1)"
:disabled="judgeWrite('warehousingType')" optionType="button" direction="horizontal" size="medium" :options="warehousingTypeOptions" :props="warehousingTypeProps" >
</JnpfRadio>
</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('creatorTime')" >
<jnpf-form-tip-item
label="创建时间" v-if="judgeShow('creatorTime')" prop="creatorTime" >
<JnpfOpenData v-model="dataForm.creatorTime" @change="changeData('creatorTime',-1)"
placeholder="系统自动生成" :disabled="judgeWrite('creatorTime')" readonly :style='{"width":"100%"}' type="currTime" >
</JnpfOpenData>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item>
<JnpfGroupTitle
content="关联信息" contentPosition="left" >
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('businessId')" >
<jnpf-form-tip-item
label="关联采购订单" v-if="judgeShow('businessId')" prop="businessId" >
<JnpfPopupSelect v-model="dataForm.businessId" @change="changeData('businessId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.businessId" placeholder="请选择" :disabled="judgeWrite('businessId')" propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='code' field='businessId' interfaceId="522687073317030149" :pageSize="20" :columnOptions="businessIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('plannedWarehousingTimeStart')" >
<jnpf-form-tip-item
label="计划入库时间开始" v-if="judgeShow('plannedWarehousingTimeStart')" prop="plannedWarehousingTimeStart" >
<JnpfDatePicker v-model="dataForm.plannedWarehousingTimeStart" @change="changeData('plannedWarehousingTimeStart',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" :disabled="judgeWrite('plannedWarehousingTimeStart')" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" >
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('plannedWarehousingTimeEnd')" >
<jnpf-form-tip-item
label="计划入库时间结束" v-if="judgeShow('plannedWarehousingTimeEnd')" prop="plannedWarehousingTimeEnd" >
<JnpfDatePicker v-model="dataForm.plannedWarehousingTimeEnd" @change="changeData('plannedWarehousingTimeEnd',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" :disabled="judgeWrite('plannedWarehousingTimeEnd')" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" >
</JnpfDatePicker>
</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="522417703080700549" :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" >
<JnpfOrganizeSelect v-model="dataForm.enterpriseId" @change="changeData('enterpriseId',-1)"
placeholder="请选择" selectType="all" :ableIds="ableAll.enterpriseIdableIds" :disabled="judgeWrite('enterpriseId')" clearable :style='{"width":"100%"}'>
</JnpfOrganizeSelect>
</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:{
},
//
ableAll:{
},
tableRows:{
},
Vmodel:"",
currVmodel:"",
dataForm: {
warehousingType : "1",
warehousingCode : undefined,
creatorTime : undefined,
creatorUserId : undefined,
businessId : undefined,
plannedWarehousingTimeStart : undefined,
plannedWarehousingTimeEnd : undefined,
subjectBasicId : undefined,
shippingAddress : undefined,
enterpriseId : [],
version: 0,
},
tableRequiredData: {},
dataRule:
{
warehousingType: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
businessId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
plannedWarehousingTimeStart: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
plannedWarehousingTimeEnd: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
subjectBasicId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
shippingAddress: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
},
warehousingTypeOptions:[{"fullName":"采购入库","id":"1"},{"fullName":"退货入库","id":"2"},{"fullName":"调拨入库","id":"3"},{"fullName":"成品入库","id":"4"},{"fullName":"盘盈入库","id":"5"},{"fullName":"其他入库","id":"6"}],
warehousingTypeProps:{"label":"fullName","value":"id" },
businessIdcolumnOptions:[ {"label":"采购订单号","value":"code"},],
subjectBasicIdcolumnOptions:[ {"label":"供应商名称","value":"name"},],
childIndex:-1,
isEdit:false,
interfaceRes: {
warehousingType:[] ,
warehousingCode:[] ,
creatorTime:[] ,
creatorUserId:[] ,
businessId:[] ,
plannedWarehousingTimeStart:[] ,
plannedWarehousingTimeEnd:[] ,
subjectBasicId:[] ,
shippingAddress:[] ,
enterpriseId:[] ,
},
}
},
computed: {
formOperates() {
return this.setting.formOperates
}
},
watch: {},
created() {
this.getFormById()
if(this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) {
this.initDefaultData()
}
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if(this[options]){
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model,index,defaultValue) {
if(!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll(){
},
selfGetInfo(dataForm) {
this.dataInfo(dataForm)
},
beforeSubmit(){
const _data =this.dataList()
return _data
},
selfInit() {
this.dataAll()
},
getFormById() {
getFormById("528936118222078597").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
}
}
}
}
}
}
return isOk
},
clearData(){
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
},
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()
this.childIndex=-1
},
},
}
</script>

@ -0,0 +1,600 @@
<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.warehousingType" placeholder="请选择" clearable
:options="warehousingTypeOptions" :props="warehousingTypeProps">
</JnpfSelect>
</el-form-item>
</el-col>
<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 label="创建用户">
<JnpfUserSelect v-model="query.creatorUserId" placeholder="请选择" />
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="机构名称">
<JnpfOrganizeSelect selectType="all" v-model="query.enterpriseId" placeholder="请选择"
clearable multiple />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="发货地址">
<el-input v-model="query.shippingAddress" placeholder="请输入" clearable> </el-input>
</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>
</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'
:span-method="arraySpanMethod" fixed="left">
<el-table-column label="业务类型" prop="warehousingType" algin="left" fixed="left">
<template slot-scope="scope">
{{ scope.row.warehousingType}}
</template>
</el-table-column>
<!-- <el-table-column prop="warehousingCode" label="通知编号" align="left" fixed="left">
</el-table-column> -->
<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="111" label="入库仓库" align="left">
</el-table-column>
<el-table-column prop="111" label="单据状态" align="left">
</el-table-column>
<el-table-column prop="111" label="计划入库数量" align="left">
</el-table-column>
<el-table-column prop="111" label="已确认入库数量" align="left">
</el-table-column>
<el-table-column prop="111" label="待确认入库数量" align="left">
</el-table-column>
<el-table-column prop="111" label="期望送达时间" align="left">
</el-table-column>
<el-table-column prop="111" label="配送方式" align="left">
</el-table-column>
<el-table-column prop="111" label="交货方式" align="left">
</el-table-column>
<el-table-column prop="111" label="运输方式" align="left">
</el-table-column>
<el-table-column prop="111" label="承运方式" align="left">
</el-table-column>
<el-table-column prop="111" 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="enterpriseId" 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>
<el-button type="text" v-has="'btn-warehousing'"
@click="addOrUpdateHandle()">入库</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: {
warehousingType: undefined,
warehousingCode: undefined,
creatorUserId: undefined,
enterpriseId: undefined,
shippingAddress: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "creatorTime",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
warehousingTypeOptions: [{ "fullName": "采购入库", "id": "1" }, { "fullName": "退货入库", "id": "2" }, { "fullName": "调拨入库", "id": "3" }, { "fullName": "成品入库", "id": "4" }, { "fullName": "盘盈入库", "id": "5" }, { "fullName": "其他入库", "id": "6" }],
warehousingTypeProps: { "label": "fullName", "value": "id" },
interfaceRes: {
businessId: [],
subjectBasicId: [],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
getFormById("528936118222078597").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: '528936118222078597',
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")
})
},
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 = "creatorTime"
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,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>

File diff suppressed because one or more lines are too long

@ -136,8 +136,7 @@
v-if="judgeRequired('workorderproductList-productId')">*</span>商品名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId"
@change="changeData('workorderproduct-productId',scope.$index)"
<JnpfPopupSelect v-model="scope.row.productId" @change="changeDataProductList"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.workorderproductproductId" placeholder="请选择"
:disabled="judgeWrite('workorderproductList')||judgeWrite('workorderproductList-productId')"
@ -149,6 +148,50 @@
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="存货类型" prop="creatorUserId">
<template slot="header">
<span class="required-sign">*</span>存货类型
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.productTypeIds" placeholder="请输入" disabled
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="规格" prop="creatorUserId">
<template slot="header">
<span class="required-sign">*</span>规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.spec" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="库存单位" prop="lastModifyUserId">
<template slot="header">
<span class="required-sign">*</span>库存单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.inventoryUnitIds" placeholder="请输入" disabled
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="条码" prop="deleteUserId">
<template slot="header">
<span class="required-sign">*</span>条码
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.barCode" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="加工单位" v-if="judgeShow('workorderproduct-unitId')"
prop="unitId">
<template slot="header">
@ -258,14 +301,14 @@
</div> -->
<el-table :data="dataForm.workOrderPrimaryList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="商品id" v-if="judgeShow('workorderprimary-productId')"
<el-table-column label="商品名称" v-if="judgeShow('workorderprimary-productId')"
prop="productId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('workorderprimaryList-productId')">*</span>商品id
v-if="judgeRequired('workorderprimaryList-productId')">*</span>商品名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="dataForm.productId" @change="changeProductIdData"
<JnpfPopupSelect v-model="dataForm.productId" @change="changeDataProductList"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.workorderprimaryproductId" placeholder="请选择"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
@ -275,6 +318,49 @@
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="存货类型" prop="creatorUserId">
<template slot="header">
<span class="required-sign">*</span>存货类型
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.productTypeIds" placeholder="请输入" disabled
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="规格" prop="creatorUserId">
<template slot="header">
<span class="required-sign">*</span>规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.spec" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="库存单位" prop="lastModifyUserId">
<template slot="header">
<span class="required-sign">*</span>库存单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.inventoryUnitIds" placeholder="请输入" disabled
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="条码" prop="deleteUserId">
<template slot="header">
<span class="required-sign">*</span>条码
</template>
<template slot-scope="scope">
<JnpfInput v-model="dataForm.barCode" placeholder="请输入" disabled clearable
:style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<!-- <template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId"
@ -290,7 +376,7 @@
</JnpfPopupSelect>
</template>
-->
</el-table-column>
<el-table-column label="理论发料量" v-if="judgeShow('workorderprimary-theoryNum')"
prop="theoryNum">
<template slot="header">
@ -541,8 +627,15 @@ export default {
},
mounted() { },
methods: {
changeProductIdData(model, row) {
changeDataProductList(model, row) {
debugger
this.dataForm.spec = row.spec
this.dataForm.inventoryType = row.inventory_types
this.dataForm.inventoryUnitIds = row.inventory_unit_ids
this.dataForm.salesMainUnitIds = row.sales_main_unit_ids
this.dataForm.barCode = row.bar_code
this.dataForm.operateUnitIds = row.operate_unit_ids
this.dataForm.productTypeIds = row.product_type_ids
},
changeData(model, index) {
@ -685,7 +778,7 @@ export default {
const e = this.dataForm.workOrderPrimaryList[i];
if (!e.productId) {
this.$message({
message: '商品id不能为空',
message: '商品名称不能为空',
type: 'error',
duration: 1000
});

Loading…
Cancel
Save