新增企业页面

jg-waiwang-pro
vayne 9 months ago
parent e10730d9cf
commit 671c7e303a

@ -124,5 +124,5 @@ logging:
log: log:
level: level:
# 等级 TRACE,DEBUG,INFO,WARN,ERROR(不区分大小写) # 等级 TRACE,DEBUG,INFO,WARN,ERROR(不区分大小写)
root: info root: debug
path: log/${spring.application.name} path: log/${spring.application.name}

@ -153,6 +153,83 @@ public class OrganizeController extends SuperController<OrganizeService, Organiz
} }
/**
* ()
*
* @param pagination
* @return
*/
@Operation(summary = "获取组织列表(只查询公司类型)")
@SaCheckPermission(value = {"permission.organize", "permission.position", "permission.user", "permission.role"}, mode = SaMode.OR)
@GetMapping("Enterprise")
public ActionResult<ListVO<OrganizeListVO>> getEnterpriseList(Pagination pagination) {
// 获取所有组织
Map<String, OrganizeEntity> orgMaps;
if (!userProvider.get().getIsAdministrator()) {
// 通过权限转树
List<OrganizeAdministratorEntity> listss = organizeAdministratorService.getOrganizeAdministratorEntity(userProvider.get().getUserId());
Set<String> orgIds = new HashSet<>(16);
// 判断自己是哪些组织的管理员
listss.stream().forEach(t-> {
if (t != null) {
if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) {
orgIds.add(t.getOrganizeId());
}
if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) {
List<String> underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false);
orgIds.addAll(underOrganizations);
}
}
});
List<String> list1 = new ArrayList<>(orgIds);
// 得到所有有权限的组织
orgMaps = organizeService.getOrganizeName(list1, pagination.getKeyword(), false);
//过滤部门
orgMaps = orgMaps.entrySet().stream().filter(e -> e.getValue().getCategory().equals("company")).collect(Collectors.toMap(Map.Entry::getKey,Map.Entry::getValue));
}else{
orgMaps = organizeService.getOrgMaps(pagination.getKeyword(), false);
//过滤部门
orgMaps = orgMaps.entrySet().stream().filter(e -> e.getValue().getCategory().equals("company")).collect(Collectors.toMap(Map.Entry::getKey,Map.Entry::getValue));
}
Map<String, OrganizeModel> orgMapsModel = JSONObject.parseObject(JSONObject.toJSONString(orgMaps), new TypeReference<LinkedHashMap<String, OrganizeModel>>() {}, new Feature[0]);;
Map<String, String> orgIdNameMaps = organizeService.getInfoList();
orgMapsModel.values().forEach(t -> {
if (PermissionConst.COMPANY.equals(t.getType())) {
t.setIcon("icon-ym icon-ym-tree-organization3");
} else {
t.setIcon("icon-ym icon-ym-tree-department1");
}
// 处理断层
if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) {
String[] split = t.getOrganizeIdTree().split(",");
List<String> list1 = Arrays.asList(split);
Collections.reverse(list1);
for (String orgId : list1) {
if(!orgId.equals(t.getId())) {
OrganizeModel organizeEntity1 = orgMapsModel.get(orgId);
if (organizeEntity1 != null) {
t.setParentId(organizeEntity1.getId());
String[] split1 = t.getOrganizeIdTree().split(organizeEntity1.getId());
if (split1.length > 1) {
t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/"));
}
break;
}
}
}
}
});
List<SumTree<OrganizeModel>> trees = TreeDotUtils.convertMapsToTreeDot(orgMapsModel);
List<OrganizeListVO> listVO = JsonUtil.getJsonToList(trees, OrganizeListVO.class);
listVO.forEach(t -> {
t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/"));
});
ListVO<OrganizeListVO> vo = new ListVO<>();
vo.setList(listVO);
return ActionResult.success(vo);
}
/** /**
* *
* *

@ -1,15 +1,15 @@
package jnpf.mapper; package jnpf.mapper;
import jnpf.entity.BusinessAddressEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.entity.BusinessAddressEntity;
/** /**
* businessLine * businessLine
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
public interface BusinessAddressMapper extends BaseMapper<BusinessAddressEntity> { public interface BusinessAddressMapper extends BaseMapper<BusinessAddressEntity> {

@ -1,15 +1,15 @@
package jnpf.mapper; package jnpf.mapper;
import jnpf.entity.BusinessCargoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.entity.BusinessCargoEntity;
/** /**
* businessLine * businessLine
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
public interface BusinessCargoMapper extends BaseMapper<BusinessCargoEntity> { public interface BusinessCargoMapper extends BaseMapper<BusinessCargoEntity> {

@ -1,15 +1,15 @@
package jnpf.mapper; package jnpf.mapper;
import jnpf.entity.BusinessContactEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.entity.BusinessContactEntity;
/** /**
* businessLine * businessLine
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
public interface BusinessContactMapper extends BaseMapper<BusinessContactEntity> { public interface BusinessContactMapper extends BaseMapper<BusinessContactEntity> {

@ -1,15 +1,15 @@
package jnpf.mapper; package jnpf.mapper;
import jnpf.entity.BusinessLineEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.entity.BusinessLineEntity;
/** /**
* businessLine * businessLine
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
public interface BusinessLineMapper extends BaseMapper<BusinessLineEntity> { public interface BusinessLineMapper extends BaseMapper<BusinessLineEntity> {

@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
public interface BusinessAddressService extends IService<BusinessAddressEntity> { public interface BusinessAddressService extends IService<BusinessAddressEntity> {
QueryWrapper<BusinessAddressEntity> getChild(BusinessLinePagination pagination,QueryWrapper<BusinessAddressEntity> businessAddressQueryWrapper); QueryWrapper<BusinessAddressEntity> getChild(BusinessLinePagination pagination,QueryWrapper<BusinessAddressEntity> businessAddressQueryWrapper);

@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
public interface BusinessCargoService extends IService<BusinessCargoEntity> { public interface BusinessCargoService extends IService<BusinessCargoEntity> {
QueryWrapper<BusinessCargoEntity> getChild(BusinessLinePagination pagination,QueryWrapper<BusinessCargoEntity> businessCargoQueryWrapper); QueryWrapper<BusinessCargoEntity> getChild(BusinessLinePagination pagination,QueryWrapper<BusinessCargoEntity> businessCargoQueryWrapper);

@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
public interface BusinessContactService extends IService<BusinessContactEntity> { public interface BusinessContactService extends IService<BusinessContactEntity> {
QueryWrapper<BusinessContactEntity> getChild(BusinessLinePagination pagination,QueryWrapper<BusinessContactEntity> businessContactQueryWrapper); QueryWrapper<BusinessContactEntity> getChild(BusinessLinePagination pagination,QueryWrapper<BusinessContactEntity> businessContactQueryWrapper);

@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
public interface BusinessLineService extends IService<BusinessLineEntity> { public interface BusinessLineService extends IService<BusinessLineEntity> {
List<BusinessLineEntity> getList(BusinessLinePagination businessLinePagination); List<BusinessLineEntity> getList(BusinessLinePagination businessLinePagination);

@ -33,7 +33,7 @@ import jnpf.permission.entity.UserEntity;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
@Service @Service
public class BusinessAddressServiceImpl extends ServiceImpl<BusinessAddressMapper, BusinessAddressEntity> implements BusinessAddressService{ public class BusinessAddressServiceImpl extends ServiceImpl<BusinessAddressMapper, BusinessAddressEntity> implements BusinessAddressService{

@ -33,7 +33,7 @@ import jnpf.permission.entity.UserEntity;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
@Service @Service
public class BusinessCargoServiceImpl extends ServiceImpl<BusinessCargoMapper, BusinessCargoEntity> implements BusinessCargoService{ public class BusinessCargoServiceImpl extends ServiceImpl<BusinessCargoMapper, BusinessCargoEntity> implements BusinessCargoService{

@ -33,7 +33,7 @@ import jnpf.permission.entity.UserEntity;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
@Service @Service
public class BusinessContactServiceImpl extends ServiceImpl<BusinessContactMapper, BusinessContactEntity> implements BusinessContactService{ public class BusinessContactServiceImpl extends ServiceImpl<BusinessContactMapper, BusinessContactEntity> implements BusinessContactService{

@ -36,7 +36,7 @@ import jnpf.permission.entity.UserEntity;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
@Service @Service
public class BusinessLineServiceImpl extends ServiceImpl<BusinessLineMapper, BusinessLineEntity> implements BusinessLineService{ public class BusinessLineServiceImpl extends ServiceImpl<BusinessLineMapper, BusinessLineEntity> implements BusinessLineService{
@ -287,7 +287,7 @@ public class BusinessLineServiceImpl extends ServiceImpl<BusinessLineMapper, Bus
} }
if(ObjectUtil.isNotEmpty(businessLinePagination.getDiffFlag())){ if(ObjectUtil.isNotEmpty(businessLinePagination.getDiffFlag()) && businessLinePagination.getDiffFlag().equals("1")){
businessLineNum++; businessLineNum++;
String value = businessLinePagination.getDiffFlag() instanceof List ? String value = businessLinePagination.getDiffFlag() instanceof List ?
@ -521,10 +521,58 @@ public class BusinessLineServiceImpl extends ServiceImpl<BusinessLineMapper, Bus
} }
//子表字段验证 //子表字段验证
if (form.getBusinessContactList()!=null){ if (form.getBusinessContactList()!=null){
for(BusinessContactModel t : form.getBusinessContactList()){
if(StringUtil.isNotEmpty(t.getName())){
t.setName(t.getName().trim());
}
else{
return "-姓名不能为空";
}
}
for(BusinessContactModel t : form.getBusinessContactList()){
if(StringUtil.isNotEmpty(t.getPhone())){
t.setPhone(t.getPhone().trim());
}
else{
return "-手机号不能为空";
}
}
for(BusinessContactModel t : form.getBusinessContactList()){
if(StringUtil.isNotEmpty(t.getEmail())){
t.setEmail(t.getEmail().trim());
}
else{
return "-邮箱不能为空";
}
}
} }
if (form.getBusinessAddressList()!=null){ if (form.getBusinessAddressList()!=null){
for(BusinessAddressModel t : form.getBusinessAddressList()){
if(StringUtil.isNotEmpty(t.getCountry())){
t.setCountry(t.getCountry().trim());
}
else{
return "-国家/地区不能为空";
}
}
for(BusinessAddressModel t : form.getBusinessAddressList()){
if(StringUtil.isNotEmpty(t.getFullAddress())){
t.setFullAddress(t.getFullAddress().trim());
}
else{
return "-详细地址不能为空";
}
}
} }
if (form.getBusinessCargoList()!=null){ if (form.getBusinessCargoList()!=null){
for(BusinessCargoModel t : form.getBusinessCargoList()){
if(StringUtil.isNotEmpty(t.getCargoName())){
t.setCargoName(t.getCargoName().trim());
}
else{
return "-货区名称不能为空";
}
}
} }
return countRecover; return countRecover;
} }
@ -548,9 +596,10 @@ public class BusinessLineServiceImpl extends ServiceImpl<BusinessLineMapper, Bus
entity.setCode(generaterSwapUtil.getBillNumber("rukudanhao", false)); entity.setCode(generaterSwapUtil.getBillNumber("rukudanhao", false));
entity.setId(mainId); entity.setId(mainId);
entity.setVersion(0); entity.setVersion(0);
}else{
entity.setCode(generaterSwapUtil.getBillNumber("rukudanhao", false));
} }
// else{
// entity.setCode(generaterSwapUtil.getBillNumber("rukudanhao", false));
// }
this.saveOrUpdate(entity); this.saveOrUpdate(entity);
//BusinessContact子表数据新增修改 //BusinessContact子表数据新增修改

@ -54,7 +54,7 @@ import org.springframework.transaction.annotation.Transactional;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Slf4j @Slf4j
@RestController @RestController
@ -109,7 +109,6 @@ public class BusinessLineController {
//数据转换 //数据转换
realList = generaterSwapUtil.swapDataList(realList, BusinessLineConstant.getFormData(), BusinessLineConstant.getColumnData(), businessLinePagination.getModuleId(),false); realList = generaterSwapUtil.swapDataList(realList, BusinessLineConstant.getFormData(), BusinessLineConstant.getColumnData(), businessLinePagination.getModuleId(),false);
//判断业务线列表还是业务组织列表
if (ObjectUtil.isNotEmpty(businessLinePagination.getDiffFlag()) && businessLinePagination.getDiffFlag().equals("2")) { if (ObjectUtil.isNotEmpty(businessLinePagination.getDiffFlag()) && businessLinePagination.getDiffFlag().equals("2")) {
boolean isPc = "pc".equals(ServletUtil.getHeader("jnpf-origin")); boolean isPc = "pc".equals(ServletUtil.getHeader("jnpf-origin"));
if (isPc) { if (isPc) {
@ -298,6 +297,12 @@ public class BusinessLineController {
case "tableField171-saleType": case "tableField171-saleType":
tableField171List.add(new ExcelExportEntity("是否可售" ,"saleType")); tableField171List.add(new ExcelExportEntity("是否可售" ,"saleType"));
break; break;
case "tableField171-cargoCapacityLow":
tableField171List.add(new ExcelExportEntity("最低库存容量" ,"cargoCapacityLow"));
break;
case "tableField171-cargoCapacityHigh":
tableField171List.add(new ExcelExportEntity("最高库存容量" ,"cargoCapacityHigh"));
break;
case "tableField171-description": case "tableField171-description":
tableField171List.add(new ExcelExportEntity("备注" ,"description")); tableField171List.add(new ExcelExportEntity("备注" ,"description"));
break; break;
@ -430,6 +435,10 @@ public class BusinessLineController {
List<ExcelExportEntity> tableField133ExcelEntityList = new ArrayList<>(); List<ExcelExportEntity> tableField133ExcelEntityList = new ArrayList<>();
Map<String, Object> tableField133ChildData = new HashMap<>(); Map<String, Object> tableField133ChildData = new HashMap<>();
List<Map<String, Object>> tableField133ChildDataList = new ArrayList<>(); 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); tableField133ChildDataList.add(tableField133ChildData);
dataMap.put("tableField133",tableField133ChildDataList); dataMap.put("tableField133",tableField133ChildDataList);
tableField133ExcelEntity.setList(tableField133ExcelEntityList); tableField133ExcelEntity.setList(tableField133ExcelEntityList);
@ -439,6 +448,11 @@ public class BusinessLineController {
List<ExcelExportEntity> tableField161ExcelEntityList = new ArrayList<>(); List<ExcelExportEntity> tableField161ExcelEntityList = new ArrayList<>();
Map<String, Object> tableField161ChildData = new HashMap<>(); Map<String, Object> tableField161ChildData = new HashMap<>();
List<Map<String, Object>> tableField161ChildDataList = new ArrayList<>(); List<Map<String, Object>> tableField161ChildDataList = new ArrayList<>();
tableField161ExcelEntityList.add(new ExcelExportEntity("类型" ,"addressType"));
tableField161ExcelEntityList.add(new ExcelExportEntity("国家/地区" ,"country"));
tableField161ExcelEntityList.add(new ExcelExportEntity("省/市/区" ,"province"));
tableField161ChildData.put("province", "例:福建省/莆田市/城厢区");
tableField161ExcelEntityList.add(new ExcelExportEntity("详细地址" ,"fullAddress"));
tableField161ChildDataList.add(tableField161ChildData); tableField161ChildDataList.add(tableField161ChildData);
dataMap.put("tableField161",tableField161ChildDataList); dataMap.put("tableField161",tableField161ChildDataList);
tableField161ExcelEntity.setList(tableField161ExcelEntityList); tableField161ExcelEntity.setList(tableField161ExcelEntityList);
@ -448,6 +462,11 @@ public class BusinessLineController {
List<ExcelExportEntity> tableField171ExcelEntityList = new ArrayList<>(); List<ExcelExportEntity> tableField171ExcelEntityList = new ArrayList<>();
Map<String, Object> tableField171ChildData = new HashMap<>(); Map<String, Object> tableField171ChildData = new HashMap<>();
List<Map<String, Object>> tableField171ChildDataList = new ArrayList<>(); List<Map<String, Object>> tableField171ChildDataList = new ArrayList<>();
tableField171ExcelEntityList.add(new ExcelExportEntity("货区名称" ,"cargoName"));
tableField171ExcelEntityList.add(new ExcelExportEntity("类型" ,"cargoType"));
tableField171ExcelEntityList.add(new ExcelExportEntity("是否可售" ,"saleType"));
tableField171ExcelEntityList.add(new ExcelExportEntity("最低库存容量" ,"cargoCapacityLow"));
tableField171ExcelEntityList.add(new ExcelExportEntity("最高库存容量" ,"cargoCapacityHigh"));
tableField171ChildDataList.add(tableField171ChildData); tableField171ChildDataList.add(tableField171ChildData);
dataMap.put("tableField171",tableField171ChildDataList); dataMap.put("tableField171",tableField171ChildDataList);
tableField171ExcelEntity.setList(tableField171ExcelEntityList); tableField171ExcelEntity.setList(tableField171ExcelEntityList);
@ -497,7 +516,7 @@ public class BusinessLineController {
String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath();
FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName);
File temporary = new File(XSSEscape.escapePath(filePath + fileName)); File temporary = new File(XSSEscape.escapePath(filePath + fileName));
int headerRowIndex = 1; int headerRowIndex = 2;
ImportParams params = new ImportParams(); ImportParams params = new ImportParams();
params.setTitleRows(0); params.setTitleRows(0);
params.setHeadRows(headerRowIndex); params.setHeadRows(headerRowIndex);
@ -516,12 +535,25 @@ public class BusinessLineController {
columns.add(new ExcelImFieldModel("belongUserId","归属人员")); columns.add(new ExcelImFieldModel("belongUserId","归属人员"));
//tableField133子表对象 //tableField133子表对象
List<ExcelImFieldModel> tableField133columns = new ArrayList<>(); 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)); columns.add(new ExcelImFieldModel("tableField133","",tableField133columns));
//tableField161子表对象 //tableField161子表对象
List<ExcelImFieldModel> tableField161columns = new ArrayList<>(); List<ExcelImFieldModel> tableField161columns = new ArrayList<>();
tableField161columns.add(new ExcelImFieldModel("addressType" ,"类型"));
tableField161columns.add(new ExcelImFieldModel("country" ,"国家/地区"));
tableField161columns.add(new ExcelImFieldModel("province" ,"省/市/区"));
tableField161columns.add(new ExcelImFieldModel("fullAddress" ,"详细地址"));
columns.add(new ExcelImFieldModel("tableField161","",tableField161columns)); columns.add(new ExcelImFieldModel("tableField161","",tableField161columns));
//tableField171子表对象 //tableField171子表对象
List<ExcelImFieldModel> tableField171columns = new ArrayList<>(); List<ExcelImFieldModel> tableField171columns = new ArrayList<>();
tableField171columns.add(new ExcelImFieldModel("cargoName" ,"货区名称"));
tableField171columns.add(new ExcelImFieldModel("cargoType" ,"类型"));
tableField171columns.add(new ExcelImFieldModel("saleType" ,"是否可售"));
tableField171columns.add(new ExcelImFieldModel("cargoCapacityLow" ,"最低库存容量"));
tableField171columns.add(new ExcelImFieldModel("cargoCapacityHigh" ,"最高库存容量"));
columns.add(new ExcelImFieldModel("tableField171","",tableField171columns)); columns.add(new ExcelImFieldModel("tableField171","",tableField171columns));
headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList))); headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList)));
headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns))); headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns)));

@ -9,7 +9,7 @@ import java.util.Date;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Data @Data
@TableName("jg_business_address") @TableName("jg_business_address")

@ -9,7 +9,7 @@ import java.util.Date;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Data @Data
@TableName("jg_business_cargo") @TableName("jg_business_cargo")
@ -22,9 +22,9 @@ public class BusinessCargoEntity {
private String cargoType; private String cargoType;
@TableField(value = "CARGO_NAME" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "CARGO_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String cargoName; private String cargoName;
@TableField("CARGO_CAPACITY_LOW") @TableField(value = "CARGO_CAPACITY_LOW" , updateStrategy = FieldStrategy.IGNORED)
private Integer cargoCapacityLow; private Integer cargoCapacityLow;
@TableField("CARGO_CAPACITY_HIGH") @TableField(value = "CARGO_CAPACITY_HIGH" , updateStrategy = FieldStrategy.IGNORED)
private Integer cargoCapacityHigh; private Integer cargoCapacityHigh;
@TableField(value = "SALE_TYPE" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "SALE_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String saleType; private String saleType;

@ -9,7 +9,7 @@ import java.util.Date;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Data @Data
@TableName("jg_business_contact") @TableName("jg_business_contact")

@ -1,21 +1,15 @@
package jnpf.entity; package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import jnpf.model.businessline.BusinessAddressModel;
import jnpf.model.businessline.BusinessCargoModel;
import jnpf.model.businessline.BusinessContactModel;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 线 * 线
* *
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Data @Data
@TableName("jg_business_line") @TableName("jg_business_line")
@ -109,17 +103,4 @@ public class BusinessLineEntity {
private Integer version; private Integer version;
@TableField("F_FLOW_ID") @TableField("F_FLOW_ID")
private String flowId; private String flowId;
/** 子表数据 **/
@TableField(exist = false)
@JsonProperty("businessContactList")
private List<BusinessContactModel> businessContactList;
/** 子表数据 **/
@TableField(exist = false)
@JsonProperty("businessAddressList")
private List<BusinessAddressModel> businessAddressList;
/** 子表数据 **/
@TableField(exist = false)
@JsonProperty("businessCargoList")
private List<BusinessCargoModel> businessCargoList;
} }

@ -1,16 +1,45 @@
package jnpf.model.businessline; package jnpf.model.businessline;
import lombok.Data; 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;
/** /**
* *
* businessLine * businessLine
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Data @Data
public class BusinessAddressExcelVO{ public class BusinessAddressExcelVO{
/** 类型 **/
@JSONField(name = "addressType")
@Excel(name = "类型",orderNum = "1", isImportField = "true" )
private String addressType;
/** 国家/地区 **/
@JSONField(name = "country")
@Excel(name = "国家/地区",orderNum = "1", isImportField = "true" )
private String country;
/** 省/市/区 **/
@JSONField(name = "province")
@Excel(name = "省/市/区",orderNum = "1", isImportField = "true" )
private String province;
/** 详细地址 **/
@JSONField(name = "fullAddress")
@Excel(name = "详细地址",orderNum = "1", isImportField = "true" )
private String fullAddress;
} }

@ -1,7 +1,12 @@
package jnpf.model.businessline; package jnpf.model.businessline;
import lombok.Data; import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* *
@ -9,22 +14,26 @@ import com.alibaba.fastjson.annotation.JSONField;
* V3.5 * V3.5
* : https://www.jnpfsoft.com * : https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
@Data @Data
public class BusinessAddressModel { public class BusinessAddressModel {
/** 类型 **/ /** 类型 **/
@Excel(name = "类型",orderNum = "1",isImportField = "true")
@JSONField(name = "addressType") @JSONField(name = "addressType")
private Object addressType; private Object addressType;
/** 国家/地区 **/ /** 国家/地区 **/
@Excel(name = "国家/地区",orderNum = "1",isImportField = "true")
@JSONField(name = "country") @JSONField(name = "country")
private String country; private String country;
/** 省/市/区 **/ /** 省/市/区 **/
@Excel(name = "省/市/区",orderNum = "1",isImportField = "true")
@JSONField(name = "province") @JSONField(name = "province")
private Object province; private Object province;
/** 详细地址 **/ /** 详细地址 **/
@Excel(name = "详细地址",orderNum = "1",isImportField = "true")
@JSONField(name = "fullAddress") @JSONField(name = "fullAddress")
private String fullAddress; private String fullAddress;
/** 备注 **/ /** 备注 **/

@ -1,16 +1,50 @@
package jnpf.model.businessline; package jnpf.model.businessline;
import lombok.Data; 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;
/** /**
* *
* businessLine * businessLine
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Data @Data
public class BusinessCargoExcelVO{ public class BusinessCargoExcelVO{
/** 货区名称 **/
@JSONField(name = "cargoName")
@Excel(name = "货区名称",orderNum = "1", isImportField = "true" )
private String cargoName;
/** 类型 **/
@JSONField(name = "cargoType")
@Excel(name = "类型",orderNum = "1", isImportField = "true" )
private String cargoType;
/** 是否可售 **/
@JSONField(name = "saleType")
@Excel(name = "是否可售",orderNum = "1", isImportField = "true" )
private String saleType;
/** 最低库存容量 **/
@JSONField(name = "cargoCapacityLow")
@Excel(name = "最低库存容量",orderNum = "1", isImportField = "true" )
private Integer cargoCapacityLow;
/** 最高库存容量 **/
@JSONField(name = "cargoCapacityHigh")
@Excel(name = "最高库存容量",orderNum = "1", isImportField = "true" )
private Integer cargoCapacityHigh;
} }

@ -1,7 +1,12 @@
package jnpf.model.businessline; package jnpf.model.businessline;
import lombok.Data; import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* *
@ -9,21 +14,34 @@ import com.alibaba.fastjson.annotation.JSONField;
* V3.5 * V3.5
* : https://www.jnpfsoft.com * : https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
@Data @Data
public class BusinessCargoModel { public class BusinessCargoModel {
/** 货区名称 **/ /** 货区名称 **/
@Excel(name = "货区名称",orderNum = "1",isImportField = "true")
@JSONField(name = "cargoName") @JSONField(name = "cargoName")
private String cargoName; private String cargoName;
/** 类型 **/ /** 类型 **/
@Excel(name = "类型",orderNum = "1",isImportField = "true")
@JSONField(name = "cargoType") @JSONField(name = "cargoType")
private Object cargoType; private Object cargoType;
/** 是否可售 **/ /** 是否可售 **/
@Excel(name = "是否可售",orderNum = "1",isImportField = "true")
@JSONField(name = "saleType") @JSONField(name = "saleType")
private Object saleType; private Object saleType;
/** 最低库存容量 **/
@Excel(name = "最低库存容量",orderNum = "1",isImportField = "true")
@JSONField(name = "cargoCapacityLow")
private BigDecimal cargoCapacityLow;
/** 最高库存容量 **/
@Excel(name = "最高库存容量",orderNum = "1",isImportField = "true")
@JSONField(name = "cargoCapacityHigh")
private BigDecimal cargoCapacityHigh;
/** 备注 **/ /** 备注 **/
@JSONField(name = "description") @JSONField(name = "description")
private String description; private String description;

@ -1,16 +1,45 @@
package jnpf.model.businessline; package jnpf.model.businessline;
import lombok.Data; 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;
/** /**
* *
* businessLine * businessLine
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Data @Data
public class BusinessContactExcelVO{ public class BusinessContactExcelVO{
/** 类型 **/
@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;
} }

@ -1,7 +1,12 @@
package jnpf.model.businessline; package jnpf.model.businessline;
import lombok.Data; import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* *
@ -9,24 +14,28 @@ import com.alibaba.fastjson.annotation.JSONField;
* V3.5 * V3.5
* : https://www.jnpfsoft.com * : https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-01-19 * 2024-01-23
*/ */
@Data @Data
public class BusinessContactModel { public class BusinessContactModel {
/** 类型 **/ /** 类型 **/
@Excel(name = "类型",orderNum = "1",isImportField = "true")
@JSONField(name = "contactType") @JSONField(name = "contactType")
private Object contactType; private Object contactType;
/** 姓名 **/ /** 姓名 **/
@Excel(name = "姓名",orderNum = "1",isImportField = "true")
@JSONField(name = "name") @JSONField(name = "name")
private String name; private String name;
/** 手机号 **/ /** 手机号 **/
@Excel(name = "手机号",orderNum = "1",isImportField = "true")
@JSONField(name = "phone") @JSONField(name = "phone")
private String phone; private String phone;
/** 座机 **/ /** 座机 **/
@JSONField(name = "landline") @JSONField(name = "landline")
private String landline; private String landline;
/** 邮箱 **/ /** 邮箱 **/
@Excel(name = "邮箱",orderNum = "1",isImportField = "true")
@JSONField(name = "email") @JSONField(name = "email")
private String email; private String email;
/** 传真 **/ /** 传真 **/

@ -11,7 +11,7 @@ import com.alibaba.fastjson.annotation.JSONField;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Data @Data
public class BusinessLineExcelErrorVO extends BusinessLineExcelVO{ public class BusinessLineExcelErrorVO extends BusinessLineExcelVO{

@ -1,12 +1,15 @@
package jnpf.model.businessline; package jnpf.model.businessline;
import lombok.Data; import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection; import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
* *
@ -14,7 +17,7 @@ import java.util.List;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Data @Data
public class BusinessLineExcelVO{ public class BusinessLineExcelVO{
@ -61,15 +64,15 @@ public class BusinessLineExcelVO{
private String belongUserId; private String belongUserId;
@JsonProperty("tableField133") @JsonProperty("tableField133")
@ExcelCollection(name="",orderNum = "0") @ExcelCollection(name="",orderNum = "4")
private List<BusinessContactExcelVO> tableField133; private List<BusinessContactExcelVO> tableField133;
@JsonProperty("tableField161") @JsonProperty("tableField161")
@ExcelCollection(name="",orderNum = "0") @ExcelCollection(name="",orderNum = "4")
private List<BusinessAddressExcelVO> tableField161; private List<BusinessAddressExcelVO> tableField161;
@JsonProperty("tableField171") @JsonProperty("tableField171")
@ExcelCollection(name="",orderNum = "0") @ExcelCollection(name="",orderNum = "5")
private List<BusinessCargoExcelVO> tableField171; private List<BusinessCargoExcelVO> tableField171;

@ -1,8 +1,9 @@
package jnpf.model.businessline; package jnpf.model.businessline;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
@ -10,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Data @Data
public class BusinessLineForm { public class BusinessLineForm {
@ -86,4 +87,7 @@ public class BusinessLineForm {
/** 卸货效率 **/ /** 卸货效率 **/
@JsonProperty("unloadingEfficiency") @JsonProperty("unloadingEfficiency")
private String unloadingEfficiency; private String unloadingEfficiency;
/** 业务线与仓库区分标志 **/
@JsonProperty("diffFlag")
private Object diffFlag;
} }

@ -1,9 +1,9 @@
package jnpf.model.businessline; package jnpf.model.businessline;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import jnpf.base.Pagination; import jnpf.base.Pagination;
import java.util.List;
/** /**
* *
@ -11,7 +11,7 @@ import jnpf.base.Pagination;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-01-19 * @ 2024-01-23
*/ */
@Data @Data
public class BusinessLinePagination extends Pagination { public class BusinessLinePagination extends Pagination {
@ -39,8 +39,7 @@ public class BusinessLinePagination extends Pagination {
/** 成立时间 */ /** 成立时间 */
@JsonProperty("establishDate") @JsonProperty("establishDate")
private Object establishDate; private Object establishDate;
/** 业务线与仓库区分标志 */
/** 区分标志*/ @JsonProperty("diffFlag")
@TableField(exist = false)
private Object diffFlag; private Object diffFlag;
} }

@ -10,6 +10,12 @@ enum Api {
export function getOrganizeList(data) { export function getOrganizeList(data) {
return defHttp.get({ url: Api.Prefix, data }); return defHttp.get({ url: Api.Prefix, data });
} }
// 获取公司列表
export function getEnterpriseList(data) {
return defHttp.get({ url: Api.Prefix + '/Enterprise', data });
}
// 获取组织/公司下拉框列表 // 获取组织/公司下拉框列表
export function getOrganizeSelector(id = '0') { export function getOrganizeSelector(id = '0') {
return defHttp.get({ url: Api.Prefix + `/Selector/${id || '0'}` }); return defHttp.get({ url: Api.Prefix + `/Selector/${id || '0'}` });

@ -0,0 +1,138 @@
<template>
<div class="jnpf-content-wrapper">
<div class="jnpf-content-wrapper-center">
<div class="jnpf-content-wrapper-content">
<BasicTable @register="registerTable">
<template #tableTitle>
<a-dropdown>
<template #overlay>
<a-menu @click="handleAdd">
<a-menu-item key="company">新建公司</a-menu-item>
<!-- <a-menu-item key="department">新建部门</a-menu-item> -->
</a-menu>
</template>
<a-button type="primary" preIcon="icon-ym icon-ym-btn-add">{{ t('common.addText') }}<DownOutlined /></a-button>
</a-dropdown>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'fullName'"><i :class="'mr-6px ' + record.icon"></i>{{ record.fullName }}</template>
<template v-if="column.key === 'action'">
<TableAction :actions="getTableActions(record)" :dropDownActions="getDropDownActions(record)" />
</template>
</template>
</BasicTable>
</div>
</div>
<Form @register="registerForm" @reload="reload" />
<DepForm @register="registerDepForm" @reload="reload" />
<Member @register="registerMember" />
</div>
</template>
<script lang="ts" setup>
import { getOrganizeList, delOrganize, getEnterpriseList } from '/@/api/permission/organize';
import { BasicTable, useTable, TableAction, BasicColumn, FormProps, ActionItem } from '/@/components/Table';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { useModal } from '/@/components/Modal';
import { usePopup } from '/@/components/Popup';
import { useOrganizeStore } from '/@/store/modules/organize';
import Form from './Form.vue';
import DepForm from './DepForm.vue';
import Member from './Member.vue';
import { DownOutlined } from '@ant-design/icons-vue';
defineOptions({ name: 'permission-organize' });
const { createMessage } = useMessage();
const { t } = useI18n();
const organizeStore = useOrganizeStore();
const [registerDepForm, { openModal: openDepFormModal }] = useModal();
const [registerMember, { openModal: openMemberModal }] = useModal();
const [registerForm, { openPopup: openFormPopup }] = usePopup();
const columns: BasicColumn[] = [
{ title: '名称', dataIndex: 'fullName' },
{ title: '编码', dataIndex: 'enCode' },
{ title: '层级', dataIndex: 'index', width: 100, align: 'center' },
{ title: '类型', dataIndex: 'type', width: 100, align: 'center', customRender: ({ record }) => (record.type === 'company' ? '公司' : '部门') },
{ title: '创建时间', dataIndex: 'creatorTime', width: 150, format: 'date|YYYY-MM-DD HH:mm' },
{ title: '排序', dataIndex: 'sortCode', width: 70, align: 'center' },
];
const [registerTable, { reload }] = useTable({
api: getEnterpriseList,
columns,
isTreeTable: true,
useSearchForm: true,
pagination: false,
formConfig: getFormConfig(),
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
afterFetch: data => setTableIndex(data),
});
// index
function setTableIndex(arr, index = 0) {
arr.forEach(item => {
item.index = 1;
if (index) item.index = index + 1;
if (item.children) setTableIndex(item.children, item.index);
});
}
function getFormConfig(): Partial<FormProps> {
return {
schemas: [
{
field: 'keyword',
label: t('common.keyword'),
component: 'Input',
componentProps: {
placeholder: t('common.enterKeyword'),
submitOnPressEnter: true,
},
},
],
};
}
function getTableActions(record): ActionItem[] {
return [
{
label: t('common.editText'),
onClick: addOrUpdateHandle.bind(null, record.id, record.type, record.parentId),
},
{
label: t('common.delText'),
color: 'error',
modelConfirm: {
onOk: handleDelete.bind(null, record.id),
},
},
];
}
function getDropDownActions(record): ActionItem[] {
return [
{
label: '查看成员',
onClick: viewMember.bind(null, record.id, record.fullName),
},
];
}
function handleAdd({ key }) {
addOrUpdateHandle('', key);
}
function addOrUpdateHandle(id = '', type, parentId = '') {
const openMethod = type === 'company' ? openFormPopup : openDepFormModal;
openMethod(true, { id, parentId });
}
function handleDelete(id) {
delOrganize(id).then(res => {
createMessage.success(res.msg);
organizeStore.resetState();
reload();
});
}
function viewMember(id, fullName) {
openMemberModal(true, { id, fullName });
}
</script>

@ -293,6 +293,7 @@ dataForm: {
description:undefined, description:undefined,
businessContactList:[], businessContactList:[],
version: 0, version: 0,
diffFlag:'',
}, },
tableRows:{ tableRows:{
@ -329,13 +330,13 @@ dataRule: {
trigger: 'change' trigger: 'change'
}, },
], ],
city: [ // city: [
{ // {
required: true, // required: true,
message: '请至少选择一个', // message: '',
trigger: 'change' // trigger: 'change'
}, // },
], // ],
establishDate: [ establishDate: [
{ {
required: true, required: true,
@ -441,6 +442,7 @@ version: 0,
const values = await getForm()?.validate(); const values = await getForm()?.validate();
if (!values) return; if (!values) return;
state.submitType = type; state.submitType = type;
state.dataForm.diffFlag = '1';
state.submitType === 1 ? setFormProps({ continueLoading: true }) : setFormProps({ confirmLoading: true }); state.submitType === 1 ? setFormProps({ continueLoading: true }) : setFormProps({ confirmLoading: true });
const formMethod = state.dataForm.id ? update : create; const formMethod = state.dataForm.id ? update : create;
formMethod(state.dataForm) formMethod(state.dataForm)

@ -259,6 +259,18 @@
</template> </template>
<template v-if="column.key === 'saleType' "> <template v-if="column.key === 'saleType' ">
<p>{{record.saleType}}</p> <p>{{record.saleType}}</p>
</template>
<template v-if="column.key === 'cargoCapacityLow' ">
<JnpfInputNumber v-model:value="record.cargoCapacityLow"
placeholder="请输入" disabled
detailed :style='{"width":"100%"}' :step="1" :controls="false" addonAfter="吨" >
</JnpfInputNumber>
</template>
<template v-if="column.key === 'cargoCapacityHigh' ">
<JnpfInputNumber v-model:value="record.cargoCapacityHigh"
placeholder="请输入" disabled
detailed :style='{"width":"100%"}' :step="1" :controls="false" addonAfter="吨" >
</JnpfInputNumber>
</template> </template>
<template v-if="column.key === 'description' "> <template v-if="column.key === 'description' ">
<p>{{record.description}}</p> <p>{{record.description}}</p>
@ -307,7 +319,7 @@
dataIndex: 'contactType' , dataIndex: 'contactType' ,
key: 'contactType' , key: 'contactType' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '姓名', title: '姓名',
@ -315,7 +327,7 @@
dataIndex: 'name' , dataIndex: 'name' ,
key: 'name' , key: 'name' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '手机号', title: '手机号',
@ -323,7 +335,7 @@
dataIndex: 'phone' , dataIndex: 'phone' ,
key: 'phone' , key: 'phone' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '座机', title: '座机',
@ -339,7 +351,7 @@
dataIndex: 'email' , dataIndex: 'email' ,
key: 'email' , key: 'email' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '传真', title: '传真',
@ -395,7 +407,7 @@
dataIndex: 'addressType' , dataIndex: 'addressType' ,
key: 'addressType' , key: 'addressType' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '国家/地区', title: '国家/地区',
@ -403,7 +415,7 @@
dataIndex: 'country' , dataIndex: 'country' ,
key: 'country' , key: 'country' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '省/市/区', title: '省/市/区',
@ -411,7 +423,7 @@
dataIndex: 'province' , dataIndex: 'province' ,
key: 'province' , key: 'province' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '详细地址', title: '详细地址',
@ -419,7 +431,7 @@
dataIndex: 'fullAddress' , dataIndex: 'fullAddress' ,
key: 'fullAddress' , key: 'fullAddress' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '备注', title: '备注',
@ -475,7 +487,7 @@
dataIndex: 'cargoName' , dataIndex: 'cargoName' ,
key: 'cargoName' , key: 'cargoName' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '类型', title: '类型',
@ -483,7 +495,7 @@
dataIndex: 'cargoType' , dataIndex: 'cargoType' ,
key: 'cargoType' , key: 'cargoType' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '是否可售', title: '是否可售',
@ -491,7 +503,23 @@
dataIndex: 'saleType' , dataIndex: 'saleType' ,
key: 'saleType' , key: 'saleType' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
},
{
title: '最低库存容量',
showLabel: true,
dataIndex: 'cargoCapacityLow' ,
key: 'cargoCapacityLow' ,
tipLabel: '' ,
required: true,
},
{
title: '最高库存容量',
showLabel: true,
dataIndex: 'cargoCapacityHigh' ,
key: 'cargoCapacityHigh' ,
tipLabel: '' ,
required: true,
}, },
{ {
title: '备注', title: '备注',

@ -349,6 +349,16 @@
placeholder="请选择" :allowClear='true' :style='{"width":"100%"}' :showSearch='false' :options="optionsObj.businessCargosaleTypeOptions" :fieldNames="optionsObj.businessCargosaleTypeProps" placeholder="请选择" :allowClear='true' :style='{"width":"100%"}' :showSearch='false' :options="optionsObj.businessCargosaleTypeOptions" :fieldNames="optionsObj.businessCargosaleTypeProps"
> >
</JnpfSelect> </JnpfSelect>
</template>
<template v-if="column.key === 'cargoCapacityLow' ">
<JnpfInputNumber v-model:value="record.cargoCapacityLow" @change="changeData('businessCargocargoCapacityLow',index)"
placeholder="请输入" :style='{"width":"100%"}' :step="1" addonAfter="吨" :controls="false" >
</JnpfInputNumber>
</template>
<template v-if="column.key === 'cargoCapacityHigh' ">
<JnpfInputNumber v-model:value="record.cargoCapacityHigh" @change="changeData('businessCargocargoCapacityHigh',index)"
placeholder="请输入" :style='{"width":"100%"}' :step="1" addonAfter="吨" :controls="false" >
</JnpfInputNumber>
</template> </template>
<template v-if="column.key === 'description' "> <template v-if="column.key === 'description' ">
<JnpfInput v-model:value="record.description" @change="changeData('businessCargodescription',index)" <JnpfInput v-model:value="record.description" @change="changeData('businessCargodescription',index)"
@ -423,21 +433,21 @@ continueText: string; allList: any[];
dataIndex: 'contactType' , dataIndex: 'contactType' ,
key: 'contactType' , key: 'contactType' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '姓名', title: '姓名',
dataIndex: 'name' , dataIndex: 'name' ,
key: 'name' , key: 'name' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '手机号', title: '手机号',
dataIndex: 'phone' , dataIndex: 'phone' ,
key: 'phone' , key: 'phone' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '座机', title: '座机',
@ -451,7 +461,7 @@ continueText: string; allList: any[];
dataIndex: 'email' , dataIndex: 'email' ,
key: 'email' , key: 'email' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '传真', title: '传真',
@ -505,28 +515,28 @@ continueText: string; allList: any[];
dataIndex: 'addressType' , dataIndex: 'addressType' ,
key: 'addressType' , key: 'addressType' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '国家/地区', title: '国家/地区',
dataIndex: 'country' , dataIndex: 'country' ,
key: 'country' , key: 'country' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '省/市/区', title: '省/市/区',
dataIndex: 'province' , dataIndex: 'province' ,
key: 'province' , key: 'province' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '详细地址', title: '详细地址',
dataIndex: 'fullAddress' , dataIndex: 'fullAddress' ,
key: 'fullAddress' , key: 'fullAddress' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '备注', title: '备注',
@ -580,21 +590,35 @@ continueText: string; allList: any[];
dataIndex: 'cargoName' , dataIndex: 'cargoName' ,
key: 'cargoName' , key: 'cargoName' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '类型', title: '类型',
dataIndex: 'cargoType' , dataIndex: 'cargoType' ,
key: 'cargoType' , key: 'cargoType' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
}, },
{ {
title: '是否可售', title: '是否可售',
dataIndex: 'saleType' , dataIndex: 'saleType' ,
key: 'saleType' , key: 'saleType' ,
tipLabel: '' , tipLabel: '' ,
required: false, required: true,
},
{
title: '最低库存容量',
dataIndex: 'cargoCapacityLow' ,
key: 'cargoCapacityLow' ,
tipLabel: '' ,
required: true,
},
{
title: '最高库存容量',
dataIndex: 'cargoCapacityHigh' ,
key: 'cargoCapacityHigh' ,
tipLabel: '' ,
required: true,
}, },
{ {
title: '备注', title: '备注',
@ -666,6 +690,7 @@ dataForm: {
businessAddressList:[], businessAddressList:[],
businessCargoList:[], businessCargoList:[],
version: 0, version: 0,
diffFlag:'',
}, },
tableRows:{ tableRows:{
@ -688,6 +713,8 @@ tableRows:{
}, },
businessCargoList:{ businessCargoList:{
cargoName : '', cargoName : '',
cargoCapacityLow : undefined,
cargoCapacityHigh : undefined,
description : '', description : '',
lastModifyTime : '', lastModifyTime : '',
enabledmark:undefined enabledmark:undefined
@ -716,27 +743,27 @@ dataRule: {
trigger: 'change' trigger: 'change'
}, },
], ],
establishDate: [ // establishDate: [
{ // {
required: true, // required: true,
message: '不能为空', // message: '',
trigger: 'change' // trigger: 'change'
}, // },
], // ],
belongUserId: [ // belongUserId: [
{ // {
required: true, // required: true,
message: '请至少选择一个', // message: '',
trigger: 'change' // trigger: 'change'
}, // },
], // ],
city: [ // city: [
{ // {
required: true, // required: true,
message: '请至少选择一个', // message: '',
trigger: 'change' // trigger: 'change'
}, // },
], // ],
}, },
optionsObj:{ optionsObj:{
@ -761,7 +788,7 @@ optionsObj:{
childIndex: -1, childIndex: -1,
isEdit: false, isEdit: false,
interfaceRes: {"code":[],"businessCargocargoType":[],"city":[],"description":[],"businessContactphone":[],"type":[],"businessCargosaleType":[],"erpType":[],"businessAddressprovince":[],"businessAddresslastModifyTime":[],"loadingEffciency":[],"businessContactname":[],"businessContactcontactType":[],"businessCargodescription":[],"businessCargolastModifyTime":[],"businessContactemail":[],"businessContactlastModifyTime":[],"businessStart":[],"businessHours":[],"businessAddressfullAddress":[],"businessAddresscountry":[],"establishDate":[],"businessContactfax":[],"parentId":[],"unloadingDuration":[],"belongUserId":[],"simpleName":[],"name":[],"loadingDuration":[],"allowUnloadingStart":[],"businessAddressdescription":[],"businessAddressaddressType":[],"businessType":[],"allowLoadingStart":[],"unloadingEfficiency":[],"businessContactlandline":[],"businessCargocargoName":[]}, interfaceRes: {"code":[],"businessCargocargoType":[],"city":[],"description":[],"businessContactphone":[],"type":[],"businessCargosaleType":[],"businessCargocargoCapacityHigh":[],"erpType":[],"businessAddressprovince":[],"businessAddresslastModifyTime":[],"loadingEffciency":[],"businessContactname":[],"businessContactcontactType":[],"businessCargodescription":[],"businessCargolastModifyTime":[],"businessContactemail":[],"businessContactlastModifyTime":[],"businessStart":[],"businessHours":[],"businessAddressfullAddress":[],"businessAddresscountry":[],"establishDate":[],"businessContactfax":[],"parentId":[],"unloadingDuration":[],"belongUserId":[],"simpleName":[],"name":[],"loadingDuration":[],"allowUnloadingStart":[],"businessAddressdescription":[],"businessAddressaddressType":[],"businessType":[],"allowLoadingStart":[],"unloadingEfficiency":[],"businessContactlandline":[],"businessCargocargoName":[],"businessCargocargoCapacityLow":[]},
// //
ableAll:{ ableAll:{
}, },
@ -835,6 +862,7 @@ ableAll:{
businessAddressList:[], businessAddressList:[],
businessCargoList:[], businessCargoList:[],
version: 0, version: 0,
diffFlag:'',
}; };
state.childIndex = -1; state.childIndex = -1;
changeLoading(false); changeLoading(false);
@ -865,6 +893,7 @@ version: 0,
const values = await getForm()?.validate(); const values = await getForm()?.validate();
if (!values) return; if (!values) return;
state.submitType = type; state.submitType = type;
state.dataForm.diffFlag = '2'
state.submitType === 1 ? setFormProps({ continueLoading: true }) : setFormProps({ confirmLoading: true }); state.submitType === 1 ? setFormProps({ continueLoading: true }) : setFormProps({ confirmLoading: true });
const formMethod = state.dataForm.id ? update : create; const formMethod = state.dataForm.id ? update : create;
formMethod(state.dataForm) formMethod(state.dataForm)
@ -1004,6 +1033,8 @@ function changeDataFormData(type, data, model,index,defaultValue) {
businessCargocargoTypeOptions:state.optionsObj.businessCargocargoTypeOptions, businessCargocargoTypeOptions:state.optionsObj.businessCargocargoTypeOptions,
saleType:'', saleType:'',
businessCargosaleTypeOptions:state.optionsObj.businessCargosaleTypeOptions, businessCargosaleTypeOptions:state.optionsObj.businessCargosaleTypeOptions,
cargoCapacityLow:undefined,
cargoCapacityHigh:undefined,
description:undefined, description:undefined,
lastModifyTime:undefined, lastModifyTime:undefined,
} }

@ -515,6 +515,7 @@
searchFormSubmit(); searchFormSubmit();
} }
function handleSearchSubmit(data) { function handleSearchSubmit(data) {
data.diffFlag = '2';
clearSelectedRowKeys(); clearSelectedRowKeys();
let obj = { let obj = {
...defaultSearchInfo, ...defaultSearchInfo,

@ -0,0 +1,624 @@
<template>
<BasicPopup v-bind="$attrs" @register="registerPopup" :title="title" destroyOnClose>
<template #insertToolbar>
</template>
<a-row class="p-10px dynamic-form " :style="{ margin: '0 auto', width: '100%' }">
<!-- 表单 -->
<a-form :colon="false" size="default" layout= "horizontal"
labelAlign= "left"
:labelCol="{ style: { width: '100px' } }" :model="dataForm" ref="formRef" >
<a-row :gutter="15">
<!-- 具体表单 -->
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="code" >
<template #label>业务组织编号</template>
<p>{{dataForm.code}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="name" >
<template #label>业务组织名称</template>
<p>{{dataForm.name}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="simpleName" >
<template #label>业务组织简称</template>
<p>{{dataForm.simpleName}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="parentId" >
<template #label>隶属业务线</template>
<p>{{dataForm.parentId}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="type" >
<template #label>类型</template>
<p>{{dataForm.type}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="erpType" >
<template #label>ERP子库</template>
<p>{{dataForm.erpType}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="establishDate" >
<template #label>成立时间</template>
<p>{{dataForm.establishDate}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="belongUserId" >
<template #label>归属人员</template>
<p>{{dataForm.belongUserId}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="city" >
<template #label>所在城市</template>
<p>{{dataForm.city}}</p>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item" >
<a-form-item
name="description" >
<template #label>描述</template>
<p>{{dataForm.description}}</p>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item">
<a-form-item>
<JnpfGroupTitle
contentPosition="left" content ="运营信息" >
</JnpfGroupTitle>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item" >
<a-form-item
name="businessType" >
<template #label>运营时间</template>
<p>{{dataForm.businessType}}</p>
</a-form-item>
</a-col>
<a-col :span="18" class="ant-col-item" >
<a-form-item
name="businessHours" >
<template #label>营业时间</template>
<p>{{dataForm.businessHours}}</p>
</a-form-item>
</a-col>
<a-col :span="18" class="ant-col-item" >
<a-form-item
name="businessStart" >
<template #label>营业时间开始</template>
<p>{{dataForm.businessStart}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="allowLoadingStart" >
<template #label>允许装货时间</template>
<p>{{dataForm.allowLoadingStart}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="loadingDuration" >
<template #label>装货时长</template>
<p>{{dataForm.loadingDuration}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="loadingEffciency" >
<template #label>装货效率</template>
<p>{{dataForm.loadingEffciency}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="allowUnloadingStart" >
<template #label>允许卸货时间</template>
<p>{{dataForm.allowUnloadingStart}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="unloadingDuration" >
<template #label>卸货时长</template>
<p>{{dataForm.unloadingDuration}}</p>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" >
<a-form-item
name="unloadingEfficiency" >
<template #label>卸货效率</template>
<p>{{dataForm.unloadingEfficiency}}</p>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item">
<a-form-item>
<JnpfGroupTitle
contentPosition="left" content ="联系人信息" >
</JnpfGroupTitle>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item">
<a-form-item>
<a-table :data-source="dataForm.tableField133"
:columns="businessContactColumns" size="small" :pagination="false" :scroll="{ x: 'max-content' }">
<template #headerCell="{ column }">
<span class="required-sign" v-if="column.required">*</span>
{{ column.title }}
<BasicHelp :text="column.tipLabel" v-if="column.tipLabel && column.title" />
</template>
<template #bodyCell="{ column, index, record }">
<template v-if="column.key === 'index'">{{ index + 1 }}</template>
<template v-if="column.key === 'contactType' ">
<p>{{record.contactType}}</p>
</template>
<template v-if="column.key === 'name' ">
<p>{{record.name}}</p>
</template>
<template v-if="column.key === 'phone' ">
<p>{{record.phone}}</p>
</template>
<template v-if="column.key === 'landline' ">
<p>{{record.landline}}</p>
</template>
<template v-if="column.key === 'email' ">
<p>{{record.email}}</p>
</template>
<template v-if="column.key === 'fax' ">
<p>{{record.fax}}</p>
</template>
<template v-if="column.key === 'lastModifyTime' ">
<p>{{record.lastModifyTime}}</p>
</template>
</template>
</a-table>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item">
<a-form-item>
<JnpfGroupTitle
contentPosition="left" content ="地址信息" >
</JnpfGroupTitle>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item">
<a-form-item>
<a-table :data-source="dataForm.tableField161"
:columns="businessAddressColumns" size="small" :pagination="false" :scroll="{ x: 'max-content' }">
<template #headerCell="{ column }">
<span class="required-sign" v-if="column.required">*</span>
{{ column.title }}
<BasicHelp :text="column.tipLabel" v-if="column.tipLabel && column.title" />
</template>
<template #bodyCell="{ column, index, record }">
<template v-if="column.key === 'index'">{{ index + 1 }}</template>
<template v-if="column.key === 'addressType' ">
<p>{{record.addressType}}</p>
</template>
<template v-if="column.key === 'country' ">
<p>{{record.country}}</p>
</template>
<template v-if="column.key === 'province' ">
<p>{{record.province}}</p>
</template>
<template v-if="column.key === 'fullAddress' ">
<p>{{record.fullAddress}}</p>
</template>
<template v-if="column.key === 'description' ">
<p>{{record.description}}</p>
</template>
<template v-if="column.key === 'lastModifyTime' ">
<p>{{record.lastModifyTime}}</p>
</template>
</template>
</a-table>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item">
<a-form-item>
<JnpfGroupTitle
contentPosition="left" content ="货区信息" >
</JnpfGroupTitle>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item">
<a-form-item>
<a-table :data-source="dataForm.tableField171"
:columns="businessCargoColumns" size="small" :pagination="false" :scroll="{ x: 'max-content' }">
<template #headerCell="{ column }">
<span class="required-sign" v-if="column.required">*</span>
{{ column.title }}
<BasicHelp :text="column.tipLabel" v-if="column.tipLabel && column.title" />
</template>
<template #bodyCell="{ column, index, record }">
<template v-if="column.key === 'index'">{{ index + 1 }}</template>
<template v-if="column.key === 'cargoName' ">
<p>{{record.cargoName}}</p>
</template>
<template v-if="column.key === 'cargoType' ">
<p>{{record.cargoType}}</p>
</template>
<template v-if="column.key === 'saleType' ">
<p>{{record.saleType}}</p>
</template>
<template v-if="column.key === 'cargoCapacityLow' ">
<JnpfInputNumber v-model:value="record.cargoCapacityLow"
placeholder="请输入" disabled
detailed :style='{"width":"100%"}' :step="1" :controls="false" addonAfter="吨" >
</JnpfInputNumber>
</template>
<template v-if="column.key === 'cargoCapacityHigh' ">
<JnpfInputNumber v-model:value="record.cargoCapacityHigh"
placeholder="请输入" disabled
detailed :style='{"width":"100%"}' :step="1" :controls="false" addonAfter="吨" >
</JnpfInputNumber>
</template>
<template v-if="column.key === 'description' ">
<p>{{record.description}}</p>
</template>
<template v-if="column.key === 'lastModifyTime' ">
<p>{{record.lastModifyTime}}</p>
</template>
</template>
</a-table>
</a-form-item>
</a-col>
<!-- 表单结束 -->
</a-row>
</a-form>
</a-row>
</BasicPopup>
<!-- 有关联表单详情开始 -->
<RelationDetail ref="relationDetailRef" />
<!-- 有关联表单详情结束 -->
</template>
<script lang="ts" setup>
import { getDetailInfo } from './helper/api';
import { getConfigData } from '/@/api/onlineDev/visualDev';
import { reactive, toRefs, nextTick, ref, computed, unref ,toRaw} from 'vue';
import { BasicPopup, usePopup } from '/@/components/Popup';
import { BasicModal, useModal } from '/@/components/Modal';
//
import RelationDetail from '/@/views/common/dynamicModel/list/detail/index.vue';
//
import { usePermission } from '/@/hooks/web/usePermission';
import { useMessage } from '/@/hooks/web/useMessage';
interface State {
dataForm: any;
title: string;
}
defineOptions({ name: 'Detail' });
const { createMessage, createConfirm } = useMessage();
const [registerPopup, { openPopup, setPopupProps, closePopup }] = usePopup();
const businessContactColumns: any[] = computed(() => {
let list = [
{
title: '类型',
showLabel: true,
dataIndex: 'contactType' ,
key: 'contactType' ,
tipLabel: '' ,
required: true,
},
{
title: '姓名',
showLabel: true,
dataIndex: 'name' ,
key: 'name' ,
tipLabel: '' ,
required: true,
},
{
title: '手机号',
showLabel: true,
dataIndex: 'phone' ,
key: 'phone' ,
tipLabel: '' ,
required: true,
},
{
title: '座机',
showLabel: true,
dataIndex: 'landline' ,
key: 'landline' ,
tipLabel: '' ,
required: false,
},
{
title: '邮箱',
showLabel: true,
dataIndex: 'email' ,
key: 'email' ,
tipLabel: '' ,
required: true,
},
{
title: '传真',
showLabel: true,
dataIndex: 'fax' ,
key: 'fax' ,
tipLabel: '' ,
required: false,
},
{
title: '更新时间',
showLabel: true,
dataIndex: 'lastModifyTime' ,
key: 'lastModifyTime' ,
tipLabel: '' ,
required: false,
},
];
const indexColumn = { title: '序号', showLabel: true, dataIndex: 'index', key: 'index', align: 'center', width: 50 };
//
let columnList = list;
let complexHeaderList: any[] = [];
if (complexHeaderList.length) {
let childColumns: any[] = [];
for (let i = 0; i < complexHeaderList.length; i++) {
const e = complexHeaderList[i];
e.title = e.fullName;
e.align = e.align;
e.children = [];
e.jnpfKey = 'complexHeader';
if (e.childColumns?.length) {
childColumns.push(...e.childColumns);
for (let j = 0; j < list.length; j++) {
const o = list[j];
if (e.childColumns.includes(o.key)) e.children.push({ ...toRaw(o), align: e.align });
}
}
}
complexHeaderList = complexHeaderList.filter(o => o.children.length);
for (let i = 0; i < list.length; i++) {
const item = list[i];
if (!childColumns.includes(item.key)) complexHeaderList.push(item);
}
columnList = complexHeaderList;
}
return [indexColumn, ...columnList];
});
const businessAddressColumns: any[] = computed(() => {
let list = [
{
title: '类型',
showLabel: true,
dataIndex: 'addressType' ,
key: 'addressType' ,
tipLabel: '' ,
required: true,
},
{
title: '国家/地区',
showLabel: true,
dataIndex: 'country' ,
key: 'country' ,
tipLabel: '' ,
required: true,
},
{
title: '省/市/区',
showLabel: true,
dataIndex: 'province' ,
key: 'province' ,
tipLabel: '' ,
required: true,
},
{
title: '详细地址',
showLabel: true,
dataIndex: 'fullAddress' ,
key: 'fullAddress' ,
tipLabel: '' ,
required: true,
},
{
title: '备注',
showLabel: true,
dataIndex: 'description' ,
key: 'description' ,
tipLabel: '' ,
required: false,
},
{
title: '更新时间',
showLabel: true,
dataIndex: 'lastModifyTime' ,
key: 'lastModifyTime' ,
tipLabel: '' ,
required: false,
},
];
const indexColumn = { title: '序号', showLabel: true, dataIndex: 'index', key: 'index', align: 'center', width: 50 };
//
let columnList = list;
let complexHeaderList: any[] = [];
if (complexHeaderList.length) {
let childColumns: any[] = [];
for (let i = 0; i < complexHeaderList.length; i++) {
const e = complexHeaderList[i];
e.title = e.fullName;
e.align = e.align;
e.children = [];
e.jnpfKey = 'complexHeader';
if (e.childColumns?.length) {
childColumns.push(...e.childColumns);
for (let j = 0; j < list.length; j++) {
const o = list[j];
if (e.childColumns.includes(o.key)) e.children.push({ ...toRaw(o), align: e.align });
}
}
}
complexHeaderList = complexHeaderList.filter(o => o.children.length);
for (let i = 0; i < list.length; i++) {
const item = list[i];
if (!childColumns.includes(item.key)) complexHeaderList.push(item);
}
columnList = complexHeaderList;
}
return [indexColumn, ...columnList];
});
const businessCargoColumns: any[] = computed(() => {
let list = [
{
title: '货区名称',
showLabel: true,
dataIndex: 'cargoName' ,
key: 'cargoName' ,
tipLabel: '' ,
required: true,
},
{
title: '类型',
showLabel: true,
dataIndex: 'cargoType' ,
key: 'cargoType' ,
tipLabel: '' ,
required: true,
},
{
title: '是否可售',
showLabel: true,
dataIndex: 'saleType' ,
key: 'saleType' ,
tipLabel: '' ,
required: true,
},
{
title: '最低库存容量',
showLabel: true,
dataIndex: 'cargoCapacityLow' ,
key: 'cargoCapacityLow' ,
tipLabel: '' ,
required: true,
},
{
title: '最高库存容量',
showLabel: true,
dataIndex: 'cargoCapacityHigh' ,
key: 'cargoCapacityHigh' ,
tipLabel: '' ,
required: true,
},
{
title: '备注',
showLabel: true,
dataIndex: 'description' ,
key: 'description' ,
tipLabel: '' ,
required: false,
},
{
title: '更新时间',
showLabel: true,
dataIndex: 'lastModifyTime' ,
key: 'lastModifyTime' ,
tipLabel: '' ,
required: false,
},
];
const indexColumn = { title: '序号', showLabel: true, dataIndex: 'index', key: 'index', align: 'center', width: 50 };
//
let columnList = list;
let complexHeaderList: any[] = [];
if (complexHeaderList.length) {
let childColumns: any[] = [];
for (let i = 0; i < complexHeaderList.length; i++) {
const e = complexHeaderList[i];
e.title = e.fullName;
e.align = e.align;
e.children = [];
e.jnpfKey = 'complexHeader';
if (e.childColumns?.length) {
childColumns.push(...e.childColumns);
for (let j = 0; j < list.length; j++) {
const o = list[j];
if (e.childColumns.includes(o.key)) e.children.push({ ...toRaw(o), align: e.align });
}
}
}
complexHeaderList = complexHeaderList.filter(o => o.children.length);
for (let i = 0; i < list.length; i++) {
const item = list[i];
if (!childColumns.includes(item.key)) complexHeaderList.push(item);
}
columnList = complexHeaderList;
}
return [indexColumn, ...columnList];
});
const relationDetailRef = ref<any>(null);
const state = reactive<State>({
dataForm:{},
title: '详情',
});
const { title, dataForm } = toRefs(state);
//
const { hasFormP } = usePermission();
defineExpose({ init });
function init(data) {
state.dataForm.id = data.id;
openPopup();
nextTick(() => {
setTimeout(initData, 0);
});
}
function initData() {
changeLoading(true);
if (state.dataForm.id) {
getData(state.dataForm.id);
} else {
closePopup();
}
}
function getData(id) {
getDetailInfo(id).then((res) => {
state.dataForm = res.data || {};
nextTick(() => {
changeLoading(false);
});
});
}
function toDetail(modelId, id) {
if (!id) return;
getConfigData(modelId).then((res) => {
if (!res.data || !res.data.formData) return;
const formConf = JSON.parse(res.data.formData);
formConf.popupType = 'general';
const data = { id, formConf, modelId };
relationDetailRef.value?.init(data);
});
}
function setFormProps(data) {
setPopupProps(data);
}
function changeLoading(loading) {
setFormProps({ loading });
}
</script>

@ -0,0 +1,34 @@
import { defHttp } from '/@/utils/http/axios';
// 获取列表
export function getList(data) {
return defHttp.post({ url: '/api/scm/BusinessLine/getList', data });
}
// 新建
export function create(data) {
return defHttp.post({ url:'/api/scm/BusinessLine', data });
}
// 修改
export function update(data) {
return defHttp.put({ url: '/api/scm/BusinessLine/'+ data.id, data });
}
// 详情(无转换数据)
export function getInfo(id) {
return defHttp.get({ url: '/api/scm/BusinessLine/' + id });
}
// 获取(转换数据)
export function getDetailInfo(id) {
return defHttp.get({ url: '/api/scm/BusinessLine/detail/' + id });
}
// 删除
export function del(id) {
return defHttp.delete({ url: '/api/scm/BusinessLine/' + id });
}
// 批量删除数据
export function batchDelete(data) {
return defHttp.delete({ url: '/api/scm/BusinessLine/batchRemove', data });
}
// 导出
export function exportData(data) {
return defHttp.post({ url: '/api/scm/BusinessLine/Actions/Export', data });
}

@ -0,0 +1,483 @@
<template>
<div class="jnpf-content-wrapper">
<div class="jnpf-content-wrapper-center">
<div class="jnpf-content-wrapper-search-box">
<BasicForm @register="registerSearchForm" :schemas="searchSchemas"
@advanced-change="redoHeight" @submit="handleSearchSubmit" @reset="handleSearchReset"
class="search-form">
</BasicForm>
</div>
<div class="jnpf-content-wrapper-content">
<BasicTable @register="registerTable" v-bind="getTableBindValue" ref="tableRef"
@columns-change="handleColumnChange">
<template #tableTitle>
<a-button type="primary" preIcon="icon-ym icon-ym-btn-add" v-auth="'btn_add'"
@click="addHandle()">新增</a-button>
</template>
<template #toolbar>
<a-tooltip placement="top">
<template #title>
<span>{{ t('common.superQuery') }}</span>
</template>
<filter-outlined @click="openSuperQuery(true, { columnOptions: superQueryJson })" />
</a-tooltip>
</template>
<template #bodyCell="{ column, record, index }">
<template v-for="(item, index) in childColumnList" v-if="childColumnList.length">
<template
v-if="column?.id?.includes('-') && item.children && item.children[0] && column.key === item.children[0]?.dataIndex">
<ChildTableColumn :data="record[item.prop]" :head="item.children"
@toggleExpand="toggleExpand(record, item.prop+`Expand`)" @toDetail="toDetail"
:expand="record[item.prop+`Expand`]" :key="index" />
</template>
</template>
<template v-if="column.jnpfKey === 'relationForm'">
<p class="link-text"
@click="toDetail(column.modelId, record[column.dataIndex+`_id`])">
{{ record[column.dataIndex] }}</p>
</template>
<template v-if="column.jnpfKey === 'inputNumber'">
<jnpf-input-number v-model:value="record[column.prop]" :precision="column.precision" :thousands="column.thousands" disabled detailed />
</template>
<template v-if="column.jnpfKey === 'calculate'">
<jnpf-calculate
v-model:value="record[column.prop]"
:isStorage="column.isStorage"
:precision="column.precision"
:thousands="column.thousands"
detailed />
</template>
<template v-if="column.key === 'action' && !record.top">
<TableAction :actions="getTableActions(record)" />
</template>
</template>
</BasicTable>
</div>
</div>
<Form ref="formRef" @reload="reload" />
<Detail ref="detailRef" />
<RelationDetail ref="relationDetailRef" />
<SuperQueryModal @register="registerSuperQueryModal" @superQuery="handleSuperQuery" />
</div>
</template>
<script lang="ts" setup>
import { getList, del, exportData, batchDelete } from './helper/api';
import { getConfigData } from '/@/api/onlineDev/visualDev';
import { getDictionaryDataSelector } from '/@/api/systemData/dictionary';
import { getDataInterfaceRes } from '/@/api/systemData/dataInterface';
import { ref, reactive, onMounted, toRefs, computed, unref, nextTick, toRaw } from 'vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { useOrganizeStore } from '/@/store/modules/organize';
import { useUserStore } from '/@/store/modules/user';
import { BasicModal, useModal } from '/@/components/Modal';
import { usePopup } from '/@/components/Popup';
import { ScrollContainer } from '/@/components/Container';
import { BasicLeftTree, TreeActionType } from '/@/components/Tree';
import { BasicForm, useForm } from '/@/components/Form';
import { BasicTable, useTable, TableAction, ActionItem, TableActionType } from '/@/components/Table';
import { SuperQueryModal } from '/@/components/CommonModal';
import Form from './Form.vue';
import Detail from './Detail.vue';
//
import RelationDetail from '/@/views/common/dynamicModel/list/detail/index.vue';
//
import ChildTableColumn from '/@/views/common/dynamicModel/list/ChildTableColumn.vue';
import { useRoute } from 'vue-router';
import { FilterOutlined } from '@ant-design/icons-vue';
import { getSearchFormSchemas } from '/@/components/FormGenerator/src/helper/transform';
import { cloneDeep } from 'lodash-es';
import columnList from './helper/columnList';
import searchList from './helper/searchList';
import superQueryJson from './helper/superQueryJson';
import { dyOptionsList, systemComponentsList } from '/@/components/FormGenerator/src/helper/config';
import { thousandsFormat} from '/@/utils/jnpf';
interface State {
formFlowId: string;
flowList: any[];
config: any;
columnList: any[];
printListOptions: any[];
columnBtnsList: any[];
customBtnsList: any[];
treeFieldNames: any;
leftTreeData: any[];
leftTreeLoading: boolean;
treeActiveId: string;
treeActiveNodePath: any;
columns: any[];
complexColumns: any[];
childColumnList: any[];
exportList: any[];
cacheList: any[];
currFlow: any;
isCustomCopy: boolean;
candidateType: number;
currRow: any;
workFlowFormData: any;
expandObj: any;
columnSettingList: any[];
searchSchemas: any[];
treeRelationObj: any;
treeQueryJson: any;
}
const route = useRoute();
const { createMessage, createConfirm } = useMessage();
const { t } = useI18n();
const organizeStore = useOrganizeStore();
const userStore = useUserStore();
const userInfo = userStore.getUserInfo;
const [registerExportModal, { openModal: openExportModal, closeModal: closeExportModal, setModalProps: setExportModalProps }] = useModal();
const [registerImportModal, { openModal: openImportModal }] = useModal();
const [registerSuperQueryModal, { openModal: openSuperQuery }] = useModal();
const formRef = ref<any>(null);
const tableRef = ref<Nullable<TableActionType>>(null);
const detailRef = ref<any>(null);
const relationDetailRef = ref<any>(null);
const defaultSearchInfo = {
menuId: route.meta.modelId as string,
moduleId:'519510290946064581',
superQueryJson: '',
};
const searchInfo = reactive({
...cloneDeep(defaultSearchInfo),
});
const state = reactive<State>({
formFlowId: '',
flowList: [],
config: {},
columnList: [],
printListOptions: [],
columnBtnsList: [],
customBtnsList: [],
treeFieldNames: {
children: 'children' ,
title: 'fullName' ,
key: 'id' ,
isLeaf: 'isLeaf',
},
leftTreeData: [],
leftTreeLoading: false,
treeActiveId: '',
treeActiveNodePath: [],
columns: [],
complexColumns: [], //
childColumnList: [],
exportList: [],
cacheList: [],
currFlow: {},
isCustomCopy: false,
candidateType: 1,
currRow: {},
workFlowFormData: {},
expandObj: {},
columnSettingList: [],
searchSchemas: [],
treeRelationObj: null,
treeQueryJson: {},
});
const { flowList, childColumnList, searchSchemas } = toRefs(state);
const [registerSearchForm, { updateSchema, resetFields, submit: searchFormSubmit }] = useForm({
baseColProps: { span: 6 },
showActionButtonGroup: true,
showAdvancedButton: true,
compact: true,
});
const [registerTable, { reload, setLoading, getFetchParams, getSelectRowKeys, redoHeight,clearSelectedRowKeys }] = useTable({
api: getList,
immediate: false,
clickToRowSelect: false,
afterFetch: (data) => {
const list = data.map((o) => ({
...o,
...state.expandObj,
}));
state.cacheList = cloneDeep(list);
return list;
},
});
const getTableBindValue = computed(() => {
let columns = state.complexColumns;
const data: any = {
pagination: false, //
searchInfo: unref(searchInfo),
defSort: {
sort: "desc", //sort
sidx: "", //defaultSidx
},
columns,
isTreeTable: true,
bordered: true,
actionColumn: {
width: 150,
title: '操作',
dataIndex: 'action',
},
};
return data;
});
function init() {
state.config = {};
searchInfo.menuId = route.meta.modelId as string;
state.columnList = columnList;
setLoading(true);
getSearchSchemas();
getColumnList();
nextTick(() => {
//
searchFormSubmit();
});
}
function getSearchSchemas() {
const schemas = getSearchFormSchemas(searchList);
state.searchSchemas = schemas;
schemas.forEach((cur) => {
const config = cur.__config__;
if (dyOptionsList.includes(config.jnpfKey)) {
if (config.dataType === 'dictionary') {
if (!config.dictionaryType) return;
getDictionaryDataSelector(config.dictionaryType).then((res) => {
updateSchema([{ field: cur.field, componentProps: { options: res.data.list } }]);
});
}
if (config.dataType === 'dynamic') {
if (!config.propsUrl) return;
const query = { paramList: config.templateJson || [] };
getDataInterfaceRes(config.propsUrl, query).then((res) => {
const data = Array.isArray(res.data) ? res.data : [];
updateSchema([{ field: cur.field, componentProps: { options: data } }]);
});
}
}
cur.defaultValue = cur.value;
});
}
function getColumnList() {
//
let columnList = state.columnList;
state.exportList = columnList;
let columns = columnList.map((o) => ({
...o,
title: o.label,
dataIndex: o.prop,
align: o.align,
fixed: o.fixed == 'none' ? false : o.fixed,
sorter: o.sortable,
width: o.width || 100,
}));
//
columns = getComplexColumns(columns);
state.columns = columns.filter((o) => o.prop.indexOf('-') < 0);
//
getChildComplexColumns(columns);
}
//
function getComplexColumns(columns) {
//
let complexHeaderList: any[] = [];
if (!complexHeaderList.length) return columns;
let childColumns: any[] = [];
for (let i = 0; i < complexHeaderList.length; i++) {
const e = complexHeaderList[i];
e.title = e.fullName;
e.align = e.align;
e.dataIndex = e.id;
e.prop = e.id;
e.children = [];
e.jnpfKey = 'complexHeader';
if (e.childColumns?.length) {
childColumns.push(...e.childColumns);
for (let k = 0; k < e.childColumns.length; k++) {
const item = e.childColumns[k];
for (let j = 0; j < columns.length; j++) {
const o = columns[j];
if (o.__vModel__ == item && o.fixed !== 'left' && o.fixed !== 'right' && !o.__config__.isSubTable) e.children.push({ ...o });
}
}
}
}
complexHeaderList = complexHeaderList.filter(o => o.children.length);
for (let i = 0; i < columns.length; i++) {
const item = columns[i];
if (!childColumns.includes(item.__vModel__) || item.__config__.isSubTable) complexHeaderList.push(item);
}
return complexHeaderList;
}
//
function getChildComplexColumns(columnList) {
let list: any[] = [];
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e);
} else {
let prop = e.prop.split('-')[0];
let vModel = e.prop.split('-')[1];
let label = e.label.split('-')[0];
let childLabel = e.label.replace(label + '-', '');
let newItem = {
align: 'center',
jnpfKey: 'table',
prop,
label,
title: label,
dataIndex: prop,
children: [],
};
e.dataIndex = vModel;
e.title = childLabel;
if (!state.expandObj.hasOwnProperty(prop+`Expand`)) state.expandObj[prop+`Expand`] = false;
if (!list.some((o) => o.prop === prop)) list.push(newItem);
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e);
break;
}
}
}
}
//
getMergeList(list);
state.complexColumns = list;
state.childColumnList = list.filter((o) => o.jnpfKey === 'table');
// 100
for (let i = 0; i < state.childColumnList.length; i++) {
const e = state.childColumnList[i];
if (e.children?.length) e.children = e.children.map(o => ({ ...o, width: 100 }));
}
}
function getMergeList(list) {
list.forEach((item) => {
if (item.jnpfKey === 'table' && item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
child.customCell = () => ({
rowspan: 1,
colspan: item.children.length,
class: 'child-table-box',
});
} else {
child.customCell = () => ({
rowspan: 0,
colspan: 0,
});
}
});
}
});
}
function toggleExpand(row, field) {
row[field] = !row[field];
}
//
function toDetail(modelId, id) {
if (!id) return;
getConfigData(modelId).then((res) => {
if (!res.data || !res.data.formData) return;
const formConf = JSON.parse(res.data.formData);
formConf.popupType = 'general';
const data = { id, formConf, modelId };
relationDetailRef.value?.init(data);
});
}
function handleColumnChange(data) {
state.columnSettingList = data;
}
function getTableActions(record): ActionItem[] {
return [
{
label: '编辑',
onClick: updateHandle.bind(null, record),
auth: 'btn_edit', //
},
{
label: '删除',
color: 'error',
modelConfirm: {
onOk: handleDelete.bind(null, record.id),
},
auth: 'btn_remove', //
},
{
label: '详情',
onClick: goDetail.bind(null, record),
auth: 'btn_detail', //
},
];
}
//
function updateHandle(record) {
//
const data = {
id: record.id,
menuId: searchInfo.menuId,
allList: state.cacheList,
};
formRef.value?.init(data);
}
//
function handleDelete(id) {
del(id).then((res) => {
createMessage.success(res.msg);
clearSelectedRowKeys();
reload();
});
}
//
function goDetail(record) {
//
const data = {
id: record.id,
};
detailRef.value?.init(data);
}
//
function addHandle() {
//
const data = {
id: '',
menuId: searchInfo.menuId,
allList: state.cacheList,
};
formRef.value?.init(data);
}
//
function handleSuperQuery(superQueryJson) {
searchInfo.superQueryJson = superQueryJson;
reload({ page: 1 });
}
function handleSearchReset() {
searchFormSubmit();
}
function handleSearchSubmit(data) {
clearSelectedRowKeys();
let obj = {
...defaultSearchInfo,
superQueryJson: searchInfo.superQueryJson,
...data,
...(state.treeQueryJson || {})
};
Object.keys(searchInfo).map(key => {
delete searchInfo[key];
});
for (let [key, value] of Object.entries(obj)) {
searchInfo[key.replaceAll('-', '_')] = value;
}
console.log(searchInfo);
reload({ page: 1 });
}
onMounted(() => {
init();
});
</script>
Loading…
Cancel
Save