jg-waiwang-pro
XI_TENG\xixi_ 8 months ago
parent ebcf2a3192
commit 2ff5c0989f

@ -0,0 +1,11 @@
<?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.WarehousingReportlossMapper">
<select id="queryReportlossSum" resultType="String">
SELECT SUM(reportloss_number) AS reportSum FROM jg_warehousing_reportloss_product t1
LEFT JOIN jg_warehousing_reportloss t2 ON t2.id=t1.reportloss_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.WarehousingReportlossProductMapper">
</mapper>

@ -0,0 +1,18 @@
package jnpf.mapper;
import jnpf.entity.WarehousingReportlossEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* warehousingReportloss
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-22
*/
public interface WarehousingReportlossMapper extends BaseMapper<WarehousingReportlossEntity> {
//报损总数量
String queryReportlossSum(String id);
}

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

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.warehousingreportloss.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingReportloss
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-22
*/
public interface WarehousingReportlossProductService extends IService<WarehousingReportlossProductEntity> {
QueryWrapper<WarehousingReportlossProductEntity> getChild(WarehousingReportlossPagination pagination,QueryWrapper<WarehousingReportlossProductEntity> warehousingReportlossProductQueryWrapper);
}

@ -0,0 +1,41 @@
package jnpf.service;
import jnpf.model.warehousingreportloss.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingReportloss
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-22
*/
public interface WarehousingReportlossService extends IService<WarehousingReportlossEntity> {
List<WarehousingReportlossEntity> getList(WarehousingReportlossPagination warehousingReportlossPagination);
List<WarehousingReportlossEntity> getTypeList(WarehousingReportlossPagination warehousingReportlossPagination,String dataType);
WarehousingReportlossEntity getInfo(String id);
void delete(WarehousingReportlossEntity entity);
void create(WarehousingReportlossEntity entity);
boolean update(String id, WarehousingReportlossEntity entity);
//子表方法
List<WarehousingReportlossProductEntity> getWarehousingReportlossProductList(String id,WarehousingReportlossPagination warehousingReportlossPagination);
List<WarehousingReportlossProductEntity> getWarehousingReportlossProductList(String id);
//副表数据方法
String checkForm(WarehousingReportlossForm form,int i);
void saveOrUpdate(WarehousingReportlossForm warehousingReportlossForm,String id, boolean isSave) throws Exception;
//查询报损总数量
String queryReportlossSum(String id);
}

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

@ -0,0 +1,414 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingReportlossMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousingreportloss.*;
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;
/**
*
* warehousingReportloss
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-22
*/
@Service
public class WarehousingReportlossServiceImpl extends ServiceImpl<WarehousingReportlossMapper, WarehousingReportlossEntity> implements WarehousingReportlossService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingReportlossProductService warehousingReportlossProductService;
@Autowired
private WarehousingReportlossMapper warehousingReportlossMapper;
@Override
public List<WarehousingReportlossEntity> getList(WarehousingReportlossPagination warehousingReportlossPagination){
return getTypeList(warehousingReportlossPagination,warehousingReportlossPagination.getDataType());
}
/** 列表查询 */
@Override
public List<WarehousingReportlossEntity> getTypeList(WarehousingReportlossPagination warehousingReportlossPagination,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 ? WarehousingReportlossConstant.getAppColumnData() : WarehousingReportlossConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int warehousingReportlossNum =0;
QueryWrapper<WarehousingReportlossEntity> warehousingReportlossQueryWrapper=new QueryWrapper<>();
int warehousingReportlossProductNum =0;
QueryWrapper<WarehousingReportlossProductEntity> warehousingReportlossProductQueryWrapper=new QueryWrapper<>();
long warehousingReportlossProductcount = warehousingReportlossProductService.count();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(warehousingReportlossPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = warehousingReportlossPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<WarehousingReportlossEntity> warehousingReportlossSuperWrapper = new QueryWrapper<>();
warehousingReportlossSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingReportlossSuperWrapper,WarehousingReportlossEntity.class,queryJson,"0"));
int warehousingReportlossNum1 = warehousingReportlossSuperWrapper.getExpression().getNormal().size();
if (warehousingReportlossNum1>0){
List<String> warehousingReportlossList =this.list(warehousingReportlossSuperWrapper).stream().map(WarehousingReportlossEntity::getId).collect(Collectors.toList());
allSuperList.addAll(warehousingReportlossList);
intersectionSuperList.add(warehousingReportlossList);
superNum++;
}
String warehousingReportlossProductTable = "jg_warehousing_reportloss_product";
boolean warehousingReportlossProductHasSql = queryJson.contains(warehousingReportlossProductTable);
List<String> warehousingReportlossProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingReportlossConstant.getTableList(), warehousingReportlossProductTable , queryJson, null);
if (warehousingReportlossProductHasSql){
allSuperList.addAll(warehousingReportlossProductList);
intersectionSuperList.add(warehousingReportlossProductList);
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<WarehousingReportlossEntity> warehousingReportlossSuperWrapper = new QueryWrapper<>();
warehousingReportlossSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingReportlossSuperWrapper,WarehousingReportlossEntity.class,ruleJson,"0"));
int warehousingReportlossNum1 = warehousingReportlossSuperWrapper.getExpression().getNormal().size();
if (warehousingReportlossNum1>0){
List<String> warehousingReportlossList =this.list(warehousingReportlossSuperWrapper).stream().map(WarehousingReportlossEntity::getId).collect(Collectors.toList());
allRuleList.addAll(warehousingReportlossList);
intersectionRuleList.add(warehousingReportlossList);
ruleNum++;
}
String warehousingReportlossProductTable = "jg_warehousing_reportloss_product";
boolean warehousingReportlossProductHasSql = ruleJson.contains(warehousingReportlossProductTable);
List<String> warehousingReportlossProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingReportlossConstant.getTableList(), warehousingReportlossProductTable , ruleJson, null);
if (warehousingReportlossProductHasSql){
allRuleList.addAll(warehousingReportlossProductList);
intersectionRuleList.add(warehousingReportlossProductList);
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 warehousingReportlossObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingReportlossQueryWrapper,WarehousingReportlossEntity.class,warehousingReportlossPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingReportlossObj)){
return new ArrayList<>();
} else {
warehousingReportlossQueryWrapper = (QueryWrapper<WarehousingReportlossEntity>)warehousingReportlossObj;
if( warehousingReportlossQueryWrapper.getExpression().getNormal().size()>0){
warehousingReportlossNum++;
}
}
Object warehousingReportlossProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingReportlossProductQueryWrapper,WarehousingReportlossProductEntity.class,warehousingReportlossPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingReportlossProductObj)){
return new ArrayList<>();
} else {
warehousingReportlossProductQueryWrapper = (QueryWrapper<WarehousingReportlossProductEntity>)warehousingReportlossProductObj;
if( warehousingReportlossProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingReportlossProductNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehousingReportlossObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingReportlossQueryWrapper,WarehousingReportlossEntity.class,warehousingReportlossPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingReportlossObj)){
return new ArrayList<>();
} else {
warehousingReportlossQueryWrapper = (QueryWrapper<WarehousingReportlossEntity>)warehousingReportlossObj;
if( warehousingReportlossQueryWrapper.getExpression().getNormal().size()>0){
warehousingReportlossNum++;
}
}
Object warehousingReportlossProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingReportlossProductQueryWrapper,WarehousingReportlossProductEntity.class,warehousingReportlossPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingReportlossProductObj)){
return new ArrayList<>();
} else {
warehousingReportlossProductQueryWrapper = (QueryWrapper<WarehousingReportlossProductEntity>)warehousingReportlossProductObj;
if( warehousingReportlossProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingReportlossProductNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(warehousingReportlossPagination.getReportlossTime())){
warehousingReportlossNum++;
List ReportlossTimeList = JsonUtil.getJsonToList(warehousingReportlossPagination.getReportlossTime(),String.class);
Long fir = Long.valueOf(String.valueOf(ReportlossTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(ReportlossTimeList.get(1)));
warehousingReportlossQueryWrapper.lambda().ge(WarehousingReportlossEntity::getReportlossTime, new Date(fir))
.le(WarehousingReportlossEntity::getReportlossTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if(ObjectUtil.isNotEmpty(warehousingReportlossPagination.getReportlossType())){
warehousingReportlossNum++;
List<String> idList = new ArrayList<>();
try {
String[][] reportlossType = JsonUtil.getJsonToBean(warehousingReportlossPagination.getReportlossType(),String[][].class);
for(int i=0;i<reportlossType.length;i++){
if(reportlossType[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(reportlossType[i])));
}
}
}catch (Exception e1){
try {
List<String> reportlossType = JsonUtil.getJsonToList(warehousingReportlossPagination.getReportlossType(),String.class);
if(reportlossType.size()>0){
idList.addAll(reportlossType);
}
}catch (Exception e2){
idList.add(String.valueOf(warehousingReportlossPagination.getReportlossType()));
}
}
warehousingReportlossQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(WarehousingReportlossEntity::getReportlossType, tt).or();
});
});
}
if(ObjectUtil.isNotEmpty(warehousingReportlossPagination.getReportlossCode())){
warehousingReportlossNum++;
String value = warehousingReportlossPagination.getReportlossCode() instanceof List ?
JsonUtil.getObjectToString(warehousingReportlossPagination.getReportlossCode()) :
String.valueOf(warehousingReportlossPagination.getReportlossCode());
warehousingReportlossQueryWrapper.lambda().like(WarehousingReportlossEntity::getReportlossCode,value);
}
}
if(warehousingReportlossProductNum>0){
List<String> warehousingReportlossProductIdList = warehousingReportlossProductService.list(warehousingReportlossProductQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getReportlossId())).map(t->t.getReportlossId()).collect(Collectors.toList());
long count = warehousingReportlossProductService.count();
if (count>0){
intersectionList.add(warehousingReportlossProductIdList);
}
AllIdList.addAll(warehousingReportlossProductIdList);
}
total+=warehousingReportlossProductNum;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
warehousingReportlossQueryWrapper.lambda().in(WarehousingReportlossEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
warehousingReportlossQueryWrapper.lambda().and(t->t.in(WarehousingReportlossEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
warehousingReportlossQueryWrapper.lambda().and(t->t.in(WarehousingReportlossEntity::getId, finalAllRuleIDlist));
}
//假删除标志
warehousingReportlossQueryWrapper.lambda().isNull(WarehousingReportlossEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(warehousingReportlossPagination.getSidx())){
warehousingReportlossQueryWrapper.lambda().orderByDesc(WarehousingReportlossEntity::getId);
}else{
try {
String sidx = warehousingReportlossPagination.getSidx();
String[] strs= sidx.split("_name");
WarehousingReportlossEntity warehousingReportlossEntity = new WarehousingReportlossEntity();
Field declaredField = warehousingReportlossEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
warehousingReportlossQueryWrapper="asc".equals(warehousingReportlossPagination.getSort().toLowerCase())?warehousingReportlossQueryWrapper.orderByAsc(value):warehousingReportlossQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<WarehousingReportlossEntity> page=new Page<>(warehousingReportlossPagination.getCurrentPage(), warehousingReportlossPagination.getPageSize());
IPage<WarehousingReportlossEntity> userIPage=this.page(page, warehousingReportlossQueryWrapper);
return warehousingReportlossPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WarehousingReportlossEntity> list = new ArrayList();
return warehousingReportlossPagination.setData(list, list.size());
}
}else{
return this.list(warehousingReportlossQueryWrapper);
}
}
@Override
public WarehousingReportlossEntity getInfo(String id){
QueryWrapper<WarehousingReportlossEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingReportlossEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(WarehousingReportlossEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, WarehousingReportlossEntity entity){
return this.updateById(entity);
}
@Override
public void delete(WarehousingReportlossEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** WarehousingReportlossProduct子表方法 */
@Override
public List<WarehousingReportlossProductEntity> getWarehousingReportlossProductList(String id,WarehousingReportlossPagination warehousingReportlossPagination){
Map<String, Object> newtabMap=WarehousingReportlossConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="warehousingReportlossProduct";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<WarehousingReportlossProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = warehousingReportlossProductService.getChild(warehousingReportlossPagination,queryWrapper);
queryWrapper.lambda().eq(WarehousingReportlossProductEntity::getReportlossId, id);
generaterSwapUtil.wrapperHandle(WarehousingReportlossConstant.getColumnData(), WarehousingReportlossConstant.getAppColumnData(), queryWrapper,WarehousingReportlossProductEntity.class,"sub",tableName);
return warehousingReportlossProductService.list(queryWrapper);
}
/** WarehousingReportlossProduct子表方法 */
@Override
public List<WarehousingReportlossProductEntity> getWarehousingReportlossProductList(String id){
QueryWrapper<WarehousingReportlossProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingReportlossProductEntity::getReportlossId, id);
return warehousingReportlossProductService.list(queryWrapper);
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(WarehousingReportlossForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
//子表字段验证
if (form.getWarehousingReportlossProductList()!=null){
}
return countRecover;
}
/**
* ()
* @param id
* @param warehousingReportlossForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(WarehousingReportlossForm warehousingReportlossForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
warehousingReportlossForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WarehousingReportlossConstant.getFormData(),warehousingReportlossForm),WarehousingReportlossForm.class);
WarehousingReportlossEntity entity = JsonUtil.getJsonToBean(warehousingReportlossForm, WarehousingReportlossEntity.class);
if(isSave){
String mainId = id ;
entity.setReportlossCode(generaterSwapUtil.getBillNumber("warehousingReportloss", false));
entity.setId(mainId);
entity.setFlowId(warehousingReportlossForm.getFlowId());
entity.setVersion(0);
}else{
entity.setReportlossCode(generaterSwapUtil.getBillNumber("warehousingReportloss", false));
entity.setFlowId(warehousingReportlossForm.getFlowId());
}
this.saveOrUpdate(entity);
//WarehousingReportlossProduct子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingReportlossProductEntity> WarehousingReportlossProductqueryWrapper = new QueryWrapper<>();
WarehousingReportlossProductqueryWrapper.lambda().eq(WarehousingReportlossProductEntity::getReportlossId, entity.getId());
warehousingReportlossProductService.remove(WarehousingReportlossProductqueryWrapper);
}
if (warehousingReportlossForm.getWarehousingReportlossProductList()!=null){
List<WarehousingReportlossProductEntity> tableField109 = JsonUtil.getJsonToList(warehousingReportlossForm.getWarehousingReportlossProductList(),WarehousingReportlossProductEntity.class);
for(WarehousingReportlossProductEntity entitys : tableField109){
entitys.setId(RandomUtil.uuId());
entitys.setReportlossId(entity.getId());
if(isSave){
}else{
}
warehousingReportlossProductService.saveOrUpdate(entitys);
}
}
}
@Override
public String queryReportlossSum(String id) {
return warehousingReportlossMapper.queryReportlossSum(id);
}
}

@ -0,0 +1,426 @@
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.warehousingreportloss.*;
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;
/**
* warehousingReportloss
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-22
*/
@Slf4j
@RestController
@Tag(name = "warehousingReportloss" , description = "scm")
@RequestMapping("/api/scm/WarehousingReportloss")
public class WarehousingReportlossController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingReportlossService warehousingReportlossService;
@Autowired
private WarehousingReportlossProductService warehousingReportlossProductService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param warehousingReportlossPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody WarehousingReportlossPagination warehousingReportlossPagination)throws IOException{
List<WarehousingReportlossEntity> list= warehousingReportlossService.getList(warehousingReportlossPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingReportlossEntity entity : list) {
entity.setReportlossSum(warehousingReportlossService.queryReportlossSum(entity.getId()));
Map<String, Object> warehousingReportlossMap=JsonUtil.entityToMap(entity);
warehousingReportlossMap.put("id", warehousingReportlossMap.get("id"));
//副表数据
//子表数据
List<WarehousingReportlossProductEntity> warehousingReportlossProductList = warehousingReportlossService.getWarehousingReportlossProductList(entity.getId(),warehousingReportlossPagination);
warehousingReportlossMap.put("tableField109",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingReportlossProductList)));
realList.add(warehousingReportlossMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingReportlossConstant.getFormData(), WarehousingReportlossConstant.getColumnData(), warehousingReportlossPagination.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(warehousingReportlossPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param warehousingReportlossForm
* @return
*/
@PostMapping("/{id}")
@Operation(summary = "创建")
public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid WarehousingReportlossForm warehousingReportlossForm) {
String b = warehousingReportlossService.checkForm(warehousingReportlossForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
warehousingReportlossService.saveOrUpdate(warehousingReportlossForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody WarehousingReportlossPagination warehousingReportlossPagination) throws IOException {
if (StringUtil.isEmpty(warehousingReportlossPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<WarehousingReportlossEntity> list= warehousingReportlossService.getList(warehousingReportlossPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingReportlossEntity entity : list) {
Map<String, Object> warehousingReportlossMap=JsonUtil.entityToMap(entity);
warehousingReportlossMap.put("id", warehousingReportlossMap.get("id"));
//副表数据
//子表数据
List<WarehousingReportlossProductEntity> warehousingReportlossProductList = warehousingReportlossService.getWarehousingReportlossProductList(entity.getId(),warehousingReportlossPagination);
warehousingReportlossMap.put("tableField109",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingReportlossProductList)));
realList.add(warehousingReportlossMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingReportlossConstant.getFormData(), WarehousingReportlossConstant.getColumnData(), warehousingReportlossPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(warehousingReportlossPagination.getSelectKey())?warehousingReportlossPagination.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 tableField109ExcelEntity = new ExcelExportEntity("","tableField109");
List<ExcelExportEntity> tableField109List = new ArrayList<>();
for(String key:keys){
switch(key){
case "reportlossCode" :
entitys.add(new ExcelExportEntity("报损单编号" ,"reportlossCode"));
break;
case "reportlossType" :
entitys.add(new ExcelExportEntity("单据类型" ,"reportlossType"));
break;
case "reportlossTime" :
entitys.add(new ExcelExportEntity("报损时间" ,"reportlossTime"));
break;
case "reportlossReason" :
entitys.add(new ExcelExportEntity("报损原因" ,"reportlossReason"));
break;
case "warehouseId" :
entitys.add(new ExcelExportEntity("仓库名称" ,"warehouseId"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "tableField109-productId":
tableField109List.add(new ExcelExportEntity("商品名称" ,"productId"));
break;
case "tableField109-reportlossUnit":
tableField109List.add(new ExcelExportEntity("报损单位" ,"reportlossUnit"));
break;
case "tableField109-reportlossNumber":
tableField109List.add(new ExcelExportEntity("报损数量" ,"reportlossNumber"));
break;
default:
break;
}
}
if(tableField109List.size() > 0){
tableField109ExcelEntity.setList(tableField109List);
entitys.add(tableField109ExcelEntity);
}
}
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(WarehousingReportlossConstant.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 warehousingReportlossForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid WarehousingReportlossForm warehousingReportlossForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
warehousingReportlossForm.setId(id);
if (!isImport) {
String b = warehousingReportlossService.checkForm(warehousingReportlossForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
WarehousingReportlossEntity entity= warehousingReportlossService.getInfo(id);
if(entity!=null){
try{
warehousingReportlossService.saveOrUpdate(warehousingReportlossForm,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){
WarehousingReportlossEntity entity= warehousingReportlossService.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);
warehousingReportlossService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
WarehousingReportlossEntity entity= warehousingReportlossService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingReportlossMap=JsonUtil.entityToMap(entity);
warehousingReportlossMap.put("id", warehousingReportlossMap.get("id"));
//副表数据
//子表数据
List<WarehousingReportlossProductEntity> warehousingReportlossProductList = warehousingReportlossService.getWarehousingReportlossProductList(entity.getId());
warehousingReportlossMap.put("tableField109",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingReportlossProductList)));
warehousingReportlossMap = generaterSwapUtil.swapDataDetail(warehousingReportlossMap,WarehousingReportlossConstant.getFormData(),"530031733014287557",false);
return ActionResult.success(warehousingReportlossMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
WarehousingReportlossEntity entity= warehousingReportlossService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingReportlossMap=JsonUtil.entityToMap(entity);
warehousingReportlossMap.put("id", warehousingReportlossMap.get("id"));
//副表数据
//子表数据
List<WarehousingReportlossProductEntity> warehousingReportlossProductList = warehousingReportlossService.getWarehousingReportlossProductList(entity.getId());
warehousingReportlossMap.put("warehousingReportlossProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingReportlossProductList)));
warehousingReportlossMap = generaterSwapUtil.swapDataForm(warehousingReportlossMap,WarehousingReportlossConstant.getFormData(),WarehousingReportlossConstant.TABLEFIELDKEY,WarehousingReportlossConstant.TABLERENAMES);
return ActionResult.success(warehousingReportlossMap);
}
}

@ -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-22
*/
@Data
@TableName("jg_warehousing_reportloss")
public class WarehousingReportlossEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "REPORTLOSS_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String reportlossCode;
@TableField(value = "REPORTLOSS_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String reportlossType;
@TableField(value = "REPORTLOSS_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date reportlossTime;
@TableField(value = "REPORTLOSS_REASON" , updateStrategy = FieldStrategy.IGNORED)
private String reportlossReason;
@TableField("REPORTLOSS_STATUS")
private String reportlossStatus;
@TableField(value = "WAREHOUSE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String warehouseId;
@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("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 reportlossSum;
}

@ -0,0 +1,54 @@
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-22
*/
@Data
@TableName("jg_warehousing_reportloss_product")
public class WarehousingReportlossProductEntity {
@TableId(value ="ID" )
private String id;
@TableField("REPORTLOSS_ID")
private String reportlossId;
@TableField(value = "PRODUCT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String productId;
@TableField("PHYSICAL_INVENTORY")
private BigDecimal physicalInventory;
@TableField("AVAILABLE_STOCK")
private BigDecimal availableStock;
@TableField(value = "REPORTLOSS_UNIT" , updateStrategy = FieldStrategy.IGNORED)
private String reportlossUnit;
@TableField(value = "REPORTLOSS_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal reportlossNumber;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
}

@ -0,0 +1,47 @@
package jnpf.model.warehousingreportloss;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* warehousingReportloss
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-22
*/
@Data
public class WarehousingReportlossForm {
/** 主键 */
private String id;
/** 子表数据 **/
@JsonProperty("warehousingReportlossProductList")
private List<WarehousingReportlossProductModel> warehousingReportlossProductList;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 流程id **/
@JsonProperty("flowId")
private String flowId;
/** 报损单编号 **/
@JsonProperty("reportlossCode")
private String reportlossCode;
/** 单据类型 **/
@JsonProperty("reportlossType")
private Object reportlossType;
/** 报损时间 **/
@JsonProperty("reportlossTime")
private String reportlossTime;
/** 报损原因 **/
@JsonProperty("reportlossReason")
private Object reportlossReason;
/** 仓库名称 **/
@JsonProperty("warehouseId")
private String warehouseId;
/** 备注 **/
@JsonProperty("remark")
private String remark;
}

@ -0,0 +1,39 @@
package jnpf.model.warehousingreportloss;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* warehousingReportloss
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-22
*/
@Data
public class WarehousingReportlossPagination 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("reportlossTime")
private Object reportlossTime;
/** 单据类型 */
@JsonProperty("reportlossType")
private Object reportlossType;
/** 报损单编号 */
@JsonProperty("reportlossCode")
private Object reportlossCode;
}

@ -0,0 +1,30 @@
package jnpf.model.warehousingreportloss;
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;
/**
*
* warehousingReportloss
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-02-22
*/
@Data
public class WarehousingReportlossProductModel {
/** 商品名称 **/
@JSONField(name = "productId")
private String productId;
/** 报损单位 **/
@JSONField(name = "reportlossUnit")
private String reportlossUnit;
/** 报损数量 **/
@JSONField(name = "reportlossNumber")
private String reportlossNumber;
}

@ -400,7 +400,7 @@ export default {
missingDiskRuleProps: { "label": "fullName", "value": "id" }, missingDiskRuleProps: { "label": "fullName", "value": "id" },
duplicateInventoryRuleOptions: [{ "fullName": "累加汇总", "id": "1" }, { "fullName": "覆盖更新", "id": "2" }], duplicateInventoryRuleOptions: [{ "fullName": "累加汇总", "id": "1" }, { "fullName": "覆盖更新", "id": "2" }],
duplicateInventoryRuleProps: { "label": "fullName", "value": "id" }, duplicateInventoryRuleProps: { "label": "fullName", "value": "id" },
warehousinginventoryproductproductIdcolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "商品编码", "value": "code" }, { "label": "批次号", "value": "batch_number" },], warehousinginventoryproductproductIdcolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "商品编码", "value": "code" }, { "label": "批次号", "value": "batchNumber" },],
childIndex: -1, childIndex: -1,
isEdit: false, isEdit: false,
interfaceRes: { interfaceRes: {

@ -13,16 +13,14 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="业务类型"> <el-form-item label="业务类型">
<JnpfSelect v-model="query.inventoryType" placeholder="请选择" clearable <JnpfSelect v-model="query.inventoryType" placeholder="请选择" clearable
:options="inventoryTypeOptions" :options="inventoryTypeOptions" :props="inventoryTypeProps">
:props="inventoryTypeProps" >
</JnpfSelect> </JnpfSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="盘点开始时间"> <el-form-item label="盘点开始时间">
<JnpfDateRangePicker v-model="query.inventoryTimeStart" <JnpfDateRangePicker v-model="query.inventoryTimeStart" format="yyyy-MM-dd"
format="yyyy-MM-dd" startPlaceholder="开始日期" startPlaceholder="开始日期" endPlaceholder="结束日期">
endPlaceholder="结束日期" >
</JnpfDateRangePicker> </JnpfDateRangePicker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -48,7 +46,8 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button> <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 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 type="text" icon="el-icon-arrow-down" @click="showAll=true"
v-if="!showAll">
展开 展开
</el-button> </el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else> <el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
@ -61,11 +60,14 @@
<div class="JNPF-common-layout-main JNPF-flex-main"> <div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head"> <div class="JNPF-common-head">
<div> <div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'" @click="addOrUpdateHandle()"> <el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
@click="addOrUpdateHandle()">新增
</el-button> </el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()" v-has="'btn_download'" >导出 <el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()"
v-has="'btn_download'">导出
</el-button> </el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()" v-has="'btn_batchRemove'" >批量删除 <el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()"
v-has="'btn_batchRemove'">批量删除
</el-button> </el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
@ -79,52 +81,35 @@
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange" <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
:span-method="arraySpanMethod" @selection-change="handleSelectionChange" :span-method="arraySpanMethod">
<el-table-column label="业务类型" prop="inventoryType" algin="left">
>
<el-table-column label="业务类型" prop="inventoryType" algin="left"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.inventoryType}} {{ scope.row.inventoryType}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="warehouseId" label="仓库名称" align="left">
prop="warehouseId"
label="仓库名称" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="inventoryTimeStart" label="盘点开始时间" align="left">
prop="inventoryTimeStart"
label="盘点开始时间" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="documentNo" label="单据编号" align="left">
prop="documentNo"
label="单据编号" align="left"
>
</el-table-column> </el-table-column>
<el-table-column
prop="creatorUserId" <el-table-column prop="ProductNum" label="商品种类数" align="left">
label="创建用户" align="left"
>
</el-table-column> </el-table-column>
<el-table-column
prop="creatorTime" <el-table-column prop="ProductSum" label="商品总数量" align="left">
label="创建时间" align="left"
>
</el-table-column> </el-table-column>
<el-table-column
prop="lastModifyUserId" <el-table-column prop="creatorUserId" label="创建用户" align="left">
label="修改用户" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="creatorTime" label="创建时间" align="left">
prop="lastModifyTime"
label="修改时间" align="left"
>
</el-table-column> </el-table-column>
<el-table-column prop="flowState" label="状态" width="100" > <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"> <template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag> <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="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
@ -134,27 +119,26 @@
<el-tag type="warning" v-else></el-tag> <el-tag type="warning" v-else></el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" fixed="right" width="150">
fixed="right" width="150" > <template slot-scope="scope">
<template slot-scope="scope" >
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1" <el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'" >编辑 @click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
</el-button> </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 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>
<el-button size="mini" type="text" :disabled="!scope.row.flowState" <el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)" @click="updateHandle(scope.row,scope.row.flowState)">详情</el-button>
>详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/> <pagination :total="total" :page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize" @pagination="initData" />
</div> </div>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/> <JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/> <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" /> <FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<el-dialog title="请选择流程" :close-on-click-modal="false" append-to-body <el-dialog title="请选择流程" :close-on-click-modal="false" append-to-body
@ -168,8 +152,9 @@
</el-dialog> </el-dialog>
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" /> <ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/> <Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" /> <ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail"
@close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" <SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" /> @superQuery="superQuery" />
</div> </div>
@ -177,39 +162,39 @@
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import {getDictionaryDataSelector} from '@/api/systemData/dictionary' import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getFormById } from '@/api/workFlow/FormDesign' import { getFormById } from '@/api/workFlow/FormDesign'
import { getFlowList } from '@/api/workFlow/FlowEngine' import { getFlowList } from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox' import FlowBox from '@/views/workFlow/components/FlowBox'
import ExportBox from '@/components/ExportBox' import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail' import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface' import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev' import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user' import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize' import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList' import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery' import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson' import superQueryJson from './superQueryJson'
export default { export default {
components: { components: {
FlowBox, FlowBox,
ExportBox,ToFormDetail , SuperQuery ExportBox, ToFormDetail, SuperQuery
}, },
data() { data() {
return { return {
keyword:'', keyword: '',
expandsTree: true, expandsTree: true,
refreshTree: true, refreshTree: true,
toFormDetailVisible:false, toFormDetailVisible: false,
expandObj:{}, expandObj: {},
columnOptions: [], columnOptions: [],
mergeList: [], mergeList: [],
exportList:[], exportList: [],
columnList, columnList,
showAll: false, showAll: false,
@ -218,11 +203,11 @@
uploadBoxVisible: false, uploadBoxVisible: false,
detailVisible: false, detailVisible: false,
query: { query: {
inventoryType:undefined, inventoryType: undefined,
inventoryTimeStart:undefined, inventoryTimeStart: undefined,
documentNo:undefined, documentNo: undefined,
creatorUserId:undefined, creatorUserId: undefined,
creatorTime:undefined, creatorTime: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -246,18 +231,18 @@
flowListVisible: false, flowListVisible: false,
flowList: [], flowList: [],
exportBoxVisible: false, exportBoxVisible: false,
inventoryTypeOptions:[{"fullName":"日常盘点单","id":"1"},{"fullName":"业务盘点单","id":"2"}], inventoryTypeOptions: [{ "fullName": "日常盘点单", "id": "1" }, { "fullName": "业务盘点单", "id": "2" }],
inventoryTypeProps:{"label":"fullName","value":"id" }, inventoryTypeProps: { "label": "fullName", "value": "id" },
stocktakingModeOptions:[{"fullName":"静态盘点","id":"1"},{"fullName":"动态盘点","id":"2"}], stocktakingModeOptions: [{ "fullName": "静态盘点", "id": "1" }, { "fullName": "动态盘点", "id": "2" }],
stocktakingModeProps:{"label":"fullName","value":"id" }, stocktakingModeProps: { "label": "fullName", "value": "id" },
missingDiskRuleOptions:[{"fullName":"漏盘商品不做盈亏调整","id":"1"},{"fullName":"漏盘商品账面库存自动清零","id":"2"}], missingDiskRuleOptions: [{ "fullName": "漏盘商品不做盈亏调整", "id": "1" }, { "fullName": "漏盘商品账面库存自动清零", "id": "2" }],
missingDiskRuleProps:{"label":"fullName","value":"id" }, missingDiskRuleProps: { "label": "fullName", "value": "id" },
duplicateInventoryRuleOptions:[{"fullName":"累加汇总","id":"1"},{"fullName":"覆盖更新","id":"2"}], duplicateInventoryRuleOptions: [{ "fullName": "累加汇总", "id": "1" }, { "fullName": "覆盖更新", "id": "2" }],
duplicateInventoryRuleProps:{"label":"fullName","value":"id" }, duplicateInventoryRuleProps: { "label": "fullName", "value": "id" },
tableField112_productIdcolumnOptions:[ {"label":"商品名称","value":"name"}, {"label":"商品编码","value":"code"}, {"label":"批次号","value":"batch_number"},], tableField112_productIdcolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "商品编码", "value": "code" }, { "label": "批次号", "value": "batch_number" },],
interfaceRes: { interfaceRes: {
warehouseId:[] , warehouseId: [],
tableField112_productId: [] , tableField112_productId: [],
}, },
} }
}, },
@ -269,8 +254,8 @@
}, },
created() { created() {
getFormById("529993401664295493").then(res1 => { getFormById("529993401664295493").then(res1 => {
let flowId = res1.data&&res1.data.id let flowId = res1.data && res1.data.id
getFlowList(flowId,'1').then(res2 => { getFlowList(flowId, '1').then(res2 => {
this.flowList = res2.data this.flowList = res2.data
this.getColumnList(), this.getColumnList(),
this.initSearchDataAndListData() this.initSearchDataAndListData()
@ -310,9 +295,9 @@
}, },
loadNode(node, resolve) { loadNode(node, resolve) {
const nodeData = node.data const nodeData = node.data
const config ={ const config = {
treeInterfaceId:"", treeInterfaceId: "",
treeTemplateJson:[] treeTemplateJson: []
} }
if (config.treeInterfaceId) { if (config.treeInterfaceId) {
// //
@ -391,7 +376,7 @@
} }
}) })
newList.forEach(item => { newList.forEach(item => {
if (item.children && item.children.length ) { if (item.children && item.children.length) {
item.children.forEach((child, index) => { item.children.forEach((child, index) => {
if (index == 0) { if (index == 0) {
this.mergeList.push({ this.mergeList.push({
@ -429,13 +414,13 @@
} }
this.exportList = exportList this.exportList = exportList
}, },
goDetail(id){ goDetail(id) {
this.detailVisible = true this.detailVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.Detail.init(id) this.$refs.Detail.init(id)
}) })
}, },
sortChange({column, prop, order}) { sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc' this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop this.listQuery.sidx = !order ? '' : prop
this.initData() this.initData()
@ -454,16 +439,16 @@
...this.query, ...this.query,
keyword: this.keyword, keyword: this.keyword,
dataType: 0, dataType: 0,
menuId:this.menuId, menuId: this.menuId,
moduleId:'529993401664295493', moduleId: '529993401664295493',
type:1, type: 1,
}; };
request({ request({
url: `/api/scm/WarehousingInventory/getList`, url: `/api/scm/WarehousingInventory/getList`,
method: 'post', method: 'post',
data: _query data: _query
}).then(res => { }).then(res => {
var _list =res.data.list; var _list = res.data.list;
this.list = _list.map(o => ({ this.list = _list.map(o => ({
...o, ...o,
...this.expandObj, ...this.expandObj,
@ -491,10 +476,10 @@
}).catch(() => { }).catch(() => {
}); });
}, },
handelUpload(){ handelUpload() {
this.uploadBoxVisible = true this.uploadBoxVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.UploadBox.init("","scm/WarehousingInventory") this.$refs.UploadBox.init("", "scm/WarehousingInventory")
}) })
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
@ -541,11 +526,11 @@
this.listQuery.currentPage = 1 this.listQuery.currentPage = 1
this.initData() this.initData()
}, },
addOrUpdateHandle(row,flowState) { addOrUpdateHandle(row, flowState) {
if(!row){ if (!row) {
this.addHandle(); this.addHandle();
}else { } else {
this.updateHandle(row,flowState) this.updateHandle(row, flowState)
} }
}, },
exportData() { exportData() {
@ -555,7 +540,7 @@
}) })
}, },
download(data) { download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId} let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
request({ request({
url: `/api/scm/WarehousingInventory/Actions/Export`, url: `/api/scm/WarehousingInventory/Actions/Export`,
method: 'post', method: 'post',
@ -568,14 +553,14 @@
}) })
}, },
search() { search() {
this.listQuery.currentPage=1 this.listQuery.currentPage = 1
this.listQuery.pageSize=20 this.listQuery.pageSize = 20
this.listQuery.sort="desc" this.listQuery.sort = "desc"
this.listQuery.sidx="" this.listQuery.sidx = ""
this.initData() this.initData()
}, },
// //
updateHandle(row,flowState) { updateHandle(row, flowState) {
let data = { let data = {
id: row.id, id: row.id,
flowId: row.flowId || this.flowList[0].id, flowId: row.flowId || this.flowList[0].id,
@ -635,5 +620,5 @@
if (isrRefresh) this.reset() if (isrRefresh) this.reset()
}, },
} }
} }
</script> </script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,603 @@
<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('reportlossCode')">
<jnpf-form-tip-item label="报损单编号" v-if="judgeShow('reportlossCode')"
prop="reportlossCode">
<JnpfInput v-model="dataForm.reportlossCode" @change="changeData('reportlossCode',-1)"
placeholder="系统自动生成" :disabled="judgeWrite('reportlossCode')" readonly
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('reportlossType')">
<jnpf-form-tip-item label="单据类型" v-if="judgeShow('reportlossType')"
prop="reportlossType">
<JnpfSelect v-model="dataForm.reportlossType"
@change="changeData('reportlossType',-1)" placeholder="请选择"
:disabled="judgeWrite('reportlossType')" clearable :style='{"width":"100%"}'
:options="reportlossTypeOptions" :props="reportlossTypeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('reportlossTime')">
<jnpf-form-tip-item label="报损时间" v-if="judgeShow('reportlossTime')"
prop="reportlossTime">
<JnpfDatePicker v-model="dataForm.reportlossTime"
@change="changeData('reportlossTime',-1)" :startTime="dateTime(false,1,1,'','')"
:endTime="dateTime(false,1,1,'','')" placeholder="请选择"
:disabled="judgeWrite('reportlossTime')" clearable :style='{"width":"100%"}'
type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('reportlossReason')">
<jnpf-form-tip-item label="报损原因" v-if="judgeShow('reportlossReason')"
prop="reportlossReason">
<JnpfSelect v-model="dataForm.reportlossReason"
@change="changeData('reportlossReason',-1)" placeholder="请选择"
:disabled="judgeWrite('reportlossReason')" clearable :style='{"width":"100%"}'
:options="reportlossReasonOptions" :props="reportlossReasonProps">
</JnpfSelect>
</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')" 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="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.warehousingReportlossProductList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="商品名称"
v-if="judgeShow('warehousingreportlossproduct-productId')" prop="productId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingreportlossproductList-productId')">*</span>商品名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId" @change="reportlossProductBatch"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.warehousingreportlossproductproductId"
placeholder="请选择"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-productId')"
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='name' :field="'productId'+scope.$index"
interfaceId="529994958833209925" :pageSize="20"
:columnOptions="warehousingreportlossproductproductIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="报损单位"
v-if="judgeShow('warehousingreportlossproduct-reportlossUnit')"
prop="reportlossUnit">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingreportlossproductList-reportlossUnit')">*</span>报损单位
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.reportlossUnit"
@change="changeData('warehousingreportlossproduct-reportlossUnit',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.warehousingreportlossproductreportlossUnit"
placeholder="请选择"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-reportlossUnit')"
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='unit_name' :field="'reportlossUnit'+scope.$index"
interfaceId="529938341609623877" :pageSize="20"
:columnOptions="warehousingreportlossproductreportlossUnitcolumnOptions"
clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="规格" v-if="judgeShow('warehousingreportlossproduct-spec')"
prop="spec">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingreportlossproductList-spec')">*</span>规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.spec"
@change="changeData('warehousingreportlossproduct-spec',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-spec')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="库存单位"
v-if="judgeShow('warehousingreportlossproduct-inventoryUnitIds')"
prop="inventoryUnitIds">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingreportlossproductList-inventoryUnitIds')">*</span>库存单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.inventoryUnitIds"
@change="changeData('warehousinginventoryproduct-inventoryUnitIds',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-inventoryUnitIds')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="实物库存"
v-if="judgeShow('warehousingreportlossproduct-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('warehousingreportlossproduct-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('warehousingreportlossproduct-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('warehousingreportlossproduct-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('warehousingreportlossproduct-reportlossNumber')"
prop="reportlossNumber">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousingreportlossproductList-reportlossNumber')">*</span>报损数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.reportlossNumber"
@change="changeData('warehousingreportlossproduct-reportlossNumber',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-reportlossNumber')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50"
v-if="!judgeWrite('warehousingreportlossproductList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delwarehousingreportlossproductList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addwarehousingreportlossproductList()"
v-if="!judgeWrite('warehousingreportlossproductList')">
<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: {
warehousingReportlossProductList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
warehousingReportlossProductList: {
productId: '',
productIdOptions: [],
reportlossUnit: '',
reportlossUnitOptions: [],
reportlossNumber: '',
reportlossNumberOptions: [],
enabledmark: undefined
},
},
Vmodel: "",
currVmodel: "",
dataForm: {
reportlossCode: undefined,
reportlossType: undefined,
reportlossTime: undefined,
reportlossReason: undefined,
warehouseId: undefined,
remark: undefined,
warehousingReportlossProductList: [],
version: 0,
},
tableRequiredData: {},
dataRule:
{
reportlossType: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
reportlossTime: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
reportlossReason: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
warehouseId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
},
reportlossTypeOptions: [{ "fullName": "采购报损", "id": "1" }, { "fullName": "销售报损", "id": "2" }, { "fullName": "仓库报损", "id": "3" }, { "fullName": "加工报损", "id": "4" }, { "fullName": "其他报损", "id": "5" }],
reportlossTypeProps: { "label": "fullName", "value": "id" },
reportlossReasonOptions: [{ "fullName": "质量问题", "id": "1" }, { "fullName": "客户退回", "id": "2" }, { "fullName": "试用", "id": "3" }, { "fullName": "临期报废", "id": "4" }, { "fullName": "其他", "id": "5" }],
reportlossReasonProps: { "label": "fullName", "value": "id" },
warehouseIdcolumnOptions: [{ "label": "仓库名称", "value": "name" }, { "label": "仓库编码", "value": "code" },],
warehousingreportlossproductproductIdcolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "商品编码", "value": "code" }, { "label": "批次号", "value": "batchNumber" },],
warehousingreportlossproductreportlossUnitcolumnOptions: [{ "label": "单位", "value": "unit_name" },],
childIndex: -1,
isEdit: false,
interfaceRes: {
reportlossCode: [],
reportlossType: [],
reportlossTime: [],
reportlossReason: [],
warehouseId: [],
remark: [],
warehousingreportlossproductproductId: [],
warehousingreportlossproductreportlossUnit: [],
warehousingreportlossproductreportlossNumber: [],
},
}
},
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: {
reportlossProductBatch(model, row) {
this.dataForm.warehousingReportlossProductList.push(row)
this.dataForm.warehousingReportlossProductList.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("530031733014287557").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.warehousingreportlossproductExist()) return
return isOk
},
warehousingreportlossproductExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.warehousingReportlossProductList.length; i++) {
const e = this.dataForm.warehousingReportlossProductList[i];
}
return isOk;
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
this.dataForm.reportlossTime = new Date().getTime()
},
addwarehousingreportlossproductList() {
let item = {
productId: '',
reportlossUnit: '',
reportlossNumber: undefined,
}
this.getwarehousingreportlossproductList(item)
},
delwarehousingreportlossproductList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.warehousingReportlossProductList.splice(index, 1);
}).catch(() => {
});
},
getwarehousingreportlossproductList(value) {
let item = { ...this.tableRows.warehousingReportlossProductList, ...value }
this.dataForm.warehousingReportlossProductList.push(item)
this.childIndex = this.dataForm.warehousingReportlossProductList.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.warehousingReportlossProductList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
},
},
}
</script>

@ -0,0 +1,602 @@
<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="报损时间">
<JnpfDateRangePicker v-model="query.reportlossTime" format="yyyy-MM-dd"
startPlaceholder="开始日期" endPlaceholder="结束日期">
</JnpfDateRangePicker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单据类型">
<JnpfSelect v-model="query.reportlossType" placeholder="请选择" clearable
:options="reportlossTypeOptions" :props="reportlossTypeProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="报损单编号">
<el-input v-model="query.reportlossCode" 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="reportlossCode" label="报损单编号" align="left">
</el-table-column>
<el-table-column label="单据类型" prop="reportlossType" algin="left">
<template slot-scope="scope">
{{ scope.row.reportlossType}}
</template>
</el-table-column>
<el-table-column prop="reportlossTime" label="报损时间" align="left">
</el-table-column>
<el-table-column label="报损原因" prop="reportlossReason" algin="left">
<template slot-scope="scope">
{{ scope.row.reportlossReason}}
</template>
</el-table-column>
<el-table-column prop="warehouseId" label="仓库名称" align="left">
</el-table-column>
<el-table-column prop="reportlossSum" 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,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
reportlossTime: undefined,
reportlossType: undefined,
reportlossCode: 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,
reportlossTypeOptions: [{ "fullName": "采购报损", "id": "1" }, { "fullName": "销售报损", "id": "2" }, { "fullName": "仓库报损", "id": "3" }, { "fullName": "加工报损", "id": "4" }, { "fullName": "其他报损", "id": "5" }],
reportlossTypeProps: { "label": "fullName", "value": "id" },
reportlossReasonOptions: [{ "fullName": "质量问题", "id": "1" }, { "fullName": "客户退回", "id": "2" }, { "fullName": "试用", "id": "3" }, { "fullName": "临期报废", "id": "4" }, { "fullName": "其他", "id": "5" }],
reportlossReasonProps: { "label": "fullName", "value": "id" },
tableField109_productIdcolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "商品编码", "value": "code" }, { "label": "批次号", "value": "batch_number" },],
tableField109_reportlossUnitcolumnOptions: [{ "label": "单位", "value": "unit_name" },],
interfaceRes: {
warehouseId: [],
tableField109_productId: [],
tableField109_reportlossUnit: [],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
getFormById("530031733014287557").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: '530031733014287557',
type: 1,
};
request({
url: `/api/scm/WarehousingReportloss/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/WarehousingReportloss/${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/WarehousingReportloss")
})
},
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/WarehousingReportloss/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/WarehousingReportloss/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>

@ -566,7 +566,7 @@ export default {
}, },
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" }], 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" }, warehousingStorageTypeProps: { "label": "fullName", "value": "id" },
warehousingIdcolumnOptions: [{ "label": "通知编号", "value": "warehousing_code" }, { "label": "供应商id", "value": "subject_basic_id" }, { "label": "仓库id", "value": "warehouse_id" },], warehousingIdcolumnOptions: [{ "label": "通知编号", "value": "warehousing_code" }, { "label": "供应商名称", "value": "subjectName" }, { "label": "仓库名称", "value": "businessName" },],
warehouseIdcolumnOptions: [{ "label": "仓库编号", "value": "code" }, { "label": "仓库名称", "value": "name" }, { "label": "仓库简称", "value": "simple_name" },], 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" },], 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" },], warehousingstorageproductproductIdcolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "商品编码", "value": "code" }, { "label": "商品规格", "value": "spec" },],

@ -614,6 +614,8 @@ export default {
flowId: item.id, flowId: item.id,
opType: '-1' opType: '-1'
} }
// debugger
// console.log(item.id);
this.flowListVisible = false this.flowListVisible = false
this.flowVisible = true this.flowVisible = true
this.$nextTick(() => { this.$nextTick(() => {

File diff suppressed because one or more lines are too long

@ -1,448 +0,0 @@
<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>

@ -1,589 +0,0 @@
<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

@ -0,0 +1,982 @@
<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="529638640356183877" :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: "1",
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": "1" }],
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.firstSubjectBasicId
this.dataForm.shippingAddress = val2.receiveAddress
this.dataForm.enterpriseId = val2.enterpriseId
this.dataForm.warehouseId = val2.deliveryWarehouse
this.dataForm.deliveryAddress = val2.deliveryAddress
val2.businessOrderProductRelationalList.forEach((item, index) => {
item.productName = item.name
item.purchaseUnitId = item.salesMainUnitId
item.purchaseNum = item.businessNum
})
this.dataForm.warehousingProductList = val2.businessOrderProductRelationalList
},
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,616 @@
<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>
<el-button type="text" v-has="'btn-warehousing'" @click="addwarehousing()">
</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>
<!-- <el-button type="text" v-has="'btn-warehousing'" @click="addwarehousing()"> -->
<!-- </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> -->
<div class="template-item" v-for="item in flowList" :key="item.id"
@click="selectFlow(item)">{{"入库单"}}
</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" />
<purRouter v-if="purVisible" ref="purRouter" @refresh="initData" />
</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'
import purRouter from '@/views/scm/warehousing/warehousingstorage/form.vue'
export default {
components: {
FlowBox,
ExportBox, ToFormDetail, SuperQuery, purRouter
},
data() {
return {
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
purVisible: false,
query: {
warehousingCode: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
multipleSelectionItem: [],
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("1760244414589886466").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: {
addwarehousing() {
if (!this.multipleSelectionItem.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
} else if (this.multipleSelectionItem.length > 1) {
this.$message({
type: 'error',
message: '入库请选择其中一条数据',
duration: 1500,
})
return
}
const data = this.multipleSelectionItem
// this.multipleSelectionItem.warehousingId = this.multipleSelectionItem.id
// console.log(this.multipleSelectionItem);
// debugger
this.flowListVisible = true
this.$nextTick(() => {
this.$refs.purRouter.init(data)
})
},
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: '1760244414589886466',
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) {
this.multipleSelectionItem = 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: '529629824994529221',
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>

@ -1,60 +1,40 @@
<template> <template>
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-center"> <div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16"> <el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent> <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-col :span="6">
<el-form-item label="通知编号"> <el-form-item label="通知编号">
<el-input v-model="query.warehousingCode" placeholder="请输入" clearable> </el-input> <el-input v-model="query.warehousingCode" placeholder="请输入" clearable> </el-input>
</el-form-item> </el-form-item>
</el-col> </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-col :span="6">
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button> <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 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-form-item>
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
<div class="JNPF-common-layout-main JNPF-flex-main"> <div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head"> <!-- <div class="JNPF-common-head">
<div> <div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'" <el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
@click="addOrUpdateHandle()">新增 @click="addOrUpdateHandle()">新增
</el-button> </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>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true"> <el-tooltip content="高级查询" placement="top" v-if="true">
@ -66,60 +46,22 @@
@click="initData()" /> @click="initData()" />
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div> -->
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
:span-method="arraySpanMethod" fixed="left"> @selection-change="handleSelectionChange" :span-method="arraySpanMethod">
<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 prop="warehousingCode" label="通知编号" align="left">
</el-table-column> </el-table-column>
<el-table-column prop="businessId" label="关联单据号" align="left"> <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>
<el-table-column prop="subjectBasicId" label="客户名称" align="left">
<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>
<el-table-column prop="111" label="承运方式" align="left"> <el-table-column prop="shippingAddress" label="收货地址" align="left">
</el-table-column> </el-table-column>
<el-table-column prop="111" label="承运商" align="left"> <el-table-column prop="enterpriseId" label="机构名称" align="left">
</el-table-column>
<el-table-column prop="creatorTime" label="创建时间" align="left">
</el-table-column> </el-table-column>
<el-table-column prop="creatorUserId" label="创建用户" align="left"> <el-table-column prop="warehouseId" label="发货仓库" align="left">
</el-table-column> </el-table-column>
<el-table-column prop="deliveryAddress" label="发货地址" align="left">
<el-table-column prop="enterpriseId" label="机构名称" align="left">
</el-table-column> </el-table-column>
<el-table-column prop="flowState" label="状态" width="100"> <el-table-column prop="flowState" label="状态" width="100">
<template slot-scope="scope" v-if="!scope.row.top"> <template slot-scope="scope" v-if="!scope.row.top">
@ -133,18 +75,21 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="150"> <el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1" <el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'">编辑 @click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" <el-button type="text" class="JNPF-table-delBtn"
:disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1" v-has="'btn_remove'" :disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1" v-has="'btn_remove'"
@click="handleDel(scope.row.id)">删除 @click="handleDel(scope.row.id)">删除
</el-button> --> </el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState" <el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)">详情</el-button> @click="updateHandle(scope.row,scope.row.flowState)">详情</el-button>
</el-button>
<el-button type="text" v-has="'btn-warehousing'" <el-button type="text" icon="icon-ym icon-ym-btn-add" v-has="'btn-warehousingsale'"
@click="addOrUpdateHandle()">入库</el-button> @click="addOrUpdateHandle()">出库
</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -213,17 +158,12 @@ export default {
exportList: [], exportList: [],
columnList, columnList,
showAll: false,
superQueryVisible: false, superQueryVisible: false,
superQueryJson, superQueryJson,
uploadBoxVisible: false, uploadBoxVisible: false,
detailVisible: false, detailVisible: false,
query: { query: {
warehousingType: undefined,
warehousingCode: undefined, warehousingCode: undefined,
creatorUserId: undefined,
enterpriseId: undefined,
shippingAddress: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -233,25 +173,28 @@ export default {
}, },
list: [], list: [],
listLoading: true, listLoading: true,
total: 0, multipleSelection: [], total: 0,
queryData: {}, queryData: {},
listQuery: { listQuery: {
superQueryJson: '', superQueryJson: '',
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: "desc", sort: "desc",
sidx: "creatorTime", sidx: "",
}, },
formVisible: false, formVisible: false,
flowVisible: false, flowVisible: false,
flowListVisible: false, flowListVisible: false,
flowList: [], flowList: [],
exportBoxVisible: false, exportBoxVisible: false,
warehousingTypeOptions: [{ "fullName": "采购入库", "id": "1" }, { "fullName": "退货入库", "id": "2" }, { "fullName": "调拨入库", "id": "3" }, { "fullName": "成品入库", "id": "4" }, { "fullName": "盘盈入库", "id": "5" }, { "fullName": "其他入库", "id": "6" }], warehousingTypeOptions: [{ "fullName": "销售出库", "id": "8" }],
warehousingTypeProps: { "label": "fullName", "value": "id" }, warehousingTypeProps: { "label": "fullName", "value": "id" },
interfaceRes: { interfaceRes: {
businessId: [], businessId: [],
subjectBasicId: [], 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" }],
}, },
} }
}, },
@ -262,7 +205,7 @@ export default {
} }
}, },
created() { created() {
getFormById("528936118222078597").then(res1 => { getFormById("529305238373400645").then(res1 => {
let flowId = res1.data && res1.data.id let flowId = res1.data && res1.data.id
getFlowList(flowId, '1').then(res2 => { getFlowList(flowId, '1').then(res2 => {
this.flowList = res2.data this.flowList = res2.data
@ -449,7 +392,7 @@ export default {
keyword: this.keyword, keyword: this.keyword,
dataType: 0, dataType: 0,
menuId: this.menuId, menuId: this.menuId,
moduleId: '528936118222078597', moduleId: '529305238373400645',
type: 1, type: 1,
}; };
request({ request({
@ -491,6 +434,39 @@ export default {
this.$refs.UploadBox.init("", "scm/WarehousingNotification") 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() { openSuperQuery() {
this.superQueryVisible = true this.superQueryVisible = true
this.$nextTick(() => { this.$nextTick(() => {
@ -532,7 +508,7 @@ export default {
this.listQuery.currentPage = 1 this.listQuery.currentPage = 1
this.listQuery.pageSize = 20 this.listQuery.pageSize = 20
this.listQuery.sort = "desc" this.listQuery.sort = "desc"
this.listQuery.sidx = "creatorTime" this.listQuery.sidx = ""
this.initData() this.initData()
}, },
// //
Loading…
Cancel
Save