# Conflicts:
#	jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ParkMapper.java
#	jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ParkService.java
#	jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ParkServiceImpl.java
#	jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ParkController.java
#	jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ParkEntity.java
#	jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/park/ParkConstant.java
#	jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/park/ParkExcelErrorVO.java
#	jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/park/ParkExcelVO.java
#	jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/park/ParkForm.java
#	jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/park/ParkPagination.java
#	jnpf-java-boot/jnpf-web/src/views/scm/park/Detail.vue
#	jnpf-java-boot/jnpf-web/src/views/scm/park/form.vue
#	jnpf-java-boot/jnpf-web/src/views/scm/park/index.vue
master
vayne 3 months ago
commit 43888861ff

@ -115,7 +115,11 @@
<artifactId>jnpf-visualdev-integrate-controller</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.jnpf</groupId>
<artifactId>jnpf-scm-controller</artifactId>
<version>${project.version}</version>
</dependency>
<!--打包WAR包删除注释-->
<!--<dependency>
<groupId>org.springframework.boot</groupId>

@ -1,16 +1,16 @@
package jnpf.mapper;
import jnpf.base.mapper.SuperMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.entity.ContractEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
*
* @author JNPF
* @version V3.1.0
* @copyright
* @date 2021/3/16 9:47
* Contract
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
public interface ContractMapper extends SuperMapper<ContractEntity> {
public interface ContractMapper extends BaseMapper<ContractEntity> {
}

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.EnterpriseMerchantsEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* EnterpriseMerchants
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
*/
public interface EnterpriseMerchantsMapper extends BaseMapper<EnterpriseMerchantsEntity> {
}

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
* 2024-07-17
*/
public interface ParkMapper extends BaseMapper<ParkEntity> {

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

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

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

@ -1,28 +1,56 @@
package jnpf.service;
import jnpf.base.service.SuperService;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.base.Pagination;
import jnpf.entity.ContractEntity;
import jnpf.model.contract.*;
import jnpf.entity.*;
import java.util.*;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
*
* @author JNPF
* @version V3.1.0
* @copyright
* @date 2021/3/16 9:47
* Contract
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
public interface ContractService extends SuperService<ContractEntity> {
public interface ContractService extends IService<ContractEntity> {
List<ContractEntity> getList(ContractPagination contractPagination);
List<ContractEntity> getlist(Pagination pagination);
List<ContractEntity> getTypeList(ContractPagination contractPagination, String dataType);
ContractEntity getInfo(String id);
void delete(ContractEntity entity);
void create(ContractEntity entity);
void update(String id, ContractEntity entity);
boolean update(String id, ContractEntity entity);
void delete(ContractEntity entity);
//子表方法
List<SpacecontractEntity> getSpacecontractList(String id, ContractPagination contractPagination);
List<SpacecontractEntity> getSpacecontractList(String id);
//副表数据方法
String checkForm(ContractForm form, int i);
void saveOrUpdate(ContractForm contractForm, String id, boolean isSave) throws Exception;
/**
*
*
* @param request
* @return string
*/
String confirmation(ContractRequest request);
/**
*
*
* @param request
* @return string
*/
String finish(ContractRequest request);
}

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.enterprisemerchants.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* EnterpriseMerchants
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
*/
public interface EnterpriseMerchantsService extends IService<EnterpriseMerchantsEntity> {
List<EnterpriseMerchantsEntity> getList(EnterpriseMerchantsPagination enterpriseMerchantsPagination);
List<EnterpriseMerchantsEntity> getTypeList(EnterpriseMerchantsPagination enterpriseMerchantsPagination,String dataType);
EnterpriseMerchantsEntity getInfo(String id);
void delete(EnterpriseMerchantsEntity entity);
void create(EnterpriseMerchantsEntity entity);
boolean update(String id, EnterpriseMerchantsEntity entity);
//子表方法
//副表数据方法
String checkForm(EnterpriseMerchantsForm form,int i);
void saveOrUpdate(EnterpriseMerchantsForm enterpriseMerchantsForm,String id, boolean isSave) throws Exception;
}

@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
* 2024-07-17
*/
public interface ParkService extends IService<ParkEntity> {
List<ParkEntity> getList(ParkPagination parkPagination);

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.person.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* Person
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
public interface PersonService extends IService<PersonEntity> {
List<PersonEntity> getList(PersonPagination personPagination);
List<PersonEntity> getTypeList(PersonPagination personPagination,String dataType);
PersonEntity getInfo(String id);
void delete(PersonEntity entity);
void create(PersonEntity entity);
boolean update(String id, PersonEntity entity);
//子表方法
//副表数据方法
String checkForm(PersonForm form,int i);
void saveOrUpdate(PersonForm personForm,String id, boolean isSave) throws Exception;
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.contract.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* Contract
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
public interface SpacecontractService extends IService<SpacecontractEntity> {
QueryWrapper<SpacecontractEntity> getChild(ContractPagination pagination,QueryWrapper<SpacecontractEntity> spacecontractQueryWrapper);
}

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.vehicle.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* Vehicle
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
public interface VehicleService extends IService<VehicleEntity> {
List<VehicleEntity> getList(VehiclePagination vehiclePagination);
List<VehicleEntity> getTypeList(VehiclePagination vehiclePagination,String dataType);
VehicleEntity getInfo(String id);
void delete(VehicleEntity entity);
void create(VehicleEntity entity);
boolean update(String id, VehicleEntity entity);
//子表方法
//副表数据方法
String checkForm(VehicleForm form,int i);
void saveOrUpdate(VehicleForm vehicleForm,String id, boolean isSave) throws Exception;
}

@ -1,76 +1,398 @@
package jnpf.service.impl;
import jnpf.base.service.SuperServiceImpl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.base.Pagination;
import jnpf.base.UserInfo;
import jnpf.base.model.ColumnDataModel;
import jnpf.database.model.superQuery.SuperJsonModel;
import jnpf.entity.ContractEntity;
import jnpf.entity.SpacecontractEntity;
import jnpf.mapper.ContractMapper;
import jnpf.model.QueryModel;
import jnpf.model.contract.*;
import jnpf.permission.entity.UserEntity;
import jnpf.service.ContractService;
import jnpf.entity.ContractEntity;
import jnpf.util.RandomUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import jnpf.service.SpacecontractService;
import jnpf.util.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.lang.reflect.Field;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
*
* @author JNPF
* @version V3.1.0
* @copyright
* @date 2021/3/16 9:47
* Contract
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
@Service
public class ContractServiceImpl extends SuperServiceImpl<ContractMapper, ContractEntity> implements ContractService {
@Slf4j
public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEntity> implements ContractService {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private SpacecontractService spacecontractService;
@Override
public List<ContractEntity> getlist(Pagination pagination){
//通过UserProvider获取用户信息
QueryWrapper<ContractEntity> queryWrapper = new QueryWrapper<>();
if (!StringUtil.isEmpty(pagination.getKeyword())) {
queryWrapper.lambda().and(
t -> t.like(ContractEntity::getContractName, pagination.getKeyword())
.or().like(ContractEntity::getMytelePhone, pagination.getKeyword())
);
public List<ContractEntity> getList(ContractPagination contractPagination) {
return getTypeList(contractPagination, contractPagination.getDataType());
}
/**
*
*/
@Override
public List<ContractEntity> getTypeList(ContractPagination contractPagination, 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 ? ContractConstant.getAppColumnData() : ContractConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total = 0;
int contractNum = 0;
QueryWrapper<ContractEntity> contractQueryWrapper = new QueryWrapper<>();
int spacecontractNum = 0;
QueryWrapper<SpacecontractEntity> spacecontractQueryWrapper = new QueryWrapper<>();
long spacecontractcount = spacecontractService.count();
List<String> allSuperIDlist = new ArrayList<>();
String superOp = "";
if (ObjectUtil.isNotEmpty(contractPagination.getSuperQueryJson())) {
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = contractPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<ContractEntity> contractSuperWrapper = new QueryWrapper<>();
contractSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(contractSuperWrapper, ContractEntity.class, queryJson, "0"));
int contractNum1 = contractSuperWrapper.getExpression().getNormal().size();
if (contractNum1 > 0) {
List<String> contractList = this.list(contractSuperWrapper).stream().map(ContractEntity::getId).collect(Collectors.toList());
allSuperList.addAll(contractList);
intersectionSuperList.add(contractList);
superNum++;
}
String SpacecontractTable = "yq_space_contract";
boolean SpacecontractHasSql = queryJson.contains(SpacecontractTable);
List<String> spacecontractList = generaterSwapUtil.selectIdsByChildCondition(ContractConstant.getTableList(), SpacecontractTable, queryJson, null);
if (SpacecontractHasSql) {
allSuperList.addAll(spacecontractList);
intersectionSuperList.add(spacecontractList);
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<ContractEntity> contractSuperWrapper = new QueryWrapper<>();
contractSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(contractSuperWrapper, ContractEntity.class, ruleJson, "0"));
int contractNum1 = contractSuperWrapper.getExpression().getNormal().size();
if (contractNum1 > 0) {
List<String> contractList = this.list(contractSuperWrapper).stream().map(ContractEntity::getId).collect(Collectors.toList());
allRuleList.addAll(contractList);
intersectionRuleList.add(contractList);
ruleNum++;
}
String SpacecontractTable = "yq_space_contract";
boolean SpacecontractHasSql = ruleJson.contains(SpacecontractTable);
List<String> spacecontractList = generaterSwapUtil.selectIdsByChildCondition(ContractConstant.getTableList(), SpacecontractTable, ruleJson, null);
if (SpacecontractHasSql) {
allRuleList.addAll(spacecontractList);
intersectionRuleList.add(spacecontractList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if (ruleOp.equalsIgnoreCase("and")) {
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
} else {
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if (isPc && pcPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object contractObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(contractQueryWrapper, ContractEntity.class, contractPagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(contractObj)) {
return new ArrayList<>();
} else {
contractQueryWrapper = (QueryWrapper<ContractEntity>) contractObj;
if (contractQueryWrapper.getExpression().getNormal().size() > 0) {
contractNum++;
}
}
Object spacecontractObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(spacecontractQueryWrapper, SpacecontractEntity.class, contractPagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(spacecontractObj)) {
return new ArrayList<>();
} else {
spacecontractQueryWrapper = (QueryWrapper<SpacecontractEntity>) spacecontractObj;
if (spacecontractQueryWrapper.getExpression().getNormal().size() > 0) {
spacecontractNum++;
}
}
}
}
if (!isPc && appPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object contractObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(contractQueryWrapper, ContractEntity.class, contractPagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(contractObj)) {
return new ArrayList<>();
} else {
contractQueryWrapper = (QueryWrapper<ContractEntity>) contractObj;
if (contractQueryWrapper.getExpression().getNormal().size() > 0) {
contractNum++;
}
}
Object spacecontractObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(spacecontractQueryWrapper, SpacecontractEntity.class, contractPagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(spacecontractObj)) {
return new ArrayList<>();
} else {
spacecontractQueryWrapper = (QueryWrapper<SpacecontractEntity>) spacecontractObj;
if (spacecontractQueryWrapper.getExpression().getNormal().size() > 0) {
spacecontractNum++;
}
}
}
}
if (isPc) {
if (ObjectUtil.isNotEmpty(contractPagination.getCreationTime())) {
contractNum++;
List CreationTimeList = JsonUtil.getJsonToList(contractPagination.getCreationTime(), String.class);
Long fir = Long.valueOf(String.valueOf(CreationTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(CreationTimeList.get(1)));
contractQueryWrapper.lambda().ge(ContractEntity::getCreationTime, new Date(fir))
.le(ContractEntity::getCreationTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if (ObjectUtil.isNotEmpty(contractPagination.getMerchantName())) {
contractNum++;
List<String> idList = new ArrayList<>();
try {
String[][] merchantName = JsonUtil.getJsonToBean(contractPagination.getMerchantName(), String[][].class);
for (int i = 0; i < merchantName.length; i++) {
if (merchantName[i].length > 0) {
idList.add(JsonUtil.getObjectToString(Arrays.asList(merchantName[i])));
}
}
} catch (Exception e1) {
try {
List<String> merchantName = JsonUtil.getJsonToList(contractPagination.getMerchantName(), String.class);
if (merchantName.size() > 0) {
idList.addAll(merchantName);
}
} catch (Exception e2) {
idList.add(String.valueOf(contractPagination.getMerchantName()));
}
}
contractQueryWrapper.lambda().and(t -> {
idList.forEach(tt -> {
t.like(ContractEntity::getMerchantName, tt).or();
});
});
}
if (ObjectUtil.isNotEmpty(contractPagination.getContractStatus())) {
contractNum++;
List<String> idList = new ArrayList<>();
try {
String[][] contractStatus = JsonUtil.getJsonToBean(contractPagination.getContractStatus(), String[][].class);
for (int i = 0; i < contractStatus.length; i++) {
if (contractStatus[i].length > 0) {
idList.add(JsonUtil.getObjectToString(Arrays.asList(contractStatus[i])));
}
}
} catch (Exception e1) {
try {
List<String> contractStatus = JsonUtil.getJsonToList(contractPagination.getContractStatus(), String.class);
if (contractStatus.size() > 0) {
idList.addAll(contractStatus);
}
} catch (Exception e2) {
idList.add(String.valueOf(contractPagination.getContractStatus()));
}
}
contractQueryWrapper.lambda().and(t -> {
idList.forEach(tt -> {
t.like(ContractEntity::getContractStatus, tt).or();
});
});
}
if (ObjectUtil.isNotEmpty(contractPagination.getContractName())) {
contractNum++;
String value = contractPagination.getContractName() instanceof List ?
JsonUtil.getObjectToString(contractPagination.getContractName()) :
String.valueOf(contractPagination.getContractName());
contractQueryWrapper.lambda().like(ContractEntity::getContractName, value);
}
if (ObjectUtil.isNotEmpty(contractPagination.getContractNumber())) {
contractNum++;
String value = contractPagination.getContractNumber() instanceof List ?
JsonUtil.getObjectToString(contractPagination.getContractNumber()) :
String.valueOf(contractPagination.getContractNumber());
contractQueryWrapper.lambda().like(ContractEntity::getContractNumber, value);
}
if (ObjectUtil.isNotEmpty(contractPagination.getParkId())) {
contractNum++;
List<String> idList = new ArrayList<>();
try {
String[][] parkId = JsonUtil.getJsonToBean(contractPagination.getParkId(), String[][].class);
for (int i = 0; i < parkId.length; i++) {
if (parkId[i].length > 0) {
idList.add(JsonUtil.getObjectToString(Arrays.asList(parkId[i])));
}
}
} catch (Exception e1) {
try {
List<String> parkId = JsonUtil.getJsonToList(contractPagination.getParkId(), String.class);
if (parkId.size() > 0) {
idList.addAll(parkId);
}
} catch (Exception e2) {
idList.add(String.valueOf(contractPagination.getParkId()));
}
}
contractQueryWrapper.lambda().and(t -> {
idList.forEach(tt -> {
t.like(ContractEntity::getParkId, tt).or();
});
});
}
}
if (spacecontractNum > 0) {
List<String> spacecontractIdList = spacecontractService.list(spacecontractQueryWrapper).stream().filter(t -> StringUtil.isNotEmpty(t.getContractNumber())).map(t -> t.getContractNumber()).collect(Collectors.toList());
long count = spacecontractService.count();
if (count > 0) {
intersectionList.add(spacecontractIdList);
}
AllIdList.addAll(spacecontractIdList);
}
total += spacecontractNum;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total > 0) {
if (intersection.size() == 0) {
intersection.add("jnpfNullList");
}
contractQueryWrapper.lambda().in(ContractEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)) {
if (allSuperIDlist.size() == 0) {
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
contractQueryWrapper.lambda().and(t -> t.in(ContractEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)) {
if (allRuleIDlist.size() == 0) {
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
contractQueryWrapper.lambda().and(t -> t.in(ContractEntity::getId, finalAllRuleIDlist));
}
//假删除标志
contractQueryWrapper.lambda().isNull(ContractEntity::getDeleteMark);
//排序
if (StringUtil.isEmpty(pagination.getSidx())) {
if (StringUtil.isEmpty(contractPagination.getSidx())) {
contractQueryWrapper.lambda().orderByDesc(ContractEntity::getId);
} else {
try {
String sidx = contractPagination.getSidx();
String[] strs = sidx.split("_name");
ContractEntity contractEntity = new ContractEntity();
Field declaredField = contractEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
contractQueryWrapper = "asc".equals(contractPagination.getSort().toLowerCase()) ? contractQueryWrapper.orderByAsc(value) : contractQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if ("0".equals(dataType)) {
if ((total > 0 && AllIdList.size() > 0) || total == 0) {
Page<ContractEntity> page = new Page<>(contractPagination.getCurrentPage(), contractPagination.getPageSize());
IPage<ContractEntity> userIPage = this.page(page, contractQueryWrapper);
return contractPagination.setData(userIPage.getRecords(), userIPage.getTotal());
} else {
List<ContractEntity> list = new ArrayList();
return contractPagination.setData(list, list.size());
}
} else {
queryWrapper = "asc".equals(pagination.getSort().toLowerCase()) ? queryWrapper.orderByAsc(pagination.getSidx()) : queryWrapper.orderByDesc(pagination.getSidx());
return this.list(contractQueryWrapper);
}
Page<ContractEntity> page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize());
IPage<ContractEntity> userPage = this.page(page, queryWrapper);
return pagination.setData(userPage.getRecords(), page.getTotal());
}
@Override
public ContractEntity getInfo(String id){
public ContractEntity getInfo(String id) {
QueryWrapper<ContractEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ContractEntity::getId, id);
return this.getOne(queryWrapper);
}
@Override
@DSTransactional
public void create(ContractEntity entity){
entity.setId(RandomUtil.uuId());
public void create(ContractEntity entity) {
this.save(entity);
}
@Override
@DSTransactional
public void update(String id, ContractEntity entity){
entity.setId(id);
this.updateById(entity);
public boolean update(String id, ContractEntity entity) {
return this.updateById(entity);
}
@Override
@ -79,4 +401,172 @@ public class ContractServiceImpl extends SuperServiceImpl<ContractMapper, Contra
this.removeById(entity.getId());
}
}
/**
* Spacecontract
*/
@Override
public List<SpacecontractEntity> getSpacecontractList(String id, ContractPagination contractPagination) {
Map<String, Object> newtabMap = ContractConstant.TABLEFIELDKEY.entrySet()
.stream().collect(Collectors.toMap(e -> e.getValue(), e -> e.getKey()));
String tableName = "spacecontract";
tableName = newtabMap.get(tableName) == null ? tableName : newtabMap.get(tableName).toString();
QueryWrapper<SpacecontractEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = spacecontractService.getChild(contractPagination, queryWrapper);
queryWrapper.lambda().eq(SpacecontractEntity::getContractNumber, id);
queryWrapper.lambda().isNull(SpacecontractEntity::getCeleteTags);
generaterSwapUtil.wrapperHandle(ContractConstant.getColumnData(), ContractConstant.getAppColumnData(), queryWrapper, SpacecontractEntity.class, "sub", tableName);
return spacecontractService.list(queryWrapper);
}
/**
* Spacecontract
*/
@Override
public List<SpacecontractEntity> getSpacecontractList(String id) {
QueryWrapper<SpacecontractEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SpacecontractEntity::getContractNumber, id);
return spacecontractService.list(queryWrapper);
}
/**
* i-0-1
*/
@Override
public String checkForm(ContractForm 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.getContractName())) {
return "合同名称不能为空";
}
if (StringUtil.isEmpty(form.getTotalRentalPrice())) {
return "租金总价不能为空";
}
if (StringUtil.isNotEmpty(form.getTotalRentalPrice())) {
if (!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getTotalRentalPrice())).matches()) {
return "请输入正确的金额";
}
}
if (StringUtil.isEmpty(form.getTotalDeposit())) {
return "押金总计不能为空";
}
if (StringUtil.isNotEmpty(form.getTotalDeposit())) {
if (!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getTotalDeposit())).matches()) {
return "请输入正确的金额";
}
}
if (StringUtil.isEmpty(form.getLeaseTerm())) {
return "租期不能为空";
}
if (StringUtil.isEmpty(form.getContacts())) {
return "联系人不能为空";
}
if (StringUtil.isEmpty(form.getContactsPhone())) {
return "联系电话不能为空";
}
//子表字段验证
if (form.getSpacecontractList() != null) {
for (SpacecontractModel t : form.getSpacecontractList()) {
if (StringUtil.isNotEmpty(t.getTotalRentalPrice())) {
t.setTotalRentalPrice(t.getTotalRentalPrice().trim());
}
if (StringUtil.isNotEmpty(t.getTotalRentalPrice())) {
if (!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(t.getTotalRentalPrice())).matches()) {
return "请输入正确的金额";
}
}
}
}
return countRecover;
}
/**
* ()
*
* @param id
* @param contractForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(ContractForm contractForm, String id, boolean isSave) throws Exception {
UserInfo userInfo = userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
contractForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(ContractConstant.getFormData(), contractForm), ContractForm.class);
ContractEntity entity = JsonUtil.getJsonToBean(contractForm, ContractEntity.class);
if (isSave) {
//获取当前年月日
String currentDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
entity.setCreationTime(DateUtil.getNowDate());
entity.setContractNumber(currentDate + RandomUtil.uuId().substring(0, 6));
entity.setId(RandomUtil.uuId());
entity.setVersion(0);
} else {
entity.setCreationTime(DateUtil.getNowDate());
}
this.saveOrUpdate(entity);
//Spacecontract子表数据新增修改
if (!isSave) {
QueryWrapper<SpacecontractEntity> SpacecontractqueryWrapper = new QueryWrapper<>();
SpacecontractqueryWrapper.lambda().eq(SpacecontractEntity::getContractNumber, entity.getContractNumber());
spacecontractService.remove(SpacecontractqueryWrapper);
}
if (contractForm.getSpacecontractList() != null) {
List<SpacecontractEntity> tableField130 = JsonUtil.getJsonToList(contractForm.getSpacecontractList(), SpacecontractEntity.class);
int i = 1;
for (SpacecontractEntity entitys : tableField130) {
entitys.setId(RandomUtil.uuId());
entitys.setContractNumber(entity.getContractNumber());
entitys.setContractLineNumber(String.valueOf(i));
if (isSave) {
} else {
}
i++;
spacecontractService.saveOrUpdate(entitys);
}
}
}
@Override
public String confirmation(ContractRequest request) {
log.info("合同确认id{}", request.getId());
LambdaQueryWrapper<ContractEntity> eq = new LambdaQueryWrapper<>(ContractEntity.class)
.eq(ContractEntity::getId, request.getId());
ContractEntity contract = this.getOne(eq);
if (!"10".equals(contract.getContractStatus()) || !"21".equals(contract.getContractStatus())) {
return "该合同处于已确认状态,不允许再次确认";
}
//todo 查询空间判断
//todo 需要处理别的逻辑
contract.setContractStatus(request.getContractStatus());
contract.setApproveDate(DateUtil.getNowDate());
contract.setApprovedBy(userProvider.get().getUserId());
contract.setApproveRemarks(StringUtils.isNoneBlank(request.getApproveRemarks()) ? request.getApproveRemarks() : "同意");
return "合同确认成功";
}
@Override
public String finish(ContractRequest request) {
log.info("合同结束id{}", request.getId());
LambdaQueryWrapper<ContractEntity> eq = new LambdaQueryWrapper<>(ContractEntity.class)
.eq(ContractEntity::getId, request.getId());
ContractEntity contract = this.getOne(eq);
if (!"20".equals(contract.getContractStatus())) {
return "该合同没有确认,不允许结束!";
}
//todo 需要处理别的逻辑
contract.setContractStatus(request.getContractStatus());
contract.setRemarks(StringUtils.isNoneBlank(request.getApproveRemarks()) ? request.getApproveRemarks() : "同意");
this.updateById(contract);
return "合同结束成功";
}
}

@ -0,0 +1,389 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.EnterpriseMerchantsMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.enterprisemerchants.*;
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;
/**
*
* EnterpriseMerchants
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
*/
@Service
public class EnterpriseMerchantsServiceImpl extends ServiceImpl<EnterpriseMerchantsMapper, EnterpriseMerchantsEntity> implements EnterpriseMerchantsService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<EnterpriseMerchantsEntity> getList(EnterpriseMerchantsPagination enterpriseMerchantsPagination){
return getTypeList(enterpriseMerchantsPagination,enterpriseMerchantsPagination.getDataType());
}
/** 列表查询 */
@Override
public List<EnterpriseMerchantsEntity> getTypeList(EnterpriseMerchantsPagination enterpriseMerchantsPagination,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 ? EnterpriseMerchantsConstant.getAppColumnData() : EnterpriseMerchantsConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int enterpriseMerchantsNum =0;
QueryWrapper<EnterpriseMerchantsEntity> enterpriseMerchantsQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(enterpriseMerchantsPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = enterpriseMerchantsPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<EnterpriseMerchantsEntity> enterpriseMerchantsSuperWrapper = new QueryWrapper<>();
enterpriseMerchantsSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(enterpriseMerchantsSuperWrapper,EnterpriseMerchantsEntity.class,queryJson,"0"));
int enterpriseMerchantsNum1 = enterpriseMerchantsSuperWrapper.getExpression().getNormal().size();
if (enterpriseMerchantsNum1>0){
List<String> enterpriseMerchantsList =this.list(enterpriseMerchantsSuperWrapper).stream().map(EnterpriseMerchantsEntity::getId).collect(Collectors.toList());
allSuperList.addAll(enterpriseMerchantsList);
intersectionSuperList.add(enterpriseMerchantsList);
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<EnterpriseMerchantsEntity> enterpriseMerchantsSuperWrapper = new QueryWrapper<>();
enterpriseMerchantsSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(enterpriseMerchantsSuperWrapper,EnterpriseMerchantsEntity.class,ruleJson,"0"));
int enterpriseMerchantsNum1 = enterpriseMerchantsSuperWrapper.getExpression().getNormal().size();
if (enterpriseMerchantsNum1>0){
List<String> enterpriseMerchantsList =this.list(enterpriseMerchantsSuperWrapper).stream().map(EnterpriseMerchantsEntity::getId).collect(Collectors.toList());
allRuleList.addAll(enterpriseMerchantsList);
intersectionRuleList.add(enterpriseMerchantsList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object enterpriseMerchantsObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(enterpriseMerchantsQueryWrapper,EnterpriseMerchantsEntity.class,enterpriseMerchantsPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(enterpriseMerchantsObj)){
return new ArrayList<>();
} else {
enterpriseMerchantsQueryWrapper = (QueryWrapper<EnterpriseMerchantsEntity>)enterpriseMerchantsObj;
if( enterpriseMerchantsQueryWrapper.getExpression().getNormal().size()>0){
enterpriseMerchantsNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object enterpriseMerchantsObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(enterpriseMerchantsQueryWrapper,EnterpriseMerchantsEntity.class,enterpriseMerchantsPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(enterpriseMerchantsObj)){
return new ArrayList<>();
} else {
enterpriseMerchantsQueryWrapper = (QueryWrapper<EnterpriseMerchantsEntity>)enterpriseMerchantsObj;
if( enterpriseMerchantsQueryWrapper.getExpression().getNormal().size()>0){
enterpriseMerchantsNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(enterpriseMerchantsPagination.getCmpNo())){
enterpriseMerchantsNum++;
String value = enterpriseMerchantsPagination.getCmpNo() instanceof List ?
JsonUtil.getObjectToString(enterpriseMerchantsPagination.getCmpNo()) :
String.valueOf(enterpriseMerchantsPagination.getCmpNo());
enterpriseMerchantsQueryWrapper.lambda().like(EnterpriseMerchantsEntity::getCmpNo,value);
}
if(ObjectUtil.isNotEmpty(enterpriseMerchantsPagination.getCmpNm())){
enterpriseMerchantsNum++;
String value = enterpriseMerchantsPagination.getCmpNm() instanceof List ?
JsonUtil.getObjectToString(enterpriseMerchantsPagination.getCmpNm()) :
String.valueOf(enterpriseMerchantsPagination.getCmpNm());
enterpriseMerchantsQueryWrapper.lambda().like(EnterpriseMerchantsEntity::getCmpNm,value);
}
if(ObjectUtil.isNotEmpty(enterpriseMerchantsPagination.getCompType())){
enterpriseMerchantsNum++;
List<String> idList = new ArrayList<>();
try {
String[][] compType = JsonUtil.getJsonToBean(enterpriseMerchantsPagination.getCompType(),String[][].class);
for(int i=0;i<compType.length;i++){
if(compType[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(compType[i])));
}
}
}catch (Exception e1){
try {
List<String> compType = JsonUtil.getJsonToList(enterpriseMerchantsPagination.getCompType(),String.class);
if(compType.size()>0){
idList.addAll(compType);
}
}catch (Exception e2){
idList.add(String.valueOf(enterpriseMerchantsPagination.getCompType()));
}
}
enterpriseMerchantsQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(EnterpriseMerchantsEntity::getCompType, tt).or();
});
});
}
if(ObjectUtil.isNotEmpty(enterpriseMerchantsPagination.getCompanyStatus())){
enterpriseMerchantsNum++;
List<String> idList = new ArrayList<>();
try {
String[][] companyStatus = JsonUtil.getJsonToBean(enterpriseMerchantsPagination.getCompanyStatus(),String[][].class);
for(int i=0;i<companyStatus.length;i++){
if(companyStatus[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(companyStatus[i])));
}
}
}catch (Exception e1){
try {
List<String> companyStatus = JsonUtil.getJsonToList(enterpriseMerchantsPagination.getCompanyStatus(),String.class);
if(companyStatus.size()>0){
idList.addAll(companyStatus);
}
}catch (Exception e2){
idList.add(String.valueOf(enterpriseMerchantsPagination.getCompanyStatus()));
}
}
enterpriseMerchantsQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(EnterpriseMerchantsEntity::getCompanyStatus, tt).or();
});
});
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
enterpriseMerchantsQueryWrapper.lambda().in(EnterpriseMerchantsEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
enterpriseMerchantsQueryWrapper.lambda().and(t->t.in(EnterpriseMerchantsEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
enterpriseMerchantsQueryWrapper.lambda().and(t->t.in(EnterpriseMerchantsEntity::getId, finalAllRuleIDlist));
}
//假删除标志
enterpriseMerchantsQueryWrapper.lambda().isNull(EnterpriseMerchantsEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(enterpriseMerchantsPagination.getSidx())){
enterpriseMerchantsQueryWrapper.lambda().orderByDesc(EnterpriseMerchantsEntity::getId);
}else{
try {
String sidx = enterpriseMerchantsPagination.getSidx();
String[] strs= sidx.split("_name");
EnterpriseMerchantsEntity enterpriseMerchantsEntity = new EnterpriseMerchantsEntity();
Field declaredField = enterpriseMerchantsEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
enterpriseMerchantsQueryWrapper="asc".equals(enterpriseMerchantsPagination.getSort().toLowerCase())?enterpriseMerchantsQueryWrapper.orderByAsc(value):enterpriseMerchantsQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<EnterpriseMerchantsEntity> page=new Page<>(enterpriseMerchantsPagination.getCurrentPage(), enterpriseMerchantsPagination.getPageSize());
IPage<EnterpriseMerchantsEntity> userIPage=this.page(page, enterpriseMerchantsQueryWrapper);
return enterpriseMerchantsPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<EnterpriseMerchantsEntity> list = new ArrayList();
return enterpriseMerchantsPagination.setData(list, list.size());
}
}else{
return this.list(enterpriseMerchantsQueryWrapper);
}
}
@Override
public EnterpriseMerchantsEntity getInfo(String id){
QueryWrapper<EnterpriseMerchantsEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(EnterpriseMerchantsEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(EnterpriseMerchantsEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, EnterpriseMerchantsEntity entity){
return this.updateById(entity);
}
@Override
public void delete(EnterpriseMerchantsEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(EnterpriseMerchantsForm 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.getCmpNo())){
return "公司编码不能为空";
}
if(StringUtil.isEmpty(form.getCmpNm())){
return "公司名称不能为空";
}
if(StringUtil.isEmpty(form.getUserNm())){
return "联系人不能为空";
}
if(StringUtil.isEmpty(form.getContactNumber())){
return "联系电话不能为空";
}
if(StringUtil.isNotEmpty(form.getContactNumber())){
if(!Pattern.compile("^1[3456789]\\d{9}$|^0\\d{2,3}-?\\d{7,8}$").matcher(String.valueOf(form.getContactNumber())).matches()){
return "请输入正确的联系方式";
}
}
if(StringUtil.isEmpty(form.getMailbox())){
return "邮箱不能为空";
}
if(StringUtil.isNotEmpty(form.getMailbox())){
if(!Pattern.compile("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$").matcher(String.valueOf(form.getMailbox())).matches()){
return "请输入正确的邮箱";
}
}
if(StringUtil.isEmpty(form.getRegisteredAddress())){
return "注册地址不能为空";
}
if(StringUtil.isEmpty(form.getUnifiedSocialCreditCode())){
return "统一社会信用代码不能为空";
}
if(StringUtil.isEmpty(form.getLgPersonNm())){
return "法定代表人不能为空";
}
if(StringUtil.isEmpty(form.getCompanyRegistrationNumber())){
return "公司注册号不能为空";
}
if(StringUtil.isEmpty(form.getOfficeAddress())){
return "办公地址不能为空";
}
if(StringUtil.isEmpty(form.getRegisteredCapital())){
return "注册资本不能为空";
}
if(StringUtil.isNotEmpty(form.getRegisteredCapital())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getRegisteredCapital())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isEmpty(form.getBankAccount())){
return "银行账号不能为空";
}
return countRecover;
}
/**
* ()
* @param id
* @param enterpriseMerchantsForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(EnterpriseMerchantsForm enterpriseMerchantsForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
enterpriseMerchantsForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(EnterpriseMerchantsConstant.getFormData(),enterpriseMerchantsForm),EnterpriseMerchantsForm.class);
EnterpriseMerchantsEntity entity = JsonUtil.getJsonToBean(enterpriseMerchantsForm, EnterpriseMerchantsEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
entity.setVersion(0);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -18,7 +18,6 @@ import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
@ -37,7 +36,7 @@ import jnpf.permission.entity.UserEntity;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
* 2024-07-17
*/
@Service
public class ParkServiceImpl extends ServiceImpl<ParkMapper, ParkEntity> implements ParkService{
@ -154,11 +153,6 @@ public class ParkServiceImpl extends ServiceImpl<ParkMapper, ParkEntity> impleme
parkQueryWrapper.lambda().like(ParkEntity::getName,value);
}
if(StringUtils.isNotEmpty(parkPagination.getType())){
parkNum++;
parkQueryWrapper.lambda().like(ParkEntity::getType,parkPagination.getType());
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);

@ -0,0 +1,313 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.PersonMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.person.*;
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;
/**
*
* Person
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
@Service
public class PersonServiceImpl extends ServiceImpl<PersonMapper, PersonEntity> implements PersonService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<PersonEntity> getList(PersonPagination personPagination){
return getTypeList(personPagination,personPagination.getDataType());
}
/** 列表查询 */
@Override
public List<PersonEntity> getTypeList(PersonPagination personPagination,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 ? PersonConstant.getAppColumnData() : PersonConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int personNum =0;
QueryWrapper<PersonEntity> personQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(personPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = personPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<PersonEntity> personSuperWrapper = new QueryWrapper<>();
personSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(personSuperWrapper,PersonEntity.class,queryJson,"0"));
int personNum1 = personSuperWrapper.getExpression().getNormal().size();
if (personNum1>0){
List<String> personList =this.list(personSuperWrapper).stream().map(PersonEntity::getId).collect(Collectors.toList());
allSuperList.addAll(personList);
intersectionSuperList.add(personList);
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<PersonEntity> personSuperWrapper = new QueryWrapper<>();
personSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(personSuperWrapper,PersonEntity.class,ruleJson,"0"));
int personNum1 = personSuperWrapper.getExpression().getNormal().size();
if (personNum1>0){
List<String> personList =this.list(personSuperWrapper).stream().map(PersonEntity::getId).collect(Collectors.toList());
allRuleList.addAll(personList);
intersectionRuleList.add(personList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object personObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(personQueryWrapper,PersonEntity.class,personPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(personObj)){
return new ArrayList<>();
} else {
personQueryWrapper = (QueryWrapper<PersonEntity>)personObj;
if( personQueryWrapper.getExpression().getNormal().size()>0){
personNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object personObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(personQueryWrapper,PersonEntity.class,personPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(personObj)){
return new ArrayList<>();
} else {
personQueryWrapper = (QueryWrapper<PersonEntity>)personObj;
if( personQueryWrapper.getExpression().getNormal().size()>0){
personNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(personPagination.getUserCode())){
personNum++;
String value = personPagination.getUserCode() instanceof List ?
JsonUtil.getObjectToString(personPagination.getUserCode()) :
String.valueOf(personPagination.getUserCode());
personQueryWrapper.lambda().like(PersonEntity::getUserCode,value);
}
if(ObjectUtil.isNotEmpty(personPagination.getUserName())){
personNum++;
String value = personPagination.getUserName() instanceof List ?
JsonUtil.getObjectToString(personPagination.getUserName()) :
String.valueOf(personPagination.getUserName());
personQueryWrapper.lambda().like(PersonEntity::getUserName,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
personQueryWrapper.lambda().in(PersonEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
personQueryWrapper.lambda().and(t->t.in(PersonEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
personQueryWrapper.lambda().and(t->t.in(PersonEntity::getId, finalAllRuleIDlist));
}
//假删除标志
personQueryWrapper.lambda().isNull(PersonEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(personPagination.getSidx())){
personQueryWrapper.lambda().orderByDesc(PersonEntity::getId);
}else{
try {
String sidx = personPagination.getSidx();
String[] strs= sidx.split("_name");
PersonEntity personEntity = new PersonEntity();
Field declaredField = personEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
personQueryWrapper="asc".equals(personPagination.getSort().toLowerCase())?personQueryWrapper.orderByAsc(value):personQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<PersonEntity> page=new Page<>(personPagination.getCurrentPage(), personPagination.getPageSize());
IPage<PersonEntity> userIPage=this.page(page, personQueryWrapper);
return personPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<PersonEntity> list = new ArrayList();
return personPagination.setData(list, list.size());
}
}else{
return this.list(personQueryWrapper);
}
}
@Override
public PersonEntity getInfo(String id){
QueryWrapper<PersonEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(PersonEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(PersonEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, PersonEntity entity){
return this.updateById(entity);
}
@Override
public void delete(PersonEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(PersonForm 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.getUserCode())){
return "用户编码不能为空";
}
if(StringUtil.isNotEmpty(form.getUserCode())){
form.setUserCode(form.getUserCode().trim());
QueryWrapper<PersonEntity> userCodeWrapper=new QueryWrapper<>();
userCodeWrapper.lambda().eq(PersonEntity::getUserCode,form.getUserCode());
//假删除标志
userCodeWrapper.lambda().isNull(PersonEntity::getDeleteMark);
if (isUp){
userCodeWrapper.lambda().ne(PersonEntity::getId, id);
}
if((int) this.count(userCodeWrapper)>0){
countRecover = "用户编码不能重复";
}
}
if(StringUtil.isEmpty(form.getUserName())){
return "用户名不能为空";
}
if(StringUtil.isEmpty(form.getIdCard())){
return "身份证号不能为空";
}
if(StringUtil.isEmpty(form.getPhone())){
return "联系电话不能为空";
}
if(StringUtil.isNotEmpty(form.getPhone())){
if(!Pattern.compile("^1[3456789]\\d{9}$|^0\\d{2,3}-?\\d{7,8}$").matcher(String.valueOf(form.getPhone())).matches()){
return "请输入正确的联系方式";
}
}
if(StringUtil.isEmpty(form.getEntryCodes())){
return "出入码不能为空";
}
return countRecover;
}
/**
* ()
* @param id
* @param personForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(PersonForm personForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
personForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(PersonConstant.getFormData(),personForm),PersonForm.class);
PersonEntity entity = JsonUtil.getJsonToBean(personForm, PersonEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
entity.setVersion(0);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.SpacecontractMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.contract.*;
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;
/**
*
* Contract
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
@Service
public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, SpacecontractEntity> implements SpacecontractService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<SpacecontractEntity> getChild(ContractPagination pagination, QueryWrapper<SpacecontractEntity> spacecontractQueryWrapper){
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?ContractConstant.getColumnData():ContractConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return spacecontractQueryWrapper;
}
}

@ -0,0 +1,319 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.VehicleMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.vehicle.*;
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;
/**
*
* Vehicle
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
@Service
public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, VehicleEntity> implements VehicleService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<VehicleEntity> getList(VehiclePagination vehiclePagination){
return getTypeList(vehiclePagination,vehiclePagination.getDataType());
}
/** 列表查询 */
@Override
public List<VehicleEntity> getTypeList(VehiclePagination vehiclePagination,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 ? VehicleConstant.getAppColumnData() : VehicleConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int vehicleNum =0;
QueryWrapper<VehicleEntity> vehicleQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(vehiclePagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = vehiclePagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<VehicleEntity> vehicleSuperWrapper = new QueryWrapper<>();
vehicleSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(vehicleSuperWrapper,VehicleEntity.class,queryJson,"0"));
int vehicleNum1 = vehicleSuperWrapper.getExpression().getNormal().size();
if (vehicleNum1>0){
List<String> vehicleList =this.list(vehicleSuperWrapper).stream().map(VehicleEntity::getId).collect(Collectors.toList());
allSuperList.addAll(vehicleList);
intersectionSuperList.add(vehicleList);
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<VehicleEntity> vehicleSuperWrapper = new QueryWrapper<>();
vehicleSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(vehicleSuperWrapper,VehicleEntity.class,ruleJson,"0"));
int vehicleNum1 = vehicleSuperWrapper.getExpression().getNormal().size();
if (vehicleNum1>0){
List<String> vehicleList =this.list(vehicleSuperWrapper).stream().map(VehicleEntity::getId).collect(Collectors.toList());
allRuleList.addAll(vehicleList);
intersectionRuleList.add(vehicleList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object vehicleObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(vehicleQueryWrapper,VehicleEntity.class,vehiclePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(vehicleObj)){
return new ArrayList<>();
} else {
vehicleQueryWrapper = (QueryWrapper<VehicleEntity>)vehicleObj;
if( vehicleQueryWrapper.getExpression().getNormal().size()>0){
vehicleNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object vehicleObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(vehicleQueryWrapper,VehicleEntity.class,vehiclePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(vehicleObj)){
return new ArrayList<>();
} else {
vehicleQueryWrapper = (QueryWrapper<VehicleEntity>)vehicleObj;
if( vehicleQueryWrapper.getExpression().getNormal().size()>0){
vehicleNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(vehiclePagination.getVehicleNumber())){
vehicleNum++;
String value = vehiclePagination.getVehicleNumber() instanceof List ?
JsonUtil.getObjectToString(vehiclePagination.getVehicleNumber()) :
String.valueOf(vehiclePagination.getVehicleNumber());
vehicleQueryWrapper.lambda().like(VehicleEntity::getVehicleNumber,value);
}
if(ObjectUtil.isNotEmpty(vehiclePagination.getVehicleType())){
vehicleNum++;
List<String> idList = new ArrayList<>();
try {
String[][] vehicleType = JsonUtil.getJsonToBean(vehiclePagination.getVehicleType(),String[][].class);
for(int i=0;i<vehicleType.length;i++){
if(vehicleType[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(vehicleType[i])));
}
}
}catch (Exception e1){
try {
List<String> vehicleType = JsonUtil.getJsonToList(vehiclePagination.getVehicleType(),String.class);
if(vehicleType.size()>0){
idList.addAll(vehicleType);
}
}catch (Exception e2){
idList.add(String.valueOf(vehiclePagination.getVehicleType()));
}
}
vehicleQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(VehicleEntity::getVehicleType, tt).or();
});
});
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
vehicleQueryWrapper.lambda().in(VehicleEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
vehicleQueryWrapper.lambda().and(t->t.in(VehicleEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
vehicleQueryWrapper.lambda().and(t->t.in(VehicleEntity::getId, finalAllRuleIDlist));
}
//假删除标志
vehicleQueryWrapper.lambda().isNull(VehicleEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(vehiclePagination.getSidx())){
vehicleQueryWrapper.lambda().orderByDesc(VehicleEntity::getId);
}else{
try {
String sidx = vehiclePagination.getSidx();
String[] strs= sidx.split("_name");
VehicleEntity vehicleEntity = new VehicleEntity();
Field declaredField = vehicleEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
vehicleQueryWrapper="asc".equals(vehiclePagination.getSort().toLowerCase())?vehicleQueryWrapper.orderByAsc(value):vehicleQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<VehicleEntity> page=new Page<>(vehiclePagination.getCurrentPage(), vehiclePagination.getPageSize());
IPage<VehicleEntity> userIPage=this.page(page, vehicleQueryWrapper);
return vehiclePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<VehicleEntity> list = new ArrayList();
return vehiclePagination.setData(list, list.size());
}
}else{
return this.list(vehicleQueryWrapper);
}
}
@Override
public VehicleEntity getInfo(String id){
QueryWrapper<VehicleEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(VehicleEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(VehicleEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, VehicleEntity entity){
return this.updateById(entity);
}
@Override
public void delete(VehicleEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(VehicleForm 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.getVehicleNumber())){
return "车牌号不能为空";
}
if(StringUtil.isEmpty(form.getVehicleBrand())){
return "车辆品牌不能为空";
}
if(StringUtil.isEmpty(form.getVehicleColor())){
return "车辆颜色不能为空";
}
if(StringUtil.isEmpty(form.getContactsName())){
return "联系人不能为空";
}
if(StringUtil.isEmpty(form.getContactsPhone())){
return "联系电话不能为空";
}
if(StringUtil.isNotEmpty(form.getContactsPhone())){
if(!Pattern.compile("^1[3456789]\\d{9}$|^0\\d{2,3}-?\\d{7,8}$").matcher(String.valueOf(form.getContactsPhone())).matches()){
return "请输入正确的联系方式";
}
}
return countRecover;
}
/**
* ()
* @param id
* @param vehicleForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(VehicleForm vehicleForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
vehicleForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(VehicleConstant.getFormData(),vehicleForm),VehicleForm.class);
VehicleEntity entity = JsonUtil.getJsonToBean(vehicleForm, VehicleEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
entity.setVersion(0);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -1,123 +1,421 @@
package jnpf.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.xuyanwu.spring.file.storage.FileInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.Pagination;
import jnpf.base.controller.SuperController;
import jnpf.base.UserInfo;
import jnpf.base.model.ColumnDataModel;
import jnpf.base.util.VisualUtils;
import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.config.ConfigValueUtil;
import jnpf.entity.ContractEntity;
import jnpf.model.ContractForm;
import jnpf.model.ContractInfoVO;
import jnpf.model.ContractListVO;
import jnpf.entity.SpacecontractEntity;
import jnpf.model.contract.ContractConstant;
import jnpf.model.contract.ContractForm;
import jnpf.model.contract.ContractPagination;
import jnpf.model.contract.ContractRequest;
import jnpf.model.visualJson.config.HeaderModel;
import jnpf.service.ContractService;
import jnpf.util.JsonUtil;
import jnpf.service.SpacecontractService;
import jnpf.util.*;
import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.util.List;
import java.io.IOException;
import java.util.*;
/**
* Contract
* V3.0.0
* (https://www.jnpfsoft.com)
* JNPF
* 2020-12-31
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Slf4j
@RestController
@Tag(name = "示例接口", description = "Contract")
@RequestMapping("/Contract")
public class ContractController extends SuperController<ContractService, ContractEntity> {
@Tag(name = "Contract", description = "example")
@RequestMapping("/api/example/Contract")
public class ContractController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private ContractService contractService;
@Autowired
private SpacecontractService spacecontractService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
*
* @param pagination
* @param contractPagination
* @return
*/
@Operation(summary = "获取列表")
@GetMapping("/List")
public ActionResult<PageListVO<ContractListVO>> list(Pagination pagination) {
List<ContractEntity> entity = contractService.getlist(pagination);
List<ContractListVO> listVo = JsonUtil.getJsonToList(JsonUtil.getObjectToStringDateFormat(entity, "yyyy-MM-dd HH:mm:ss"), ContractListVO.class);
PaginationVO vo = JsonUtil.getJsonToBean(pagination, PaginationVO.class);
return ActionResult.page(listVo, vo);
@PostMapping("/getList")
public ActionResult list(@RequestBody ContractPagination contractPagination) throws IOException {
List<ContractEntity> list = contractService.getList(contractPagination);
List<Map<String, Object>> realList = new ArrayList<>();
for (ContractEntity entity : list) {
Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id"));
//副表数据
//子表数据
List<SpacecontractEntity> spacecontractList = contractService.getSpacecontractList(entity.getId(), contractPagination);
contractMap.put("tableField130", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(spacecontractList)));
realList.add(contractMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(), false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(contractPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
*
* @param id
* @param contractForm
* @return
*/
@Operation(summary = "获取详情")
@GetMapping("/{id}")
@Parameters({
@Parameter(name = "id", description = "主键", required = true),
})
public ActionResult<ContractInfoVO> info(@PathVariable("id") String id) {
ContractEntity entity = contractService.getInfo(id);
ContractInfoVO vo = JsonUtil.getJsonToBean(entity, ContractInfoVO.class);
return ActionResult.success(vo);
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid ContractForm contractForm) {
String b = contractService.checkForm(contractForm, 0);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
try {
contractService.saveOrUpdate(contractForm, null, true);
} catch (Exception e) {
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* Excel
*
* @param contractForm
* @return
*/
@Operation(summary = "新建")
@PostMapping
@Parameters({
@Parameter(name = "contractForm", description = "示例模型",required = true),
})
public ActionResult create(@RequestBody @Valid ContractForm contractForm) {
ContractEntity entity = JsonUtil.getJsonToBean(contractForm, ContractEntity.class);
contractService.create(entity);
return ActionResult.success("保存成功");
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody ContractPagination contractPagination) throws IOException {
if (StringUtil.isEmpty(contractPagination.getSelectKey())) {
return ActionResult.fail("请选择导出字段");
}
List<ContractEntity> list = contractService.getList(contractPagination);
List<Map<String, Object>> realList = new ArrayList<>();
for (ContractEntity entity : list) {
Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id"));
//副表数据
//子表数据
List<SpacecontractEntity> spacecontractList = contractService.getSpacecontractList(entity.getId(), contractPagination);
contractMap.put("tableField130", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(spacecontractList)));
realList.add(contractMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(), false);
String[] keys = !StringUtil.isEmpty(contractPagination.getSelectKey()) ? contractPagination.getSelectKey() : new String[0];
UserInfo userInfo = userProvider.get();
DownloadVO vo = this.creatModelExcel(configValueUtil.getTemporaryFilePath(), realList, keys, userInfo);
return ActionResult.success(vo);
}
/**
* @param id
* @param contractForm
*
*/
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 tableField130ExcelEntity = new ExcelExportEntity("空间列表", "tableField130");
List<ExcelExportEntity> tableField130List = new ArrayList<>();
for (String key : keys) {
switch (key) {
case "contractNumber":
entitys.add(new ExcelExportEntity("合同编号", "contractNumber"));
break;
case "contractName":
entitys.add(new ExcelExportEntity("合同名称", "contractName"));
break;
case "pricingMethod":
entitys.add(new ExcelExportEntity("计价方式", "pricingMethod"));
break;
case "signingDate":
entitys.add(new ExcelExportEntity("签订日期", "signingDate"));
break;
case "parkId":
entitys.add(new ExcelExportEntity("园区名称", "parkId"));
break;
case "merchantName":
entitys.add(new ExcelExportEntity("商户名称", "merchantName"));
break;
case "totalRentalPrice":
entitys.add(new ExcelExportEntity("租金总价", "totalRentalPrice"));
break;
case "totalDeposit":
entitys.add(new ExcelExportEntity("押金总计", "totalDeposit"));
break;
case "payDeposit":
entitys.add(new ExcelExportEntity("支付方式", "payDeposit"));
break;
case "returnDeposit":
entitys.add(new ExcelExportEntity("退还方式", "returnDeposit"));
break;
case "startTime":
entitys.add(new ExcelExportEntity("开始时间", "startTime"));
break;
case "endTime":
entitys.add(new ExcelExportEntity("结束时间", "endTime"));
break;
case "leaseTerm":
entitys.add(new ExcelExportEntity("租期", "leaseTerm"));
break;
case "contacts":
entitys.add(new ExcelExportEntity("联系人", "contacts"));
break;
case "contactsPhone":
entitys.add(new ExcelExportEntity("联系电话", "contactsPhone"));
break;
case "contractStatus":
entitys.add(new ExcelExportEntity("合同状态", "contractStatus"));
break;
case "creationTime":
entitys.add(new ExcelExportEntity("创建时间", "creationTime"));
break;
case "contractExplain":
entitys.add(new ExcelExportEntity("合同说明", "contractExplain"));
break;
case "contractEnclosure":
entitys.add(new ExcelExportEntity("合同附件", "contractEnclosure"));
break;
case "tableField130-contractLineNumber":
tableField130List.add(new ExcelExportEntity("合同行号", "contractLineNumber"));
break;
case "tableField130-spaceName":
tableField130List.add(new ExcelExportEntity("空间名称", "spaceName"));
break;
case "tableField130-spaceArea":
tableField130List.add(new ExcelExportEntity("空间面积", "spaceArea"));
break;
case "tableField130-totalRentalPrice":
tableField130List.add(new ExcelExportEntity("租金总价", "totalRentalPrice"));
break;
default:
break;
}
}
if (tableField130List.size() > 0) {
tableField130ExcelEntity.setList(tableField130List);
entitys.add(tableField130ExcelEntity);
}
}
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(ContractConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
}
String fileName = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
*
*
* @param id
* @param contractForm
* @return
*/
@Operation(summary = "修改")
@PutMapping("/{id}")
@Parameters({
@Parameter(name = "contractForm", description = "示例模型",required = true),
@Parameter(name = "id", description = "主键", required = true),
})
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ContractForm contractForm) {
ContractEntity entity = JsonUtil.getJsonToBean(contractForm, ContractEntity.class);
contractService.update(id, entity);
return ActionResult.success("修改成功");
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ContractForm contractForm,
@RequestParam(value = "isImport", required = false) boolean isImport) {
contractForm.setId(id);
if (!isImport) {
String b = contractService.checkForm(contractForm, 1);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
}
ContractEntity entity = contractService.getInfo(id);
if (entity != null) {
try {
contractService.saveOrUpdate(contractForm, id, false);
} catch (Exception e) {
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
} else {
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
*
* @param id
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Parameters({
@Parameter(name = "id", description = "主键", required = true),
})
@Transactional
public ActionResult delete(@PathVariable("id") String id) {
ContractEntity entity = contractService.getInfo(id);
contractService.delete(entity);
if (entity != null) {
//假删除
entity.setDeleteMark(1);
contractService.update(id, entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id) {
ContractEntity entity = contractService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id"));
//副表数据
//子表数据
List<SpacecontractEntity> spacecontractList = contractService.getSpacecontractList(entity.getId());
contractMap.put("tableField130", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(spacecontractList)));
contractMap = generaterSwapUtil.swapDataDetail(contractMap, ContractConstant.getFormData(), "582839350958489605", false);
return ActionResult.success(contractMap);
}
/**
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id) {
ContractEntity entity = contractService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id"));
//副表数据
//子表数据
List<SpacecontractEntity> spacecontractList = contractService.getSpacecontractList(entity.getId());
contractMap.put("spacecontractList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(spacecontractList)));
contractMap = generaterSwapUtil.swapDataForm(contractMap, ContractConstant.getFormData(), ContractConstant.TABLEFIELDKEY, ContractConstant.TABLERENAMES);
return ActionResult.success(contractMap);
}
@Operation(summary = "合同确认")
@PostMapping("/confirmation")
public ActionResult confirmation(@RequestBody ContractRequest request) {
String result = contractService.confirmation(request);
if (!result.contains("成功")) {
return ActionResult.fail(result);
}
return ActionResult.success(result);
}
@Operation(summary = "合同结束")
@PostMapping("/finish")
public ActionResult finish(@RequestBody ContractRequest request) {
String result = contractService.finish(request);
if (!result.contains("成功")) {
return ActionResult.fail(result);
}
return ActionResult.success(result);
}
}

@ -0,0 +1,191 @@
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.enterprisemerchants.*;
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.transaction.annotation.Transactional;
/**
* EnterpriseMerchants
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
*/
@Slf4j
@RestController
@Tag(name = "EnterpriseMerchants" , description = "example")
@RequestMapping("/api/example/EnterpriseMerchants")
public class EnterpriseMerchantsController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private EnterpriseMerchantsService enterpriseMerchantsService;
/**
*
*
* @param enterpriseMerchantsPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody EnterpriseMerchantsPagination enterpriseMerchantsPagination)throws IOException{
List<EnterpriseMerchantsEntity> list= enterpriseMerchantsService.getList(enterpriseMerchantsPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (EnterpriseMerchantsEntity entity : list) {
Map<String, Object> enterpriseMerchantsMap=JsonUtil.entityToMap(entity);
enterpriseMerchantsMap.put("id", enterpriseMerchantsMap.get("id"));
//副表数据
//子表数据
realList.add(enterpriseMerchantsMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, EnterpriseMerchantsConstant.getFormData(), EnterpriseMerchantsConstant.getColumnData(), enterpriseMerchantsPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(enterpriseMerchantsPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param enterpriseMerchantsForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid EnterpriseMerchantsForm enterpriseMerchantsForm) {
String b = enterpriseMerchantsService.checkForm(enterpriseMerchantsForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
enterpriseMerchantsService.saveOrUpdate(enterpriseMerchantsForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param enterpriseMerchantsForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid EnterpriseMerchantsForm enterpriseMerchantsForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
enterpriseMerchantsForm.setId(id);
if (!isImport) {
String b = enterpriseMerchantsService.checkForm(enterpriseMerchantsForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
EnterpriseMerchantsEntity entity= enterpriseMerchantsService.getInfo(id);
if(entity!=null){
try{
enterpriseMerchantsService.saveOrUpdate(enterpriseMerchantsForm,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){
EnterpriseMerchantsEntity entity= enterpriseMerchantsService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark(1);
enterpriseMerchantsService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
EnterpriseMerchantsEntity entity= enterpriseMerchantsService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> enterpriseMerchantsMap=JsonUtil.entityToMap(entity);
enterpriseMerchantsMap.put("id", enterpriseMerchantsMap.get("id"));
//副表数据
//子表数据
enterpriseMerchantsMap = generaterSwapUtil.swapDataDetail(enterpriseMerchantsMap,EnterpriseMerchantsConstant.getFormData(),"582533930381480837",false);
return ActionResult.success(enterpriseMerchantsMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
EnterpriseMerchantsEntity entity= enterpriseMerchantsService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> enterpriseMerchantsMap=JsonUtil.entityToMap(entity);
enterpriseMerchantsMap.put("id", enterpriseMerchantsMap.get("id"));
//副表数据
//子表数据
enterpriseMerchantsMap = generaterSwapUtil.swapDataForm(enterpriseMerchantsMap,EnterpriseMerchantsConstant.getFormData(),EnterpriseMerchantsConstant.TABLEFIELDKEY,EnterpriseMerchantsConstant.TABLERENAMES);
return ActionResult.success(enterpriseMerchantsMap);
}
}

@ -54,7 +54,7 @@ import org.springframework.transaction.annotation.Transactional;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Slf4j
@RestController
@ -167,8 +167,8 @@ public class ParkController {
case "name" :
entitys.add(new ExcelExportEntity("园区名称" ,"name"));
break;
case "describe" :
entitys.add(new ExcelExportEntity("描述" ,"describe"));
case "description" :
entitys.add(new ExcelExportEntity("园区描述" ,"description"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));

@ -0,0 +1,191 @@
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.person.*;
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.transaction.annotation.Transactional;
/**
* Person
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Slf4j
@RestController
@Tag(name = "Person" , description = "example")
@RequestMapping("/api/example/Person")
public class PersonController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private PersonService personService;
/**
*
*
* @param personPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody PersonPagination personPagination)throws IOException{
List<PersonEntity> list= personService.getList(personPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (PersonEntity entity : list) {
Map<String, Object> personMap=JsonUtil.entityToMap(entity);
personMap.put("id", personMap.get("id"));
//副表数据
//子表数据
realList.add(personMap);
}
//数据转换
//realList = generaterSwapUtil.swapDataList(realList, PersonConstant.getFormData(), PersonConstant.getColumnData(), personPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(personPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param personForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid PersonForm personForm) {
String b = personService.checkForm(personForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
personService.saveOrUpdate(personForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param personForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid PersonForm personForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
personForm.setId(id);
if (!isImport) {
String b = personService.checkForm(personForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
PersonEntity entity= personService.getInfo(id);
if(entity!=null){
try{
personService.saveOrUpdate(personForm,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){
PersonEntity entity= personService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark(1);
personService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
PersonEntity entity= personService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> personMap=JsonUtil.entityToMap(entity);
personMap.put("id", personMap.get("id"));
//副表数据
//子表数据
personMap = generaterSwapUtil.swapDataDetail(personMap,PersonConstant.getFormData(),"582897958719067077",false);
return ActionResult.success(personMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
PersonEntity entity= personService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> personMap=JsonUtil.entityToMap(entity);
personMap.put("id", personMap.get("id"));
//副表数据
//子表数据
personMap = generaterSwapUtil.swapDataForm(personMap,PersonConstant.getFormData(),PersonConstant.TABLEFIELDKEY,PersonConstant.TABLERENAMES);
return ActionResult.success(personMap);
}
}

@ -0,0 +1,191 @@
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.vehicle.*;
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.transaction.annotation.Transactional;
/**
* Vehicle
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Slf4j
@RestController
@Tag(name = "Vehicle" , description = "example")
@RequestMapping("/api/example/Vehicle")
public class VehicleController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private VehicleService vehicleService;
/**
*
*
* @param vehiclePagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody VehiclePagination vehiclePagination)throws IOException{
List<VehicleEntity> list= vehicleService.getList(vehiclePagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (VehicleEntity entity : list) {
Map<String, Object> vehicleMap=JsonUtil.entityToMap(entity);
vehicleMap.put("id", vehicleMap.get("id"));
//副表数据
//子表数据
realList.add(vehicleMap);
}
//数据转换
//realList = generaterSwapUtil.swapDataList(realList, VehicleConstant.getFormData(), VehicleConstant.getColumnData(), vehiclePagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(vehiclePagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param vehicleForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid VehicleForm vehicleForm) {
String b = vehicleService.checkForm(vehicleForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
vehicleService.saveOrUpdate(vehicleForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param vehicleForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid VehicleForm vehicleForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
vehicleForm.setId(id);
if (!isImport) {
String b = vehicleService.checkForm(vehicleForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
VehicleEntity entity= vehicleService.getInfo(id);
if(entity!=null){
try{
vehicleService.saveOrUpdate(vehicleForm,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){
VehicleEntity entity= vehicleService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark(1);
vehicleService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
VehicleEntity entity= vehicleService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> vehicleMap=JsonUtil.entityToMap(entity);
vehicleMap.put("id", vehicleMap.get("id"));
//副表数据
//子表数据
vehicleMap = generaterSwapUtil.swapDataDetail(vehicleMap,VehicleConstant.getFormData(),"582912646513169797",false);
return ActionResult.success(vehicleMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
VehicleEntity entity= vehicleService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> vehicleMap=JsonUtil.entityToMap(entity);
vehicleMap.put("id", vehicleMap.get("id"));
//副表数据
//子表数据
vehicleMap = generaterSwapUtil.swapDataForm(vehicleMap,VehicleConstant.getFormData(),VehicleConstant.TABLEFIELDKEY,VehicleConstant.TABLERENAMES);
return ActionResult.success(vehicleMap);
}
}

@ -1,33 +1,103 @@
package jnpf.entity;
import jnpf.base.entity.SuperBaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
* Contract
* V3.0.0
* (https://www.jnpfsoft.com)
* JNPF
* 2020-12-31
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
@TableName("test_contract")
public class ContractEntity extends SuperBaseEntity.SuperTBaseEntity<String> implements Serializable {
@TableField("F_CONTRACTNAME")
@TableName("yq_contract")
public class ContractEntity {
@TableId(value ="ID" )
private String id;
@TableField("CREATE_BY")
private String createBy;
@TableField("CREATION_TIME")
private Date creationTime;
@TableField("UPDATE_BY")
private String updateBy;
@TableField("UPDATE_TIME")
private Date updateTime;
@TableField(value = "CONTRACT_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String contractNumber;
@TableField(value = "CONTRACT_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String contractName;
@TableField("F_MYTELEPHONE")
private String mytelePhone;
@TableField("F_FILEJSON")
private String fileJson;
@TableField(value = "SIGNING_DATE" , updateStrategy = FieldStrategy.IGNORED)
private Date signingDate;
@TableField(value = "LEASE_TERM" , updateStrategy = FieldStrategy.IGNORED)
private String leaseTerm;
@TableField("MERCHANT_ID")
private String merchantId;
@TableField(value = "MERCHANT_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String merchantName;
@TableField(value = "PARK_ID" , updateStrategy = FieldStrategy.IGNORED)
private String parkId;
@TableField("PARK_NAME")
private String parkName;
@TableField(value = "CONTRACT_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String contractStatus;
@TableField(value = "CONTRACT_ENCLOSURE" , updateStrategy = FieldStrategy.IGNORED)
private String contractEnclosure;
@TableField(value = "CONTRACT_EXPLAIN" , updateStrategy = FieldStrategy.IGNORED)
private String contractExplain;
@TableField(value = "TOTAL_RENTAL_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal totalRentalPrice;
@TableField(value = "PRICING_METHOD" , updateStrategy = FieldStrategy.IGNORED)
private String pricingMethod;
@TableField(value = "TOTAL_DEPOSIT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal totalDeposit;
@TableField("APPROVE_DATE")
private Date approveDate;
@TableField("APPROVED_BY")
private String approvedBy;
@TableField("APPROVE_REMARKS")
private String approveRemarks;
@TableField("APPROVE_CHANGE")
private String approveChange;
@TableField(value = "RETURN_DEPOSIT" , updateStrategy = FieldStrategy.IGNORED)
private String returnDeposit;
@TableField(value = "PAY_DEPOSIT" , updateStrategy = FieldStrategy.IGNORED)
private String payDeposit;
@TableField("APPROVE_CHANGE_TIME")
private Date approveChangeTime;
@TableField("APPROVE_CHANGE_REMARKS")
private String approveChangeRemarks;
@TableField(value = "START_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date startTime;
@TableField(value = "END_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date endTime;
@TableField(value = "CONTACTS" , updateStrategy = FieldStrategy.IGNORED)
private String contacts;
@TableField(value = "CONTACTS_PHONE" , updateStrategy = FieldStrategy.IGNORED)
private String contactsPhone;
@TableField("SUBMITTER")
private String submitter;
@TableField("SUBMISSION_TIME")
private Date submissionTime;
@TableField("REMARKS")
private String remarks;
@TableField("OPTIMISTIC_LOCK")
private Integer optimisticLock;
@TableField("CELETE_TAGS")
private Integer celeteTags;
@TableField("COMPANY")
private String company;
@TableField("DEPARTMENT")
private String department;
@TableField("ORGANIZATION")
private String organization;
@TableField("F_FLOW_ID")
private String flowId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_VERSION")
private Integer version;
}

@ -0,0 +1,97 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
*/
@Data
@TableName("yq_enterprise_merchants")
public class EnterpriseMerchantsEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "CMP_NO" , updateStrategy = FieldStrategy.IGNORED)
private String cmpNo;
@TableField(value = "CMP_NM" , updateStrategy = FieldStrategy.IGNORED)
private String cmpNm;
@TableField(value = "COMP_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String compType;
@TableField(value = "COMPANY_REGISTRATION_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String companyRegistrationNumber;
@TableField(value = "INCORPORATION_DATE" , updateStrategy = FieldStrategy.IGNORED)
private Date incorporationDate;
@TableField(value = "REGISTERED_ADDRESS" , updateStrategy = FieldStrategy.IGNORED)
private String registeredAddress;
@TableField(value = "OFFICE_ADDRESS" , updateStrategy = FieldStrategy.IGNORED)
private String officeAddress;
@TableField(value = "USER_NM" , updateStrategy = FieldStrategy.IGNORED)
private String userNm;
@TableField(value = "CONTACT_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String contactNumber;
@TableField(value = "MAILBOX" , updateStrategy = FieldStrategy.IGNORED)
private String mailbox;
@TableField(value = "LG_PERSON_NM" , updateStrategy = FieldStrategy.IGNORED)
private String lgPersonNm;
@TableField(value = "INDUSTRY" , updateStrategy = FieldStrategy.IGNORED)
private String industry;
@TableField(value = "COMPANY_SIZE" , updateStrategy = FieldStrategy.IGNORED)
private String companySize;
@TableField(value = "REGISTERED_CAPITAL" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal registeredCapital;
@TableField(value = "REGISTERED_CAPITAL_UNIT" , updateStrategy = FieldStrategy.IGNORED)
private String registeredCapitalUnit;
@TableField(value = "NATURE_OF_BUSINESS" , updateStrategy = FieldStrategy.IGNORED)
private String natureObusiness;
@TableField(value = "COMPANY_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String companyStatus;
@TableField(value = "BUSINESS_LICENSE_PHOTO" , updateStrategy = FieldStrategy.IGNORED)
private String businessLicensePhoto;
@TableField(value = "UNIFIED_SOCIAL_CREDIT_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String unifiedSocialCreditCode;
@TableField(value = "BANK_ACCOUNT" , updateStrategy = FieldStrategy.IGNORED)
private Integer bankAccount;
@TableField(value = "OPENING_BANK" , updateStrategy = FieldStrategy.IGNORED)
private String openingBank;
@TableField("FUND_BALANCE")
private BigDecimal fundBalance;
@TableField(value = "ENTRY_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String entryStatus;
@TableField("PARK_ID")
private String parkId;
@TableField("PARK_NAME")
private String parkName;
@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_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField("F_VERSION")
private Integer version;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -5,13 +5,14 @@ import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Data
@TableName("yq_park_area_space")
@ -28,6 +29,8 @@ public class ParkEntity {
private String description;
@TableField(value = "TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String type;
@TableField("SPACE_NUM")
private BigDecimal spaceNum;
@TableField("SPACE_AREA")
private BigDecimal spaceArea;
@TableField("SPACE_TYPE")

@ -0,0 +1,67 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
@TableName("yq_person")
public class PersonEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "MERCHANT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String merchantId;
@TableField("MERCHANT_NAME")
private String merchantName;
@TableField(value = "USER_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String userCode;
@TableField(value = "USER_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String userName;
@TableField(value = "USER_ASCRIPTION" , updateStrategy = FieldStrategy.IGNORED)
private String userAscription;
@TableField(value = "ID_CARD" , updateStrategy = FieldStrategy.IGNORED)
private String idCard;
@TableField(value = "PHONE" , updateStrategy = FieldStrategy.IGNORED)
private String phone;
@TableField(value = "ENTRY_CODES" , updateStrategy = FieldStrategy.IGNORED)
private String entryCodes;
@TableField(value = "EFFECTIVE_START_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date effectiveStartTime;
@TableField(value = "EFFECTIVE_END_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date effectiveEndTime;
@TableField("REMARKS")
private String remarks;
@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_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField("F_VERSION")
private Integer version;
@TableField("F_FLOW_ID")
private String flowId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
}

@ -0,0 +1,55 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
@TableName("yq_space_contract")
public class SpacecontractEntity {
@TableId(value ="ID" )
private String id;
@TableField("CREATE_BY")
private String createBy;
@TableField("CREATION_TIME")
private Date creationTime;
@TableField("UPDATE_BY")
private String updateBy;
@TableField("UPDATE_TIME")
private Date updateTime;
@TableField("CONTRACT_NUMBER")
private String contractNumber;
@TableField(value = "CONTRACT_LINE_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String contractLineNumber;
@TableField("CONTRACT_NAME")
private String contractName;
@TableField(value = "TOTAL_RENTAL_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal totalRentalPrice;
@TableField("SPACE_ID")
private String spaceId;
@TableField(value = "SPACE_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String spaceName;
@TableField(value = "SPACE_AREA" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal spaceArea;
@TableField("REMARKS")
private String remarks;
@TableField("OPTIMISTIC_LOCK")
private Integer optimisticLock;
@TableField("CELETE_TAGS")
private Integer celeteTags;
@TableField("COMPANY")
private String company;
@TableField("DEPARTMENT")
private String department;
@TableField("ORGANIZATION")
private String organization;
}

@ -0,0 +1,67 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
@TableName("yq_vehicle")
public class VehicleEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "VEHICLE_ASCRIPTION" , updateStrategy = FieldStrategy.IGNORED)
private String vehicleAscription;
@TableField(value = "VEHICLE_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String vehicleNumber;
@TableField(value = "VEHICLE_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String vehicleType;
@TableField(value = "VEHICLE_BRAND" , updateStrategy = FieldStrategy.IGNORED)
private String vehicleBrand;
@TableField(value = "VEHICLE_COLOR" , updateStrategy = FieldStrategy.IGNORED)
private String vehicleColor;
@TableField(value = "VEHICLE_PHOTOS" , updateStrategy = FieldStrategy.IGNORED)
private String vehiclePhotos;
@TableField(value = "CONTACTS_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String contactsName;
@TableField(value = "CONTACTS_PHONE" , updateStrategy = FieldStrategy.IGNORED)
private String contactsPhone;
@TableField("REMARKS")
private String remarks;
@TableField(value = "ASCRIPTION_ID" , updateStrategy = FieldStrategy.IGNORED)
private String ascriptionId;
@TableField(value = "ASCRIPTION_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String ascriptionName;
@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_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField("F_VERSION")
private Integer version;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -1,26 +0,0 @@
package jnpf.model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
*
*
* : V3.0.0
* : (https://www.jnpfsoft.com)
* JNPF
* 2020-12-31
*/
@Data
public class ContractForm {
@Schema(description = "姓名")
private String contractName;
@Schema(description = "手机号")
private String mytelePhone;
@Schema(description = "文件")
private String fileJson;
}

@ -1,27 +0,0 @@
package jnpf.model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
*
*
* : V3.0.0
* : (https://www.jnpfsoft.com)
* JNPF
* 2020-12-31
*/
@Data
public class ContractInfoVO {
@Schema(description = "主键")
private String id;
@Schema(description = "姓名")
private String contractName;
@Schema(description = "手机号")
private String mytelePhone;
@Schema(description = "文件")
private String fileJson;
}

@ -1,16 +0,0 @@
package jnpf.model;
import lombok.Data;
/**
*
*
* : V3.0.0
* : (https://www.jnpfsoft.com)
* JNPF
* 2020-12-31
*/
@Data
public class ContractListVO extends ContractInfoVO {
}

@ -0,0 +1,83 @@
package jnpf.model.contract;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.List;
/**
* Contract
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
public class ContractForm {
/** 主键 */
private String id;
/** 子表数据 **/
@JsonProperty("spacecontractList")
private List<SpacecontractModel> spacecontractList;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 合同编号 **/
@JsonProperty("contractNumber")
private String contractNumber;
/** 合同名称 **/
@JsonProperty("contractName")
private String contractName;
/** 计价方式 **/
@JsonProperty("pricingMethod")
private Object pricingMethod;
/** 签订日期 **/
@JsonProperty("signingDate")
private String signingDate;
/** 园区名称 **/
@JsonProperty("parkId")
private Object parkId;
/** 商户名称 **/
@JsonProperty("merchantName")
private Object merchantName;
/** 租金总价 **/
@JsonProperty("totalRentalPrice")
private String totalRentalPrice;
/** 押金总计 **/
@JsonProperty("totalDeposit")
private String totalDeposit;
/** 支付方式 **/
@JsonProperty("payDeposit")
private Object payDeposit;
/** 退还方式 **/
@JsonProperty("returnDeposit")
private Object returnDeposit;
/** 开始时间 **/
@JsonProperty("startTime")
private String startTime;
/** 结束时间 **/
@JsonProperty("endTime")
private String endTime;
/** 租期 **/
@JsonProperty("leaseTerm")
private String leaseTerm;
/** 联系人 **/
@JsonProperty("contacts")
private String contacts;
/** 联系电话 **/
@JsonProperty("contactsPhone")
private String contactsPhone;
/** 合同状态 **/
@JsonProperty("contractStatus")
private Object contractStatus;
/** 创建时间 **/
@JsonProperty("creationTime")
private String creationTime;
/** 合同说明 **/
@JsonProperty("contractExplain")
private String contractExplain;
/** 合同附件 **/
@JsonProperty("contractEnclosure")
private Object contractEnclosure;
}

@ -0,0 +1,48 @@
package jnpf.model.contract;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* Contract
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
public class ContractPagination 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("creationTime")
private Object creationTime;
/** 商户名称 */
@JsonProperty("merchantName")
private Object merchantName;
/** 合同状态 */
@JsonProperty("contractStatus")
private Object contractStatus;
/** 合同名称 */
@JsonProperty("contractName")
private Object contractName;
/** 合同编号 */
@JsonProperty("contractNumber")
private Object contractNumber;
/** 园区名称 */
@JsonProperty("parkId")
private Object parkId;
}

@ -0,0 +1,24 @@
package jnpf.model.contract;
import lombok.Data;
import java.io.Serializable;
@Data
public class ContractRequest implements Serializable {
/**
* id
*/
private String id;
/**
*
*/
private String contractStatus;
/**
*
*/
private String approveRemarks;
}

@ -0,0 +1,33 @@
package jnpf.model.contract;
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;
/**
*
* Contract
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
@Data
public class SpacecontractModel {
/** 合同行号 **/
@JSONField(name = "contractLineNumber")
private String contractLineNumber;
/** 空间名称 **/
@JSONField(name = "spaceName")
private String spaceName;
/** 空间面积 **/
@JSONField(name = "spaceArea")
private String spaceArea;
/** 租金总价 **/
@JSONField(name = "totalRentalPrice")
private String totalRentalPrice;
}

@ -0,0 +1,89 @@
package jnpf.model.enterprisemerchants;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* EnterpriseMerchants
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
*/
@Data
public class EnterpriseMerchantsForm {
/** 主键 */
private String id;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 公司编码 **/
@JsonProperty("cmpNo")
private String cmpNo;
/** 公司名称 **/
@JsonProperty("cmpNm")
private String cmpNm;
/** 所属行业 **/
@JsonProperty("industry")
private Object industry;
/** 公司规模 **/
@JsonProperty("companySize")
private Object companySize;
/** 公司类型 **/
@JsonProperty("compType")
private Object compType;
/** 公司状态 **/
@JsonProperty("companyStatus")
private Object companyStatus;
/** 联系人 **/
@JsonProperty("userNm")
private String userNm;
/** 联系电话 **/
@JsonProperty("contactNumber")
private String contactNumber;
/** 邮箱 **/
@JsonProperty("mailbox")
private String mailbox;
/** 入驻状态 **/
@JsonProperty("entryStatus")
private Object entryStatus;
/** 营业执照照片 **/
@JsonProperty("businessLicensePhoto")
private Object businessLicensePhoto;
/** 注册地址 **/
@JsonProperty("registeredAddress")
private String registeredAddress;
/** 统一社会信用代码 **/
@JsonProperty("unifiedSocialCreditCode")
private String unifiedSocialCreditCode;
/** 成立日期 **/
@JsonProperty("incorporationDate")
private String incorporationDate;
/** 法定代表人 **/
@JsonProperty("lgPersonNm")
private String lgPersonNm;
/** 公司注册号 **/
@JsonProperty("companyRegistrationNumber")
private String companyRegistrationNumber;
/** 办公地址 **/
@JsonProperty("officeAddress")
private String officeAddress;
/** 注册资本 **/
@JsonProperty("registeredCapital")
private String registeredCapital;
/** 注册资金单位 **/
@JsonProperty("registeredCapitalUnit")
private Object registeredCapitalUnit;
/** 银行账号 **/
@JsonProperty("bankAccount")
private String bankAccount;
/** 开户银行 **/
@JsonProperty("openingBank")
private String openingBank;
/** 经营范围 **/
@JsonProperty("natureObusiness")
private String natureObusiness;
}

@ -0,0 +1,42 @@
package jnpf.model.enterprisemerchants;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* EnterpriseMerchants
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
*/
@Data
public class EnterpriseMerchantsPagination 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("cmpNo")
private Object cmpNo;
/** 公司名称 */
@JsonProperty("cmpNm")
private Object cmpNm;
/** 公司类型 */
@JsonProperty("compType")
private Object compType;
/** 公司状态 */
@JsonProperty("companyStatus")
private Object companyStatus;
}

@ -11,7 +11,7 @@ import com.alibaba.fastjson.annotation.JSONField;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Data
public class ParkExcelErrorVO extends ParkExcelVO{

@ -17,7 +17,7 @@ import java.util.List;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Data
public class ParkExcelVO{

@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Data
public class ParkForm {
@ -26,10 +26,7 @@ public class ParkForm {
/** 园区名称 **/
@JsonProperty("name")
private String name;
/** 父id **/
@JsonProperty("pid")
private String pid;
/** 描述 **/
/** 园区描述 **/
@JsonProperty("description")
private String description;
/** 备注 **/

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Data
public class ParkPagination extends Pagination {
@ -30,7 +30,4 @@ public class ParkPagination extends Pagination {
/** 园区名称 */
@JsonProperty("name")
private Object name;
/** 类型 */
@JsonProperty("type")
private String type;
}

@ -0,0 +1,52 @@
package jnpf.model.person;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Person
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
public class PersonForm {
/** 主键 */
private String id;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 用户编码 **/
@JsonProperty("userCode")
private String userCode;
/** 用户名 **/
@JsonProperty("userName")
private String userName;
/** 身份证号 **/
@JsonProperty("idCard")
private String idCard;
/** 联系电话 **/
@JsonProperty("phone")
private String phone;
/** 人员归属 **/
@JsonProperty("userAscription")
private Object userAscription;
/** 有效开始时间 **/
@JsonProperty("effectiveStartTime")
private String effectiveStartTime;
/** 有效结束时间 **/
@JsonProperty("effectiveEndTime")
private String effectiveEndTime;
/** 出入码 **/
@JsonProperty("entryCodes")
private String entryCodes;
/** 商户 **/
@JsonProperty("merchantId")
private String merchantId;
@JsonProperty("merchantName")
private String merchantName;
}

@ -0,0 +1,36 @@
package jnpf.model.person;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* Person
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
public class PersonPagination 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("userCode")
private Object userCode;
/** 用户名 */
@JsonProperty("userName")
private Object userName;
}

@ -0,0 +1,53 @@
package jnpf.model.vehicle;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Vehicle
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
public class VehicleForm {
/** 主键 */
private String id;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 车牌号 **/
@JsonProperty("vehicleNumber")
private String vehicleNumber;
/** 车辆类型 **/
@JsonProperty("vehicleType")
private Object vehicleType;
/** 车辆品牌 **/
@JsonProperty("vehicleBrand")
private String vehicleBrand;
/** 车辆颜色 **/
@JsonProperty("vehicleColor")
private String vehicleColor;
/** 联系人 **/
@JsonProperty("contactsName")
private String contactsName;
/** 联系电话 **/
@JsonProperty("contactsPhone")
private String contactsPhone;
/** 车辆照片 **/
@JsonProperty("vehiclePhotos")
private Object vehiclePhotos;
/** 车辆归属 **/
@JsonProperty("vehicleAscription")
private Object vehicleAscription;
/** 归属 **/
@JsonProperty("ascriptionId")
private Object ascriptionId;
/** 归属名称 **/
@JsonProperty("ascriptionName")
private String ascriptionName;
}

@ -0,0 +1,36 @@
package jnpf.model.vehicle;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* Vehicle
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
public class VehiclePagination 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("vehicleNumber")
private Object vehicleNumber;
/** 车辆类型 */
@JsonProperty("vehicleType")
private Object vehicleType;
}

@ -5,11 +5,11 @@ import jnpf.entity.ParkEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* park
* Park
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-12
* 2024-07-15
*/
public interface ParkMapper extends BaseMapper<ParkEntity> {

@ -7,11 +7,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* park
* Park
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-12
* 2024-07-15
*/
public interface ParkService extends IService<ParkEntity> {
List<ParkEntity> getList(ParkPagination parkPagination);

@ -32,11 +32,11 @@ import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* park
* Park
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-12
* 2024-07-15
*/
@Service
public class ParkServiceImpl extends ServiceImpl<ParkMapper, ParkEntity> implements ParkService{

@ -9,7 +9,7 @@ import java.util.Date;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-12
* @ 2024-07-15
*/
@Data
@TableName("yq_park")

@ -7,11 +7,11 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* park
* Park
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-12
* @ 2024-07-15
*/
@Data
public class ParkExcelErrorVO extends ParkExcelVO{

@ -13,11 +13,11 @@ import java.math.BigDecimal;
import java.util.List;
/**
*
* park
* Park
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-12
* @ 2024-07-15
*/
@Data
public class ParkExcelVO{

@ -6,11 +6,11 @@ import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* park
* Park
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-12
* @ 2024-07-15
*/
@Data
public class ParkForm {

@ -7,11 +7,11 @@ import java.util.List;
/**
*
* park
* Park
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-12
* @ 2024-07-15
*/
@Data
public class ParkPagination extends Pagination {

@ -0,0 +1,269 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
content="详情"/>
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<jnpf-form-tip-item label="合同编号"
prop="contractNumber" >
<p>{{dataForm.contractNumber}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="合同名称"
prop="contractName" >
<p>{{dataForm.contractName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="计价方式"
prop="pricingMethod" >
<p>{{ dataForm.pricingMethod }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="签订日期"
prop="signingDate" >
<p>{{dataForm.signingDate}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="园区名称"
prop="parkId" >
<p>{{dataForm.parkId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="商户名称"
prop="merchantName" >
<p>{{dataForm.merchantName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="租金总价"
prop="totalRentalPrice" >
<p>{{dataForm.totalRentalPrice}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="押金总计"
prop="totalDeposit" >
<p>{{dataForm.totalDeposit}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="支付方式"
prop="payDeposit" >
<p>{{ dataForm.payDeposit }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="退还方式"
prop="returnDeposit" >
<p>{{ dataForm.returnDeposit }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="开始时间"
prop="startTime" >
<p>{{dataForm.startTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="结束时间"
prop="endTime" >
<p>{{dataForm.endTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="租期"
prop="leaseTerm" >
<p>{{dataForm.leaseTerm}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="联系人"
prop="contacts" >
<p>{{dataForm.contacts}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="联系电话"
prop="contactsPhone" >
<p>{{dataForm.contactsPhone}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="合同状态"
prop="contractStatus" >
<p>{{ dataForm.contractStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="合同说明"
prop="contractExplain" >
<p>{{dataForm.contractExplain}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="合同附件"
prop="contractEnclosure" >
<JnpfUploadFile v-model="dataForm.contractEnclosure"
disabled
detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传" >
</JnpfUploadFile>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>空间列表</h2>
</div>
<el-table :data="dataForm.tableField130" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="contractLineNumber" label="合同行号" >
<template slot="header">
合同行号
<span slot="label">
<el-tooltip placement="top" content='后台自动生成'>
<a class='el-icon-question tooltip-question'></a>
</el-tooltip>
</span>
</template>
<template slot-scope="scope">
<p>{{scope.row.contractLineNumber}}</p>
</template>
</el-table-column>
<el-table-column prop="spaceName" label="空间名称" >
<template slot-scope="scope">
<p>{{scope.row.spaceName}}</p>
</template>
</el-table-column>
<el-table-column prop="spaceArea" label="空间面积" >
<template slot-scope="scope">
<p>{{scope.row.spaceArea}}</p>
</template>
</el-table-column>
<el-table-column prop="totalRentalPrice" label="租金总价" >
<template slot-scope="scope">
<p>{{scope.row.totalRentalPrice}}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
contractNumber : '',
contractName : '',
pricingMethod : "",
signingDate : '',
parkId : "",
merchantName : "",
totalRentalPrice : "",
totalDeposit : '',
payDeposit : "",
returnDeposit : "",
startTime : '',
endTime : '',
leaseTerm : '',
contacts : '',
contactsPhone : '',
contractStatus : "10",
creationTime : "",
contractExplain : '',
contractEnclosure : [],
spacecontractList:[],
},
pricingMethodOptions:[{"fullName":"月付","id":"1"},{"fullName":"季付","id":"2"},{"fullName":"年付","id":"3"}],
pricingMethodProps:{"label":"fullName","value":"id" },
parkIdProps:{"label":"park_name","value":"park_number" },
merchantNameProps:{"label":"cmp_nm","value":"id" },
payDepositOptions:[{"fullName":"选项1","id":"1"},{"fullName":"选项2","id":"2"}],
payDepositProps:{"label":"fullName","value":"id" },
returnDepositOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],
returnDepositProps:{"label":"fullName","value":"id" },
contractStatusOptions:[{"fullName":"待确认","id":"10"},{"fullName":"已确认","id":"20"},{"fullName":"已结案","id":"30"},{"fullName":"待确认","id":"21"}],
contractStatusProps:{"label":"fullName","value":"id" },
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
goBack() {
this.$emit('refresh')
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/Contract/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

@ -0,0 +1,62 @@
<template>
<el-dialog title="合同确认" :visible.sync="showDialog" width="30%" @close="handleDialogClose">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="审核意见">
<el-input v-model="form.adjustComm" placeholder="请输入审核意见"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit"> </el-button>
<el-button type="danger" @click="rollback"> </el-button>
<el-button @click="showDialog = false"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
selectedRows: {
type: Array,
default: () => []
},
onSubmit: {
type: Function,
default: () => { },
},
onRollback: {
type: Function,
default: () => { },
},
},
data() {
return {
form: {
approveRemarks: '',
},
};
},
methods: {
handleDialogClose() {
this.form.approveRemarks = ''; //
this.$emit('update:showDialog', false); // showDialog
},
handleSubmit() {
this.onSubmit({
approveRemarks: this.form.approveRemarks,
});
this.handleDialogClose(); //
},
rollback() {
this.onRollback({
approveRemarks: this.form.approveRemarks,
});
this.handleDialogClose(); //
},
},
};
</script>

@ -0,0 +1,51 @@
<template>
<el-dialog title="合同结束" :visible.sync="showEndDialog" width="30%" @close="handleDialogClose">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="备注说明">
<el-input v-model="form.adjustComm" placeholder="请输入备注说明"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleEndSubmit"> </el-button>
<el-button @click="showEndDialog = false"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
showEndDialog: {
type: Boolean,
default: false,
},
selectedRows: {
type: Array,
default: () => []
},
onEndSubmit: {
type: Function,
default: () => { },
},
},
data() {
return {
form: {
approveRemarks: '同意',
},
};
},
methods: {
handleDialogClose() {
this.form.approveRemarks = ''; //
this.$emit('update:showEndDialog', false); // showDialog
},
handleEndSubmit() {
this.onEndSubmit({
approveRemarks: this.form.approveRemarks,
});
this.handleDialogClose(); //
},
},
};
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,935 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" :content="!dataForm.id ? '新建' : '编辑'" />
<div class="options">
<el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
{{ '上一条' }}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled='nextDis'>
{{ '下一条' }}
</el-dropdown-item>
</template>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)"
:loading="continueBtnLoading" :disabled='btnLoading'>
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"
:disabled='continueBtnLoading'>
</el-button>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{ margin: '0 auto', width: '100%' }">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right">
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="8">
<jnpf-form-tip-item label="合同编号" prop="contractNumber">
<JnpfInput v-model="dataForm.contractNumber" @change="changeData('contractNumber', -1)"
placeholder="自动生成" disabled :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="合同名称" prop="contractName">
<JnpfInput v-model="dataForm.contractName" @change="changeData('contractName', -1)"
placeholder="请输入合同名称" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="计价方式" prop="pricingMethod">
<JnpfSelect v-model="dataForm.pricingMethod" @change="changeData('pricingMethod', -1)"
placeholder="请选择计价方式" clearable :style='{ "width": "100%" }'
:options="pricingMethodOptions" :props="pricingMethodProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="签订日期" prop="signingDate">
<JnpfDatePicker v-model="dataForm.signingDate" @change="changeData('signingDate', -1)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
placeholder="请选择签订日期" clearable :style='{ "width": "100%" }' type="date"
format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="园区名称" prop="parkId">
<JnpfSelect v-model="dataForm.parkId" @change="changeData('parkId', -1)"
placeholder="请选择园区" clearable :style='{ "width": "100%" }' :options="parkIdOptions"
:props="parkIdProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="商户名称" prop="merchantName">
<JnpfSelect v-model="dataForm.merchantName" @change="changeData('merchantName', -1)"
placeholder="请选择" clearable :style='{ "width": "100%" }' filterable
:options="merchantNameOptions" :props="merchantNameProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="租金总价" prop="totalRentalPrice">
<JnpfInput v-model="dataForm.totalRentalPrice"
@change="changeData('totalRentalPrice', -1)" placeholder="请输入租金总价" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="押金总计" prop="totalDeposit">
<JnpfInput v-model="dataForm.totalDeposit" @change="changeData('totalDeposit', -1)"
placeholder="请输入押金总计" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="支付方式" prop="payDeposit">
<JnpfSelect v-model="dataForm.payDeposit" @change="changeData('payDeposit', -1)"
placeholder="请选择押金支付方式" clearable :style='{ "width": "100%" }'
:options="payDepositOptions" :props="payDepositProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="退还方式" prop="returnDeposit">
<JnpfSelect v-model="dataForm.returnDeposit" @change="changeData('returnDeposit', -1)"
placeholder="请选择押金退还方式" clearable :style='{ "width": "100%" }'
:options="returnDepositOptions" :props="returnDepositProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="开始时间" prop="startTime">
<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">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="结束时间" prop="endTime">
<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">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="租期" prop="leaseTerm">
<JnpfInput v-model="dataForm.leaseTerm" @change="changeData('leaseTerm', -1)"
placeholder="自动生成" disabled addonAfter="月" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="联系人" prop="contacts">
<JnpfInput v-model="dataForm.contacts" @change="changeData('contacts', -1)"
placeholder="请输入联系人" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="联系电话" prop="contactsPhone">
<JnpfInput v-model="dataForm.contactsPhone" @change="changeData('contactsPhone', -1)"
placeholder="请输入联系电话" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="合同状态" prop="contractStatus">
<JnpfSelect v-model="dataForm.contractStatus" @change="changeData('contractStatus', -1)"
placeholder="请选择" disabled clearable :style='{ "width": "100%" }'
:options="contractStatusOptions" :props="contractStatusProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="合同说明" prop="contractExplain">
<JnpfTextarea v-model="dataForm.contractExplain"
@change="changeData('contractExplain', -1)" placeholder="请输入合同说明"
:style='{ "width": "100%" }' true type="textarea"
:autosize='{ "minRows": 4, "maxRows": 4 }'>
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="合同附件" prop="contractEnclosure">
<JnpfUploadFile v-model="dataForm.contractEnclosure"
@change="changeData('contractEnclosure', -1)" :fileSize="10" sizeUnit="MB"
:limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传">
</JnpfUploadFile>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>空间列表</h2>
</div>
<el-table :data="dataForm.spacecontractList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="合同行号" tipLabel="后台自动生成" prop="contractLineNumber">
<template slot="header" v-if="false">
<span class="required-sign">*</span>合同行号
<span slot="label">
<el-tooltip placement="top" content='后台自动生成'>
<a class='el-icon-question tooltip-question'></a>
</el-tooltip>
</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.contractLineNumber"
@change="changeData('spacecontract-contractLineNumber', scope.$index)"
placeholder="合同行号" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="空间名称" prop="spaceName">
<template slot="header" v-if="false">
<span class="required-sign">*</span>空间名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.spaceName"
@change="changeData('spacecontract-spaceName', scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.spacecontractspaceName" placeholder="请选择"
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='name' :field="'spaceName' + scope.$index"
interfaceId="582491427901014533" :pageSize="20"
:columnOptions="spacecontractspaceNamecolumnOptions" clearable
:style='{ "width": "100%" }'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="空间面积" prop="spaceArea">
<template slot="header" v-if="false">
<span class="required-sign">*</span>空间面积
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.spaceArea"
@change="changeData('spacecontract-spaceArea', scope.$index)"
placeholder="请输入空间面积" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="租金总价" prop="totalRentalPrice">
<template slot="header" v-if="false">
<span class="required-sign">*</span>租金总价
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.totalRentalPrice"
@change="changeData('spacecontract-totalRentalPrice', scope.$index)"
placeholder="请输入租金总价" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delspacecontractList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addspacecontractList()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible = false" />
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: {},
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting: {},
eventType: '',
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {
spacecontractList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
spacecontractList: {
contractLineNumber: '',
contractLineNumberOptions: [],
spaceName: '',
spaceNameOptions: [],
spaceArea: '',
spaceAreaOptions: [],
totalRentalPrice: '',
totalRentalPriceOptions: [],
enabledmark: undefined
},
},
Vmodel: "",
currVmodel: "",
dataForm: {
contractNumber: undefined,
contractName: undefined,
pricingMethod: undefined,
signingDate: undefined,
parkId: undefined,
merchantName: undefined,
totalRentalPrice: undefined,
totalDeposit: undefined,
payDeposit: undefined,
returnDeposit: undefined,
startTime: undefined,
endTime: undefined,
leaseTerm: undefined,
contacts: undefined,
contactsPhone: undefined,
contractStatus: "10",
creationTime: undefined,
contractExplain: undefined,
contractEnclosure: [],
spacecontractList: [],
version: 0,
},
tableRequiredData: {},
dataRule:
{
contractName: [
{
required: true,
message: '请输入合同名称',
trigger: 'blur'
},
],
pricingMethod: [
{
required: true,
message: '请选择计价方式',
trigger: 'change'
},
],
signingDate: [
{
required: true,
message: '请选择签订日期',
trigger: 'change'
},
],
parkId: [
{
required: true,
message: '请选择园区',
trigger: 'change'
},
],
merchantName: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
totalRentalPrice: [
{
required: true,
message: '请输入租金总价',
trigger: 'blur'
},
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
totalDeposit: [
{
required: true,
message: '请输入押金总计',
trigger: 'blur'
},
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
payDeposit: [
{
required: true,
message: '请选择押金支付方式',
trigger: 'change'
},
],
returnDeposit: [
{
required: true,
message: '请选择押金退还方式',
trigger: 'change'
},
],
startTime: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
endTime: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
leaseTerm: [
{
required: true,
message: '自动生成',
trigger: 'blur'
},
],
contacts: [
{
required: true,
message: '请输入联系人',
trigger: 'blur'
},
],
contactsPhone: [
{
required: true,
message: '请输入联系电话',
trigger: 'blur'
},
],
contractStatus: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
contractEnclosure: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
},
pricingMethodOptions: [{ "fullName": "月付", "id": "1" }, { "fullName": "季付", "id": "2" }, { "fullName": "年付", "id": "3" }],
pricingMethodProps: { "label": "fullName", "value": "id" },
parkIdOptions: [],
parkIdProps: { "label": "park_name", "value": "park_number" },
merchantNameOptions: [],
merchantNameProps: { "label": "cmp_nm", "value": "id" },
payDepositOptions: [{ "fullName": "选项1", "id": "1" }, { "fullName": "选项2", "id": "2" }],
payDepositProps: { "label": "fullName", "value": "id" },
returnDepositOptions: [{ "fullName": "选项一", "id": "1" }, { "fullName": "选项二", "id": "2" }],
returnDepositProps: { "label": "fullName", "value": "id" },
contractStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已结案", "id": "30" }, { "fullName": "待确认", "id": "21" }],
contractStatusProps: { "label": "fullName", "value": "id" },
spacecontractspaceNamecolumnOptions: [{ "label": "园区编码", "value": "code" }, { "label": "园区名称", "value": "name" },],
childIndex: -1,
isEdit: false,
interfaceRes: {
contractNumber: [],
contractName: [],
pricingMethod: [],
signingDate: [],
parkId: [],
merchantName: [],
totalRentalPrice: [],
totalDeposit: [],
payDeposit: [],
returnDeposit: [],
startTime: [],
endTime: [],
leaseTerm: [],
contacts: [],
contactsPhone: [],
contractStatus: [],
creationTime: [],
contractExplain: [],
contractEnclosure: [],
spacecontractcontractLineNumber: [],
spacecontractspaceName: [],
spacecontractspaceArea: [],
spacecontracttotalRentalPrice: [],
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() { },
methods: {
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/example/Contract/' + id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
changeData(model, index) {
if (model == 'startTime' && this.dataForm.endTime != undefined) {
const date1 = new Date(this.dataForm.startTime);
const date2 = new Date(this.dataForm.endTime);
let yearsDiff = date2.getFullYear() - date1.getFullYear();
let monthsDiff = date2.getMonth() - date1.getMonth();
if (monthsDiff < 0) {
monthsDiff += 12;
yearsDiff--;
}
const daysDiff = date2.getDate() - date1.getDate();
if (daysDiff > 0) {
monthsDiff++;
}
this.dataForm.leaseTerm = yearsDiff * 12 + monthsDiff;
}
if (model == 'endTime' && this.dataForm.startTime != undefined) {
const date1 = new Date(this.dataForm.startTime);
const date2 = new Date(this.dataForm.endTime);
let yearsDiff = date2.getFullYear() - date1.getFullYear();
let monthsDiff = date2.getMonth() - date1.getMonth();
if (monthsDiff < 0) {
monthsDiff += 12;
yearsDiff--;
}
const daysDiff = date2.getDate() - date1.getDate();
if (daysDiff > 0) {
monthsDiff++;
}
this.dataForm.leaseTerm = yearsDiff * 12 + monthsDiff;
}
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if (this[options]) {
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll() {
this.getparkIdOptions();
this.getmerchantNameOptions();
},
spacecontractExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.spacecontractList.length; i++) {
const e = this.dataForm.spacecontractList[i];
if (e.totalRentalPrice) {
var regPos = [{ "pattern": "/^([1-9][\\d]*|0)(\\.[\\d]+)?$/", "message": "请输入正确的金额" }]
for (let i = 0; i < regPos.length; i++) {
const element = regPos[i];
if (element.pattern && !eval(element.pattern).test(e.totalRentalPrice)) {
this.$message({
message: element.message,
type: 'error',
duration: 1000
});
isOk = false
break;
}
}
}
}
return isOk;
},
getparkIdOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.parkId))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if (json.relationField) {
let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue;
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]] : ''
} else {
val = this.dataForm[relationFieldAll]
}
json.defaultValue = val
}
}
let template = {
paramList: templateJsonList
}
getDataInterfaceRes('582491427901014533', template).then(res => {
let data = res.data
this.parkIdOptions = data
this.changeDataFormData(1, 'parkId', 'parkId', index, '')
})
},
getmerchantNameOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.merchantName))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if (json.relationField) {
let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue;
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]] : ''
} else {
val = this.dataForm[relationFieldAll]
}
json.defaultValue = val
}
}
let template = {
paramList: templateJsonList
}
getDataInterfaceRes('582842667524685829', template).then(res => {
let data = res.data
this.merchantNameOptions = data
this.changeDataFormData(1, 'merchantName', 'merchantName', index, '')
})
},
goBack() {
this.$emit('refresh')
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
}
} else {
this.prevDis = true
this.nextDis = true
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/example/Contract/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData()
this.initDefaultData()
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
if (!this.spacecontractExist()) return
this.request()
}
})
},
request() {
let _data = this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/example/Contract',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
} else {
request({
url: '/api/example/Contract/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
addspacecontractList() {
let item = {
contractLineNumber: undefined,
spaceName: '',
spaceArea: undefined,
totalRentalPrice: undefined,
}
this.getspacecontractList(item)
},
delspacecontractList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.spacecontractList.splice(index, 1);
}).catch(() => {
});
},
getspacecontractList(value) {
let item = { ...this.tableRows.spacecontractList, ...value }
this.dataForm.spacecontractList.push(item)
this.childIndex = this.dataForm.spacecontractList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for (let i = 0; i < _dataAll.spacecontractList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
},
},
}
</script>

@ -0,0 +1,657 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="申请时间">
<JnpfDateRangePicker v-model="query.creationTime" format="yyyy-MM-dd"
startPlaceholder="开始日期" endPlaceholder="结束日期" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商户名称">
<JnpfSelect v-model="query.merchantName" placeholder="请选择" clearable
:options="merchantNameOptions" :props="merchantNameProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合同状态">
<JnpfSelect v-model="query.contractStatus" placeholder="请选择" clearable
:options="contractStatusOptions" :props="contractStatusProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="合同名称">
<el-input v-model="query.contractName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合同编号">
<el-input v-model="query.contractNumber" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="园区名称">
<JnpfSelect v-model="query.parkId" placeholder="请选择园区" clearable
:options="parkIdOptions" :props="parkIdProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
</template>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
<el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">
展开
</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>
收起
</el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">
</el-button>
<el-button type="info" icon="icon-ym icon-ym-btn-download" @click="exportData()">
</el-button>
<el-button type="warning" icon="icon-ym icon-ym-btn-download" @click="showDialog = true"">合同确认
</el-button>
<el-button type="success" icon="icon-ym icon-ym-btn-download" @click="showEndDialog = true"">合同结束
</el-button>
</div>
<div class=" JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'
:span-method="arraySpanMethod" @row-click="handleRowClick">
<el-table-column width="55" align="center">
<template slot-scope="scope">
<input type="radio" :value="scope.row.id" v-model="selectedRowId"
@change="handleSelectionChange">
</template>
</el-table-column>
<el-table-column prop="contractNumber" label="合同编号" align="left">
</el-table-column>
<el-table-column prop="contractName" label="合同名称" align="left">
</el-table-column>
<el-table-column label="合同状态" prop="contractStatus" algin="left">
<template slot-scope="scope">
{{ scope.row.contractStatus }}
</template>
</el-table-column>
<el-table-column prop="parkId" label="园区名称" align="left">
</el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="left">
</el-table-column>
<el-table-column prop="signingDate" label="签订日期" align="left">
</el-table-column>
<el-table-column prop="leaseTerm" label="租期" align="left">
</el-table-column>
<el-table-column prop="startTime" label="开始时间" align="left">
</el-table-column>
<el-table-column prop="endTime" label="结束时间" align="left">
</el-table-column>
<el-table-column prop="contacts" label="联系人" align="left">
</el-table-column>
<el-table-column prop="contactsPhone" label="联系电话" align="left">
</el-table-column>
<el-table-column prop="totalRentalPrice" label="租金总价" align="left">
</el-table-column>
<el-table-column label="计价方式" prop="pricingMethod" algin="left">
<template slot-scope="scope">
{{ scope.row.pricingMethod }}
</template>
</el-table-column>
<el-table-column prop="totalDeposit" label="押金总计" align="left">
</el-table-column>
<el-table-column label="支付方式" prop="payDeposit" algin="left">
<template slot-scope="scope">
{{ scope.row.payDeposit }}
</template>
</el-table-column>
<el-table-column label="退还方式" prop="returnDeposit" algin="left">
<template slot-scope="scope">
{{ scope.row.returnDeposit }}
</template>
</el-table-column>
<el-table-column prop="contractExplain" label="合同说明" align="left">
</el-table-column>
<el-table-column label="操作" fixed="right" width="180">
<template slot-scope="scope">
<el-button type="text" v-show="scope.row.contractStatus === ''"
@click="addOrUpdateHandle(scope.row)">编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)">
</el-button>
<el-button type="text" v-show="scope.row.contractStatus === ''"
@click="addOrUpdateHandle(scope.row)">变更合同
</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" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible = false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" />
<DialogComponent :showDialog.sync="showDialog" @update:showDialog="showDialog = $event" :onSubmit="handleSubmit"
:onRollback="rollback" />
<DialogEndComponent :showEndDialog.sync="showEndDialog" @update:showEndDialog="showEndDialog = $event"
:onEndSubmit="handleEndSubmit" />
</div>
</div>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
import DialogComponent from "@/views/scm/contract/DialogComponent.vue";
import DialogEndComponent from "@/views/scm/contract/DialogEndComponent.vue";
export default {
components: {
DialogComponent,
DialogEndComponent,
JNPFForm,
Detail,
ExportBox, ToFormDetail, SuperQuery
},
data() {
return {
selectedRowId: null,
showDialog: false,
showEndDialog: false,
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
showAll: false,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
creationTime: undefined,
merchantName: undefined,
contractStatus: undefined,
contractName: undefined,
contractNumber: undefined,
parkId: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
pricingMethodOptions: [{ "fullName": "月付", "id": "1" }, { "fullName": "季付", "id": "2" }, { "fullName": "年付", "id": "3" }],
pricingMethodProps: { "label": "fullName", "value": "id" },
parkIdOptions: [],
parkIdProps: { "label": "park_name", "value": "park_number" },
merchantNameOptions: [],
merchantNameProps: { "label": "cmp_nm", "value": "id" },
payDepositOptions: [{ "fullName": "选项1", "id": "1" }, { "fullName": "选项2", "id": "2" }],
payDepositProps: { "label": "fullName", "value": "id" },
returnDepositOptions: [{ "fullName": "选项一", "id": "1" }, { "fullName": "选项二", "id": "2" }],
returnDepositProps: { "label": "fullName", "value": "id" },
contractStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已结案", "id": "30" }, { "fullName": "待确认", "id": "21" }],
contractStatusProps: { "label": "fullName", "value": "id" },
tableField130_spaceNamecolumnOptions: [{ "label": "园区编码", "value": "code" }, { "label": "园区名称", "value": "name" },],
interfaceRes: {
tableField130_spaceName: [],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.getmerchantNameOptions();
this.getparkIdOptions();
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
handleRowClick(row, event, column) {
this.selectedRowId = row.id;
console.log(this.selectedRowId);
},
handleSelectionChange(event) {
this.selectedRowId = event.target.value;
},
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
getmerchantNameOptions() {
getDataInterfaceRes('582842667524685829').then(res => {
let data = res.data
this.merchantNameOptions = data
})
},
getparkIdOptions() {
getDataInterfaceRes('582491427901014533').then(res => {
let data = res.data
this.parkIdOptions = data
})
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '582839350958489605',
type: 1,
};
request({
url: `/api/example/Contract/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/Contract/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "example/Contract")
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : ""
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
request({
url: `/api/example/Contract/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
handleSubmit(rows) {
// if (this.selectedIds.length == 0) {
// this.$message.error("");
// return;
// }
// if (rows.adjustComm == null || rows.adjustComm == "") {
// this.$message.error("");
// return;
// }
// let _query = {
// adjustStatus: 1,
// ids: this.selectedIds,
// adjustComm: rows.adjustComm
// };
// request({
// url: `/api/scm/RecycleDeliveryOrder/auditBatch`,
// method: "post",
// data: _query
// }).then(res => {
// this.$message({
// message: res.msg,
// type: "success",
// duration: 1000
// });
// this.initData();
// });
},
rollback(rows) {
// if (this.selectedIds.length == 0) {
// this.$message.error("");
// return;
// }
// if (rows.adjustComm == null || rows.adjustComm == "") {
// this.$message.error("");
// return;
// }
// let _query = {
// adjustStatus: 1,
// ids: this.selectedIds,
// adjustComm: rows.adjustComm
// };
// request({
// url: `/api/scm/RecycleDeliveryOrder/auditBatch`,
// method: "post",
// data: _query
// }).then(res => {
// this.$message({
// message: res.msg,
// type: "success",
// duration: 1000
// });
// this.initData();
// });
},
handleEndSubmit(rows) {
// if (this.selectedIds.length == 0) {
// this.$message.error("");
// return;
// }
// if (rows.adjustComm == null || rows.adjustComm == "") {
// this.$message.error("");
// return;
// }
// let _query = {
// adjustStatus: 1,
// ids: this.selectedIds,
// adjustComm: rows.adjustComm
// };
// request({
// url: `/api/scm/RecycleDeliveryOrder/auditBatch`,
// method: "post",
// data: _query
// }).then(res => {
// this.$message({
// message: res.msg,
// type: "success",
// duration: 1000
// });
// this.initData();
// });
}
}
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,258 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
content="详情"/>
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<jnpf-form-tip-item label="公司编码"
prop="cmpNo" >
<p>{{dataForm.cmpNo}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="公司名称"
prop="cmpNm" >
<p>{{dataForm.cmpNm}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="所属行业"
prop="industry" >
<p>{{dataForm.industry}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="公司规模"
prop="companySize" >
<p>{{ dataForm.companySize }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="公司类型"
prop="compType" >
<p>{{ dataForm.compType }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="公司状态"
prop="companyStatus" >
<p>{{ dataForm.companyStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="联系人"
prop="userNm" >
<p>{{dataForm.userNm}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="联系电话"
prop="contactNumber" >
<p>{{dataForm.contactNumber}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="邮箱"
prop="mailbox" >
<p>{{dataForm.mailbox}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="入驻状态"
prop="entryStatus" >
<p>{{ dataForm.entryStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="营业执照照片"
prop="businessLicensePhoto" >
<JnpfUploadImg v-model="dataForm.businessLicensePhoto"
disabled
detailed :fileSize="10" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0" >
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="注册地址"
prop="registeredAddress" >
<p>{{dataForm.registeredAddress}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="统一社会信用代码"
prop="unifiedSocialCreditCode" >
<p>{{dataForm.unifiedSocialCreditCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="成立日期"
prop="incorporationDate" >
<p>{{dataForm.incorporationDate}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="法定代表人"
prop="lgPersonNm" >
<p>{{dataForm.lgPersonNm}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="公司注册号"
prop="companyRegistrationNumber" >
<p>{{dataForm.companyRegistrationNumber}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="办公地址"
prop="officeAddress" >
<p>{{dataForm.officeAddress}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="注册资本"
prop="registeredCapital" >
<p>{{dataForm.registeredCapital}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="注册资金单位"
prop="registeredCapitalUnit" >
<p>{{ dataForm.registeredCapitalUnit }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="银行账号"
prop="bankAccount" >
<p>{{dataForm.bankAccount}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="开户银行"
prop="openingBank" >
<p>{{dataForm.openingBank}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="经营范围"
prop="natureObusiness" >
<p>{{dataForm.natureObusiness}}</p>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
cmpNo : '',
cmpNm : '',
industry : "",
companySize : "1",
compType : "1",
companyStatus : "1",
userNm : '',
contactNumber : '',
mailbox : '',
entryStatus : "1",
businessLicensePhoto : [],
registeredAddress : '',
unifiedSocialCreditCode : '',
incorporationDate : '',
lgPersonNm : '',
companyRegistrationNumber : '',
officeAddress : '',
registeredCapital : '',
registeredCapitalUnit : "1",
bankAccount : '',
openingBank : '',
natureObusiness : '',
},
industryProps:{"label":"fullName","value":"enCode" },
companySizeOptions:[{"fullName":"特大型","id":"1"},{"fullName":"大型","id":"2"},{"fullName":"中型","id":"3"},{"fullName":"小型","id":"4"},{"fullName":"微型","id":"5"}],
companySizeProps:{"label":"fullName","value":"id" },
compTypeOptions:[{"fullName":"有限责任公司","id":"1"},{"fullName":"股份有限公司","id":"2"}],
compTypeProps:{"label":"fullName","value":"id" },
companyStatusOptions:[{"fullName":"正常","id":"1"},{"fullName":"注销","id":"2"},{"fullName":"停业","id":"3"}],
companyStatusProps:{"label":"fullName","value":"id" },
entryStatusOptions:[{"fullName":"待签约","id":"1"},{"fullName":"已入驻","id":"2"},{"fullName":"已退出","id":"3"}],
entryStatusProps:{"label":"fullName","value":"id" },
registeredCapitalUnitOptions:[{"fullName":"人民币","id":"1"},{"fullName":"美元","id":"2"}],
registeredCapitalUnitProps:{"label":"fullName","value":"id" },
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
goBack() {
this.$emit('refresh')
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/EnterpriseMerchants/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,819 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" :content="!dataForm.id ? '新建':'编辑'" />
<div class="options">
<el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
{{'上一条'}}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled='nextDis'>
{{'下一条'}}
</el-dropdown-item>
</template>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)" :loading="continueBtnLoading"
:disabled='btnLoading'>
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled='continueBtnLoading'>
</el-button>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="150px"
label-position="right">
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="24">
<div style="padding:15px 0px">
<span style="color: #409EFF;"></span>
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">基础信息</span>
</div>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="公司编码" prop="cmpNo">
<JnpfInput v-model="dataForm.cmpNo" @change="changeData('cmpNo',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="公司名称" prop="cmpNm">
<JnpfInput v-model="dataForm.cmpNm" @change="changeData('cmpNm',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="所属行业" prop="industry">
<JnpfSelect v-model="dataForm.industry" @change="changeData('industry',-1)" placeholder="请选择" clearable
:style='{"width":"100%"}' :options="industryOptions" :props="industryProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="公司规模" prop="companySize">
<JnpfSelect v-model="dataForm.companySize" @change="changeData('companySize',-1)" placeholder="请选择"
clearable :style='{"width":"100%"}' :options="companySizeOptions" :props="companySizeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="公司类型" prop="compType">
<JnpfSelect v-model="dataForm.compType" @change="changeData('compType',-1)" placeholder="请选择" clearable
:style='{"width":"100%"}' :options="compTypeOptions" :props="compTypeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="公司状态" prop="companyStatus">
<JnpfSelect v-model="dataForm.companyStatus" @change="changeData('companyStatus',-1)" placeholder="请选择"
clearable :style='{"width":"100%"}' :options="companyStatusOptions" :props="companyStatusProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="联系人" prop="userNm">
<JnpfInput v-model="dataForm.userNm" @change="changeData('userNm',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="联系电话" prop="contactNumber">
<JnpfInput v-model="dataForm.contactNumber" @change="changeData('contactNumber',-1)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="邮箱" prop="mailbox">
<JnpfInput v-model="dataForm.mailbox" @change="changeData('mailbox',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="入驻状态" prop="entryStatus">
<JnpfSelect v-model="dataForm.entryStatus" @change="changeData('entryStatus',-1)" placeholder="请选择"
clearable :style='{"width":"100%"}' :options="entryStatusOptions" :props="entryStatusProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<div style="padding:15px 0px">
<span style="color: #409EFF;"></span>
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">主体信息</span>
</div>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="营业执照照片" prop="businessLicensePhoto">
<JnpfUploadImg v-model="dataForm.businessLicensePhoto" @change="changeData('businessLicensePhoto',-1)"
:fileSize="10" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0">
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="注册地址" prop="registeredAddress">
<JnpfInput v-model="dataForm.registeredAddress" @change="changeData('registeredAddress',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="统一社会信用代码" prop="unifiedSocialCreditCode">
<JnpfInput v-model="dataForm.unifiedSocialCreditCode" @change="changeData('unifiedSocialCreditCode',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="成立日期" prop="incorporationDate">
<JnpfDatePicker v-model="dataForm.incorporationDate" @change="changeData('incorporationDate',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择"
clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="法定代表人" prop="lgPersonNm">
<JnpfInput v-model="dataForm.lgPersonNm" @change="changeData('lgPersonNm',-1)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="公司注册号" prop="companyRegistrationNumber">
<JnpfInput v-model="dataForm.companyRegistrationNumber"
@change="changeData('companyRegistrationNumber',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="办公地址" prop="officeAddress">
<JnpfInput v-model="dataForm.officeAddress" @change="changeData('officeAddress',-1)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="注册资本" prop="registeredCapital">
<JnpfInput v-model="dataForm.registeredCapital" @change="changeData('registeredCapital',-1)"
placeholder="请输入" addonAfter="万" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="注册资金单位" prop="registeredCapitalUnit">
<JnpfSelect v-model="dataForm.registeredCapitalUnit" @change="changeData('registeredCapitalUnit',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="registeredCapitalUnitOptions"
:props="registeredCapitalUnitProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="银行账号" prop="bankAccount">
<JnpfInput v-model="dataForm.bankAccount" @change="changeData('bankAccount',-1)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="开户银行" prop="openingBank">
<JnpfInput v-model="dataForm.openingBank" @change="changeData('openingBank',-1)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="经营范围" prop="natureObusiness">
<JnpfTextarea v-model="dataForm.natureObusiness" @change="changeData('natureObusiness',-1)"
placeholder="请输入" :style='{"width":"100%"}' true type="textarea"
:autosize='{"minRows":4,"maxRows":4}'>
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible=false" />
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import {
getDefaultCurrentValueUserId
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentId
} from '@/api/permission/organize'
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime
} from '@/components/Generator/utils/index.js'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
export default {
components: {},
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting: {},
eventType: '',
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {},
//
ableAll: {},
tableRows: {},
Vmodel: "",
currVmodel: "",
dataForm: {
cmpNo: undefined,
cmpNm: undefined,
industry: undefined,
companySize: "1",
compType: "1",
companyStatus: "1",
userNm: undefined,
contactNumber: undefined,
mailbox: undefined,
entryStatus: "1",
businessLicensePhoto: [],
registeredAddress: undefined,
unifiedSocialCreditCode: undefined,
incorporationDate: undefined,
lgPersonNm: undefined,
companyRegistrationNumber: undefined,
officeAddress: undefined,
registeredCapital: undefined,
registeredCapitalUnit: "1",
bankAccount: undefined,
openingBank: undefined,
natureObusiness: undefined,
version: 0,
},
tableRequiredData: {},
dataRule: {
cmpNo: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
cmpNm: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
industry: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
companySize: [{
required: true,
message: '请至少选择一个',
trigger: 'change'
}, ],
compType: [{
required: true,
message: '请至少选择一个',
trigger: 'change'
}, ],
companyStatus: [{
required: true,
message: '请至少选择一个',
trigger: 'change'
}, ],
userNm: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
contactNumber: [{
required: true,
message: '请输入',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
message: '请输入正确的联系方式',
trigger: 'blur'
},
],
mailbox: [{
required: true,
message: '请输入',
trigger: 'blur'
},
{
pattern: /^[a-z0-9]+([._\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/,
message: '请输入正确的邮箱',
trigger: 'blur'
},
],
businessLicensePhoto: [{
required: true,
message: '请至少选择一个',
trigger: 'change'
}, ],
registeredAddress: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
unifiedSocialCreditCode: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
incorporationDate: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
lgPersonNm: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
companyRegistrationNumber: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
officeAddress: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
registeredCapital: [{
required: true,
message: '请输入',
trigger: 'blur'
},
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
registeredCapitalUnit: [{
required: true,
message: '请至少选择一个',
trigger: 'change'
}, ],
bankAccount: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
natureObusiness: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
},
industryOptions: [],
industryProps: {
"label": "fullName",
"value": "enCode"
},
companySizeOptions: [{
"fullName": "特大型",
"id": "1"
}, {
"fullName": "大型",
"id": "2"
}, {
"fullName": "中型",
"id": "3"
}, {
"fullName": "小型",
"id": "4"
}, {
"fullName": "微型",
"id": "5"
}],
companySizeProps: {
"label": "fullName",
"value": "id"
},
compTypeOptions: [{
"fullName": "有限责任公司",
"id": "1"
}, {
"fullName": "股份有限公司",
"id": "2"
}],
compTypeProps: {
"label": "fullName",
"value": "id"
},
companyStatusOptions: [{
"fullName": "正常",
"id": "1"
}, {
"fullName": "注销",
"id": "2"
}, {
"fullName": "停业",
"id": "3"
}],
companyStatusProps: {
"label": "fullName",
"value": "id"
},
entryStatusOptions: [{
"fullName": "待签约",
"id": "1"
}, {
"fullName": "已入驻",
"id": "2"
}, {
"fullName": "已退出",
"id": "3"
}],
entryStatusProps: {
"label": "fullName",
"value": "id"
},
registeredCapitalUnitOptions: [{
"fullName": "人民币",
"id": "1"
}, {
"fullName": "美元",
"id": "2"
}],
registeredCapitalUnitProps: {
"label": "fullName",
"value": "id"
},
childIndex: -1,
isEdit: false,
interfaceRes: {
cmpNo: [],
cmpNm: [],
industry: [],
companySize: [],
compType: [],
companyStatus: [],
userNm: [],
contactNumber: [],
mailbox: [],
entryStatus: [],
businessLicensePhoto: [],
registeredAddress: [],
unifiedSocialCreditCode: [],
incorporationDate: [],
lgPersonNm: [],
companyRegistrationNumber: [],
officeAddress: [],
registeredCapital: [],
registeredCapitalUnit: [],
bankAccount: [],
openingBank: [],
natureObusiness: [],
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/example/EnterpriseMerchants/' + id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if (this[options]) {
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll() {
this.getindustryOptions();
},
getindustryOptions() {
getDictionaryDataSelector('d59a3cf65f9847dbb08be449e3feae16').then(res => {
this.industryOptions = res.data.list
})
},
goBack() {
this.$emit('refresh')
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
}
} else {
this.prevDis = true
this.nextDis = true
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/example/EnterpriseMerchants/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData()
this.initDefaultData()
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
let _data = this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/example/EnterpriseMerchants',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
} else {
request({
url: '/api/example/EnterpriseMerchants/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex = -1
},
},
}
</script>

@ -0,0 +1,603 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="公司编码">
<el-input v-model="query.cmpNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="公司名称">
<el-input v-model="query.cmpNm" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="公司类型">
<JnpfSelect v-model="query.compType" placeholder="请选择" clearable :options="compTypeOptions"
:props="compTypeProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="公司状态">
<JnpfSelect v-model="query.companyStatus" placeholder="请选择" clearable :options="companyStatusOptions"
:props="companyStatusProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
</template>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
<el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">
展开
</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
收起
</el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' :span-method="arraySpanMethod">
<el-table-column prop="cmpNo" label="公司编码" align="left">
</el-table-column>
<el-table-column prop="cmpNm" label="公司名称" align="left">
</el-table-column>
<el-table-column label="入驻状态" prop="entryStatus" algin="left">
<template slot-scope="scope">
{{ scope.row.entryStatus}}
</template>
</el-table-column>
<el-table-column label="公司类型" prop="compType" algin="left">
<template slot-scope="scope">
{{ scope.row.compType}}
</template>
</el-table-column>
<el-table-column prop="companyRegistrationNumber" label="公司注册号" align="left">
</el-table-column>
<el-table-column prop="incorporationDate" label="成立日期" align="left">
</el-table-column>
<el-table-column prop="registeredAddress" label="注册地址" align="left">
</el-table-column>
<el-table-column prop="officeAddress" label="办公地址" align="left">
</el-table-column>
<el-table-column prop="userNm" label="联系人" align="left">
</el-table-column>
<el-table-column prop="contactNumber" label="联系电话" align="left">
</el-table-column>
<el-table-column prop="mailbox" label="邮箱" align="left">
</el-table-column>
<el-table-column prop="lgPersonNm" label="法定代表人" align="left">
</el-table-column>
<el-table-column prop="industry" label="所属行业" align="left">
</el-table-column>
<el-table-column label="公司规模" prop="companySize" algin="left">
<template slot-scope="scope">
{{ scope.row.companySize}}
</template>
</el-table-column>
<el-table-column prop="registeredCapital" label="注册资本" align="left">
</el-table-column>
<el-table-column label="注册资金单位" prop="registeredCapitalUnit" algin="left">
<template slot-scope="scope">
{{ scope.row.registeredCapitalUnit}}
</template>
</el-table-column>
<el-table-column label="公司状态" prop="companyStatus" algin="left">
<template slot-scope="scope">
{{ scope.row.companyStatus}}
</template>
</el-table-column>
<el-table-column prop="unifiedSocialCreditCode" label="统一社会信用代码" align="left">
</el-table-column>
<el-table-column prop="bankAccount" label="银行账号" align="left">
</el-table-column>
<el-table-column prop="openingBank" label="开户银行" align="left">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)">
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)">
</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" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getConfigData
} from '@/api/onlineDev/visualDev'
import {
getDefaultCurrentValueUserIdAsync
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentIdAsync
} from '@/api/permission/organize'
import columnList from './columnList'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
JNPFForm,
Detail,
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
return {
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
showAll: false,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
cmpNo: undefined,
cmpNm: undefined,
compType: undefined,
companyStatus: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
industryOptions: [],
industryProps: {
"label": "fullName",
"value": "enCode"
},
companySizeOptions: [{
"fullName": "特大型",
"id": "1"
}, {
"fullName": "大型",
"id": "2"
}, {
"fullName": "中型",
"id": "3"
}, {
"fullName": "小型",
"id": "4"
}, {
"fullName": "微型",
"id": "5"
}],
companySizeProps: {
"label": "fullName",
"value": "id"
},
compTypeOptions: [{
"fullName": "有限责任公司",
"id": "1"
}, {
"fullName": "股份有限公司",
"id": "2"
}],
compTypeProps: {
"label": "fullName",
"value": "id"
},
companyStatusOptions: [{
"fullName": "正常",
"id": "1"
}, {
"fullName": "注销",
"id": "2"
}, {
"fullName": "停业",
"id": "3"
}],
companyStatusProps: {
"label": "fullName",
"value": "id"
},
entryStatusOptions: [{
"fullName": "待签约",
"id": "1"
}, {
"fullName": "已入驻",
"id": "2"
}, {
"fullName": "已退出",
"id": "3"
}],
entryStatusProps: {
"label": "fullName",
"value": "id"
},
registeredCapitalUnitOptions: [{
"fullName": "人民币",
"id": "1"
}, {
"fullName": "美元",
"id": "2"
}],
registeredCapitalUnitProps: {
"label": "fullName",
"value": "id"
},
interfaceRes: {},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({
column
}) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '582533930381480837',
type: 1,
};
request({
url: `/api/example/EnterpriseMerchants/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/EnterpriseMerchants/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {});
},
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "example/EnterpriseMerchants")
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : ""
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({
url: `/api/example/EnterpriseMerchants/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

File diff suppressed because one or more lines are too long

@ -1,15 +1,9 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
content="详情"/>
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="800px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="12" >
@ -25,9 +19,9 @@
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="描述"
prop="describe" >
<p>{{dataForm.describe}}</p>
<jnpf-form-tip-item label="园区描述"
prop="description" >
<p>{{dataForm.description}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
@ -39,8 +33,11 @@
</template>
</el-form>
</el-row>
</div>
</transition>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
</el-dialog>
</template>
<script>
import request from '@/utils/request'
@ -62,7 +59,7 @@
id :'',
code : '',
name : '',
describe : '',
description : '',
remark : '',
type : "1",
},
@ -95,9 +92,6 @@
this.dataForm = _dataAll
},
goBack() {
this.$emit('refresh')
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;

File diff suppressed because one or more lines are too long

@ -1,504 +1,438 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header
@back="goBack"
:content="!dataForm.id ? '新建' : '编辑'"
/>
<div class="options">
<el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled="prevDis">
{{ "上一条" }}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled="nextDis">
{{ "下一条" }}
</el-dropdown-item>
</template>
<el-dropdown-item
type="primary"
@click.native="dataFormSubmit(2)"
:loading="continueBtnLoading"
:disabled="btnLoading"
>
{{
!dataForm.id ? "确定并新增" : "确定并继续"
}}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
<el-button
type="primary"
@click="dataFormSubmit()"
:loading="btnLoading"
:disabled="continueBtnLoading"
>
</el-button
>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row
:gutter="15"
class=" main"
:style="{ margin: '0 auto', width: '100%' }"
>
<el-form
ref="formRef"
:model="dataForm"
:rules="dataRule"
size="small"
label-width="100px"
label-position="right"
>
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="12">
<jnpf-form-tip-item label="园区编码" prop="code">
<JnpfInput
v-model="dataForm.code"
@change="changeData('code', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="园区名称" prop="name">
<JnpfInput
v-model="dataForm.name"
@change="changeData('name', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="描述" prop="description">
<JnpfInput
v-model="dataForm.description"
@change="changeData('description', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="备注" prop="remark">
<JnpfInput
v-model="dataForm.remark"
@change="changeData('remark', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog
v-if="selectDialogVisible"
:config="currTableConf"
:formData="dataForm"
ref="selectDialog"
@select="addForSelect"
@close="selectDialogVisible = false"
/>
</el-row>
</div>
</transition>
</template>
<template>
<el-dialog :title="!dataForm.id ? '新建' :'编辑'"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="800px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="12" >
<jnpf-form-tip-item
label="园区编码" prop="code" >
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item
label="园区名称" prop="name" >
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item
label="园区描述" prop="description" >
<JnpfInput v-model="dataForm.description" @change="changeData('description',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="备注" prop="remark" >
<JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/>
</el-row>
<span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id">
<el-button @click="prev" :disabled='prevDis'>
{{'上一条'}}
</el-button>
<el-button @click="next" :disabled='nextDis'>
{{'下一条'}}
</el-button>
</div>
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button>
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
</span>
</el-dialog>
</template>
<script>
import request from "@/utils/request";
import { mapGetters } from "vuex";
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
import { getDefaultCurrentValueUserId } from "@/api/permission/user";
import { getDefaultCurrentValueDepartmentId } from "@/api/permission/organize";
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime
} from "@/components/Generator/utils/index.js";
import { thousandsFormat } from "@/components/Generator/utils/index";
export default {
components: {},
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: "formRef",
setting: {},
eventType: "",
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {},
//
ableAll: {},
tableRows: {},
Vmodel: "",
currVmodel: "",
dataForm: {
code: undefined,
name: undefined,
description: undefined,
remark: undefined,
type: "1",
version: 0
},
tableRequiredData: {},
dataRule: {
code: [
{
required: true,
message: "请输入",
trigger: "blur"
}
],
name: [
{
required: true,
message: "请输入",
trigger: "blur"
}
]
},
typeOptions: [
{ fullName: "园区", id: "1" },
{ fullName: "区域", id: "2" },
{ fullName: "空间", id: "3" }
],
typeProps: { label: "fullName", value: "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
code: [],
name: [],
description: [],
remark: [],
type: []
}
};
},
computed: {
...mapGetters(["userInfo"])
},
watch: {},
created() {
this.dataAll();
this.initDefaultData();
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm));
},
mounted() {},
methods: {
prev() {
this.index--;
if (this.index === 0) {
this.prevDis = true;
}
this.nextDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id);
}
}
},
next() {
this.index++;
if (this.index === this.allList.length - 1) {
this.nextDis = true;
}
this.prevDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id);
}
}
},
getInfo(id) {
request({
url: "/api/example/Park/" + id,
method: "get"
}).then(res => {
this.dataInfo(res.data);
});
},
goBack() {
this.visible = false;
this.$emit("refreshDataList", true);
},
changeData(model, index) {
this.isEdit = false;
this.childIndex = index;
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key];
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = "get" + key + "Options";
if (this[options]) {
this[options]();
}
this.changeData(key, index);
}
}
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue;
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue;
}
}
} else {
this.dataForm[data] = defaultValue;
import request from '@/utils/request'
import {mapGetters} from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { },
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting:{},
eventType: '',
userBoxVisible:false,
selectDialogVisible: false,
currTableConf:{},
dataValueAll:{},
addTableConf:{
},
//
ableAll:{
},
tableRows:{
},
Vmodel:"",
currVmodel:"",
dataForm: {
code : undefined,
name : undefined,
description : undefined,
remark : undefined,
type : "1",
version: 0,
},
tableRequiredData: {},
dataRule:
{
code: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
name: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
},
typeOptions:[{"fullName":"园区","id":"1"},{"fullName":"区域","id":"2"},{"fullName":"空间","id":"3"}],
typeProps:{"label":"fullName","value":"id" },
childIndex:-1,
isEdit:false,
interfaceRes: {
code:[] ,
name:[] ,
description:[] ,
remark:[] ,
type:[] ,
},
}
}
},
dataAll() {},
goBack() {
this.$emit("refresh");
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll));
},
init(id, isDetail, allList) {
this.prevDis = false;
this.nextDis = false;
this.allList = allList || [];
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id);
if (this.index == 0) {
this.prevDis = true;
}
if (this.index == this.allList.length - 1) {
this.nextDis = true;
}
} else {
this.prevDis = true;
this.nextDis = true;
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true;
request({
url: "/api/example/Park/" + this.dataForm.id,
method: "get"
}).then(res => {
this.dataInfo(res.data);
this.loading = false;
});
} else {
this.clearData();
this.initDefaultData();
}
});
this.$store.commit("generator/UPDATE_RELATION_DATA", {});
},
//
initDefaultData() {},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0;
this.$refs["formRef"].validate(valid => {
if (valid) {
this.request();
}
});
},
request() {
let _data = this.dataList();
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true;
} else {
this.btnLoading = true;
}
if (!this.dataForm.id) {
request({
url: "/api/example/Park",
method: "post",
data: _data
})
.then(res => {
this.$message({
message: res.msg,
type: "success",
duration: 1000,
onClose: () => {
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/example/Park/'+ id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if(this[options]){
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model,index,defaultValue) {
if(!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll(){
},
clearData(){
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id,isDetail,allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
}
} else {
this.prevDis = true
this.nextDis = true
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/Park/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
}else{
this.clearData()
this.initDefaultData()
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
let _data =this.dataList()
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData();
this.initDefaultData();
});
this.continueBtnLoading = false;
return;
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
}
});
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
} else {
request({
url: "/api/example/Park/" + this.dataForm.id,
method: "PUT",
data: _data
})
.then(res => {
this.$message({
message: res.msg,
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2)
return (this.continueBtnLoading = false);
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
}
});
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key];
this.currVmodel = key;
this.selectDialogVisible = true;
this.$nextTick(() => {
this.$refs.selectDialog.init();
});
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i];
if (this["get" + this.currVmodel]) {
this["get" + this.currVmodel](t);
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData);
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue;
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = new Date().getTime();
} else if (timeType == 4) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime();
}
} else if (timeType == 5) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime();
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == "HH:mm" ? "HH:mm:00" : formatType;
let timeDataValue = null;
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || "00:00:00";
if (timeDataValue.split(":").length == 3) {
timeDataValue = timeDataValue;
} else {
timeDataValue = timeDataValue + ":00";
}
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format);
} else if (timeType == 4) {
let previousDate = "";
previousDate = getBeforeTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
} else if (timeType == 5) {
let previousDate = "";
previousDate = getLaterTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll;
this.dataForm = _dataAll;
this.isEdit = true;
this.dataAll();
this.childIndex = -1;
if (!this.dataForm.id) {
request({
url: '/api/example/Park',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(()=>{
this.btnLoading = false
this.continueBtnLoading = false
})
}else{
request({
url: '/api/example/Park/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(()=>{
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
openSelectDialog(key) {
this.currTableConf=this.addTableConf[key]
this.currVmodel=key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if(this['get'+this.currVmodel]){
this['get'+this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList(){
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex=-1
},
},
}
}
};
</script>

File diff suppressed because it is too large Load Diff

@ -1,2 +1,2 @@
const superQueryJson = [{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区编码","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区编码","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767684035,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":true,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"code","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"code","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区名称","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区名称","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767686366,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"name","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"name","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"描述","addonAfter":"","__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"描述","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686553,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"describe","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"describe","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"备注","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"备注","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686749,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"remark","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"remark","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"filterable":false,"clearable":true,"multiple":false,"fullName":"类型","props":{"label":"fullName","value":"id"},"__config__":{"formId":105,"visibility":["pc","app"],"jnpfKey":"select","defaultValue":"1","noShow":true,"dataType":"static","dictionaryType":"","tipLabel":"","dragDisabled":false,"className":[],"label":"类型","trigger":"change","propsUrl":"","templateJson":[],"showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1721036412554,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","propsName":"","tag":"JnpfSelect","regList":[],"span":24},"options":[{"fullName":"园区","id":"1"},{"fullName":"区域","id":"2"},{"fullName":"空间","id":"3"}],"__vModel__":"type","style":{"width":"100%"},"disabled":false,"interfaceHasPage":false,"id":"type","placeholder":"请选择","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
const superQueryJson = [{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区编码","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区编码","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767684035,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":true,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"code","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"code","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区名称","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区名称","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767686366,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"name","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"name","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区描述","addonAfter":"","__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区描述","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686553,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"description","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"description","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"备注","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"备注","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686749,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"remark","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"remark","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"filterable":false,"clearable":true,"multiple":false,"fullName":"类型","props":{"label":"fullName","value":"id"},"__config__":{"formId":105,"visibility":["pc","app"],"jnpfKey":"select","defaultValue":"1","noShow":true,"dataType":"static","dictionaryType":"","tipLabel":"","dragDisabled":false,"className":[],"label":"类型","trigger":"change","propsUrl":"","templateJson":[],"showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1721036412554,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","propsName":"","tag":"JnpfSelect","regList":[],"span":24},"options":[{"fullName":"园区","id":"1"},{"fullName":"区域","id":"2"},{"fullName":"空间","id":"3"}],"__vModel__":"type","style":{"width":"100%"},"disabled":false,"interfaceHasPage":false,"id":"type","placeholder":"请选择","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
export default superQueryJson

@ -0,0 +1,149 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<jnpf-form-tip-item label="用户编码"
prop="userCode" >
<p>{{dataForm.userCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="用户名"
prop="userName" >
<p>{{dataForm.userName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="身份证号"
prop="idCard" >
<p>{{dataForm.idCard}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="联系电话"
prop="phone" >
<p>{{dataForm.phone}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="人员归属"
prop="userAscription" >
<p>{{ dataForm.userAscription }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="有效开始时间"
prop="effectiveStartTime" >
<p>{{dataForm.effectiveStartTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="有效结束时间"
prop="effectiveEndTime" >
<p>{{dataForm.effectiveEndTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="出入码"
prop="entryCodes" >
<p>{{dataForm.entryCodes}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="商户"
prop="merchantId" >
<p>{{dataForm.merchantId}}</p>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
userCode : '',
userName : '',
idCard : '',
phone : '',
userAscription : "1",
effectiveStartTime : '',
effectiveEndTime : '',
entryCodes : '',
merchantId : "",
},
userAscriptionOptions:[{"fullName":"商户","id":"1"},{"fullName":"公司","id":"2"}],
userAscriptionProps:{"label":"fullName","value":"id" },
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/Person/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,554 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' :'编辑'" :close-on-click-modal="false" append-to-body :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right">
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="8">
<jnpf-form-tip-item label="用户编码" prop="userCode">
<JnpfInput v-model="dataForm.userCode" @change="changeData('userCode',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="用户名" prop="userName">
<JnpfInput v-model="dataForm.userName" @change="changeData('userName',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="身份证号" prop="idCard">
<JnpfInput v-model="dataForm.idCard" @change="changeData('idCard',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="联系电话" prop="phone">
<JnpfInput v-model="dataForm.phone" @change="changeData('phone',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="人员归属" prop="userAscription">
<JnpfSelect v-model="dataForm.userAscription" @change="changeData('userAscription',-1)" placeholder="请选择"
clearable :style='{"width":"100%"}' :options="userAscriptionOptions" :props="userAscriptionProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="有效开始时间" prop="effectiveStartTime">
<JnpfDatePicker v-model="dataForm.effectiveStartTime" @change="changeData('effectiveStartTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="有效结束时间" prop="effectiveEndTime">
<JnpfDatePicker v-model="dataForm.effectiveEndTime" @change="changeData('effectiveEndTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="出入码" prop="entryCodes">
<JnpfInput v-model="dataForm.entryCodes" @change="changeData('entryCodes',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="归属部门" prop="merchantId" v-if="dataForm.userAscription == 2">
<JnpfDepSelect v-model="dataForm.merchantId" @change="depSelectChangeData" placeholder="请选择"
selectType="all" :ableIds="ableAll.merchantIdableIds" clearable :style='{"width":"100%"}'>
</JnpfDepSelect>
</jnpf-form-tip-item>
<jnpf-form-tip-item label="归属商户" prop="merchantId" v-if="dataForm.userAscription == 1">
<JnpfPopupSelect v-model="dataForm.merchantId" @change="selectChangeData" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.merchantId" placeholder="请选择" propsValue="id"
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='cmp_nm' field='merchantId'
interfaceId="582919057313895877" :pageSize="20" :columnOptions="merchantIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible=false" />
</el-row>
<span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id">
<el-button @click="prev" :disabled='prevDis'>
{{'上一条'}}
</el-button>
<el-button @click="next" :disabled='nextDis'>
{{'下一条'}}
</el-button>
</div>
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button>
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import {
getDefaultCurrentValueUserId
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentId
} from '@/api/permission/organize'
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime
} from '@/components/Generator/utils/index.js'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
export default {
components: {},
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting: {},
eventType: '',
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {},
//
ableAll: {},
tableRows: {},
Vmodel: "",
currVmodel: "",
dataForm: {
userCode: undefined,
userName: undefined,
idCard: undefined,
phone: undefined,
userAscription: "1",
effectiveStartTime: undefined,
effectiveEndTime: undefined,
entryCodes: undefined,
merchantId: undefined,
version: 0,
},
tableRequiredData: {},
dataRule: {
userCode: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
userName: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
idCard: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
phone: [{
required: true,
message: '请输入',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
message: '请输入正确的联系方式',
trigger: 'blur'
},
],
userAscription: [{
required: true,
message: '请至少选择一个',
trigger: 'change'
}, ],
effectiveStartTime: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
effectiveEndTime: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
entryCodes: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
},
userAscriptionOptions: [{
"fullName": "商户",
"id": "1"
}, {
"fullName": "公司",
"id": "2"
}],
userAscriptionProps: {
"label": "fullName",
"value": "id"
},
merchantIdcolumnOptions: [{
"label": "编码",
"value": "cmp_no"
}, {
"label": "名称",
"value": "cmp_nm"
}, ],
childIndex: -1,
isEdit: false,
interfaceRes: {
userCode: [],
userName: [],
idCard: [],
phone: [],
userAscription: [],
effectiveStartTime: [],
effectiveEndTime: [],
entryCodes: [],
merchantId: [],
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
selectChangeData(var1, var2){
this.dataForm.merchantId = var2.id;
this.dataForm.merchantName = var2.cmp_nm;
},
depSelectChangeData(var1, var2){
this.dataForm.merchantId = var2.id;
this.dataForm.merchantName = var2.fullName;
},
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/example/Person/' + id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if (this[options]) {
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll() {},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
}
} else {
this.prevDis = true
this.nextDis = true
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/example/Person/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData()
this.initDefaultData()
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
let _data = this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/example/Person',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
} else {
request({
url: '/api/example/Person/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex = -1
},
},
}
</script>

@ -0,0 +1,481 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="用户编码">
<el-input v-model="query.userCode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="用户名">
<el-input v-model="query.userName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' :span-method="arraySpanMethod">
<el-table-column prop="userCode" label="用户编码" align="left">
</el-table-column>
<el-table-column prop="userName" label="用户名" align="left">
</el-table-column>
<el-table-column prop="userAscription" label="归属" align="center" width="150">
<template slot-scope="scope">
<el-tag v-if="scope.row.userAscription == 1"></el-tag>
<el-tag type="success" v-else-if="scope.row.userAscription == 2">公司</el-tag>
</template>
</el-table-column>
<el-table-column prop="idCard" label="身份证号" align="left">
</el-table-column>
<el-table-column prop="phone" label="联系电话" align="left">
</el-table-column>
<el-table-column prop="merchantName" label="归属名称" align="left">
</el-table-column>
<el-table-column prop="effectiveStartTime" label="有效开始时间" align="left">
</el-table-column>
<el-table-column prop="effectiveEndTime" label="有效结束时间" align="left">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)">
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)">
</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" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getConfigData
} from '@/api/onlineDev/visualDev'
import {
getDefaultCurrentValueUserIdAsync
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentIdAsync
} from '@/api/permission/organize'
import columnList from './columnList'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
JNPFForm,
Detail,
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
return {
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
userCode: undefined,
userName: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
userAscriptionOptions: [{
"fullName": "商户",
"id": "1"
}, {
"fullName": "公司",
"id": "2"
}],
userAscriptionProps: {
"label": "fullName",
"value": "id"
},
interfaceRes: {
merchantId: [],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({
column
}) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '582897958719067077',
type: 1,
};
request({
url: `/api/example/Person/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/Person/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {});
},
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "example/Person")
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : ""
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({
url: `/api/example/Person/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,161 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<jnpf-form-tip-item label="车牌号"
prop="vehicleNumber" >
<p>{{dataForm.vehicleNumber}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="车辆类型"
prop="vehicleType" >
<p>{{ dataForm.vehicleType }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="车辆品牌"
prop="vehicleBrand" >
<p>{{dataForm.vehicleBrand}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="车辆颜色"
prop="vehicleColor" >
<p>{{dataForm.vehicleColor}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="联系人"
prop="contactsName" >
<p>{{dataForm.contactsName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="联系电话"
prop="contactsPhone" >
<p>{{dataForm.contactsPhone}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="车辆照片"
prop="vehiclePhotos" >
<JnpfUploadImg v-model="dataForm.vehiclePhotos"
disabled
detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" >
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="车辆归属"
prop="vehicleAscription" >
<p>{{ dataForm.vehicleAscription }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="归属"
prop="ascriptionId" >
<p>{{dataForm.ascriptionId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="归属名称"
prop="ascriptionName" >
<p>{{dataForm.ascriptionName}}</p>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
vehicleNumber : '',
vehicleType : "",
vehicleBrand : '',
vehicleColor : '',
contactsName : '',
contactsPhone : '',
vehiclePhotos : [],
vehicleAscription : "1",
ascriptionId : '',
ascriptionName : "",
},
vehicleTypeOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],
vehicleTypeProps:{"label":"fullName","value":"id" },
vehicleAscriptionOptions:[{"fullName":"商户","id":"1"},{"fullName":"公司","id":"2"}],
vehicleAscriptionProps:{"label":"fullName","value":"id" },
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/Vehicle/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,566 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' :'编辑'" :close-on-click-modal="false" append-to-body :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right">
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="8">
<jnpf-form-tip-item label="车牌号" prop="vehicleNumber">
<JnpfInput v-model="dataForm.vehicleNumber" @change="changeData('vehicleNumber',-1)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="车辆类型" prop="vehicleType">
<JnpfSelect v-model="dataForm.vehicleType" @change="changeData('vehicleType',-1)" placeholder="请选择"
clearable :style='{"width":"100%"}' :options="vehicleTypeOptions" :props="vehicleTypeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="车辆品牌" prop="vehicleBrand">
<JnpfInput v-model="dataForm.vehicleBrand" @change="changeData('vehicleBrand',-1)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="车辆颜色" prop="vehicleColor">
<JnpfInput v-model="dataForm.vehicleColor" @change="changeData('vehicleColor',-1)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="联系人" prop="contactsName">
<JnpfInput v-model="dataForm.contactsName" @change="changeData('contactsName',-1)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="联系电话" prop="contactsPhone">
<JnpfInput v-model="dataForm.contactsPhone" @change="changeData('contactsPhone',-1)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="车辆照片" prop="vehiclePhotos">
<JnpfUploadImg v-model="dataForm.vehiclePhotos" @change="changeData('vehiclePhotos',-1)" :fileSize="10"
sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0">
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="车辆归属" prop="vehicleAscription">
<JnpfSelect v-model="dataForm.vehicleAscription" @change="changeData('vehicleAscription',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="vehicleAscriptionOptions"
:props="vehicleAscriptionProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="归属部门" prop="ascriptionId" v-if="dataForm.vehicleAscription == 2">
<JnpfDepSelect v-model="dataForm.ascriptionId" @change="depSelectChangeData" placeholder="请选择"
selectType="all" :ableIds="ableAll.ascriptionIdableIds" clearable :style='{"width":"100%"}'>
</JnpfDepSelect>
</jnpf-form-tip-item>
<jnpf-form-tip-item label="归属商户" prop="ascriptionId" v-if="dataForm.vehicleAscription == 1">
<JnpfPopupSelect v-model="dataForm.ascriptionId" @change="selectChangeData" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.ascriptionName" placeholder="请选择" propsValue="id"
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='cmp_nm' field='ascriptionId'
interfaceId="582919057313895877" :pageSize="20" :columnOptions="ascriptionNamecolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible=false" />
</el-row>
<span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id">
<el-button @click="prev" :disabled='prevDis'>
{{'上一条'}}
</el-button>
<el-button @click="next" :disabled='nextDis'>
{{'下一条'}}
</el-button>
</div>
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button>
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import {
getDefaultCurrentValueUserId
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentId
} from '@/api/permission/organize'
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime
} from '@/components/Generator/utils/index.js'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
export default {
components: {},
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting: {},
eventType: '',
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {},
//
ableAll: {},
tableRows: {},
Vmodel: "",
currVmodel: "",
dataForm: {
vehicleNumber: undefined,
vehicleType: undefined,
vehicleBrand: undefined,
vehicleColor: undefined,
contactsName: undefined,
contactsPhone: undefined,
vehiclePhotos: [],
vehicleAscription: "1",
ascriptionId: undefined,
ascriptionName: undefined,
version: 0,
},
tableRequiredData: {},
dataRule: {
vehicleNumber: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
vehicleType: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
vehicleBrand: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
vehicleColor: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
contactsName: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
contactsPhone: [{
required: true,
message: '请输入',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
message: '请输入正确的联系方式',
trigger: 'blur'
},
],
ascriptionId: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
ascriptionName: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
},
vehicleTypeOptions: [{
"fullName": "选项一",
"id": "1"
}, {
"fullName": "选项二",
"id": "2"
}],
vehicleTypeProps: {
"label": "fullName",
"value": "id"
},
vehicleAscriptionOptions: [{
"fullName": "商户",
"id": "1"
}, {
"fullName": "公司",
"id": "2"
}],
vehicleAscriptionProps: {
"label": "fullName",
"value": "id"
},
ascriptionNamecolumnOptions: [{
"label": "编码",
"value": "cmp_no"
}, {
"label": "名称",
"value": "cmp_nm"
}, ],
childIndex: -1,
isEdit: false,
interfaceRes: {
vehicleNumber: [],
vehicleType: [],
vehicleBrand: [],
vehicleColor: [],
contactsName: [],
contactsPhone: [],
vehiclePhotos: [],
vehicleAscription: [],
ascriptionId: [],
ascriptionName: [],
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
selectChangeData(var1, var2){
this.dataForm.ascriptionId = var2.id;
this.dataForm.ascriptionName = var2.cmp_nm;
},
depSelectChangeData(var1, var2){
this.dataForm.ascriptionId = var2.id;
this.dataForm.ascriptionName = var2.fullName;
},
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/example/Vehicle/' + id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if (this[options]) {
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll() {},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
}
} else {
this.prevDis = true
this.nextDis = true
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/example/Vehicle/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData()
this.initDefaultData()
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
let _data = this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/example/Vehicle',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
} else {
request({
url: '/api/example/Vehicle/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex = -1
},
},
}
</script>

@ -0,0 +1,492 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="车牌号">
<el-input v-model="query.vehicleNumber" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="车辆类型">
<JnpfSelect v-model="query.vehicleType" placeholder="请选择" clearable :options="vehicleTypeOptions"
:props="vehicleTypeProps" 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" @click="addOrUpdateHandle()">
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' :span-method="arraySpanMethod">
<el-table-column prop="vehicleNumber" label="车牌号" align="left">
</el-table-column>
<el-table-column prop="vehicleType" label="车辆类型" align="center" width="150">
<template slot-scope="scope">
<el-tag v-if="scope.row.vehicleType == 1">1</el-tag>
<el-tag type="success" v-else-if="scope.row.vehicleType == 2">类型2</el-tag>
</template>
</el-table-column>
<el-table-column prop="vehicleBrand" label="车辆品牌" align="left">
</el-table-column>
<el-table-column prop="vehicleColor" label="车辆颜色" align="left">
</el-table-column>
<el-table-column prop="contactsName" label="联系人" align="left">
</el-table-column>
<el-table-column prop="contactsPhone" label="联系电话" align="left">
</el-table-column>
<el-table-column prop="ascriptionName" label="归属" align="left">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)">
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)">
</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" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getConfigData
} from '@/api/onlineDev/visualDev'
import {
getDefaultCurrentValueUserIdAsync
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentIdAsync
} from '@/api/permission/organize'
import columnList from './columnList'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
JNPFForm,
Detail,
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
return {
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
vehicleNumber: undefined,
vehicleType: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
vehicleTypeOptions: [{
"fullName": "选项一",
"id": "1"
}, {
"fullName": "选项二",
"id": "2"
}],
vehicleTypeProps: {
"label": "fullName",
"value": "id"
},
vehicleAscriptionOptions: [{
"fullName": "商户",
"id": "1"
}, {
"fullName": "公司",
"id": "2"
}],
vehicleAscriptionProps: {
"label": "fullName",
"value": "id"
},
interfaceRes: {
ascriptionName: [],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({
column
}) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '582912646513169797',
type: 1,
};
request({
url: `/api/example/Vehicle/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/Vehicle/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {});
},
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "example/Vehicle")
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : ""
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({
url: `/api/example/Vehicle/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save