bom列表页和班组修改

jg-waiwang-pro
XI_TENG\xixi_ 9 months ago
parent fd56d507a8
commit c6282a8fea

@ -24,7 +24,8 @@
t4.code AS productCode, t4.code AS productCode,
t4.inventory_unit_id AS inventoryUnitId, t4.inventory_unit_id AS inventoryUnitId,
t4.spec AS productSpec, t4.spec AS productSpec,
t5.category_name AS categoryName t5.category_name AS categoryName,
t5.product_type_id AS productTypeId
from jg_bom t1 from jg_bom t1
LEFT JOIN jg_bom_item t2 ON t1.id=t2.bom_id AND t2.f_delete_mark is NULL LEFT JOIN jg_bom_item t2 ON t1.id=t2.bom_id AND t2.f_delete_mark is NULL
LEFT JOIN jg_bom_item_value t3 ON t1.id=t3.bom_id AND t3.f_delete_mark is NULL LEFT JOIN jg_bom_item_value t3 ON t1.id=t3.bom_id AND t3.f_delete_mark is NULL

@ -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.BusinessContact1Mapper">
</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.BusinessLine1Mapper">
</mapper>

@ -3,5 +3,10 @@
<mapper namespace="jnpf.mapper.ClassTeamMapper"> <mapper namespace="jnpf.mapper.ClassTeamMapper">
<select id="queryClassTeamUse" resultType="Integer">
select count(0) from jg_class_team_use a
where a.team_id = #{id}
</select>
</mapper> </mapper>

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

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

@ -13,4 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface ClassTeamMapper extends BaseMapper<ClassTeamEntity> { public interface ClassTeamMapper extends BaseMapper<ClassTeamEntity> {
Integer queryClassTeamUse(String id);
} }

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.businessline1.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* businessLine1
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-04
*/
public interface BusinessContact1Service extends IService<BusinessContact1Entity> {
QueryWrapper<BusinessContact1Entity> getChild(BusinessLine1Pagination pagination,QueryWrapper<BusinessContact1Entity> businessContact1QueryWrapper);
}

@ -0,0 +1,39 @@
package jnpf.service;
import jnpf.model.businessline1.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* businessLine1
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-04
*/
public interface BusinessLine1Service extends IService<BusinessLine1Entity> {
List<BusinessLine1Entity> getList(BusinessLine1Pagination businessLine1Pagination);
List<BusinessLine1Entity> getTypeList(BusinessLine1Pagination businessLine1Pagination,String dataType);
BusinessLine1Entity getInfo(String id);
void delete(BusinessLine1Entity entity);
void create(BusinessLine1Entity entity);
boolean update(String id, BusinessLine1Entity entity);
//子表方法
List<BusinessContact1Entity> getBusinessContact1List(String id,BusinessLine1Pagination businessLine1Pagination);
List<BusinessContact1Entity> getBusinessContact1List(String id);
//副表数据方法
String checkForm(BusinessLine1Form form,int i);
void saveOrUpdate(BusinessLine1Form businessLine1Form,String id, boolean isSave) throws Exception;
}

@ -40,4 +40,8 @@ public interface ClassTeamService extends IService<ClassTeamEntity> {
void saveOrUpdate(ClassTeamForm classTeamForm,String id, boolean isSave) throws Exception; void saveOrUpdate(ClassTeamForm classTeamForm,String id, boolean isSave) throws Exception;
//查询班组的员工数量
int queryClassTeamUseInfo(String id);
} }

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

@ -0,0 +1,461 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.BusinessLine1Mapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.businessline1.*;
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;
/**
*
* businessLine1
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-04
*/
@Service
public class BusinessLine1ServiceImpl extends ServiceImpl<BusinessLine1Mapper, BusinessLine1Entity> implements BusinessLine1Service{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private BusinessContact1Service businessContact1Service;
@Override
public List<BusinessLine1Entity> getList(BusinessLine1Pagination businessLine1Pagination){
return getTypeList(businessLine1Pagination,businessLine1Pagination.getDataType());
}
/** 列表查询 */
@Override
public List<BusinessLine1Entity> getTypeList(BusinessLine1Pagination businessLine1Pagination,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 ? BusinessLine1Constant.getAppColumnData() : BusinessLine1Constant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int businessLine1Num =0;
QueryWrapper<BusinessLine1Entity> businessLine1QueryWrapper=new QueryWrapper<>();
int businessContact1Num =0;
QueryWrapper<BusinessContact1Entity> businessContact1QueryWrapper=new QueryWrapper<>();
long businessContact1count = businessContact1Service.count();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(businessLine1Pagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = businessLine1Pagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<BusinessLine1Entity> businessLine1SuperWrapper = new QueryWrapper<>();
businessLine1SuperWrapper = generaterSwapUtil.getCondition(new QueryModel(businessLine1SuperWrapper,BusinessLine1Entity.class,queryJson,"0"));
int businessLine1Num1 = businessLine1SuperWrapper.getExpression().getNormal().size();
if (businessLine1Num1>0){
List<String> businessLine1List =this.list(businessLine1SuperWrapper).stream().map(BusinessLine1Entity::getId).collect(Collectors.toList());
allSuperList.addAll(businessLine1List);
intersectionSuperList.add(businessLine1List);
superNum++;
}
String businessContact1Table = "jg_business_contact";
boolean businessContact1HasSql = queryJson.contains(businessContact1Table);
List<String> businessContact1List = generaterSwapUtil.selectIdsByChildCondition(BusinessLine1Constant.getTableList(), businessContact1Table , queryJson, null);
if (businessContact1HasSql){
allSuperList.addAll(businessContact1List);
intersectionSuperList.add(businessContact1List);
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<BusinessLine1Entity> businessLine1SuperWrapper = new QueryWrapper<>();
businessLine1SuperWrapper = generaterSwapUtil.getCondition(new QueryModel(businessLine1SuperWrapper,BusinessLine1Entity.class,ruleJson,"0"));
int businessLine1Num1 = businessLine1SuperWrapper.getExpression().getNormal().size();
if (businessLine1Num1>0){
List<String> businessLine1List =this.list(businessLine1SuperWrapper).stream().map(BusinessLine1Entity::getId).collect(Collectors.toList());
allRuleList.addAll(businessLine1List);
intersectionRuleList.add(businessLine1List);
ruleNum++;
}
String businessContact1Table = "jg_business_contact";
boolean businessContact1HasSql = ruleJson.contains(businessContact1Table);
List<String> businessContact1List = generaterSwapUtil.selectIdsByChildCondition(BusinessLine1Constant.getTableList(), businessContact1Table , ruleJson, null);
if (businessContact1HasSql){
allRuleList.addAll(businessContact1List);
intersectionRuleList.add(businessContact1List);
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 businessLine1Obj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(businessLine1QueryWrapper,BusinessLine1Entity.class,businessLine1Pagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(businessLine1Obj)){
return new ArrayList<>();
} else {
businessLine1QueryWrapper = (QueryWrapper<BusinessLine1Entity>)businessLine1Obj;
if( businessLine1QueryWrapper.getExpression().getNormal().size()>0){
businessLine1Num++;
}
}
Object businessContact1Obj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(businessContact1QueryWrapper,BusinessContact1Entity.class,businessLine1Pagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(businessContact1Obj)){
return new ArrayList<>();
} else {
businessContact1QueryWrapper = (QueryWrapper<BusinessContact1Entity>)businessContact1Obj;
if( businessContact1QueryWrapper.getExpression().getNormal().size()>0){
businessContact1Num++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object businessLine1Obj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(businessLine1QueryWrapper,BusinessLine1Entity.class,businessLine1Pagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(businessLine1Obj)){
return new ArrayList<>();
} else {
businessLine1QueryWrapper = (QueryWrapper<BusinessLine1Entity>)businessLine1Obj;
if( businessLine1QueryWrapper.getExpression().getNormal().size()>0){
businessLine1Num++;
}
}
Object businessContact1Obj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(businessContact1QueryWrapper,BusinessContact1Entity.class,businessLine1Pagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(businessContact1Obj)){
return new ArrayList<>();
} else {
businessContact1QueryWrapper = (QueryWrapper<BusinessContact1Entity>)businessContact1Obj;
if( businessContact1QueryWrapper.getExpression().getNormal().size()>0){
businessContact1Num++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(businessLine1Pagination.getCode())){
businessLine1Num++;
String value = businessLine1Pagination.getCode() instanceof List ?
JsonUtil.getObjectToString(businessLine1Pagination.getCode()) :
String.valueOf(businessLine1Pagination.getCode());
businessLine1QueryWrapper.lambda().like(BusinessLine1Entity::getCode,value);
}
if(ObjectUtil.isNotEmpty(businessLine1Pagination.getParentId())){
businessLine1Num++;
String value = businessLine1Pagination.getParentId() instanceof List ?
JsonUtil.getObjectToString(businessLine1Pagination.getParentId()) :
String.valueOf(businessLine1Pagination.getParentId());
businessLine1QueryWrapper.lambda().like(BusinessLine1Entity::getParentId,value);
}
if(ObjectUtil.isNotEmpty(businessLine1Pagination.getType())){
businessLine1Num++;
List<String> idList = new ArrayList<>();
try {
String[][] type = JsonUtil.getJsonToBean(businessLine1Pagination.getType(),String[][].class);
for(int i=0;i<type.length;i++){
if(type[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(type[i])));
}
}
}catch (Exception e1){
try {
List<String> type = JsonUtil.getJsonToList(businessLine1Pagination.getType(),String.class);
if(type.size()>0){
idList.addAll(type);
}
}catch (Exception e2){
idList.add(String.valueOf(businessLine1Pagination.getType()));
}
}
businessLine1QueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(BusinessLine1Entity::getType, tt).or();
});
});
}
if(ObjectUtil.isNotEmpty(businessLine1Pagination.getName())){
businessLine1Num++;
String value = businessLine1Pagination.getName() instanceof List ?
JsonUtil.getObjectToString(businessLine1Pagination.getName()) :
String.valueOf(businessLine1Pagination.getName());
businessLine1QueryWrapper.lambda().like(BusinessLine1Entity::getName,value);
}
}
if(!isPc){
if(ObjectUtil.isNotEmpty(businessLine1Pagination.getName())){
businessLine1Num++;
String value = businessLine1Pagination.getName() instanceof List ?
JsonUtil.getObjectToString(businessLine1Pagination.getName()) :
String.valueOf(businessLine1Pagination.getName());
businessLine1QueryWrapper.lambda().like(BusinessLine1Entity::getName,value);
}
}
if(businessContact1Num>0){
List<String> businessContact1IdList = businessContact1Service.list(businessContact1QueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getBusinessLineId())).map(t->t.getBusinessLineId()).collect(Collectors.toList());
long count = businessContact1Service.count();
if (count>0){
intersectionList.add(businessContact1IdList);
}
AllIdList.addAll(businessContact1IdList);
}
total+=businessContact1Num;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
businessLine1QueryWrapper.lambda().in(BusinessLine1Entity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
businessLine1QueryWrapper.lambda().and(t->t.in(BusinessLine1Entity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
businessLine1QueryWrapper.lambda().and(t->t.in(BusinessLine1Entity::getId, finalAllRuleIDlist));
}
//假删除标志
businessLine1QueryWrapper.lambda().isNull(BusinessLine1Entity::getDeleteMark);
//排序
if(StringUtil.isEmpty(businessLine1Pagination.getSidx())){
businessLine1QueryWrapper.lambda().orderByDesc(BusinessLine1Entity::getId);
}else{
try {
String sidx = businessLine1Pagination.getSidx();
String[] strs= sidx.split("_name");
BusinessLine1Entity businessLine1Entity = new BusinessLine1Entity();
Field declaredField = businessLine1Entity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
businessLine1QueryWrapper="asc".equals(businessLine1Pagination.getSort().toLowerCase())?businessLine1QueryWrapper.orderByAsc(value):businessLine1QueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<BusinessLine1Entity> page=new Page<>(businessLine1Pagination.getCurrentPage(), businessLine1Pagination.getPageSize());
IPage<BusinessLine1Entity> userIPage=this.page(page, businessLine1QueryWrapper);
return businessLine1Pagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<BusinessLine1Entity> list = new ArrayList();
return businessLine1Pagination.setData(list, list.size());
}
}else{
return this.list(businessLine1QueryWrapper);
}
}
@Override
public BusinessLine1Entity getInfo(String id){
QueryWrapper<BusinessLine1Entity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(BusinessLine1Entity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(BusinessLine1Entity entity){
this.save(entity);
}
@Override
public boolean update(String id, BusinessLine1Entity entity){
return this.updateById(entity);
}
@Override
public void delete(BusinessLine1Entity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** BusinessContact1子表方法 */
@Override
public List<BusinessContact1Entity> getBusinessContact1List(String id,BusinessLine1Pagination businessLine1Pagination){
Map<String, Object> newtabMap=BusinessLine1Constant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="businessContact1";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<BusinessContact1Entity> queryWrapper = new QueryWrapper<>();
queryWrapper = businessContact1Service.getChild(businessLine1Pagination,queryWrapper);
queryWrapper.lambda().eq(BusinessContact1Entity::getBusinessLineId, id);
generaterSwapUtil.wrapperHandle(BusinessLine1Constant.getColumnData(), BusinessLine1Constant.getAppColumnData(), queryWrapper,BusinessContact1Entity.class,"sub",tableName);
return businessContact1Service.list(queryWrapper);
}
/** BusinessContact1子表方法 */
@Override
public List<BusinessContact1Entity> getBusinessContact1List(String id){
QueryWrapper<BusinessContact1Entity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(BusinessContact1Entity::getBusinessLineId, id);
return businessContact1Service.list(queryWrapper);
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(BusinessLine1Form form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
if(StringUtil.isEmpty(form.getName())){
return "生产线名称不能为空";
}
if(StringUtil.isNotEmpty(form.getName())){
form.setName(form.getName().trim());
QueryWrapper<BusinessLine1Entity> nameWrapper=new QueryWrapper<>();
nameWrapper.lambda().eq(BusinessLine1Entity::getName,form.getName());
//假删除标志
nameWrapper.lambda().isNull(BusinessLine1Entity::getDeleteMark);
if (isUp){
nameWrapper.lambda().ne(BusinessLine1Entity::getId, id);
}
if((int) this.count(nameWrapper)>0){
countRecover = "生产线名称不能重复";
}
}
//子表字段验证
if (form.getBusinessContact1List()!=null){
for(BusinessContact1Model t : form.getBusinessContact1List()){
if(StringUtil.isNotEmpty(t.getName())){
t.setName(t.getName().trim());
}
else{
return "-姓名不能为空";
}
}
for(BusinessContact1Model t : form.getBusinessContact1List()){
if(StringUtil.isNotEmpty(t.getPhone())){
t.setPhone(t.getPhone().trim());
}
else{
return "-手机号不能为空";
}
}
for(BusinessContact1Model t : form.getBusinessContact1List()){
if(StringUtil.isNotEmpty(t.getEmail())){
t.setEmail(t.getEmail().trim());
}
else{
return "-邮箱不能为空";
}
}
}
return countRecover;
}
/**
* ()
* @param id
* @param businessLine1Form
* @return
*/
@Override
@Transactional
public void saveOrUpdate(BusinessLine1Form businessLine1Form,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
businessLine1Form = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(BusinessLine1Constant.getFormData(),businessLine1Form),BusinessLine1Form.class);
BusinessLine1Entity entity = JsonUtil.getJsonToBean(businessLine1Form, BusinessLine1Entity.class);
if(isSave){
String mainId = id ;
entity.setCode(generaterSwapUtil.getBillNumber("rukudanhao", false));
entity.setId(mainId);
entity.setFlowId(businessLine1Form.getFlowId());
entity.setVersion(0);
}else{
entity.setCode(generaterSwapUtil.getBillNumber("rukudanhao", false));
entity.setFlowId(businessLine1Form.getFlowId());
}
this.saveOrUpdate(entity);
//BusinessContact1子表数据新增修改
if(!isSave){
QueryWrapper<BusinessContact1Entity> BusinessContact1queryWrapper = new QueryWrapper<>();
BusinessContact1queryWrapper.lambda().eq(BusinessContact1Entity::getBusinessLineId, entity.getId());
businessContact1Service.remove(BusinessContact1queryWrapper);
}
if (businessLine1Form.getBusinessContact1List()!=null){
List<BusinessContact1Entity> tableField133 = JsonUtil.getJsonToList(businessLine1Form.getBusinessContact1List(),BusinessContact1Entity.class);
for(BusinessContact1Entity entitys : tableField133){
entitys.setId(RandomUtil.uuId());
entitys.setBusinessLineId(entity.getId());
if(isSave){
}else{
}
businessContact1Service.saveOrUpdate(entitys);
}
}
}
}

@ -50,6 +50,8 @@ public class ClassTeamServiceImpl extends ServiceImpl<ClassTeamMapper, ClassTeam
private BusinessContactTeamService businessContactTeamService; private BusinessContactTeamService businessContactTeamService;
@Autowired @Autowired
private ClassTeamUseService classTeamUseService; private ClassTeamUseService classTeamUseService;
@Autowired
private ClassTeamMapper classTeamMapper;
@Override @Override
public List<ClassTeamEntity> getList(ClassTeamPagination classTeamPagination){ public List<ClassTeamEntity> getList(ClassTeamPagination classTeamPagination){
return getTypeList(classTeamPagination,classTeamPagination.getDataType()); return getTypeList(classTeamPagination,classTeamPagination.getDataType());
@ -586,4 +588,9 @@ public class ClassTeamServiceImpl extends ServiceImpl<ClassTeamMapper, ClassTeam
} }
} }
} }
@Override
public int queryClassTeamUseInfo(String id) {
return classTeamMapper.queryClassTeamUse(id);
}
} }

@ -0,0 +1,634 @@
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.businessline1.*;
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;
/**
* businessLine1
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-04
*/
@Slf4j
@RestController
@Tag(name = "businessLine1" , description = "scm")
@RequestMapping("/api/scm/BusinessLine1")
public class BusinessLine1Controller {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private BusinessLine1Service businessLine1Service;
@Autowired
private BusinessContact1Service businessContact1Service;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param businessLine1Pagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody BusinessLine1Pagination businessLine1Pagination)throws IOException{
List<BusinessLine1Entity> list= businessLine1Service.getList(businessLine1Pagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (BusinessLine1Entity entity : list) {
if (entity.getDifflag().equals("3")||entity.getDifflag().equals("5")){
Map<String, Object> businessLine1Map=JsonUtil.entityToMap(entity);
businessLine1Map.put("id", businessLine1Map.get("id"));
//副表数据
//子表数据
List<BusinessContact1Entity> businessContact1List = businessLine1Service.getBusinessContact1List(entity.getId(),businessLine1Pagination);
businessLine1Map.put("tableField133",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessContact1List)));
realList.add(businessLine1Map);
}
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, BusinessLine1Constant.getFormData(), BusinessLine1Constant.getColumnData(), businessLine1Pagination.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(businessLine1Pagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param businessLine1Form
* @return
*/
@PostMapping("/{id}")
@Operation(summary = "创建")
public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid BusinessLine1Form businessLine1Form) {
String b = businessLine1Service.checkForm(businessLine1Form,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
businessLine1Service.saveOrUpdate(businessLine1Form, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody BusinessLine1Pagination businessLine1Pagination) throws IOException {
if (StringUtil.isEmpty(businessLine1Pagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<BusinessLine1Entity> list= businessLine1Service.getList(businessLine1Pagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (BusinessLine1Entity entity : list) {
Map<String, Object> businessLine1Map=JsonUtil.entityToMap(entity);
businessLine1Map.put("id", businessLine1Map.get("id"));
//副表数据
//子表数据
List<BusinessContact1Entity> businessContact1List = businessLine1Service.getBusinessContact1List(entity.getId(),businessLine1Pagination);
businessLine1Map.put("tableField133",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessContact1List)));
realList.add(businessLine1Map);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, BusinessLine1Constant.getFormData(), BusinessLine1Constant.getColumnData(), businessLine1Pagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(businessLine1Pagination.getSelectKey())?businessLine1Pagination.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 tableField133ExcelEntity = new ExcelExportEntity("","tableField133");
List<ExcelExportEntity> tableField133List = new ArrayList<>();
for(String key:keys){
switch(key){
case "code" :
entitys.add(new ExcelExportEntity("生产线编号" ,"code"));
break;
case "name" :
entitys.add(new ExcelExportEntity("生产线名称" ,"name"));
break;
case "simpleName" :
entitys.add(new ExcelExportEntity(" 简称/英文名" ,"simpleName"));
break;
case "type" :
entitys.add(new ExcelExportEntity("类型" ,"type"));
break;
case "parentId" :
entitys.add(new ExcelExportEntity("所属工厂" ,"parentId"));
break;
case "workshopId" :
entitys.add(new ExcelExportEntity("所属车间" ,"workshopId"));
break;
case "status" :
entitys.add(new ExcelExportEntity("状态" ,"status"));
break;
case "description" :
entitys.add(new ExcelExportEntity("描述" ,"description"));
break;
case "tableField133-contactType":
tableField133List.add(new ExcelExportEntity("类型" ,"contactType"));
break;
case "tableField133-name":
tableField133List.add(new ExcelExportEntity("姓名" ,"name"));
break;
case "tableField133-phone":
tableField133List.add(new ExcelExportEntity("手机号" ,"phone"));
break;
case "tableField133-landline":
tableField133List.add(new ExcelExportEntity("座机" ,"landline"));
break;
case "tableField133-email":
tableField133List.add(new ExcelExportEntity("邮箱" ,"email"));
break;
case "tableField133-fax":
tableField133List.add(new ExcelExportEntity("传真" ,"fax"));
break;
case "tableField133-lastModifyTime":
tableField133List.add(new ExcelExportEntity("更新时间" ,"lastModifyTime"));
break;
default:
break;
}
}
if(tableField133List.size() > 0){
tableField133ExcelEntity.setList(tableField133List);
entitys.add(tableField133ExcelEntity);
}
}
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(BusinessLine1Constant.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;
}
@Operation(summary = "上传文件")
@PostMapping("/Uploader")
public ActionResult<Object> Uploader() {
List<MultipartFile> list = UpUtil.getFileAll();
MultipartFile file = list.get(0);
if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) {
String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath());
String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file));
//上传文件
FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName);
DownloadVO vo = DownloadVO.builder().build();
vo.setName(fileInfo.getFilename());
return ActionResult.success(vo);
} else {
return ActionResult.fail("选择文件不符合导入");
}
}
/**
*
*
* @return
*/
@Operation(summary = "模板下载")
@GetMapping("/TemplateDownload")
public ActionResult<DownloadVO> TemplateDownload(){
DownloadVO vo = DownloadVO.builder().build();
UserInfo userInfo = userProvider.get();
Map<String, Object> dataMap = new HashMap<>();
//主表对象
List<ExcelExportEntity> entitys = new ArrayList<>();
//以下添加字段
entitys.add(new ExcelExportEntity("生产线编号" ,"code"));
dataMap.put("code", "系统自动生成");
entitys.add(new ExcelExportEntity("生产线名称" ,"name"));
entitys.add(new ExcelExportEntity("类型" ,"type"));
entitys.add(new ExcelExportEntity("所属工厂" ,"parentId"));
entitys.add(new ExcelExportEntity("状态" ,"status"));
entitys.add(new ExcelExportEntity("所属车间" ,"workshopId"));
//tableField133子表对象
ExcelExportEntity tableField133ExcelEntity = new ExcelExportEntity("","tableField133");
List<ExcelExportEntity> tableField133ExcelEntityList = new ArrayList<>();
Map<String, Object> tableField133ChildData = new HashMap<>();
List<Map<String, Object>> tableField133ChildDataList = new ArrayList<>();
tableField133ExcelEntityList.add(new ExcelExportEntity("类型" ,"contactType"));
tableField133ExcelEntityList.add(new ExcelExportEntity("姓名" ,"name"));
tableField133ExcelEntityList.add(new ExcelExportEntity("手机号" ,"phone"));
tableField133ExcelEntityList.add(new ExcelExportEntity("邮箱" ,"email"));
tableField133ChildDataList.add(tableField133ChildData);
dataMap.put("tableField133",tableField133ChildDataList);
tableField133ExcelEntity.setList(tableField133ExcelEntityList);
entitys.add(tableField133ExcelEntity);
List<Map<String, Object>> list = new ArrayList<>();
list.add(dataMap);
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<>());
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(BusinessLine1Constant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
}
String fileName = "加工生产线模板" + DateUtil.dateNow("yyyyMMddHHmmss") + ".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 ActionResult.success(vo);
}
/**
*
*
* @return
*/
@Operation(summary = "导入预览" )
@GetMapping("/ImportPreview")
public ActionResult<Map<String, Object>> ImportPreview(String fileName) throws Exception {
Map<String, Object> headAndDataMap = new HashMap<>(2);
String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath();
FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName);
File temporary = new File(XSSEscape.escapePath(filePath + fileName));
int headerRowIndex = 2;
ImportParams params = new ImportParams();
params.setTitleRows(0);
params.setHeadRows(headerRowIndex);
params.setNeedVerify(true);
try {
List<BusinessLine1ExcelVO> excelDataList = ExcelImportUtil.importExcel(temporary, BusinessLine1ExcelVO.class, params);
// 导入字段
List<ExcelImFieldModel> columns = new ArrayList<>();
columns.add(new ExcelImFieldModel("code","生产线编号"));
columns.add(new ExcelImFieldModel("name","生产线名称"));
columns.add(new ExcelImFieldModel("type","类型"));
columns.add(new ExcelImFieldModel("parentId","所属工厂"));
columns.add(new ExcelImFieldModel("status","状态"));
columns.add(new ExcelImFieldModel("workshopId","所属车间"));
//tableField133子表对象
List<ExcelImFieldModel> tableField133columns = new ArrayList<>();
tableField133columns.add(new ExcelImFieldModel("contactType" ,"类型"));
tableField133columns.add(new ExcelImFieldModel("name" ,"姓名"));
tableField133columns.add(new ExcelImFieldModel("phone" ,"手机号"));
tableField133columns.add(new ExcelImFieldModel("email" ,"邮箱"));
columns.add(new ExcelImFieldModel("tableField133","",tableField133columns));
headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList)));
headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns)));
} catch (Exception e){
e.printStackTrace();
return ActionResult.fail("表头名称不可更改,表头行不能删除");
}
return ActionResult.success(headAndDataMap);
}
/**
*
*
* @return
*/
@Operation(summary = "导入数据" )
@PostMapping("/ImportData")
public ActionResult<ExcelImportModel> ImportData(@RequestBody VisualImportModel visualImportModel) throws Exception {
List<Map<String, Object>> listData=new ArrayList<>();
for(Map<String, Object> map : visualImportModel.getList()){
listData.add(map);
}
ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel();
uniqueModel.setDbLinkId(BusinessLine1Constant.DBLINKID);
uniqueModel.setUpdate(Objects.equals("1", "2"));
uniqueModel.setFlowId(visualImportModel.getFlowId()); ExcelImportModel excelImportModel = generaterSwapUtil.importData(BusinessLine1Constant.getFormData(),listData,uniqueModel,
BusinessLine1Constant.TABLEFIELDKEY,BusinessLine1Constant.getTableList());
List<ImportDataModel> importDataModel = uniqueModel.getImportDataModel();
for (ImportDataModel model : importDataModel) {
String id = model.getId();
Map<String, Object> result = model.getResultData();
if(StringUtil.isNotEmpty(id)){
update(id, JsonUtil.getJsonToBean(result,BusinessLine1Form.class), true);
}else {
create(RandomUtil.uuId(), JsonUtil.getJsonToBean(result,BusinessLine1Form.class));
}
}
return ActionResult.success(excelImportModel);
}
/**
*
*
* @return
*/
@Operation(summary = "导出异常报告")
@PostMapping("/ImportExceptionData")
public ActionResult<DownloadVO> ImportExceptionData(@RequestBody VisualImportModel visualImportModel) {
DownloadVO vo=DownloadVO.builder().build();
List<BusinessLine1ExcelErrorVO> businessLine1VOList = JsonUtil.getJsonToList(visualImportModel.getList(), BusinessLine1ExcelErrorVO.class);
UserInfo userInfo = userProvider.get();
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
ExportParams exportParams = new ExportParams(null, "错误报告");
exportParams.setType(ExcelType.XSSF);
workbook = ExcelExportUtil.exportExcel(exportParams,
BusinessLine1ExcelErrorVO.class, businessLine1VOList);
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) {
e.printStackTrace();
}
return ActionResult.success(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 businessLine1Form
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid BusinessLine1Form businessLine1Form,
@RequestParam(value = "isImport", required = false) boolean isImport){
businessLine1Form.setId(id);
if (!isImport) {
String b = businessLine1Service.checkForm(businessLine1Form,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
BusinessLine1Entity entity= businessLine1Service.getInfo(id);
if(entity!=null){
try{
businessLine1Service.saveOrUpdate(businessLine1Form,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){
BusinessLine1Entity entity= businessLine1Service.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);
businessLine1Service.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
BusinessLine1Entity entity= businessLine1Service.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> businessLine1Map=JsonUtil.entityToMap(entity);
businessLine1Map.put("id", businessLine1Map.get("id"));
//副表数据
//子表数据
List<BusinessContact1Entity> businessContact1List = businessLine1Service.getBusinessContact1List(entity.getId());
businessLine1Map.put("tableField133",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessContact1List)));
businessLine1Map = generaterSwapUtil.swapDataDetail(businessLine1Map,BusinessLine1Constant.getFormData(),"521949393889270917",false);
return ActionResult.success(businessLine1Map);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
BusinessLine1Entity entity= businessLine1Service.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> businessLine1Map=JsonUtil.entityToMap(entity);
businessLine1Map.put("id", businessLine1Map.get("id"));
//副表数据
//子表数据
List<BusinessContact1Entity> businessContact1List = businessLine1Service.getBusinessContact1List(entity.getId());
businessLine1Map.put("businessContact1List",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessContact1List)));
businessLine1Map = generaterSwapUtil.swapDataForm(businessLine1Map,BusinessLine1Constant.getFormData(),BusinessLine1Constant.TABLEFIELDKEY,BusinessLine1Constant.TABLERENAMES);
return ActionResult.success(businessLine1Map);
}
}

@ -83,6 +83,27 @@ public class BusinessLineController {
return ActionResult.success(listVO); return ActionResult.success(listVO);
} }
/**
*
*
* @return
*/
@Operation(summary = "获取工厂和加工车间树形树形")
@GetMapping("/WorkTree")
public ActionResult<List<BusinessLineSonTree>> WorkTree() {
List<BusinessLineEntity> list = businessLineService.list();
List<BusinessLineEntity> workTreeList =new ArrayList<>();
for (BusinessLineEntity businessLineEntity:list){
if (businessLineEntity.getDiffFlag().equals("3")||businessLineEntity.getDiffFlag().equals("5")){
workTreeList.add(businessLineEntity);
}
}
List<BusinessLineModel> models = JsonUtil.getJsonToList(workTreeList, BusinessLineModel.class);
List<SumTree<BusinessLineModel>> trees = TreeDotUtils.convertListToTreeDot(models);
List<BusinessLineSonTree> listVO = JsonUtil.getJsonToList(trees, BusinessLineSonTree.class);
return ActionResult.success(listVO);
}
/** /**
* *

@ -90,6 +90,11 @@ public class ClassTeamController {
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody ClassTeamPagination classTeamPagination)throws IOException{ public ActionResult list(@RequestBody ClassTeamPagination classTeamPagination)throws IOException{
List<ClassTeamEntity> list= classTeamService.getList(classTeamPagination); List<ClassTeamEntity> list= classTeamService.getList(classTeamPagination);
for (ClassTeamEntity classTeamEntity :list){
classTeamEntity.setClassTeamUseNum(classTeamService.queryClassTeamUseInfo(classTeamEntity.getId()));
}
List<Map<String, Object>> realList=new ArrayList<>(); List<Map<String, Object>> realList=new ArrayList<>();
for (ClassTeamEntity entity : list) { for (ClassTeamEntity entity : list) {
Map<String, Object> classTeamMap=JsonUtil.entityToMap(entity); Map<String, Object> classTeamMap=JsonUtil.entityToMap(entity);

@ -77,4 +77,7 @@ public class BomEntity {
@TableField(exist = false) @TableField(exist = false)
private String categoryName; private String categoryName;
@TableField(exist = false)
private String productTypeId;
} }

@ -0,0 +1,49 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
* 线
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-04
*/
@Data
@TableName("jg_business_contact")
public class BusinessContact1Entity {
@TableId(value ="ID" )
private String id;
@TableField("BUSINESS_LINE_ID")
private String businessLineId;
@TableField(value = "CONTACT_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String contactType;
@TableField(value = "NAME" , updateStrategy = FieldStrategy.IGNORED)
private String name;
@TableField(value = "PHONE" , updateStrategy = FieldStrategy.IGNORED)
private String phone;
@TableField(value = "LANDLINE" , updateStrategy = FieldStrategy.IGNORED)
private String landline;
@TableField(value = "EMAIL" , updateStrategy = FieldStrategy.IGNORED)
private String email;
@TableField(value = "FAX" , updateStrategy = FieldStrategy.IGNORED)
private String fax;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField(value = "F_LAST_MODIFY_TIME" , updateStrategy = FieldStrategy.IGNORED)
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;
}

@ -0,0 +1,115 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
* 线
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-04
*/
@Data
@TableName("jg_business_line")
public class BusinessLine1Entity {
@TableId(value ="ID" )
private String id;
@TableField(value = "CODE" , updateStrategy = FieldStrategy.IGNORED)
private String code;
@TableField(value = "NAME" , updateStrategy = FieldStrategy.IGNORED)
private String name;
@TableField(value = "SIMPLE_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String simpleName;
@TableField("LOGO")
private String logo;
@TableField(value = "PARENT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String parentId;
@TableField(value = "TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String type;
@TableField(value = "STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String status;
@TableField("RELATION_INSTITUTION_NUM")
private Integer relationInstitutionNum;
@TableField("EMPLOYEE_NUM")
private Integer employeeNum;
@TableField("INDUSTRY")
private String industry;
@TableField("CITY")
private String city;
@TableField("ESTABLISH_DATE")
private Date establishDate;
@TableField("BELONG_USER_ID")
private String belongUserId;
@TableField("BRAND_NAME")
private String brandName;
@TableField("PHONE")
private Integer phone;
@TableField("DIFF_FLAG")
private String difflag;
@TableField("FAX")
private String fax;
@TableField("URL")
private String url;
@TableField(value = "DESCRIPTION" , updateStrategy = FieldStrategy.IGNORED)
private String description;
@TableField("BUSINESS_TYPE")
private String businessType;
@TableField("BUSINESS_HOURS")
private String businessHours;
@TableField("BUSINESS_START")
private Date businessStart;
@TableField("BUSINESS_END")
private Date businessEnd;
@TableField("ALLOW_UNLOADING_START")
private Date allowUnloadingStart;
@TableField("ALLOW_UNLOADING_END")
private Date allowUnloadingEnd;
@TableField("UNLOADING_DURATION")
private String unloadingDuration;
@TableField("UNLOADING_EFFICIENCY")
private String unloadingEfficiency;
@TableField("ALLOW_LOADING_START")
private Date allowLoadingStart;
@TableField("ALLOW_LOADING_END")
private Date allowLoadingEnd;
@TableField("LOADING_DURATION")
private String loadingDuration;
@TableField("LOADING_EFFCIENCY")
private String loadingEffciency;
@TableField("EMAIL")
private String email;
@TableField("ERP_TYPE")
private String erpType;
@TableField("WORKSHOP_AREA")
private String workshopArea;
@TableField(value = "WORKSHOP_ID" , updateStrategy = FieldStrategy.IGNORED)
private String workshopId;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("F_VERSION")
private Integer version;
@TableField("F_FLOW_ID")
private String flowId;
@TableField("F_FLOW_TASK_ID")
private String flowTaskId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
}

@ -73,4 +73,7 @@ public class ClassTeamEntity {
private String companyId; private String companyId;
@TableField(value = "department_id" , fill = FieldFill.INSERT) @TableField(value = "department_id" , fill = FieldFill.INSERT)
private String departmentId; private String departmentId;
@TableField(exist = false)
private Integer classTeamUseNum;
} }

@ -0,0 +1,45 @@
package jnpf.model.businessline1;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* businessLine1
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-04
*/
@Data
public class BusinessContact1ExcelVO{
/** 类型 **/
@JSONField(name = "contactType")
@Excel(name = "类型",orderNum = "1", isImportField = "true" )
private String contactType;
/** 姓名 **/
@JSONField(name = "name")
@Excel(name = "姓名",orderNum = "1", isImportField = "true" )
private String name;
/** 手机号 **/
@JSONField(name = "phone")
@Excel(name = "手机号",orderNum = "1", isImportField = "true" )
private String phone;
/** 邮箱 **/
@JSONField(name = "email")
@Excel(name = "邮箱",orderNum = "1", isImportField = "true" )
private String email;
}

@ -0,0 +1,47 @@
package jnpf.model.businessline1;
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;
/**
*
* businessLine1
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-02-04
*/
@Data
public class BusinessContact1Model {
/** 类型 **/
@Excel(name = "类型",orderNum = "1",isImportField = "true")
@JSONField(name = "contactType")
private Object contactType;
/** 姓名 **/
@Excel(name = "姓名",orderNum = "1",isImportField = "true")
@JSONField(name = "name")
private String name;
/** 手机号 **/
@Excel(name = "手机号",orderNum = "1",isImportField = "true")
@JSONField(name = "phone")
private String phone;
/** 座机 **/
@JSONField(name = "landline")
private String landline;
/** 邮箱 **/
@Excel(name = "邮箱",orderNum = "1",isImportField = "true")
@JSONField(name = "email")
private String email;
/** 传真 **/
@JSONField(name = "fax")
private String fax;
/** 更新时间 **/
@JSONField(name = "lastModifyTime")
private String lastModifyTime;
}

@ -0,0 +1,22 @@
package jnpf.model.businessline1;
import lombok.Data;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* businessLine1
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-04
*/
@Data
public class BusinessLine1ExcelErrorVO extends BusinessLine1ExcelVO{
@Excel(name = "异常原因",orderNum = "999")
@JSONField(name = "errorsInfo")
private String errorsInfo;
}

@ -0,0 +1,60 @@
package jnpf.model.businessline1;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* businessLine1
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-04
*/
@Data
public class BusinessLine1ExcelVO{
/** 生产线编号 **/
@JSONField(name = "code")
@Excel(name = "生产线编号",orderNum = "1", isImportField = "true" )
private String code;
/** 生产线名称 **/
@JSONField(name = "name")
@Excel(name = "生产线名称",orderNum = "1", isImportField = "true" )
private String name;
/** 类型 **/
@JSONField(name = "type")
@Excel(name = "类型",orderNum = "1", isImportField = "true" )
private String type;
/** 所属工厂 **/
@JSONField(name = "parentId")
@Excel(name = "所属工厂",orderNum = "1", isImportField = "true" )
private String parentId;
/** 状态 **/
@JSONField(name = "status")
@Excel(name = "状态",orderNum = "1", isImportField = "true" )
private String status;
/** 所属车间 **/
@JSONField(name = "workshopId")
@Excel(name = "所属车间",orderNum = "1", isImportField = "true" )
private String workshopId;
@JsonProperty("tableField133")
@ExcelCollection(name="",orderNum = "4")
private List<BusinessContact1ExcelVO> tableField133;
}

@ -0,0 +1,53 @@
package jnpf.model.businessline1;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* businessLine1
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-04
*/
@Data
public class BusinessLine1Form {
/** 主键 */
private String id;
/** 子表数据 **/
@JsonProperty("businessContact1List")
private List<BusinessContact1Model> businessContact1List;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 流程id **/
@JsonProperty("flowId")
private String flowId;
/** 生产线编号 **/
@JsonProperty("code")
private String code;
/** 生产线名称 **/
@JsonProperty("name")
private String name;
/** 简称/英文名 **/
@JsonProperty("simpleName")
private String simpleName;
/** 类型 **/
@JsonProperty("type")
private Object type;
/** 所属工厂 **/
@JsonProperty("parentId")
private Object parentId;
/** 所属车间 **/
@JsonProperty("workshopId")
private Object workshopId;
/** 状态 **/
@JsonProperty("status")
private String status;
/** 描述 **/
@JsonProperty("description")
private String description;
}

@ -0,0 +1,42 @@
package jnpf.model.businessline1;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* businessLine1
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-04
*/
@Data
public class BusinessLine1Pagination 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("code")
private Object code;
/** 类型 */
@JsonProperty("type")
private Object type;
/** tree */
@JsonProperty("name")
private Object name;
@JsonProperty("parentId")
private Object parentId;
}

@ -17,4 +17,10 @@ public class BusinessLineModel extends SumTree {
private List<String> businessLineIds; private List<String> businessLineIds;
private String parentId; private String parentId;
@Schema(description = "类型区分")
private String diffFlag;
@Schema(description = "类型区分")
private String difflag;
} }

@ -25,4 +25,10 @@ public class BusinessLineSonTree {
private Boolean hasChildren; private Boolean hasChildren;
@Schema(description = "下级菜单列表") @Schema(description = "下级菜单列表")
private List<BusinessLineSonTree> children; private List<BusinessLineSonTree> children;
@Schema(description = "类型区分")
private String diffFlag;
@Schema(description = "类型区分")
private String difflag;
} }

@ -81,16 +81,20 @@
<el-table-column prop="bomName" label="商品名称" align="left" min-width="120"> <el-table-column prop="bomName" label="商品名称" align="left" min-width="120">
<template #default="scope"> <template #default="scope">
<el-row> <el-row>
<el-col :span="8"> <el-col>
<img src="" alt=""> {{ scope.row.productCode }}
</el-col> </el-col>
<el-col :span="12"> <el-col>
{{ scope.row.bomName }} {{ scope.row.productName }}
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="bomCode" label="类型" align="left" min-width="120"> <el-table-column prop="productTypeId" label="类型" align="left" min-width="120">
<template slot-scope="scope">
{{ scope.row.productTypeId}}
</template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="tableField106" label="" align="center"> <!-- <el-table-column prop="tableField106" label="" align="center">
@ -142,14 +146,14 @@
</el-table-column> </el-table-column>
<el-table-column prop="bomCode" label="库存单位" align="left" min-width="120"> <el-table-column prop="bomCode" label="库存单位" align="left" min-width="120">
</el-table-column> </el-table-column>
<el-table-column prop="bomCode" label="规格" align="left" min-width="120"> <el-table-column prop="productSpec" label="规格" align="left" min-width="120">
</el-table-column> </el-table-column>
<el-table-column prop="bomCode" label="商品分类" align="left" min-width="120"> <el-table-column prop="categoryName" label="商品分类" align="left" min-width="120">
</el-table-column> </el-table-column>
<el-table-column prop="bomCode" label="商品类目" align="left" min-width="120"> <!-- <el-table-column prop="bomCode" label="商品类目" align="left" min-width="120">
</el-table-column> </el-table-column>
<el-table-column prop="bomCode" label="尺寸单位" align="left" min-width="120"> <el-table-column prop="bomCode" label="尺寸单位" align="left" min-width="120">
</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">
@ -271,7 +275,10 @@ export default {
flowListVisible: false, flowListVisible: false,
flowList: [], flowList: [],
exportBoxVisible: false, exportBoxVisible: false,
productTypeIdOptions: [{ "fullName": "实物商品", "id": "1" }, { "fullName": "虚拟商品", "id": "2" }, { "fullName": "设备/器材", "id": "3" }, { "fullName": "耗材/辅材", "id": "4" }],
bomStatusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }], bomStatusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
bomStatusProps: { "label": "fullName", "value": "id" }, bomStatusProps: { "label": "fullName", "value": "id" },
tableField106_productIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" }, { "label": "规格", "value": "spec" },], tableField106_productIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" }, { "label": "规格", "value": "spec" },],
tableField118_productIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" }, { "label": "规格", "value": "spec" },], tableField118_productIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" }, { "label": "规格", "value": "spec" },],

@ -5,178 +5,202 @@
<template> <template>
<div :style="{margin: '0 auto',width:'100%'}"> <div :style="{margin: '0 auto',width:'100%'}">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="default" label-width="100px" label-position="left" :disabled="setting.readonly" > <el-form ref="formRef" :model="dataForm" :rules="dataRule" size="default" label-width="100px"
label-position="left" :disabled="setting.readonly">
<template v-if="!loading && formOperates"> <template v-if="!loading && formOperates">
<!-- 具体表单 --> <!-- 具体表单 -->
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle <JnpfGroupTitle content="基础信息" contentPosition="left">
content="基础信息" contentPosition="left" >
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" v-if="judgeShow('code')" > <el-col :span="8" v-if="judgeShow('code')">
<jnpf-form-tip-item <jnpf-form-tip-item label="生产线编号" v-if="judgeShow('code')" prop="code">
label="生产线编号" v-if="judgeShow('code')" prop="code" >
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)" <JnpfInput v-model="dataForm.code" @change="changeData('code',-1)"
placeholder="系统自动生成" :disabled="judgeWrite('code')" readonly :style='{"width":"100%"}'> placeholder="系统自动生成" :disabled="judgeWrite('code')" readonly
:style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" v-if="judgeShow('name')" > <el-col :span="8" v-if="judgeShow('name')">
<jnpf-form-tip-item <jnpf-form-tip-item label="生产线名称" v-if="judgeShow('name')" prop="name">
label="生产线名称" v-if="judgeShow('name')" prop="name" > <JnpfInput v-model="dataForm.name" @change="changeData('name',-1)" placeholder="请输入"
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)" :disabled="judgeWrite('name')" clearable :style='{"width":"100%"}'>
placeholder="请输入" :disabled="judgeWrite('name')" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" v-if="judgeShow('simpleName')" > <el-col :span="8" v-if="judgeShow('simpleName')">
<jnpf-form-tip-item <jnpf-form-tip-item label=" 简称/英文名" v-if="judgeShow('simpleName')" prop="simpleName">
label=" 简称/英文名" v-if="judgeShow('simpleName')" prop="simpleName" >
<JnpfInput v-model="dataForm.simpleName" @change="changeData('simpleName',-1)" <JnpfInput v-model="dataForm.simpleName" @change="changeData('simpleName',-1)"
placeholder="请输入" :disabled="judgeWrite('simpleName')" clearable :style='{"width":"100%"}'> placeholder="请输入" :disabled="judgeWrite('simpleName')" clearable
:style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" v-if="judgeShow('type')" > <el-col :span="8" v-if="judgeShow('type')">
<jnpf-form-tip-item <jnpf-form-tip-item label="类型" v-if="judgeShow('type')" prop="type">
label="类型" v-if="judgeShow('type')" prop="type" > <JnpfSelect v-model="dataForm.type" @change="changeData('type',-1)" placeholder="请选择"
<JnpfSelect v-model="dataForm.type" @change="changeData('type',-1)" :disabled="judgeWrite('type')" clearable :style='{"width":"100%"}'
placeholder="请选择" :disabled="judgeWrite('type')" clearable :style='{"width":"100%"}' :options="typeOptions" :props="typeProps" > :options="typeOptions" :props="typeProps">
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" v-if="judgeShow('parentId')" > <el-col :span="8" v-if="judgeShow('parentId')">
<jnpf-form-tip-item <jnpf-form-tip-item label="所属工厂" v-if="judgeShow('parentId')" prop="parentId">
label="所属工厂" v-if="judgeShow('parentId')" prop="parentId" >
<JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId',-1)" <JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId',-1)"
placeholder="请选择" :disabled="judgeWrite('parentId')" clearable :style='{"width":"100%"}' :options="parentIdOptions" :props="parentIdProps" > placeholder="请选择" :disabled="judgeWrite('parentId')" clearable
:style='{"width":"100%"}' :options="parentIdOptions" :props="parentIdProps">
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" v-if="judgeShow('workshopId')" > <el-col :span="8" v-if="judgeShow('workshopId')">
<jnpf-form-tip-item <jnpf-form-tip-item label="所属车间" v-if="judgeShow('workshopId')" prop="workshopId">
label="所属车间" v-if="judgeShow('workshopId')" prop="workshopId" >
<JnpfSelect v-model="dataForm.workshopId" @change="changeData('workshopId',-1)" <JnpfSelect v-model="dataForm.workshopId" @change="changeData('workshopId',-1)"
placeholder="请选择" :disabled="judgeWrite('workshopId')" clearable :style='{"width":"100%"}' :options="workshopIdOptions" :props="workshopIdProps" > placeholder="请选择" :disabled="judgeWrite('workshopId')" clearable
:style='{"width":"100%"}' :options="workshopIdOptions" :props="workshopIdProps">
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" v-if="judgeShow('status')" > <el-col :span="24" v-if="judgeShow('status')">
<jnpf-form-tip-item <jnpf-form-tip-item label="状态" v-if="judgeShow('status')" prop="status">
label="状态" v-if="judgeShow('status')" prop="status" >
<JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)" <JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)"
:disabled="judgeWrite('status')" optionType="button" direction="horizontal" :style='{"width":"100%"}' size="large" :options="statusOptions" :props="statusProps" > :disabled="judgeWrite('status')" optionType="button" direction="horizontal"
:style='{"width":"100%"}' size="large" :options="statusOptions"
:props="statusProps">
</JnpfRadio> </JnpfRadio>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" v-if="judgeShow('description')" > <el-col :span="24" v-if="judgeShow('description')">
<jnpf-form-tip-item <jnpf-form-tip-item label="描述" v-if="judgeShow('description')" prop="description">
label="描述" v-if="judgeShow('description')" prop="description" >
<JnpfTextarea v-model="dataForm.description" @change="changeData('description',-1)" <JnpfTextarea v-model="dataForm.description" @change="changeData('description',-1)"
placeholder="请输入" :disabled="judgeWrite('description')" clearable :style='{"width":"100%"}' :autosize='{"minRows":4,"maxRows":4}' > placeholder="请输入" :disabled="judgeWrite('description')" clearable
:style='{"width":"100%"}' :autosize='{"minRows":4,"maxRows":4}'>
</JnpfTextarea> </JnpfTextarea>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle <JnpfGroupTitle content="联系人信息" contentPosition="left">
content="联系人信息" contentPosition="left" >
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" v-if="judgeShow('-${html.relationField}')" > <el-col :span="24" v-if="judgeShow('-${html.relationField}')">
<jnpf-form-tip-item label-width="0"> <jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title"> <div class="JNPF-common-title">
<h2></h2> <h2></h2>
</div> </div>
<el-table :data="dataForm.businesscontactList" size='mini' > <el-table :data="dataForm.businesscontact1List" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column <el-table-column label="类型" v-if="judgeShow('businesscontact1-contactType')"
label="类型" v-if="judgeShow('businesscontact-contactType')" prop="contactType" > prop="contactType">
<template slot="header" > <template slot="header">
<span class="required-sign" v-if="judgeRequired('businesscontactList-contactType')" >*</span>类型 <span class="required-sign"
v-if="judgeRequired('businesscontactList-contactType')">*</span>类型
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfSelect v-model="scope.row.contactType" @change="changeData('businesscontact-contactType',scope.$index)" <JnpfSelect v-model="scope.row.contactType"
placeholder="请选择" :disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-contactType')" clearable :style='{"width":"100%"}' :options="businesscontactcontactTypeOptions" :props="businesscontactcontactTypeProps" > @change="changeData('businesscontact1-contactType',scope.$index)"
placeholder="请选择"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-contactType')"
clearable :style='{"width":"100%"}'
:options="businesscontact1contactTypeOptions"
:props="businesscontact1contactTypeProps">
</JnpfSelect> </JnpfSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="姓名" v-if="judgeShow('businesscontact1-name')" prop="name">
label="姓名" v-if="judgeShow('businesscontact-name')" prop="name" > <template slot="header">
<template slot="header" > <span class="required-sign"
<span class="required-sign" v-if="judgeRequired('businesscontactList-name')" >*</span>姓名 v-if="judgeRequired('businesscontactList-name')">*</span>姓名
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.name" @change="changeData('businesscontact-name',scope.$index)" <JnpfInput v-model="scope.row.name"
placeholder="请输入" :disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-name')" clearable :style='{"width":"100%"}'> @change="changeData('businesscontact1-name',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-name')"
clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="手机号" v-if="judgeShow('businesscontact1-phone')"
label="手机号" v-if="judgeShow('businesscontact-phone')" prop="phone" > prop="phone">
<template slot="header" > <template slot="header">
<span class="required-sign" v-if="judgeRequired('businesscontactList-phone')" >*</span>手机号 <span class="required-sign"
v-if="judgeRequired('businesscontactList-phone')">*</span>手机号
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.phone" @change="changeData('businesscontact-phone',scope.$index)" <JnpfInput v-model="scope.row.phone"
placeholder="请输入" :disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-phone')" clearable :style='{"width":"100%"}'> @change="changeData('businesscontact1-phone',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-phone')"
clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="座机" v-if="judgeShow('businesscontact1-landline')"
label="座机" v-if="judgeShow('businesscontact-landline')" prop="landline" > prop="landline">
<template slot="header" > <template slot="header">
<span class="required-sign" v-if="judgeRequired('businesscontactList-landline')" >*</span>座机 <span class="required-sign"
v-if="judgeRequired('businesscontactList-landline')">*</span>座机
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.landline" @change="changeData('businesscontact-landline',scope.$index)" <JnpfInput v-model="scope.row.landline"
placeholder="请输入" :disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-landline')" clearable :style='{"width":"100%"}'> @change="changeData('businesscontact1-landline',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-landline')"
clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="邮箱" v-if="judgeShow('businesscontact1-email')" prop="email">
label="邮箱" v-if="judgeShow('businesscontact-email')" prop="email" > <template slot="header">
<template slot="header" > <span class="required-sign"
<span class="required-sign" v-if="judgeRequired('businesscontactList-email')" >*</span>邮箱 v-if="judgeRequired('businesscontactList-email')">*</span>邮箱
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.email" @change="changeData('businesscontact-email',scope.$index)" <JnpfInput v-model="scope.row.email"
placeholder="请输入" :disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-email')" clearable :style='{"width":"100%"}'> @change="changeData('businesscontact1-email',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-email')"
clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="传真" v-if="judgeShow('businesscontact1-fax')" prop="fax">
label="传真" v-if="judgeShow('businesscontact-fax')" prop="fax" > <template slot="header">
<template slot="header" > <span class="required-sign"
<span class="required-sign" v-if="judgeRequired('businesscontactList-fax')" >*</span>传真 v-if="judgeRequired('businesscontactList-fax')">*</span>传真
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.fax" @change="changeData('businesscontact-fax',scope.$index)" <JnpfInput v-model="scope.row.fax"
placeholder="请输入" :disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-fax')" clearable :style='{"width":"100%"}'> @change="changeData('businesscontact1-fax',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-fax')"
clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="更新时间" v-if="judgeShow('businesscontact1-lastModifyTime')"
label="更新时间" v-if="judgeShow('businesscontact-lastModifyTime')" prop="lastModifyTime" > prop="lastModifyTime">
<template slot="header" > <template slot="header">
<span class="required-sign" v-if="judgeRequired('businesscontactList-lastModifyTime')" >*</span>更新时间 <span class="required-sign"
v-if="judgeRequired('businesscontactList-lastModifyTime')">*</span>更新时间
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.lastModifyTime" @change="changeData('businesscontact-lastModifyTime',scope.$index)" <JnpfInput v-model="scope.row.lastModifyTime"
placeholder="请输入" :disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-lastModifyTime')" clearable :style='{"width":"100%"}'> @change="changeData('businesscontact1-lastModifyTime',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-lastModifyTime')"
clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="50" v-if="!judgeWrite('businesscontactList')"> <el-table-column label="操作" width="50" v-if="!judgeWrite('businesscontactList')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delbusinesscontactList(scope.$index)"></el-button> <el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delbusinesscontact1List(scope.$index)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="table-actions" @click="addbusinesscontactList()" v-if="!judgeWrite('businesscontactList')"> <div class="table-actions" @click="addbusinesscontact1List()"
v-if="!judgeWrite('businesscontactList')">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -184,27 +208,27 @@
<!-- 表单结束 --> <!-- 表单结束 -->
</template> </template>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" <SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/> ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
</el-form> </el-form>
</el-row> </el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" /> <UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
</div> </div>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import {getFormById} from '@/api/workFlow/FormDesign' import { getFormById } from '@/api/workFlow/FormDesign'
import comMixin from '@/views/workFlow/workFlowForm/mixin'; import comMixin from '@/views/workFlow/workFlowForm/mixin';
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user' import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize' import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js' import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
export default { export default {
mixins: [comMixin], mixins: [comMixin],
components: { }, components: {},
props: [], props: [],
data() { data() {
return { return {
@ -218,48 +242,51 @@
loading: false, loading: false,
btnLoading: false, btnLoading: false,
formRef: 'formRef', formRef: 'formRef',
setting:{}, setting: {},
eventType: '', eventType: '',
userBoxVisible:false, userBoxVisible: false,
selectDialogVisible: false, selectDialogVisible: false,
currTableConf:{}, currTableConf: {},
dataValueAll:{}, dataValueAll: {},
addTableConf:{ addTableConf: {
businesscontactList :{"popupType":"dialog","hasPage":true,"popupTitle":"选择数据","pageSize":20,"columnOptions":[],"interfaceId":"","interfaceName":"","relationOptions":[],"templateJson":[],"popupWidth":"800px"}, businesscontact1List: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
}, },
// //
ableAll:{ ableAll: {
}, },
tableRows:{ tableRows: {
businesscontactList:{ businesscontact1List: {
contactTypeOptions:[], contactTypeOptions: [],
name : '', name: '',
nameOptions:[], nameOptions: [],
phone : '', phone: '',
phoneOptions:[], phoneOptions: [],
landline : '', landline: '',
landlineOptions:[], landlineOptions: [],
email : '', email: '',
emailOptions:[], emailOptions: [],
fax : '', fax: '',
faxOptions:[], faxOptions: [],
lastModifyTime : '', lastModifyTime: '',
lastModifyTimeOptions:[], lastModifyTimeOptions: [],
enabledmark:undefined enabledmark: undefined
}, },
}, },
Vmodel:"", Vmodel: "",
currVmodel:"", currVmodel: "",
dataForm: { dataForm: {
code : undefined, code: undefined,
name : undefined, name: undefined,
simpleName : undefined, simpleName: undefined,
type : undefined, type: undefined,
parentId : undefined, parentId: undefined,
workshopId : undefined, workshopId: undefined,
status : undefined, status: 1,
description : undefined, difflag: "5",
businesscontactList:[], diffFlag: "5",
description: undefined,
businesscontact1List: [],
version: 0, version: 0,
}, },
tableRequiredData: {}, tableRequiredData: {},
@ -301,34 +328,34 @@
}, },
], ],
}, },
typeOptions:[], typeOptions: [],
typeProps:{"label":"fullName","value":"id" }, typeProps: { "label": "fullName", "value": "id" },
parentIdOptions:[], parentIdOptions: [],
parentIdProps:{"label":"name","value":"id" }, parentIdProps: { "label": "name", "value": "id" },
workshopIdOptions:[], workshopIdOptions: [],
workshopIdProps:{"label":"name","value":"id" }, workshopIdProps: { "label": "name", "value": "id" },
statusOptions:[{"fullName":"启用","id":"1"},{"fullName":"禁用","id":"2"}], statusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
statusProps:{"label":"fullName","value":"id" }, statusProps: { "label": "fullName", "value": "id" },
businesscontactcontactTypeOptions:[], businesscontact1contactTypeOptions: [],
businesscontactcontactTypeProps:{"label":"fullName","value":"id" }, businesscontact1contactTypeProps: { "label": "fullName", "value": "id" },
childIndex:-1, childIndex: -1,
isEdit:false, isEdit: false,
interfaceRes: { interfaceRes: {
code:[] , code: [],
name:[] , name: [],
simpleName:[] , simpleName: [],
type:[] , type: [],
parentId:[] , parentId: [],
workshopId:[] , workshopId: [],
status:[] , status: [],
description:[] , description: [],
businesscontactcontactType: [] , businesscontact1contactType: [],
businesscontactname: [] , businesscontact1name: [],
businesscontactphone: [] , businesscontact1phone: [],
businesscontactlandline: [] , businesscontact1landline: [],
businesscontactemail: [] , businesscontact1email: [],
businesscontactfax: [] , businesscontact1fax: [],
businesscontactlastModifyTime: [] , businesscontact1lastModifyTime: [],
}, },
} }
}, },
@ -340,12 +367,12 @@
watch: {}, watch: {},
created() { created() {
this.getFormById() this.getFormById()
if(this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) { if (this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) {
this.initDefaultData() this.initDefaultData()
} }
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm)) this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
}, },
mounted() {}, mounted() { },
methods: { methods: {
changeData(model, index) { changeData(model, index) {
this.isEdit = false this.isEdit = false
@ -361,7 +388,7 @@
for (let i = 0; i < faceReList.length; i++) { for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) { if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options'; let options = 'get' + key + 'Options';
if(this[options]){ if (this[options]) {
this[options]() this[options]()
} }
this.changeData(key, index) this.changeData(key, index)
@ -370,8 +397,8 @@
} }
} }
}, },
changeDataFormData(type, data, model,index,defaultValue) { changeDataFormData(type, data, model, index, defaultValue) {
if(!this.isEdit) { if (!this.isEdit) {
if (type == 2) { if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) { for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) { if (index == -1) {
@ -385,17 +412,17 @@
} }
} }
}, },
dataAll(){ dataAll() {
this.gettypeOptions(); this.gettypeOptions();
this.getparentIdOptions(); this.getparentIdOptions();
this.getworkshopIdOptions(); this.getworkshopIdOptions();
this.getbusinesscontactcontactTypeOptions(); this.getbusinesscontact1contactTypeOptions();
}, },
selfGetInfo(dataForm) { selfGetInfo(dataForm) {
this.dataInfo(dataForm) this.dataInfo(dataForm)
}, },
beforeSubmit(){ beforeSubmit() {
const _data =this.dataList() const _data = this.dataList()
return _data return _data
}, },
selfInit() { selfInit() {
@ -403,7 +430,7 @@
}, },
getFormById() { getFormById() {
getFormById("521949393889270917").then(res => { getFormById("521949393889270917").then(res => {
this.dataForm.flowId = res.data&&res.data.flowId this.dataForm.flowId = res.data && res.data.flowId
// this.encode = res.data&&res.data.encode // this.encode = res.data&&res.data.encode
}) })
}, },
@ -438,13 +465,13 @@
} }
} }
} }
if (!this.businesscontactExist()) return if (!this.businesscontact1Exist()) return
return isOk return isOk
}, },
businesscontactExist() { businesscontact1Exist() {
let isOk = true; let isOk = true;
for(let i=0;i<this.dataForm.businesscontactList.length;i++){ for (let i = 0; i < this.dataForm.businesscontact1List.length; i++) {
const e = this.dataForm.businesscontactList[i]; const e = this.dataForm.businesscontact1List[i];
if (!e.contactType) { if (!e.contactType) {
this.$message({ this.$message({
message: '类型不能为空', message: '类型不能为空',
@ -494,24 +521,24 @@
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.parentId)) let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.parentId))
for (let i = 0; i < templateJsonList.length; i++) { for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i]; let json = templateJsonList[i];
if(json.relationField){ if (json.relationField) {
let relationFieldAll = json.relationField.split("-"); let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue; let val = json.defaultValue;
if(relationFieldAll.length>1 && index>-1){ if (relationFieldAll.length > 1 && index > -1) {
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:'' val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
}else { } else {
val = this.dataForm[relationFieldAll] val = this.dataForm[relationFieldAll]
} }
json.defaultValue = val json.defaultValue = val
} }
} }
let template ={ let template = {
paramList:templateJsonList paramList: templateJsonList
} }
getDataInterfaceRes('521651055751075845',template).then(res => { getDataInterfaceRes('521651055751075845', template).then(res => {
let data = res.data let data = res.data
this.parentIdOptions = data this.parentIdOptions = data
this.changeDataFormData(1,'parentId','parentId',index,'') this.changeDataFormData(1, 'parentId', 'parentId', index, '')
}) })
}, },
getworkshopIdOptions() { getworkshopIdOptions() {
@ -519,73 +546,73 @@
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.workshopId)) let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.workshopId))
for (let i = 0; i < templateJsonList.length; i++) { for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i]; let json = templateJsonList[i];
if(json.relationField){ if (json.relationField) {
let relationFieldAll = json.relationField.split("-"); let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue; let val = json.defaultValue;
if(relationFieldAll.length>1 && index>-1){ if (relationFieldAll.length > 1 && index > -1) {
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:'' val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
}else { } else {
val = this.dataForm[relationFieldAll] val = this.dataForm[relationFieldAll]
} }
json.defaultValue = val json.defaultValue = val
} }
} }
let template ={ let template = {
paramList:templateJsonList paramList: templateJsonList
} }
getDataInterfaceRes('521948662406847621',template).then(res => { getDataInterfaceRes('521948662406847621', template).then(res => {
let data = res.data let data = res.data
this.workshopIdOptions = data this.workshopIdOptions = data
this.changeDataFormData(1,'workshopId','workshopId',index,'') this.changeDataFormData(1, 'workshopId', 'workshopId', index, '')
}) })
}, },
getbusinesscontactcontactTypeOptions() { getbusinesscontact1contactTypeOptions() {
getDictionaryDataSelector('517959233023509701').then(res => { getDictionaryDataSelector('517959233023509701').then(res => {
this.businesscontactcontactTypeOptions = res.data.list this.businesscontact1contactTypeOptions = res.data.list
}) })
}, },
goBack() { goBack() {
this.$emit('refresh') this.$emit('refresh')
}, },
clearData(){ clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll)) this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
}, },
// //
initDefaultData() { initDefaultData() {
}, },
addbusinesscontactList(){ addbusinesscontact1List() {
let item = { let item = {
contactType:'', contactType: '',
contactTypeOptions:[], contactTypeOptions: [],
name:undefined, name: undefined,
phone:undefined, phone: undefined,
landline:undefined, landline: undefined,
email:undefined, email: undefined,
fax:undefined, fax: undefined,
lastModifyTime:undefined, lastModifyTime: undefined,
} }
this.getbusinesscontactList(item) this.getbusinesscontact1List(item)
}, },
delbusinesscontactList(index) { delbusinesscontact1List(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.dataForm.businesscontactList.splice(index, 1); this.dataForm.businesscontact1List.splice(index, 1);
}).catch(() => { }).catch(() => {
}); });
}, },
getbusinesscontactList(value){ getbusinesscontact1List(value) {
let item={...this.tableRows.businesscontactList,...value} let item = { ...this.tableRows.businesscontact1List, ...value }
this.dataForm.businesscontactList.push(item) this.dataForm.businesscontact1List.push(item)
this.childIndex=this.dataForm.businesscontactList.length-1 this.childIndex = this.dataForm.businesscontact1List.length - 1
this.isEdit = true this.isEdit = true
this.isEdit = false this.isEdit = false
this.childIndex = -1 this.childIndex = -1
}, },
openSelectDialog(key) { openSelectDialog(key) {
this.currTableConf=this.addTableConf[key] this.currTableConf = this.addTableConf[key]
this.currVmodel=key this.currVmodel = key
this.selectDialogVisible = true this.selectDialogVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.selectDialog.init() this.$refs.selectDialog.init()
@ -594,8 +621,8 @@
addForSelect(data) { addForSelect(data) {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let t = data[i] let t = data[i]
if(this['get'+this.currVmodel]){ if (this['get' + this.currVmodel]) {
this['get'+this.currVmodel](t) this['get' + this.currVmodel](t)
} }
} }
}, },
@ -662,21 +689,21 @@
} }
return timeDataValue; return timeDataValue;
}, },
dataList(){ dataList() {
var _data = this.dataForm; var _data = this.dataForm;
return _data; return _data;
}, },
dataInfo(dataAll){ dataInfo(dataAll) {
let _dataAll =dataAll let _dataAll = dataAll
this.dataForm = _dataAll this.dataForm = _dataAll
this.isEdit = true this.isEdit = true
this.dataAll() this.dataAll()
for(let i=0;i<_dataAll.businesscontactList.length;i++){ for (let i = 0; i < _dataAll.businesscontact1List.length; i++) {
this.childIndex = i this.childIndex = i
} }
this.childIndex=-1 this.childIndex = -1
}, },
}, },
} }
</script> </script>

@ -1,10 +1,4 @@
<template> <template>
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-left"> <div class="JNPF-common-layout-left">
@ -18,14 +12,9 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
<el-tree :data="treeData" <el-tree :data="treeData" class="JNPF-common-el-tree" highlight-current ref="treeBox"
class="JNPF-common-el-tree" highlight-current :expand-on-click-node="false" @node-click="handleNodeClick" node-key="id" :props="treeProps"
ref="treeBox" :expand-on-click-node="false" @node-click="handleNodeClick" :default-expand-all="expandsTree" :filter-node-method="filterNode" :lazy="false"
node-key="id"
:props="treeProps"
:default-expand-all="expandsTree"
:filter-node-method="filterNode"
:lazy="false"
v-if="refreshTree"> v-if="refreshTree">
<span class="custom-tree-node" slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node, data }">
<i :class="data.icon"></i> <i :class="data.icon"></i>
@ -33,19 +22,18 @@
</span> </span>
</el-tree> </el-tree>
</div> </div>
<div class="JNPF-common-layout-center"> <div class="JNPF-common-layout-center" v-if="diffFlag=='3'">
<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-col :span="6">
<el-form-item label="业务线编号"> <el-form-item label="父级业务线编号">
<el-input v-model="query.code" placeholder="请输入" clearable> </el-input> <el-input v-model="query.code" placeholder="请输入" clearable> </el-input>
</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="类型">
<JnpfSelect v-model="query.type" placeholder="请选择" clearable <JnpfSelect v-model="query.type" placeholder="请选择" clearable :options="typeOptions"
:options="typeOptions" :props="typeProps" multiple>
:props="typeProps" multiple >
</JnpfSelect> </JnpfSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -60,13 +48,17 @@
<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-upload" @click="handelUpload()" v-has="'btn_upload'" >导入 <el-button type="text" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()"
v-has="'btn_upload'">导入
</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">
@ -80,36 +72,19 @@
</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 prop="code" label="生产线编号" align="left">
>
<el-table-column
prop="code"
label="生产线编号" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="name" label="生产线名称" align="left">
prop="name"
label="生产线名称" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="simpleName" label=" 简称/英文名" align="left">
prop="simpleName"
label=" 简称/英文名" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="type" label="类型" align="left">
prop="type"
label="类型" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="description" label="描述" align="left">
prop="description"
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">
<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>
@ -119,27 +94,116 @@
<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"/> <div class="JNPF-common-layout-center" v-else-if="diffFlag=='5'">
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/> <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.code" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="类型">
<JnpfSelect v-model="query.type" placeholder="请选择" clearable :options="typeOptions"
:props="typeProps" multiple>
</JnpfSelect>
</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_addWork'"
@click="addOrUpdateHandleWork()">新增生产线
</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-upload" @click="handelUpload()"
v-has="'btn_upload'">导入
</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="code" label="生产线编号" align="left">
</el-table-column>
<el-table-column prop="name" label="生产线名称" align="left">
</el-table-column>
<el-table-column prop="simpleName" label=" 简称/英文名" align="left">
</el-table-column>
<el-table-column prop="type" label="类型" align="left">
</el-table-column>
<el-table-column prop="description" 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" /> <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
@ -153,8 +217,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>
@ -162,39 +227,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,
superQueryVisible: false, superQueryVisible: false,
@ -202,8 +267,8 @@
uploadBoxVisible: false, uploadBoxVisible: false,
detailVisible: false, detailVisible: false,
query: { query: {
code:undefined, code: undefined,
type:undefined, type: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -229,16 +294,17 @@
exportBoxVisible: false, exportBoxVisible: false,
treeData: [], treeData: [],
treeActiveId: '', treeActiveId: '',
typeOptions:[], diffFlag: '3',
typeProps:{"label":"fullName","value":"id" }, typeOptions: [],
parentIdOptions:[], typeProps: { "label": "fullName", "value": "id" },
parentIdProps:{"label":"name","value":"id" }, parentIdOptions: [],
workshopIdOptions:[], parentIdProps: { "label": "name", "value": "id" },
workshopIdProps:{"label":"name","value":"id" }, workshopIdOptions: [],
statusOptions:[{"fullName":"启用","id":"1"},{"fullName":"禁用","id":"2"}], workshopIdProps: { "label": "name", "value": "id" },
statusProps:{"label":"fullName","value":"id" }, statusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
tableField133_contactTypeOptions:[], statusProps: { "label": "fullName", "value": "id" },
tableField133_contactTypeProps:{"label":"fullName","value":"id" }, tableField133_contactTypeOptions: [],
tableField133_contactTypeProps: { "label": "fullName", "value": "id" },
interfaceRes: { interfaceRes: {
}, },
} }
@ -251,8 +317,8 @@
}, },
created() { created() {
getFormById("521949393889270917").then(res1 => { getFormById("521949393889270917").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.getTreeView(); this.getTreeView();
@ -293,9 +359,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) {
// //
@ -374,7 +440,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({
@ -417,24 +483,33 @@
this.typeOptions = res.data.list this.typeOptions = res.data.list
}) })
}, },
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()
}, },
getTreeView() { getTreeView() {
getDataInterfaceRes('519521191191380165').then(res => { request({
let data = res.data url: `/api/scm/BusinessLine/WorkTree`,
this.treeData = data method: 'get'
}).then(res => {
this.treeData = res.data
this.initSearchDataAndListData() this.initSearchDataAndListData()
}) })
}, },
// getTreeView() {
// getDataInterfaceRes('519521191191380165').then(res => {
// let data = res.data
// this.treeData = data
// this.initSearchDataAndListData()
// })
// },
getNodePath(node) { getNodePath(node) {
let fullPath = [] let fullPath = []
const loop = (node) => { const loop = (node) => {
@ -444,13 +519,13 @@
loop(node) loop(node)
return fullPath return fullPath
}, },
handleNodeClick(data,node) { handleNodeClick(data, node) {
this.treeActiveId = data.id this.treeActiveId = data.id
for(let key in this.query) this.diffFlag = data.diffFlag
{ for (let key in this.query) {
this.query[key] = undefined this.query[key] = undefined
} }
this.query.name = data.id this.query.parentId = data.id
this.listQuery = { this.listQuery = {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
@ -473,16 +548,16 @@
...this.query, ...this.query,
keyword: this.keyword, keyword: this.keyword,
dataType: 0, dataType: 0,
menuId:this.menuId, menuId: this.menuId,
moduleId:'521949393889270917', moduleId: '521949393889270917',
type:2, type: 2,
}; };
request({ request({
url: `/api/scm/BusinessLine/getList`, url: `/api/scm/BusinessLine1/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,
@ -496,7 +571,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/scm/BusinessLine/${id}`, url: `/api/scm/BusinessLine1/${id}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
@ -510,10 +585,10 @@
}).catch(() => { }).catch(() => {
}); });
}, },
handelUpload(){ handelUpload() {
this.uploadBoxVisible = true this.uploadBoxVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.UploadBox.init("","scm/BusinessLine") this.$refs.UploadBox.init("", "scm/BusinessLine1")
}) })
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
@ -534,7 +609,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/scm/BusinessLine/batchRemove`, url: `/api/scm/BusinessLine1/batchRemove`,
data: ids, data: ids,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
@ -560,13 +635,22 @@
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)
}
},
addOrUpdateHandleWork(row, flowState) {
if (!row) {
this.addHandle();
} else {
this.updateHandle(row, flowState)
} }
}, },
exportData() { exportData() {
this.exportBoxVisible = true this.exportBoxVisible = true
this.$nextTick(() => { this.$nextTick(() => {
@ -574,9 +658,9 @@
}) })
}, },
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/BusinessLine/Actions/Export`, url: `/api/scm/BusinessLine1/Actions/Export`,
method: 'post', method: 'post',
data: query data: query
}).then(res => { }).then(res => {
@ -587,14 +671,15 @@
}) })
}, },
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,
@ -654,5 +739,5 @@
if (isrRefresh) this.reset() if (isrRefresh) this.reset()
}, },
} }
} }
</script> </script>

@ -2,228 +2,237 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' :'编辑'" <el-dialog :title="!dataForm.id ? '新建' :'编辑'" :close-on-click-modal="false" append-to-body
:close-on-click-modal="false" append-to-body :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" > <el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right">
<template v-if="!loading"> <template v-if="!loading">
<!-- 具体表单 --> <!-- 具体表单 -->
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle <JnpfGroupTitle content="基础信息" contentPosition="left">
content="基础信息" contentPosition="left" >
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="计划编号" prop="timeCode">
label="计划编号" prop="timeCode" >
<JnpfInput v-model="dataForm.timeCode" @change="changeData('timeCode',-1)" <JnpfInput v-model="dataForm.timeCode" @change="changeData('timeCode',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}'> placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="计划名称" prop="timeName">
label="计划名称" prop="timeName" >
<JnpfInput v-model="dataForm.timeName" @change="changeData('timeName',-1)" <JnpfInput v-model="dataForm.timeName" @change="changeData('timeName',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="简称/英文名" prop="timeNm">
label="简称/英文名" prop="timeNm" >
<JnpfInput v-model="dataForm.timeNm" @change="changeData('timeNm',-1)" <JnpfInput v-model="dataForm.timeNm" @change="changeData('timeNm',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="有效时间" prop="startTime">
label="有效时间" prop="startTime" >
<JnpfDatePicker v-model="dataForm.startTime" @change="changeData('startTime',-1)" <JnpfDatePicker v-model="dataForm.startTime" @change="changeData('startTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" > :startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date"
format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="4" > <el-col :span="4">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfText <JnpfText
:textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":19,"line-height":32,"font-style":"normal","text-align":"left"}' content="至"> :textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":19,"line-height":32,"font-style":"normal","text-align":"left"}'
content="至">
</JnpfText> </JnpfText>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="结束时间" prop="endTime">
label="结束时间" prop="endTime" >
<JnpfDatePicker v-model="dataForm.endTime" @change="changeData('endTime',-1)" <JnpfDatePicker v-model="dataForm.endTime" @change="changeData('endTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" > :startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date"
format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item <jnpf-form-tip-item label="计划状态" prop="timeStatus">
label="计划状态" prop="timeStatus" >
<JnpfRadio v-model="dataForm.timeStatus" @change="changeData('timeStatus',-1)" <JnpfRadio v-model="dataForm.timeStatus" @change="changeData('timeStatus',-1)"
optionType="button" direction="horizontal" size="medium" :options="timeStatusOptions" :props="timeStatusProps" > optionType="button" direction="horizontal" size="medium"
:options="timeStatusOptions" :props="timeStatusProps">
</JnpfRadio> </JnpfRadio>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item <jnpf-form-tip-item label="描述" prop="remark">
label="描述" prop="remark" >
<JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)" <JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle <JnpfGroupTitle content="计划配置" contentPosition="left">
content="计划配置" contentPosition="left" >
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item <jnpf-form-tip-item label="倒班方式" prop="shiftMethod">
label="倒班方式" prop="shiftMethod" >
<JnpfSelect v-model="dataForm.shiftMethod" @change="changeData('shiftMethod',-1)" <JnpfSelect v-model="dataForm.shiftMethod" @change="changeData('shiftMethod',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="shiftMethodOptions" :props="shiftMethodProps" > placeholder="请选择" clearable :style='{"width":"100%"}' :options="shiftMethodOptions"
:props="shiftMethodProps">
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item label-width="0"> <jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title"> <div class="JNPF-common-title">
<h2>班次列表</h2> <h2>班次列表</h2>
</div> </div>
<el-table :data="dataForm.classplanitemList" size='mini' > <el-table :data="dataForm.classplanitemList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column <el-table-column label="班次名称" prop="timeId">
label="班次名称" prop="timeId" > <template slot="header" v-if="true">
<template slot="header" v-if="true" > <span class="required-sign">*</span>班次名称
<span class="required-sign" >*</span>班次名称
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.timeId" @change="changeData('classplanitem-timeId',scope.$index)" <JnpfPopupSelect v-model="scope.row.timeId"
:rowIndex="scope.$index" :formData="dataForm" :templateJson="interfaceRes.classplanitemtimeId" placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='time_name' :field="'timeId'+scope.$index" interfaceId="523033213203919429" :pageSize="20" :columnOptions="classplanitemtimeIdcolumnOptions" clearable :style='{"width":"100%"}'> @change="changeData('classplanitem-timeId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.classplanitemtimeId" placeholder="请选择" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='time_name' :field="'timeId'+scope.$index"
interfaceId="523033213203919429" :pageSize="20"
:columnOptions="classplanitemtimeIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect> </JnpfPopupSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="创建时间" prop="creatorTime">
label="创建时间" prop="creatorTime" > <template slot="header" v-if="false">
<template slot="header" v-if="false" > <span class="required-sign">*</span>创建时间
<span class="required-sign" >*</span>创建时间
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.creatorTime" @change="changeData('classplanitem-creatorTime',scope.$index)" <JnpfInput v-model="scope.row.creatorTime"
@change="changeData('classplanitem-creatorTime',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="创建用户" prop="creatorUserId">
label="创建用户" prop="creatorUserId" > <template slot="header" v-if="false">
<template slot="header" v-if="false" > <span class="required-sign">*</span>创建用户
<span class="required-sign" >*</span>创建用户
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.creatorUserId" @change="changeData('classplanitem-creatorUserId',scope.$index)" <JnpfInput v-model="scope.row.creatorUserId"
@change="changeData('classplanitem-creatorUserId',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="备注" prop="remark">
label="备注" prop="remark" > <template slot="header" v-if="false">
<template slot="header" v-if="false" > <span class="required-sign">*</span>备注
<span class="required-sign" >*</span>备注
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.remark" @change="changeData('classplanitem-remark',scope.$index)" <JnpfInput v-model="scope.row.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'> @change="changeData('classplanitem-remark',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="50" > <el-table-column label="操作" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delclassplanitemList(scope.$index)"></el-button> <el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delclassplanitemList(scope.$index)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="table-actions" @click="addclassplanitemList()" > <div class="table-actions" @click="addclassplanitemList()">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle <JnpfGroupTitle content="班组列表" contentPosition="left">
content="班组列表" contentPosition="left" >
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item label-width="0"> <jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title"> <div class="JNPF-common-title">
<h2>班次列表</h2> <h2>班次列表</h2>
</div> </div>
<el-table :data="dataForm.classplanteamList" size='mini' > <el-table :data="dataForm.classplanteamList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column <el-table-column label="班组id" prop="teamId">
label="班组id" prop="teamId" > <template slot="header" v-if="true">
<template slot="header" v-if="true" > <span class="required-sign">*</span>班组id
<span class="required-sign" >*</span>班组id
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.teamId" @change="changeData('classplanteam-teamId',scope.$index)" <JnpfPopupSelect v-model="scope.row.teamId"
:rowIndex="scope.$index" :formData="dataForm" :templateJson="interfaceRes.classplanteamteamId" placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='team_name' :field="'teamId'+scope.$index" interfaceId="523033213203919429" :pageSize="20" :columnOptions="classplanteamteamIdcolumnOptions" clearable :style='{"width":"100%"}'> @change="changeData('classplanteam-teamId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.classplanteamteamId" placeholder="请选择" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='team_name' :field="'teamId'+scope.$index"
interfaceId="523033213203919429" :pageSize="20"
:columnOptions="classplanteamteamIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect> </JnpfPopupSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="删除时间" prop="deleteTime">
label="删除时间" prop="deleteTime" > <template slot="header" v-if="false">
<template slot="header" v-if="false" > <span class="required-sign">*</span>删除时间
<span class="required-sign" >*</span>删除时间
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.deleteTime" @change="changeData('classplanteam-deleteTime',scope.$index)" <JnpfInput v-model="scope.row.deleteTime"
@change="changeData('classplanteam-deleteTime',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="创建时间" prop="creatorTime">
label="创建时间" prop="creatorTime" > <template slot="header" v-if="false">
<template slot="header" v-if="false" > <span class="required-sign">*</span>创建时间
<span class="required-sign" >*</span>创建时间
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.creatorTime" @change="changeData('classplanteam-creatorTime',scope.$index)" <JnpfInput v-model="scope.row.creatorTime"
@change="changeData('classplanteam-creatorTime',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="备注" prop="remark">
label="备注" prop="remark" > <template slot="header" v-if="false">
<template slot="header" v-if="false" > <span class="required-sign">*</span>备注
<span class="required-sign" >*</span>备注
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.remark" @change="changeData('classplanteam-remark',scope.$index)" <JnpfInput v-model="scope.row.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'> @change="changeData('classplanteam-remark',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="50" > <el-table-column label="操作" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delclassplanteamList(scope.$index)"></el-button> <el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delclassplanteamList(scope.$index)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="table-actions" @click="addclassplanteamList()" > <div class="table-actions" @click="addclassplanteamList()">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -232,7 +241,7 @@
</template> </template>
</el-form> </el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" <SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/> ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id"> <div class="upAndDown-button" v-if="dataForm.id">
@ -249,20 +258,20 @@
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button> <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user' import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize' import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js' import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
export default { export default {
components: { }, components: {},
props: [], props: [],
data() { data() {
return { return {
@ -276,56 +285,56 @@
loading: false, loading: false,
btnLoading: false, btnLoading: false,
formRef: 'formRef', formRef: 'formRef',
setting:{}, setting: {},
eventType: '', eventType: '',
userBoxVisible:false, userBoxVisible: false,
selectDialogVisible: false, selectDialogVisible: false,
currTableConf:{}, currTableConf: {},
dataValueAll:{}, dataValueAll: {},
addTableConf:{ addTableConf: {
classplanitemList :{"popupType":"dialog","hasPage":true,"popupTitle":"选择数据","pageSize":20,"columnOptions":[],"interfaceId":"","interfaceName":"","relationOptions":[],"templateJson":[],"popupWidth":"800px"}, classplanitemList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
classplanteamList :{"popupType":"dialog","hasPage":true,"popupTitle":"选择数据","pageSize":20,"columnOptions":[],"interfaceId":"","interfaceName":"","relationOptions":[],"templateJson":[],"popupWidth":"800px"}, classplanteamList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
}, },
// //
ableAll:{ ableAll: {
}, },
tableRows:{ tableRows: {
classplanitemList:{ classplanitemList: {
timeId : '', timeId: '',
timeIdOptions:[], timeIdOptions: [],
creatorTime : '', creatorTime: '',
creatorTimeOptions:[], creatorTimeOptions: [],
creatorUserId : '', creatorUserId: '',
creatorUserIdOptions:[], creatorUserIdOptions: [],
remark : '', remark: '',
remarkOptions:[], remarkOptions: [],
enabledmark:undefined enabledmark: undefined
}, },
classplanteamList:{ classplanteamList: {
teamId : '', teamId: '',
teamIdOptions:[], teamIdOptions: [],
deleteTime : '', deleteTime: '',
deleteTimeOptions:[], deleteTimeOptions: [],
creatorTime : '', creatorTime: '',
creatorTimeOptions:[], creatorTimeOptions: [],
remark : '', remark: '',
remarkOptions:[], remarkOptions: [],
enabledmark:undefined enabledmark: undefined
}, },
}, },
Vmodel:"", Vmodel: "",
currVmodel:"", currVmodel: "",
dataForm: { dataForm: {
timeCode : undefined, timeCode: undefined,
timeName : undefined, timeName: undefined,
timeNm : undefined, timeNm: undefined,
startTime : undefined, startTime: undefined,
endTime : undefined, endTime: undefined,
timeStatus : "1", timeStatus: "1",
remark : undefined, remark: undefined,
shiftMethod : undefined, shiftMethod: undefined,
classplanitemList:[], classplanitemList: [],
classplanteamList:[], classplanteamList: [],
version: 0, version: 0,
}, },
tableRequiredData: {}, tableRequiredData: {},
@ -367,31 +376,31 @@
}, },
], ],
}, },
timeStatusOptions:[{"fullName":"启用","id":"1"},{"fullName":"禁用","id":"2"}], timeStatusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
timeStatusProps:{"label":"fullName","value":"id" }, timeStatusProps: { "label": "fullName", "value": "id" },
shiftMethodOptions:[{"fullName":"按天","id":"1"},{"fullName":"按周","id":"2"},{"fullName":"按月","id":"3"},{"fullName":"按季度","id":"4"}], shiftMethodOptions: [{ "fullName": "按天", "id": "1" }, { "fullName": "按周", "id": "2" }, { "fullName": "按月", "id": "3" }, { "fullName": "按季度", "id": "4" }],
shiftMethodProps:{"label":"fullName","value":"id" }, shiftMethodProps: { "label": "fullName", "value": "id" },
classplanitemtimeIdcolumnOptions:[ {"label":"班次编号","value":"time_code"}, {"label":"班次名称","value":"time_name"},], classplanitemtimeIdcolumnOptions: [{ "label": "班次编号", "value": "time_code" }, { "label": "班次名称", "value": "time_name" },],
classplanteamteamIdcolumnOptions:[ {"label":"班次编号","value":"team_code"}, {"label":"班次名称","value":"team_name"},], classplanteamteamIdcolumnOptions: [{ "label": "班次编号", "value": "team_code" }, { "label": "班次名称", "value": "team_name" },],
childIndex:-1, childIndex: -1,
isEdit:false, isEdit: false,
interfaceRes: { interfaceRes: {
timeCode:[] , timeCode: [],
timeName:[] , timeName: [],
timeNm:[] , timeNm: [],
startTime:[] , startTime: [],
endTime:[] , endTime: [],
timeStatus:[] , timeStatus: [],
remark:[] , remark: [],
shiftMethod:[] , shiftMethod: [],
classplanitemtimeId: [] , classplanitemtimeId: [],
classplanitemcreatorTime: [] , classplanitemcreatorTime: [],
classplanitemcreatorUserId: [] , classplanitemcreatorUserId: [],
classplanitemremark: [] , classplanitemremark: [],
classplanteamteamId: [] , classplanteamteamId: [],
classplanteamdeleteTime: [] , classplanteamdeleteTime: [],
classplanteamcreatorTime: [] , classplanteamcreatorTime: [],
classplanteamremark: [] , classplanteamremark: [],
}, },
} }
}, },
@ -404,7 +413,7 @@
this.initDefaultData() this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm)) this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
}, },
mounted() {}, mounted() { },
methods: { methods: {
prev() { prev() {
this.index-- this.index--
@ -434,7 +443,7 @@
}, },
getInfo(id) { getInfo(id) {
request({ request({
url: '/api/scm/ClassPlan/'+ id, url: '/api/scm/ClassPlan/' + id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
@ -458,7 +467,7 @@
for (let i = 0; i < faceReList.length; i++) { for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) { if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options'; let options = 'get' + key + 'Options';
if(this[options]){ if (this[options]) {
this[options]() this[options]()
} }
this.changeData(key, index) this.changeData(key, index)
@ -467,8 +476,8 @@
} }
} }
}, },
changeDataFormData(type, data, model,index,defaultValue) { changeDataFormData(type, data, model, index, defaultValue) {
if(!this.isEdit) { if (!this.isEdit) {
if (type == 2) { if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) { for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) { if (index == -1) {
@ -482,11 +491,11 @@
} }
} }
}, },
dataAll(){ dataAll() {
}, },
classplanitemExist() { classplanitemExist() {
let isOk = true; let isOk = true;
for(let i=0;i<this.dataForm.classplanitemList.length;i++){ for (let i = 0; i < this.dataForm.classplanitemList.length; i++) {
const e = this.dataForm.classplanitemList[i]; const e = this.dataForm.classplanitemList[i];
if (!e.timeId) { if (!e.timeId) {
this.$message({ this.$message({
@ -502,7 +511,7 @@
}, },
classplanteamExist() { classplanteamExist() {
let isOk = true; let isOk = true;
for(let i=0;i<this.dataForm.classplanteamList.length;i++){ for (let i = 0; i < this.dataForm.classplanteamList.length; i++) {
const e = this.dataForm.classplanteamList[i]; const e = this.dataForm.classplanteamList[i];
if (!e.teamId) { if (!e.teamId) {
this.$message({ this.$message({
@ -516,10 +525,10 @@
} }
return isOk; return isOk;
}, },
clearData(){ clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll)) this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
}, },
init(id,isDetail,allList) { init(id, isDetail, allList) {
this.prevDis = false this.prevDis = false
this.nextDis = false this.nextDis = false
this.allList = allList || [] this.allList = allList || []
@ -538,16 +547,16 @@
this.dataForm.id = id || 0; this.dataForm.id = id || 0;
this.visible = true; this.visible = true;
this.$nextTick(() => { this.$nextTick(() => {
if(this.dataForm.id){ if (this.dataForm.id) {
this.loading = true this.loading = true
request({ request({
url: '/api/scm/ClassPlan/'+this.dataForm.id, url: '/api/scm/ClassPlan/' + this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
this.loading = false this.loading = false
}); });
}else{ } else {
this.clearData() this.clearData()
this.initDefaultData() this.initDefaultData()
} }
@ -570,7 +579,7 @@
}) })
}, },
request() { request() {
let _data =this.dataList() let _data = this.dataList()
if (this.dataFormSubmitType == 2) { if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true this.continueBtnLoading = true
} else { } else {
@ -600,13 +609,13 @@
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}).catch(()=>{ }).catch(() => {
this.btnLoading = false this.btnLoading = false
this.continueBtnLoading = false this.continueBtnLoading = false
}) })
}else{ } else {
request({ request({
url: '/api/scm/ClassPlan/'+this.dataForm.id, url: '/api/scm/ClassPlan/' + this.dataForm.id,
method: 'PUT', method: 'PUT',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -621,18 +630,18 @@
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}).catch(()=>{ }).catch(() => {
this.btnLoading = false this.btnLoading = false
this.continueBtnLoading = false this.continueBtnLoading = false
}) })
} }
}, },
addclassplanitemList(){ addclassplanitemList() {
let item = { let item = {
timeId:'', timeId: '',
creatorTime:undefined, creatorTime: undefined,
creatorUserId:undefined, creatorUserId: undefined,
remark:undefined, remark: undefined,
} }
this.getclassplanitemList(item) this.getclassplanitemList(item)
}, },
@ -644,20 +653,20 @@
}).catch(() => { }).catch(() => {
}); });
}, },
getclassplanitemList(value){ getclassplanitemList(value) {
let item={...this.tableRows.classplanitemList,...value} let item = { ...this.tableRows.classplanitemList, ...value }
this.dataForm.classplanitemList.push(item) this.dataForm.classplanitemList.push(item)
this.childIndex=this.dataForm.classplanitemList.length-1 this.childIndex = this.dataForm.classplanitemList.length - 1
this.isEdit = true this.isEdit = true
this.isEdit = false this.isEdit = false
this.childIndex = -1 this.childIndex = -1
}, },
addclassplanteamList(){ addclassplanteamList() {
let item = { let item = {
teamId:'', teamId: '',
deleteTime:undefined, deleteTime: undefined,
creatorTime:undefined, creatorTime: undefined,
remark:undefined, remark: undefined,
} }
this.getclassplanteamList(item) this.getclassplanteamList(item)
}, },
@ -669,17 +678,17 @@
}).catch(() => { }).catch(() => {
}); });
}, },
getclassplanteamList(value){ getclassplanteamList(value) {
let item={...this.tableRows.classplanteamList,...value} let item = { ...this.tableRows.classplanteamList, ...value }
this.dataForm.classplanteamList.push(item) this.dataForm.classplanteamList.push(item)
this.childIndex=this.dataForm.classplanteamList.length-1 this.childIndex = this.dataForm.classplanteamList.length - 1
this.isEdit = true this.isEdit = true
this.isEdit = false this.isEdit = false
this.childIndex = -1 this.childIndex = -1
}, },
openSelectDialog(key) { openSelectDialog(key) {
this.currTableConf=this.addTableConf[key] this.currTableConf = this.addTableConf[key]
this.currVmodel=key this.currVmodel = key
this.selectDialogVisible = true this.selectDialogVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.selectDialog.init() this.$refs.selectDialog.init()
@ -688,8 +697,8 @@
addForSelect(data) { addForSelect(data) {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let t = data[i] let t = data[i]
if(this['get'+this.currVmodel]){ if (this['get' + this.currVmodel]) {
this['get'+this.currVmodel](t) this['get' + this.currVmodel](t)
} }
} }
}, },
@ -756,24 +765,24 @@
} }
return timeDataValue; return timeDataValue;
}, },
dataList(){ dataList() {
var _data = this.dataForm; var _data = this.dataForm;
return _data; return _data;
}, },
dataInfo(dataAll){ dataInfo(dataAll) {
let _dataAll =dataAll let _dataAll = dataAll
this.dataForm = _dataAll this.dataForm = _dataAll
this.isEdit = true this.isEdit = true
this.dataAll() this.dataAll()
for(let i=0;i<_dataAll.classplanitemList.length;i++){ for (let i = 0; i < _dataAll.classplanitemList.length; i++) {
this.childIndex = i this.childIndex = i
} }
for(let i=0;i<_dataAll.classplanteamList.length;i++){ for (let i = 0; i < _dataAll.classplanteamList.length; i++) {
this.childIndex = i this.childIndex = i
} }
this.childIndex=-1 this.childIndex = -1
}, },
}, },
} }
</script> </script>

@ -18,16 +18,14 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="计划状态"> <el-form-item label="计划状态">
<JnpfSelect v-model="query.timeStatus" placeholder="请选择" clearable <JnpfSelect v-model="query.timeStatus" placeholder="请选择" clearable
:options="timeStatusOptions" :options="timeStatusOptions" :props="timeStatusProps">
:props="timeStatusProps" >
</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="倒班方式">
<JnpfSelect v-model="query.shiftMethod" placeholder="请选择" clearable <JnpfSelect v-model="query.shiftMethod" placeholder="请选择" clearable
:options="shiftMethodOptions" :options="shiftMethodOptions" :props="shiftMethodProps" multiple>
:props="shiftMethodProps" multiple >
</JnpfSelect> </JnpfSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -42,11 +40,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">
@ -60,62 +61,44 @@
</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 prop="timeCode" label="计划编号" align="left">
>
<el-table-column
prop="timeCode"
label="计划编号" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="timeName" label="计划名称" align="left">
prop="timeName"
label="计划名称" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="startTime" label="有效时间" align="left">
prop="startTime"
label="有效时间" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="endTime" label="结束时间" align="left">
prop="endTime"
label="结束时间" align="left"
>
</el-table-column> </el-table-column>
<el-table-column label="计划状态" prop="timeStatus" algin="left" <el-table-column label="计划状态" prop="timeStatus" algin="left">
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.timeStatus}} {{ scope.row.timeStatus}}
</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" @click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'">
<el-button type="text"
@click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'" >编辑
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'" @click="handleDel(scope.row.id)"> <el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'"
@click="handleDel(scope.row.id)">删除
</el-button> </el-button>
<el-button type="text" v-has="'btn_detail'" <el-button type="text" v-has="'btn_detail'" @click="goDetail(scope.row.id)">
@click="goDetail(scope.row.id)">详情
</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" />
<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>
@ -123,39 +106,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 JNPFForm from './form' import JNPFForm from './form'
import Detail from './Detail' import Detail from './Detail'
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: {
JNPFForm, JNPFForm,
Detail, Detail,
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,
superQueryVisible: false, superQueryVisible: false,
@ -163,9 +146,9 @@
uploadBoxVisible: false, uploadBoxVisible: false,
detailVisible: false, detailVisible: false,
query: { query: {
timeName:undefined, timeName: undefined,
timeStatus:undefined, timeStatus: undefined,
shiftMethod:undefined, shiftMethod: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -189,15 +172,15 @@
flowListVisible: false, flowListVisible: false,
flowList: [], flowList: [],
exportBoxVisible: false, exportBoxVisible: false,
timeStatusOptions:[{"fullName":"启用","id":"1"},{"fullName":"禁用","id":"2"}], timeStatusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
timeStatusProps:{"label":"fullName","value":"id" }, timeStatusProps: { "label": "fullName", "value": "id" },
shiftMethodOptions:[{"fullName":"按天","id":"1"},{"fullName":"按周","id":"2"},{"fullName":"按月","id":"3"},{"fullName":"按季度","id":"4"}], shiftMethodOptions: [{ "fullName": "按天", "id": "1" }, { "fullName": "按周", "id": "2" }, { "fullName": "按月", "id": "3" }, { "fullName": "按季度", "id": "4" }],
shiftMethodProps:{"label":"fullName","value":"id" }, shiftMethodProps: { "label": "fullName", "value": "id" },
tableField113_timeIdcolumnOptions:[ {"label":"班次编号","value":"time_code"}, {"label":"班次名称","value":"time_name"},], tableField113_timeIdcolumnOptions: [{ "label": "班次编号", "value": "time_code" }, { "label": "班次名称", "value": "time_name" },],
tableField120_teamIdcolumnOptions:[ {"label":"班次编号","value":"team_code"}, {"label":"班次名称","value":"team_name"},], tableField120_teamIdcolumnOptions: [{ "label": "班次编号", "value": "team_code" }, { "label": "班次名称", "value": "team_name" },],
interfaceRes: { interfaceRes: {
tableField113_timeId: [] , tableField113_timeId: [],
tableField120_teamId: [] , tableField120_teamId: [],
}, },
} }
}, },
@ -241,9 +224,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) {
// //
@ -322,7 +305,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({
@ -360,13 +343,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()
@ -385,16 +368,16 @@
...this.query, ...this.query,
keyword: this.keyword, keyword: this.keyword,
dataType: 0, dataType: 0,
menuId:this.menuId, menuId: this.menuId,
moduleId:'523030944941093445', moduleId: '523030944941093445',
type:1, type: 1,
}; };
request({ request({
url: `/api/scm/ClassPlan/getList`, url: `/api/scm/ClassPlan/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,
@ -422,10 +405,10 @@
}).catch(() => { }).catch(() => {
}); });
}, },
handelUpload(){ handelUpload() {
this.uploadBoxVisible = true this.uploadBoxVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.UploadBox.init("","scm/ClassPlan") this.$refs.UploadBox.init("", "scm/ClassPlan")
}) })
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
@ -473,10 +456,10 @@
this.initData() this.initData()
}, },
addOrUpdateHandle(row, isDetail) { addOrUpdateHandle(row, isDetail) {
let id = row?row.id:"" let id = row ? row.id : ""
this.formVisible = true this.formVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail,this.list) this.$refs.JNPFForm.init(id, isDetail, this.list)
}) })
}, },
exportData() { exportData() {
@ -486,7 +469,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/ClassPlan/Actions/Export`, url: `/api/scm/ClassPlan/Actions/Export`,
method: 'post', method: 'post',
@ -499,10 +482,10 @@
}) })
}, },
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()
}, },
refresh(isrRefresh) { refresh(isrRefresh) {
@ -518,5 +501,5 @@
if (isrRefresh) this.reset() if (isrRefresh) this.reset()
}, },
} }
} }
</script> </script>

@ -70,9 +70,6 @@
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<jnpf-form-tip-item label-width="0"> <jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>设计子表</h2>
</div>
<el-table :data="dataForm.tableField114" size='mini' > <el-table :data="dataForm.tableField114" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="contactType" label="联系人类型" > <el-table-column prop="contactType" label="联系人类型" >
@ -122,9 +119,6 @@
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<jnpf-form-tip-item label-width="0"> <jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>设计子表</h2>
</div>
<el-table :data="dataForm.tableField123" size='mini' > <el-table :data="dataForm.tableField123" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="belongUserId" label="员工姓名" > <el-table-column prop="belongUserId" label="员工姓名" >

@ -2,219 +2,210 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' :'编辑'" <el-dialog :title="!dataForm.id ? '新建' :'编辑'" :close-on-click-modal="false" append-to-body
:close-on-click-modal="false" append-to-body :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" > <el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right">
<template v-if="!loading"> <template v-if="!loading">
<!-- 具体表单 --> <!-- 具体表单 -->
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle <JnpfGroupTitle content="基础信息" contentPosition="left">
content="基础信息" contentPosition="left" >
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="班组编号" prop="teamCode">
label="班组编号" prop="teamCode" >
<JnpfInput v-model="dataForm.teamCode" @change="changeData('teamCode',-1)" <JnpfInput v-model="dataForm.teamCode" @change="changeData('teamCode',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}'> placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="班组名称" prop="teamName">
label="班组名称" prop="teamName" >
<JnpfInput v-model="dataForm.teamName" @change="changeData('teamName',-1)" <JnpfInput v-model="dataForm.teamName" @change="changeData('teamName',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="班组简称" prop="teamNm">
label="班组简称" prop="teamNm" >
<JnpfInput v-model="dataForm.teamNm" @change="changeData('teamNm',-1)" <JnpfInput v-model="dataForm.teamNm" @change="changeData('teamNm',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="类型" prop="type">
label="类型" prop="type" > <JnpfSelect v-model="dataForm.type" @change="changeData('type',-1)" placeholder="请选择"
<JnpfSelect v-model="dataForm.type" @change="changeData('type',-1)" clearable :style='{"width":"100%"}' :options="typeOptions" :props="typeProps">
placeholder="请选择" clearable :style='{"width":"100%"}' :options="typeOptions" :props="typeProps" >
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="所属工厂" prop="parentId">
label="所属工厂" prop="parentId" >
<JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId',-1)" <JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="parentIdOptions" :props="parentIdProps" > placeholder="请选择" clearable :style='{"width":"100%"}' :options="parentIdOptions"
:props="parentIdProps">
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="所属车间" prop="parentIds">
label="所属车间" prop="parentIds" >
<JnpfSelect v-model="dataForm.parentIds" @change="changeData('parentIds',-1)" <JnpfSelect v-model="dataForm.parentIds" @change="changeData('parentIds',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="parentIdsOptions" :props="parentIdsProps" > placeholder="请选择" clearable :style='{"width":"100%"}' :options="parentIdsOptions"
:props="parentIdsProps">
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12">
<jnpf-form-tip-item <jnpf-form-tip-item label="班组状态" prop="teamStatus">
label="班组状态" prop="teamStatus" >
<JnpfRadio v-model="dataForm.teamStatus" @change="changeData('teamStatus',-1)" <JnpfRadio v-model="dataForm.teamStatus" @change="changeData('teamStatus',-1)"
optionType="default" direction="horizontal" size="medium" :options="teamStatusOptions" :props="teamStatusProps" > optionType="default" direction="horizontal" size="medium"
:options="teamStatusOptions" :props="teamStatusProps">
</JnpfRadio> </JnpfRadio>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item <jnpf-form-tip-item label="描述" prop="remark">
label="描述" prop="remark" >
<JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)" <JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle <JnpfGroupTitle content="联系人信息" contentPosition="left">
content="联系人信息" contentPosition="left" >
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item label-width="0"> <jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title"> <el-table :data="dataForm.businessContactTeamList" size='mini'>
<h2>设计子表</h2>
</div>
<el-table :data="dataForm.businesscontactteamList" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column <el-table-column label="联系人类型" prop="contactType">
label="联系人类型" prop="contactType" > <template slot="header" v-if="true">
<template slot="header" v-if="true" > <span class="required-sign">*</span>联系人类型
<span class="required-sign" >*</span>联系人类型
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfSelect v-model="scope.row.contactType" @change="changeData('businesscontactteam-contactType',scope.$index)" <JnpfSelect v-model="scope.row.contactType"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="businesscontactteamcontactTypeOptions" :props="businesscontactteamcontactTypeProps" > @change="changeData('businesscontactteam-contactType',scope.$index)"
placeholder="请选择" clearable :style='{"width":"100%"}'
:options="businesscontactteamcontactTypeOptions"
:props="businesscontactteamcontactTypeProps">
</JnpfSelect> </JnpfSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="姓名" prop="name">
label="姓名" prop="name" > <template slot="header" v-if="true">
<template slot="header" v-if="true" > <span class="required-sign">*</span>姓名
<span class="required-sign" >*</span>姓名
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.name" @change="changeData('businesscontactteam-name',scope.$index)" <JnpfInput v-model="scope.row.name"
@change="changeData('businesscontactteam-name',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="手机号" prop="phone">
label="手机号" prop="phone" > <template slot="header" v-if="true">
<template slot="header" v-if="true" > <span class="required-sign">*</span>手机号
<span class="required-sign" >*</span>手机号
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.phone" @change="changeData('businesscontactteam-phone',scope.$index)" <JnpfInput v-model="scope.row.phone"
@change="changeData('businesscontactteam-phone',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="座机" prop="landline">
label="座机" prop="landline" > <template slot="header" v-if="false">
<template slot="header" v-if="false" > <span class="required-sign">*</span>座机
<span class="required-sign" >*</span>座机
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.landline" @change="changeData('businesscontactteam-landline',scope.$index)" <JnpfInput v-model="scope.row.landline"
@change="changeData('businesscontactteam-landline',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="邮箱" prop="email">
label="邮箱" prop="email" > <template slot="header" v-if="false">
<template slot="header" v-if="false" > <span class="required-sign">*</span>邮箱
<span class="required-sign" >*</span>邮箱
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.email" @change="changeData('businesscontactteam-email',scope.$index)" <JnpfInput v-model="scope.row.email"
@change="changeData('businesscontactteam-email',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="传真" prop="fax">
label="传真" prop="fax" > <template slot="header" v-if="false">
<template slot="header" v-if="false" > <span class="required-sign">*</span>传真
<span class="required-sign" >*</span>传真
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.fax" @change="changeData('businesscontactteam-fax',scope.$index)" <JnpfInput v-model="scope.row.fax"
placeholder="请输入" clearable :style='{"width":"100%"}'> @change="changeData('businesscontactteam-fax',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="修改时间" prop="lastModifyTime">
label="修改时间" prop="lastModifyTime" > <template slot="header" v-if="false">
<template slot="header" v-if="false" > <span class="required-sign">*</span>修改时间
<span class="required-sign" >*</span>修改时间
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.lastModifyTime" @change="changeData('businesscontactteam-lastModifyTime',scope.$index)" <JnpfInput v-model="scope.row.lastModifyTime"
@change="changeData('businesscontactteam-lastModifyTime',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="50" > <el-table-column label="操作" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delbusinesscontactteamList(scope.$index)"></el-button> <el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delbusinesscontactteamList(scope.$index)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="table-actions" @click="addbusinesscontactteamList()" > <div class="table-actions" @click="addbusinesscontactteamList()">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle <JnpfGroupTitle content="班组人员" contentPosition="left">
content="班组人员" contentPosition="left" >
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item label-width="0"> <jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title"> <el-table :data="dataForm.classTeamUseList" size='mini'>
<h2>设计子表</h2>
</div>
<el-table :data="dataForm.classteamuseList" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column <el-table-column label="员工姓名" prop="belongUserId">
label="员工姓名" prop="belongUserId" > <template slot="header" v-if="false">
<template slot="header" v-if="false" > <span class="required-sign">*</span>员工姓名
<span class="required-sign" >*</span>员工姓名
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfUserSelect v-model="scope.row.belongUserId" @change="changeData('classteamuse-belongUserId',scope.$index)" <JnpfUserSelect v-model="scope.row.belongUserId"
placeholder="请选择" selectType="all" :ableIds="ableAll.classteamusebelongUserIdableIds" clearable :style='{"width":"100%"}'> @change="changeData('classteamuse-belongUserId',scope.$index)"
placeholder="请选择" selectType="all"
:ableIds="ableAll.classteamusebelongUserIdableIds" clearable
:style='{"width":"100%"}'>
</JnpfUserSelect> </JnpfUserSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="50" > <el-table-column label="操作" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delclassteamuseList(scope.$index)"></el-button> <el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delclassteamuseList(scope.$index)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="table-actions" @click="addclassteamuseList()" > <div class="table-actions" @click="addclassteamuseList()">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -223,7 +214,7 @@
</template> </template>
</el-form> </el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" <SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/> ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id"> <div class="upAndDown-button" v-if="dataForm.id">
@ -240,20 +231,20 @@
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button> <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user' import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize' import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js' import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
export default { export default {
components: { }, components: {},
props: [], props: [],
data() { data() {
return { return {
@ -267,54 +258,54 @@
loading: false, loading: false,
btnLoading: false, btnLoading: false,
formRef: 'formRef', formRef: 'formRef',
setting:{}, setting: {},
eventType: '', eventType: '',
userBoxVisible:false, userBoxVisible: false,
selectDialogVisible: false, selectDialogVisible: false,
currTableConf:{}, currTableConf: {},
dataValueAll:{}, dataValueAll: {},
addTableConf:{ addTableConf: {
businesscontactteamList :{"popupType":"dialog","hasPage":true,"popupTitle":"选择数据","pageSize":20,"columnOptions":[],"interfaceId":"","interfaceName":"","relationOptions":[],"templateJson":[],"popupWidth":"800px"}, businessContactTeamList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
classteamuseList :{"popupType":"dialog","hasPage":true,"popupTitle":"选择数据","pageSize":20,"columnOptions":[],"interfaceId":"","interfaceName":"","relationOptions":[],"templateJson":[],"popupWidth":"800px"}, classTeamUseList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
}, },
// //
ableAll:{ ableAll: {
}, },
tableRows:{ tableRows: {
businesscontactteamList:{ businessContactTeamList: {
contactTypeOptions:[], contactTypeOptions: [],
name : '', name: '',
nameOptions:[], nameOptions: [],
phone : '', phone: '',
phoneOptions:[], phoneOptions: [],
landline : '', landline: '',
landlineOptions:[], landlineOptions: [],
email : '', email: '',
emailOptions:[], emailOptions: [],
fax : '', fax: '',
faxOptions:[], faxOptions: [],
lastModifyTime : '', lastModifyTime: '',
lastModifyTimeOptions:[], lastModifyTimeOptions: [],
enabledmark:undefined enabledmark: undefined
}, },
classteamuseList:{ classTeamUseList: {
belongUserIdOptions:[], belongUserIdOptions: [],
enabledmark:undefined enabledmark: undefined
}, },
}, },
Vmodel:"", Vmodel: "",
currVmodel:"", currVmodel: "",
dataForm: { dataForm: {
teamCode : undefined, teamCode: undefined,
teamName : undefined, teamName: undefined,
teamNm : undefined, teamNm: undefined,
type : undefined, type: undefined,
parentId : undefined, parentId: undefined,
parentIds : undefined, parentIds: undefined,
teamStatus : "1", teamStatus: "1",
remark : undefined, remark: undefined,
businesscontactteamList:[], businessContactTeamList: [],
classteamuseList:[], classTeamUseList: [],
version: 0, version: 0,
}, },
tableRequiredData: {}, tableRequiredData: {},
@ -356,35 +347,35 @@
}, },
], ],
}, },
typeOptions:[], typeOptions: [],
typeProps:{"label":"fullName","value":"id" }, typeProps: { "label": "fullName", "value": "id" },
parentIdOptions:[], parentIdOptions: [],
parentIdProps:{"label":"fullName","value":"id" }, parentIdProps: { "label": "name", "value": "id" },
parentIdsOptions:[], parentIdsOptions: [],
parentIdsProps:{"label":"fullName","value":"id" }, parentIdsProps: { "label": "name", "value": "id" },
teamStatusOptions:[{"fullName":"启用","id":"1"},{"fullName":"禁用","id":"2"}], teamStatusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
teamStatusProps:{"label":"fullName","value":"id" }, teamStatusProps: { "label": "fullName", "value": "id" },
businesscontactteamcontactTypeOptions:[], businesscontactteamcontactTypeOptions: [],
businesscontactteamcontactTypeProps:{"label":"fullName","value":"id" }, businesscontactteamcontactTypeProps: { "label": "fullName", "value": "id" },
childIndex:-1, childIndex: -1,
isEdit:false, isEdit: false,
interfaceRes: { interfaceRes: {
teamCode:[] , teamCode: [],
teamName:[] , teamName: [],
teamNm:[] , teamNm: [],
type:[] , type: [],
parentId:[] , parentId: [],
parentIds:[] , parentIds: [],
teamStatus:[] , teamStatus: [],
remark:[] , remark: [],
businesscontactteamcontactType: [] , businesscontactteamcontactType: [],
businesscontactteamname: [] , businesscontactteamname: [],
businesscontactteamphone: [] , businesscontactteamphone: [],
businesscontactteamlandline: [] , businesscontactteamlandline: [],
businesscontactteamemail: [] , businesscontactteamemail: [],
businesscontactteamfax: [] , businesscontactteamfax: [],
businesscontactteamlastModifyTime: [] , businesscontactteamlastModifyTime: [],
classteamusebelongUserId: [] , classteamusebelongUserId: [],
}, },
} }
}, },
@ -397,7 +388,7 @@
this.initDefaultData() this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm)) this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
}, },
mounted() {}, mounted() { },
methods: { methods: {
prev() { prev() {
this.index-- this.index--
@ -427,7 +418,7 @@
}, },
getInfo(id) { getInfo(id) {
request({ request({
url: '/api/scm/ClassTeam/'+ id, url: '/api/scm/ClassTeam/' + id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
@ -451,7 +442,7 @@
for (let i = 0; i < faceReList.length; i++) { for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) { if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options'; let options = 'get' + key + 'Options';
if(this[options]){ if (this[options]) {
this[options]() this[options]()
} }
this.changeData(key, index) this.changeData(key, index)
@ -460,8 +451,8 @@
} }
} }
}, },
changeDataFormData(type, data, model,index,defaultValue) { changeDataFormData(type, data, model, index, defaultValue) {
if(!this.isEdit) { if (!this.isEdit) {
if (type == 2) { if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) { for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) { if (index == -1) {
@ -475,7 +466,7 @@
} }
} }
}, },
dataAll(){ dataAll() {
this.gettypeOptions(); this.gettypeOptions();
this.getparentIdOptions(); this.getparentIdOptions();
this.getparentIdsOptions(); this.getparentIdsOptions();
@ -483,8 +474,8 @@
}, },
businesscontactteamExist() { businesscontactteamExist() {
let isOk = true; let isOk = true;
for(let i=0;i<this.dataForm.businesscontactteamList.length;i++){ for (let i = 0; i < this.dataForm.businessContactTeamList.length; i++) {
const e = this.dataForm.businesscontactteamList[i]; const e = this.dataForm.businessContactTeamList[i];
if (!e.contactType) { if (!e.contactType) {
this.$message({ this.$message({
message: '联系人类型不能为空', message: '联系人类型不能为空',
@ -517,8 +508,8 @@
}, },
classteamuseExist() { classteamuseExist() {
let isOk = true; let isOk = true;
for(let i=0;i<this.dataForm.classteamuseList.length;i++){ for (let i = 0; i < this.dataForm.classTeamUseList.length; i++) {
const e = this.dataForm.classteamuseList[i]; const e = this.dataForm.classTeamUseList[i];
} }
return isOk; return isOk;
}, },
@ -532,24 +523,24 @@
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.parentId)) let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.parentId))
for (let i = 0; i < templateJsonList.length; i++) { for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i]; let json = templateJsonList[i];
if(json.relationField){ if (json.relationField) {
let relationFieldAll = json.relationField.split("-"); let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue; let val = json.defaultValue;
if(relationFieldAll.length>1 && index>-1){ if (relationFieldAll.length > 1 && index > -1) {
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:'' val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
}else { } else {
val = this.dataForm[relationFieldAll] val = this.dataForm[relationFieldAll]
} }
json.defaultValue = val json.defaultValue = val
} }
} }
let template ={ let template = {
paramList:templateJsonList paramList: templateJsonList
} }
getDataInterfaceRes('521651055751075845',template).then(res => { getDataInterfaceRes('521651055751075845', template).then(res => {
let data = res.data let data = res.data
this.parentIdOptions = data this.parentIdOptions = data
this.changeDataFormData(1,'parentId','parentId',index,'') this.changeDataFormData(1, 'parentId', 'parentId', index, '')
}) })
}, },
getparentIdsOptions() { getparentIdsOptions() {
@ -557,24 +548,24 @@
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.parentIds)) let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.parentIds))
for (let i = 0; i < templateJsonList.length; i++) { for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i]; let json = templateJsonList[i];
if(json.relationField){ if (json.relationField) {
let relationFieldAll = json.relationField.split("-"); let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue; let val = json.defaultValue;
if(relationFieldAll.length>1 && index>-1){ if (relationFieldAll.length > 1 && index > -1) {
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:'' val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
}else { } else {
val = this.dataForm[relationFieldAll] val = this.dataForm[relationFieldAll]
} }
json.defaultValue = val json.defaultValue = val
} }
} }
let template ={ let template = {
paramList:templateJsonList paramList: templateJsonList
} }
getDataInterfaceRes('521948662406847621',template).then(res => { getDataInterfaceRes('521948662406847621', template).then(res => {
let data = res.data let data = res.data
this.parentIdsOptions = data this.parentIdsOptions = data
this.changeDataFormData(1,'parentIds','parentIds',index,'') this.changeDataFormData(1, 'parentIds', 'parentIds', index, '')
}) })
}, },
getbusinesscontactteamcontactTypeOptions() { getbusinesscontactteamcontactTypeOptions() {
@ -582,10 +573,10 @@
this.businesscontactteamcontactTypeOptions = res.data.list this.businesscontactteamcontactTypeOptions = res.data.list
}) })
}, },
clearData(){ clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll)) this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
}, },
init(id,isDetail,allList) { init(id, isDetail, allList) {
this.prevDis = false this.prevDis = false
this.nextDis = false this.nextDis = false
this.allList = allList || [] this.allList = allList || []
@ -604,16 +595,16 @@
this.dataForm.id = id || 0; this.dataForm.id = id || 0;
this.visible = true; this.visible = true;
this.$nextTick(() => { this.$nextTick(() => {
if(this.dataForm.id){ if (this.dataForm.id) {
this.loading = true this.loading = true
request({ request({
url: '/api/scm/ClassTeam/'+this.dataForm.id, url: '/api/scm/ClassTeam/' + this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
this.loading = false this.loading = false
}); });
}else{ } else {
this.clearData() this.clearData()
this.initDefaultData() this.initDefaultData()
} }
@ -636,7 +627,7 @@
}) })
}, },
request() { request() {
let _data =this.dataList() let _data = this.dataList()
if (this.dataFormSubmitType == 2) { if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true this.continueBtnLoading = true
} else { } else {
@ -666,13 +657,13 @@
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}).catch(()=>{ }).catch(() => {
this.btnLoading = false this.btnLoading = false
this.continueBtnLoading = false this.continueBtnLoading = false
}) })
}else{ } else {
request({ request({
url: '/api/scm/ClassTeam/'+this.dataForm.id, url: '/api/scm/ClassTeam/' + this.dataForm.id,
method: 'PUT', method: 'PUT',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -687,22 +678,22 @@
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}).catch(()=>{ }).catch(() => {
this.btnLoading = false this.btnLoading = false
this.continueBtnLoading = false this.continueBtnLoading = false
}) })
} }
}, },
addbusinesscontactteamList(){ addbusinesscontactteamList() {
let item = { let item = {
contactType:'', contactType: '',
contactTypeOptions:[], contactTypeOptions: [],
name:undefined, name: undefined,
phone:undefined, phone: undefined,
landline:undefined, landline: undefined,
email:undefined, email: undefined,
fax:undefined, fax: undefined,
lastModifyTime:undefined, lastModifyTime: undefined,
} }
this.getbusinesscontactteamList(item) this.getbusinesscontactteamList(item)
}, },
@ -710,21 +701,21 @@
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.dataForm.businesscontactteamList.splice(index, 1); this.dataForm.businessContactTeamList.splice(index, 1);
}).catch(() => { }).catch(() => {
}); });
}, },
getbusinesscontactteamList(value){ getbusinesscontactteamList(value) {
let item={...this.tableRows.businesscontactteamList,...value} let item = { ...this.tableRows.businessContactTeamList, ...value }
this.dataForm.businesscontactteamList.push(item) this.dataForm.businessContactTeamList.push(item)
this.childIndex=this.dataForm.businesscontactteamList.length-1 this.childIndex = this.dataForm.businessContactTeamList.length - 1
this.isEdit = true this.isEdit = true
this.isEdit = false this.isEdit = false
this.childIndex = -1 this.childIndex = -1
}, },
addclassteamuseList(){ addclassteamuseList() {
let item = { let item = {
belongUserId:undefined, belongUserId: undefined,
} }
this.getclassteamuseList(item) this.getclassteamuseList(item)
}, },
@ -732,21 +723,21 @@
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.dataForm.classteamuseList.splice(index, 1); this.dataForm.classTeamUseList.splice(index, 1);
}).catch(() => { }).catch(() => {
}); });
}, },
getclassteamuseList(value){ getclassteamuseList(value) {
let item={...this.tableRows.classteamuseList,...value} let item = { ...this.tableRows.classTeamUseList, ...value }
this.dataForm.classteamuseList.push(item) this.dataForm.classTeamUseList.push(item)
this.childIndex=this.dataForm.classteamuseList.length-1 this.childIndex = this.dataForm.classTeamUseList.length - 1
this.isEdit = true this.isEdit = true
this.isEdit = false this.isEdit = false
this.childIndex = -1 this.childIndex = -1
}, },
openSelectDialog(key) { openSelectDialog(key) {
this.currTableConf=this.addTableConf[key] this.currTableConf = this.addTableConf[key]
this.currVmodel=key this.currVmodel = key
this.selectDialogVisible = true this.selectDialogVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.selectDialog.init() this.$refs.selectDialog.init()
@ -755,8 +746,8 @@
addForSelect(data) { addForSelect(data) {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let t = data[i] let t = data[i]
if(this['get'+this.currVmodel]){ if (this['get' + this.currVmodel]) {
this['get'+this.currVmodel](t) this['get' + this.currVmodel](t)
} }
} }
}, },
@ -823,24 +814,24 @@
} }
return timeDataValue; return timeDataValue;
}, },
dataList(){ dataList() {
var _data = this.dataForm; var _data = this.dataForm;
return _data; return _data;
}, },
dataInfo(dataAll){ dataInfo(dataAll) {
let _dataAll =dataAll let _dataAll = dataAll
this.dataForm = _dataAll this.dataForm = _dataAll
this.isEdit = true this.isEdit = true
this.dataAll() this.dataAll()
for(let i=0;i<_dataAll.businesscontactteamList.length;i++){ for (let i = 0; i < _dataAll.businessContactTeamList.length; i++) {
this.childIndex = i this.childIndex = i
} }
for(let i=0;i<_dataAll.classteamuseList.length;i++){ for (let i = 0; i < _dataAll.classTeamUseList.length; i++) {
this.childIndex = i this.childIndex = i
} }
this.childIndex=-1 this.childIndex = -1
}, },
}, },
} }
</script> </script>

@ -28,33 +28,29 @@
<template v-if="showAll"> <template v-if="showAll">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="类型"> <el-form-item label="类型">
<JnpfSelect v-model="query.type" placeholder="请选择" clearable <JnpfSelect v-model="query.type" placeholder="请选择" clearable :options="typeOptions"
:options="typeOptions" :props="typeProps" multiple>
:props="typeProps" multiple >
</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="所属工厂">
<JnpfSelect v-model="query.parentId" placeholder="请选择" clearable <JnpfSelect v-model="query.parentId" placeholder="请选择" clearable
:options="parentIdOptions" :options="parentIdOptions" :props="parentIdProps" multiple>
:props="parentIdProps" multiple >
</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="所属车间">
<JnpfSelect v-model="query.parentIds" placeholder="请选择" clearable <JnpfSelect v-model="query.parentIds" placeholder="请选择" clearable
:options="parentIdsOptions" :options="parentIdsOptions" :props="parentIdsProps" multiple>
:props="parentIdsProps" multiple >
</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="班组状态">
<JnpfSelect v-model="query.teamStatus" placeholder="请选择" clearable <JnpfSelect v-model="query.teamStatus" placeholder="请选择" clearable
:options="teamStatusOptions" :options="teamStatusOptions" :props="teamStatusProps">
:props="teamStatusProps" >
</JnpfSelect> </JnpfSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -63,7 +59,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>
@ -76,11 +73,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">
@ -94,51 +94,54 @@
</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 prop="teamCode" label="班组编号" align="left">
</el-table-column>
<el-table-column prop="teamName" label="班组名称" align="left">
</el-table-column>
<el-table-column prop="type" label="类型" align="left">
</el-table-column>
<el-table-column label="状态" prop="teamStatus" algin="left">
<template slot-scope="scope">
{{ scope.row.teamStatus}}
</template>
</el-table-column>
<el-table-column prop="classTeamUseNum" label="班组成员" align="left">
</el-table-column>
> <el-table-column prop="creatorTime" label="添加时间" align="left">
<el-table-column
prop="teamCode"
label="班组编号" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="creatorUserId" label="添加人" align="left">
prop="teamName"
label="班组名称" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="lastModifyTime" label="更新时间" align="left">
prop="type"
label="类型" align="left"
>
</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" <el-button type="text" @click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'">
@click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'" >编辑
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'" @click="handleDel(scope.row.id)"> <el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'"
@click="handleDel(scope.row.id)">删除
</el-button> </el-button>
<el-button type="text" v-has="'btn_detail'" <el-button type="text" v-has="'btn_detail'" @click="goDetail(scope.row.id)">
@click="goDetail(scope.row.id)">详情
</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" />
<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>
@ -146,39 +149,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 JNPFForm from './form' import JNPFForm from './form'
import Detail from './Detail' import Detail from './Detail'
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: {
JNPFForm, JNPFForm,
Detail, Detail,
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,
@ -187,13 +190,13 @@
uploadBoxVisible: false, uploadBoxVisible: false,
detailVisible: false, detailVisible: false,
query: { query: {
teamCode:undefined, teamCode: undefined,
teamName:undefined, teamName: undefined,
teamNm:undefined, teamNm: undefined,
type:undefined, type: undefined,
parentId:undefined, parentId: undefined,
parentIds:undefined, parentIds: undefined,
teamStatus:undefined, teamStatus: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -217,16 +220,16 @@
flowListVisible: false, flowListVisible: false,
flowList: [], flowList: [],
exportBoxVisible: false, exportBoxVisible: false,
typeOptions:[], typeOptions: [],
typeProps:{"label":"fullName","value":"id" }, typeProps: { "label": "fullName", "value": "id" },
parentIdOptions:[], parentIdOptions: [],
parentIdProps:{"label":"fullName","value":"id" }, parentIdProps: { "label": "fullName", "value": "id" },
parentIdsOptions:[], parentIdsOptions: [],
parentIdsProps:{"label":"fullName","value":"id" }, parentIdsProps: { "label": "fullName", "value": "id" },
teamStatusOptions:[{"fullName":"启用","id":"1"},{"fullName":"禁用","id":"2"}], teamStatusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
teamStatusProps:{"label":"fullName","value":"id" }, teamStatusProps: { "label": "fullName", "value": "id" },
tableField114_contactTypeOptions:[], tableField114_contactTypeOptions: [],
tableField114_contactTypeProps:{"label":"fullName","value":"id" }, tableField114_contactTypeProps: { "label": "fullName", "value": "id" },
interfaceRes: { interfaceRes: {
}, },
} }
@ -274,9 +277,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) {
// //
@ -355,7 +358,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({
@ -410,13 +413,13 @@
this.parentIdsOptions = data this.parentIdsOptions = data
}) })
}, },
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()
@ -435,16 +438,16 @@
...this.query, ...this.query,
keyword: this.keyword, keyword: this.keyword,
dataType: 0, dataType: 0,
menuId:this.menuId, menuId: this.menuId,
moduleId:'522443214272080773', moduleId: '522443214272080773',
type:1, type: 1,
}; };
request({ request({
url: `/api/scm/ClassTeam/getList`, url: `/api/scm/ClassTeam/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,
@ -472,10 +475,10 @@
}).catch(() => { }).catch(() => {
}); });
}, },
handelUpload(){ handelUpload() {
this.uploadBoxVisible = true this.uploadBoxVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.UploadBox.init("","scm/ClassTeam") this.$refs.UploadBox.init("", "scm/ClassTeam")
}) })
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
@ -523,10 +526,10 @@
this.initData() this.initData()
}, },
addOrUpdateHandle(row, isDetail) { addOrUpdateHandle(row, isDetail) {
let id = row?row.id:"" let id = row ? row.id : ""
this.formVisible = true this.formVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail,this.list) this.$refs.JNPFForm.init(id, isDetail, this.list)
}) })
}, },
exportData() { exportData() {
@ -536,7 +539,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/ClassTeam/Actions/Export`, url: `/api/scm/ClassTeam/Actions/Export`,
method: 'post', method: 'post',
@ -549,10 +552,10 @@
}) })
}, },
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()
}, },
refresh(isrRefresh) { refresh(isrRefresh) {
@ -568,5 +571,5 @@
if (isrRefresh) this.reset() if (isrRefresh) this.reset()
}, },
} }
} }
</script> </script>

@ -23,8 +23,7 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="状态"> <el-form-item label="状态">
<JnpfSelect v-model="query.timeStatus" placeholder="请选择" clearable <JnpfSelect v-model="query.timeStatus" placeholder="请选择" clearable
:options="timeStatusOptions" :options="timeStatusOptions" :props="timeStatusProps">
:props="timeStatusProps" >
</JnpfSelect> </JnpfSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -39,11 +38,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">
@ -57,67 +59,46 @@
</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 prop="timeCode" label="班组编号" align="left">
>
<el-table-column
prop="timeCode"
label="班组编号" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="timeName" label="班组名称" align="left">
prop="timeName"
label="班组名称" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="startTime" label="开始时间" align="left">
prop="startTime"
label="开始时间" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="endTime" label="结束时间" align="left">
prop="endTime"
label="结束时间" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="timeNm" label="班组简称" align="left">
prop="timeNm"
label="班组简称" align="left"
>
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="timeStatus" algin="left" <el-table-column label="状态" prop="timeStatus" algin="left">
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.timeStatus}} {{ scope.row.timeStatus}}
</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" @click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'">
<el-button type="text"
@click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'" >编辑
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'" @click="handleDel(scope.row.id)"> <el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'"
@click="handleDel(scope.row.id)">删除
</el-button> </el-button>
<el-button type="text" v-has="'btn_detail'" <el-button type="text" v-has="'btn_detail'" @click="goDetail(scope.row.id)">
@click="goDetail(scope.row.id)">详情
</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" />
<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>
@ -125,39 +106,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 JNPFForm from './form' import JNPFForm from './form'
import Detail from './Detail' import Detail from './Detail'
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: {
JNPFForm, JNPFForm,
Detail, Detail,
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,
superQueryVisible: false, superQueryVisible: false,
@ -165,9 +146,9 @@
uploadBoxVisible: false, uploadBoxVisible: false,
detailVisible: false, detailVisible: false,
query: { query: {
timeCode:undefined, timeCode: undefined,
timeName:undefined, timeName: undefined,
timeStatus:undefined, timeStatus: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -191,8 +172,8 @@
flowListVisible: false, flowListVisible: false,
flowList: [], flowList: [],
exportBoxVisible: false, exportBoxVisible: false,
timeStatusOptions:[{"fullName":"启用","id":"1"},{"fullName":"禁用","id":"2"}], timeStatusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
timeStatusProps:{"label":"fullName","value":"id" }, timeStatusProps: { "label": "fullName", "value": "id" },
interfaceRes: { interfaceRes: {
}, },
} }
@ -237,9 +218,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) {
// //
@ -318,7 +299,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({
@ -356,13 +337,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()
@ -381,16 +362,16 @@
...this.query, ...this.query,
keyword: this.keyword, keyword: this.keyword,
dataType: 0, dataType: 0,
menuId:this.menuId, menuId: this.menuId,
moduleId:'522729389880782341', moduleId: '522729389880782341',
type:1, type: 1,
}; };
request({ request({
url: `/api/scm/ClassTime/getList`, url: `/api/scm/ClassTime/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,
@ -418,10 +399,10 @@
}).catch(() => { }).catch(() => {
}); });
}, },
handelUpload(){ handelUpload() {
this.uploadBoxVisible = true this.uploadBoxVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.UploadBox.init("","scm/ClassTime") this.$refs.UploadBox.init("", "scm/ClassTime")
}) })
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
@ -469,10 +450,10 @@
this.initData() this.initData()
}, },
addOrUpdateHandle(row, isDetail) { addOrUpdateHandle(row, isDetail) {
let id = row?row.id:"" let id = row ? row.id : ""
this.formVisible = true this.formVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail,this.list) this.$refs.JNPFForm.init(id, isDetail, this.list)
}) })
}, },
exportData() { exportData() {
@ -482,7 +463,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/ClassTime/Actions/Export`, url: `/api/scm/ClassTime/Actions/Export`,
method: 'post', method: 'post',
@ -495,10 +476,10 @@
}) })
}, },
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()
}, },
refresh(isrRefresh) { refresh(isrRefresh) {
@ -514,5 +495,5 @@
if (isrRefresh) this.reset() if (isrRefresh) this.reset()
}, },
} }
} }
</script> </script>

@ -2,35 +2,32 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' :'编辑'" <el-dialog :title="!dataForm.id ? '新建' :'编辑'" :close-on-click-modal="false" append-to-body
:close-on-click-modal="false" append-to-body :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="600px">
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" > <el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right">
<template v-if="!loading"> <template v-if="!loading">
<!-- 具体表单 --> <!-- 具体表单 -->
<el-col :span="12" > <el-col :span="12">
<jnpf-form-tip-item <jnpf-form-tip-item label="工序分类编码" prop="categoryCode">
label="工序分类编码" prop="categoryCode" >
<JnpfInput v-model="dataForm.categoryCode" @change="changeData('categoryCode',-1)" <JnpfInput v-model="dataForm.categoryCode" @change="changeData('categoryCode',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}'> placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12">
<jnpf-form-tip-item <jnpf-form-tip-item label="工序分类名称" prop="categoryName">
label="工序分类名称" prop="categoryName" >
<JnpfInput v-model="dataForm.categoryName" @change="changeData('categoryName',-1)" <JnpfInput v-model="dataForm.categoryName" @change="changeData('categoryName',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item <jnpf-form-tip-item label="工序分类描述" prop="categoryDescription">
label="工序分类描述" prop="categoryDescription" > <JnpfInput v-model="dataForm.categoryDescription"
<JnpfInput v-model="dataForm.categoryDescription" @change="changeData('categoryDescription',-1)" @change="changeData('categoryDescription',-1)" placeholder="请输入" clearable
placeholder="请输入" clearable :style='{"width":"100%"}'> :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -38,7 +35,7 @@
</template> </template>
</el-form> </el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" <SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/> ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id"> <div class="upAndDown-button" v-if="dataForm.id">
@ -55,20 +52,20 @@
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button> <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user' import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize' import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js' import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
export default { export default {
components: { }, components: {},
props: [], props: [],
data() { data() {
return { return {
@ -82,25 +79,25 @@
loading: false, loading: false,
btnLoading: false, btnLoading: false,
formRef: 'formRef', formRef: 'formRef',
setting:{}, setting: {},
eventType: '', eventType: '',
userBoxVisible:false, userBoxVisible: false,
selectDialogVisible: false, selectDialogVisible: false,
currTableConf:{}, currTableConf: {},
dataValueAll:{}, dataValueAll: {},
addTableConf:{ addTableConf: {
}, },
// //
ableAll:{ ableAll: {
}, },
tableRows:{ tableRows: {
}, },
Vmodel:"", Vmodel: "",
currVmodel:"", currVmodel: "",
dataForm: { dataForm: {
categoryCode : undefined, categoryCode: undefined,
categoryName : undefined, categoryName: undefined,
categoryDescription : undefined, categoryDescription: undefined,
version: 0, version: 0,
}, },
tableRequiredData: {}, tableRequiredData: {},
@ -114,12 +111,12 @@
}, },
], ],
}, },
childIndex:-1, childIndex: -1,
isEdit:false, isEdit: false,
interfaceRes: { interfaceRes: {
categoryCode:[] , categoryCode: [],
categoryName:[] , categoryName: [],
categoryDescription:[] , categoryDescription: [],
}, },
} }
}, },
@ -132,7 +129,7 @@
this.initDefaultData() this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm)) this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
}, },
mounted() {}, mounted() { },
methods: { methods: {
prev() { prev() {
this.index-- this.index--
@ -162,7 +159,7 @@
}, },
getInfo(id) { getInfo(id) {
request({ request({
url: '/api/scm/ProcessClassification/'+ id, url: '/api/scm/ProcessClassification/' + id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
@ -186,7 +183,7 @@
for (let i = 0; i < faceReList.length; i++) { for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) { if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options'; let options = 'get' + key + 'Options';
if(this[options]){ if (this[options]) {
this[options]() this[options]()
} }
this.changeData(key, index) this.changeData(key, index)
@ -195,8 +192,8 @@
} }
} }
}, },
changeDataFormData(type, data, model,index,defaultValue) { changeDataFormData(type, data, model, index, defaultValue) {
if(!this.isEdit) { if (!this.isEdit) {
if (type == 2) { if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) { for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) { if (index == -1) {
@ -210,12 +207,12 @@
} }
} }
}, },
dataAll(){ dataAll() {
}, },
clearData(){ clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll)) this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
}, },
init(id,isDetail,allList) { init(id, isDetail, allList) {
this.prevDis = false this.prevDis = false
this.nextDis = false this.nextDis = false
this.allList = allList || [] this.allList = allList || []
@ -234,16 +231,16 @@
this.dataForm.id = id || 0; this.dataForm.id = id || 0;
this.visible = true; this.visible = true;
this.$nextTick(() => { this.$nextTick(() => {
if(this.dataForm.id){ if (this.dataForm.id) {
this.loading = true this.loading = true
request({ request({
url: '/api/scm/ProcessClassification/'+this.dataForm.id, url: '/api/scm/ProcessClassification/' + this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
this.loading = false this.loading = false
}); });
}else{ } else {
this.clearData() this.clearData()
this.initDefaultData() this.initDefaultData()
} }
@ -264,7 +261,7 @@
}) })
}, },
request() { request() {
let _data =this.dataList() let _data = this.dataList()
if (this.dataFormSubmitType == 2) { if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true this.continueBtnLoading = true
} else { } else {
@ -294,13 +291,13 @@
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}).catch(()=>{ }).catch(() => {
this.btnLoading = false this.btnLoading = false
this.continueBtnLoading = false this.continueBtnLoading = false
}) })
}else{ } else {
request({ request({
url: '/api/scm/ProcessClassification/'+this.dataForm.id, url: '/api/scm/ProcessClassification/' + this.dataForm.id,
method: 'PUT', method: 'PUT',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -315,15 +312,15 @@
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}).catch(()=>{ }).catch(() => {
this.btnLoading = false this.btnLoading = false
this.continueBtnLoading = false this.continueBtnLoading = false
}) })
} }
}, },
openSelectDialog(key) { openSelectDialog(key) {
this.currTableConf=this.addTableConf[key] this.currTableConf = this.addTableConf[key]
this.currVmodel=key this.currVmodel = key
this.selectDialogVisible = true this.selectDialogVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.selectDialog.init() this.$refs.selectDialog.init()
@ -332,8 +329,8 @@
addForSelect(data) { addForSelect(data) {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let t = data[i] let t = data[i]
if(this['get'+this.currVmodel]){ if (this['get' + this.currVmodel]) {
this['get'+this.currVmodel](t) this['get' + this.currVmodel](t)
} }
} }
}, },
@ -400,18 +397,18 @@
} }
return timeDataValue; return timeDataValue;
}, },
dataList(){ dataList() {
var _data = this.dataForm; var _data = this.dataForm;
return _data; return _data;
}, },
dataInfo(dataAll){ dataInfo(dataAll) {
let _dataAll =dataAll let _dataAll = dataAll
this.dataForm = _dataAll this.dataForm = _dataAll
this.isEdit = true this.isEdit = true
this.dataAll() this.dataAll()
this.childIndex=-1 this.childIndex = -1
}, },
}, },
} }
</script> </script>

@ -31,11 +31,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">
@ -49,46 +52,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 prop="categoryCode" label="工序分类编码" align="left">
>
<el-table-column
prop="categoryCode"
label="工序分类编码" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="categoryName" label="工序分类名称" align="left">
prop="categoryName"
label="工序分类名称" align="left"
>
</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" @click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'">
<el-button type="text"
@click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'" >编辑
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'" @click="handleDel(scope.row.id)"> <el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'"
@click="handleDel(scope.row.id)">删除
</el-button> </el-button>
<el-button type="text" v-has="'btn_detail'" <el-button type="text" v-has="'btn_detail'" @click="goDetail(scope.row.id)">
@click="goDetail(scope.row.id)">详情
</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" />
<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>
@ -96,39 +88,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 JNPFForm from './form' import JNPFForm from './form'
import Detail from './Detail' import Detail from './Detail'
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: {
JNPFForm, JNPFForm,
Detail, Detail,
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,
superQueryVisible: false, superQueryVisible: false,
@ -136,8 +128,8 @@
uploadBoxVisible: false, uploadBoxVisible: false,
detailVisible: false, detailVisible: false,
query: { query: {
categoryCode:undefined, categoryCode: undefined,
categoryName:undefined, categoryName: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -205,9 +197,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) {
// //
@ -286,7 +278,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({
@ -324,13 +316,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()
@ -349,16 +341,16 @@
...this.query, ...this.query,
keyword: this.keyword, keyword: this.keyword,
dataType: 0, dataType: 0,
menuId:this.menuId, menuId: this.menuId,
moduleId:'522320367801345093', moduleId: '522320367801345093',
type:1, type: 1,
}; };
request({ request({
url: `/api/scm/ProcessClassification/getList`, url: `/api/scm/ProcessClassification/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,
@ -386,10 +378,10 @@
}).catch(() => { }).catch(() => {
}); });
}, },
handelUpload(){ handelUpload() {
this.uploadBoxVisible = true this.uploadBoxVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.UploadBox.init("","scm/ProcessClassification") this.$refs.UploadBox.init("", "scm/ProcessClassification")
}) })
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
@ -437,10 +429,10 @@
this.initData() this.initData()
}, },
addOrUpdateHandle(row, isDetail) { addOrUpdateHandle(row, isDetail) {
let id = row?row.id:"" let id = row ? row.id : ""
this.formVisible = true this.formVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail,this.list) this.$refs.JNPFForm.init(id, isDetail, this.list)
}) })
}, },
exportData() { exportData() {
@ -450,7 +442,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/ProcessClassification/Actions/Export`, url: `/api/scm/ProcessClassification/Actions/Export`,
method: 'post', method: 'post',
@ -463,10 +455,10 @@
}) })
}, },
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()
}, },
refresh(isrRefresh) { refresh(isrRefresh) {
@ -482,5 +474,5 @@
if (isrRefresh) this.reset() if (isrRefresh) this.reset()
}, },
} }
} }
</script> </script>

@ -2,111 +2,107 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' :'编辑'" <el-dialog :title="!dataForm.id ? '新建' :'编辑'" :close-on-click-modal="false" append-to-body
:close-on-click-modal="false" append-to-body :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="600px">
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" > <el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right">
<template v-if="!loading"> <template v-if="!loading">
<!-- 具体表单 --> <!-- 具体表单 -->
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle <JnpfGroupTitle content="工序类型" contentPosition="left">
content="工序类型" contentPosition="left" >
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfText <JnpfText
:textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":12,"line-height":32,"font-style":"normal","text-align":"left"}' content=" 不同的工序类型可实现不同的业务流程,工序类型一旦保存不可修改,请选择更匹配你需求的一个。"> :textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":12,"line-height":32,"font-style":"normal","text-align":"left"}'
content=" 不同的工序类型可实现不同的业务流程,工序类型一旦保存不可修改,请选择更匹配你需求的一个。">
</JnpfText> </JnpfText>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item <jnpf-form-tip-item label="工序类型" prop="type">
label="工序类型" prop="type" > <JnpfRadio v-model="dataForm.type" @change="changeData('type',-1)" optionType="button"
<JnpfRadio v-model="dataForm.type" @change="changeData('type',-1)" direction="horizontal" size="small" :options="typeOptions" :props="typeProps">
optionType="button" direction="horizontal" size="small" :options="typeOptions" :props="typeProps" >
</JnpfRadio> </JnpfRadio>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle <JnpfGroupTitle content="基础信息" contentPosition="left">
content="基础信息" contentPosition="left" >
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="工序编号" prop="productionCode">
label="工序编号" prop="productionCode" >
<JnpfInput v-model="dataForm.productionCode" @change="changeData('productionCode',-1)" <JnpfInput v-model="dataForm.productionCode" @change="changeData('productionCode',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}'> placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="工序名称" prop="productionName">
label="工序名称" prop="productionName" >
<JnpfInput v-model="dataForm.productionName" @change="changeData('productionName',-1)" <JnpfInput v-model="dataForm.productionName" @change="changeData('productionName',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="工序分类" prop="processId">
label="工序分类" prop="processId" >
<JnpfPopupSelect v-model="dataForm.processId" @change="changeData('processId',-1)" <JnpfPopupSelect v-model="dataForm.processId" @change="changeData('processId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.processId" placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='category_name' field='processId' interfaceId="522368175543690373" :pageSize="20" :columnOptions="processIdcolumnOptions" clearable :style='{"width":"100%"}'> :rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.processId"
placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='category_name' field='processId'
interfaceId="522368175543690373" :pageSize="20"
:columnOptions="processIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect> </JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="负责人员" prop="responsibleOfficer">
label="负责人员" prop="responsibleOfficer" > <JnpfUserSelect v-model="dataForm.responsibleOfficer"
<JnpfUserSelect v-model="dataForm.responsibleOfficer" @change="changeData('responsibleOfficer',-1)" @change="changeData('responsibleOfficer',-1)" placeholder="请选择" selectType="all"
placeholder="请选择" selectType="all" :ableIds="ableAll.responsibleOfficerableIds" clearable :style='{"width":"100%"}'> :ableIds="ableAll.responsibleOfficerableIds" clearable :style='{"width":"100%"}'>
</JnpfUserSelect> </JnpfUserSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<jnpf-form-tip-item <jnpf-form-tip-item label="状态" prop="status">
label="状态" prop="status" >
<JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)" <JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)"
optionType="button" direction="horizontal" size="small" :options="statusOptions" :props="statusProps" > optionType="button" direction="horizontal" size="small" :options="statusOptions"
:props="statusProps">
</JnpfRadio> </JnpfRadio>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item <jnpf-form-tip-item label="备注" prop="remark">
label="备注" prop="remark" >
<JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)" <JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle <JnpfGroupTitle content="其他信息" contentPosition="left">
content="其他信息" contentPosition="left" >
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12">
<jnpf-form-tip-item <jnpf-form-tip-item label="其他图纸" prop="drawingInformation">
label="其他图纸" prop="drawingInformation" > <JnpfUploadImg v-model="dataForm.drawingInformation"
<JnpfUploadImg v-model="dataForm.drawingInformation" @change="changeData('drawingInformation',-1)" @change="changeData('drawingInformation',-1)" :fileSize="10" sizeUnit="MB"
:fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" > :limit="9" pathType="defaultPath" :isAccount="0">
</JnpfUploadImg> </JnpfUploadImg>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12">
<jnpf-form-tip-item <jnpf-form-tip-item label="其他文件" prop="otherDocuments">
label="其他文件" prop="otherDocuments" > <JnpfUploadFile v-model="dataForm.otherDocuments"
<JnpfUploadFile v-model="dataForm.otherDocuments" @change="changeData('otherDocuments',-1)" @change="changeData('otherDocuments',-1)" :fileSize="10" sizeUnit="MB" :limit="9"
:fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传" > pathType="defaultPath" :isAccount="0" buttonText="点击上传">
</JnpfUploadFile> </JnpfUploadFile>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -114,7 +110,7 @@
</template> </template>
</el-form> </el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" <SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/> ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id"> <div class="upAndDown-button" v-if="dataForm.id">
@ -131,20 +127,20 @@
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button> <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user' import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize' import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js' import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
export default { export default {
components: { }, components: {},
props: [], props: [],
data() { data() {
return { return {
@ -158,31 +154,31 @@
loading: false, loading: false,
btnLoading: false, btnLoading: false,
formRef: 'formRef', formRef: 'formRef',
setting:{}, setting: {},
eventType: '', eventType: '',
userBoxVisible:false, userBoxVisible: false,
selectDialogVisible: false, selectDialogVisible: false,
currTableConf:{}, currTableConf: {},
dataValueAll:{}, dataValueAll: {},
addTableConf:{ addTableConf: {
}, },
// //
ableAll:{ ableAll: {
}, },
tableRows:{ tableRows: {
}, },
Vmodel:"", Vmodel: "",
currVmodel:"", currVmodel: "",
dataForm: { dataForm: {
type : "1", type: "1",
productionCode : undefined, productionCode: undefined,
productionName : undefined, productionName: undefined,
processId : undefined, processId: undefined,
responsibleOfficer : undefined, responsibleOfficer: undefined,
status : "1", status: "1",
remark : undefined, remark: undefined,
drawingInformation : [], drawingInformation: [],
otherDocuments : [], otherDocuments: [],
version: 0, version: 0,
}, },
tableRequiredData: {}, tableRequiredData: {},
@ -224,23 +220,23 @@
}, },
], ],
}, },
typeOptions:[{"fullName":"自制工序","id":"1"},{"fullName":"委外工序","id":"2"}], typeOptions: [{ "fullName": "自制工序", "id": "1" }, { "fullName": "委外工序", "id": "2" }],
typeProps:{"label":"fullName","value":"id" }, typeProps: { "label": "fullName", "value": "id" },
processIdcolumnOptions:[ {"label":"名称","value":"category_name"}, {"label":"编码","value":"category_code"},], processIdcolumnOptions: [{ "label": "名称", "value": "category_name" }, { "label": "编码", "value": "category_code" },],
statusOptions:[{"fullName":"启用","id":"1"},{"fullName":"禁用","id":"2"}], statusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
statusProps:{"label":"fullName","value":"id" }, statusProps: { "label": "fullName", "value": "id" },
childIndex:-1, childIndex: -1,
isEdit:false, isEdit: false,
interfaceRes: { interfaceRes: {
type:[] , type: [],
productionCode:[] , productionCode: [],
productionName:[] , productionName: [],
processId:[] , processId: [],
responsibleOfficer:[] , responsibleOfficer: [],
status:[] , status: [],
remark:[] , remark: [],
drawingInformation:[] , drawingInformation: [],
otherDocuments:[] , otherDocuments: [],
}, },
} }
}, },
@ -253,7 +249,7 @@
this.initDefaultData() this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm)) this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
}, },
mounted() {}, mounted() { },
methods: { methods: {
prev() { prev() {
this.index-- this.index--
@ -283,7 +279,7 @@
}, },
getInfo(id) { getInfo(id) {
request({ request({
url: '/api/scm/ProductionProcesses/'+ id, url: '/api/scm/ProductionProcesses/' + id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
@ -307,7 +303,7 @@
for (let i = 0; i < faceReList.length; i++) { for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) { if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options'; let options = 'get' + key + 'Options';
if(this[options]){ if (this[options]) {
this[options]() this[options]()
} }
this.changeData(key, index) this.changeData(key, index)
@ -316,8 +312,8 @@
} }
} }
}, },
changeDataFormData(type, data, model,index,defaultValue) { changeDataFormData(type, data, model, index, defaultValue) {
if(!this.isEdit) { if (!this.isEdit) {
if (type == 2) { if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) { for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) { if (index == -1) {
@ -331,12 +327,12 @@
} }
} }
}, },
dataAll(){ dataAll() {
}, },
clearData(){ clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll)) this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
}, },
init(id,isDetail,allList) { init(id, isDetail, allList) {
this.prevDis = false this.prevDis = false
this.nextDis = false this.nextDis = false
this.allList = allList || [] this.allList = allList || []
@ -355,16 +351,16 @@
this.dataForm.id = id || 0; this.dataForm.id = id || 0;
this.visible = true; this.visible = true;
this.$nextTick(() => { this.$nextTick(() => {
if(this.dataForm.id){ if (this.dataForm.id) {
this.loading = true this.loading = true
request({ request({
url: '/api/scm/ProductionProcesses/'+this.dataForm.id, url: '/api/scm/ProductionProcesses/' + this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
this.loading = false this.loading = false
}); });
}else{ } else {
this.clearData() this.clearData()
this.initDefaultData() this.initDefaultData()
} }
@ -385,7 +381,7 @@
}) })
}, },
request() { request() {
let _data =this.dataList() let _data = this.dataList()
if (this.dataFormSubmitType == 2) { if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true this.continueBtnLoading = true
} else { } else {
@ -415,13 +411,13 @@
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}).catch(()=>{ }).catch(() => {
this.btnLoading = false this.btnLoading = false
this.continueBtnLoading = false this.continueBtnLoading = false
}) })
}else{ } else {
request({ request({
url: '/api/scm/ProductionProcesses/'+this.dataForm.id, url: '/api/scm/ProductionProcesses/' + this.dataForm.id,
method: 'PUT', method: 'PUT',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -436,15 +432,15 @@
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}).catch(()=>{ }).catch(() => {
this.btnLoading = false this.btnLoading = false
this.continueBtnLoading = false this.continueBtnLoading = false
}) })
} }
}, },
openSelectDialog(key) { openSelectDialog(key) {
this.currTableConf=this.addTableConf[key] this.currTableConf = this.addTableConf[key]
this.currVmodel=key this.currVmodel = key
this.selectDialogVisible = true this.selectDialogVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.selectDialog.init() this.$refs.selectDialog.init()
@ -453,8 +449,8 @@
addForSelect(data) { addForSelect(data) {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let t = data[i] let t = data[i]
if(this['get'+this.currVmodel]){ if (this['get' + this.currVmodel]) {
this['get'+this.currVmodel](t) this['get' + this.currVmodel](t)
} }
} }
}, },
@ -521,18 +517,18 @@
} }
return timeDataValue; return timeDataValue;
}, },
dataList(){ dataList() {
var _data = this.dataForm; var _data = this.dataForm;
return _data; return _data;
}, },
dataInfo(dataAll){ dataInfo(dataAll) {
let _dataAll =dataAll let _dataAll = dataAll
this.dataForm = _dataAll this.dataForm = _dataAll
this.isEdit = true this.isEdit = true
this.dataAll() this.dataAll()
this.childIndex=-1 this.childIndex = -1
}, },
}, },
} }
</script> </script>

@ -104,6 +104,14 @@
{{ scope.row.status}} {{ scope.row.status}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="creatorTime" label="添加时间" align="left">
</el-table-column>
<el-table-column prop="creatorUserId" label="添加人" align="left">
</el-table-column>
<el-table-column prop="lastModifyTime" label="更新时间" align="left">
</el-table-column>
<el-table-column 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" @click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'"> <el-button type="text" @click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'">

Loading…
Cancel
Save