feat():合同管理空间问题提交;

master
jiyufei 3 months ago
parent 25e6635588
commit 1e707e01db

@ -1,5 +1,8 @@
package jnpf.service;
import jnpf.model.contract.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.entity.ContractEntity;
import jnpf.entity.SpacecontractEntity;
@ -14,7 +17,7 @@ import java.util.List;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
* 2024-07-19
*/
public interface ContractService extends IService<ContractEntity> {
List<ContractEntity> getList(ContractPagination contractPagination);

@ -407,16 +407,17 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
@Override
public boolean update(String id, ContractEntity entity) {
return this.updateById(entity);
boolean result = this.updateById(entity);
if (result) {
CompletableFuture.runAsync(() -> spacecontractService.delData(entity.getContractNumber()));
}
return result;
}
@Override
public void delete(ContractEntity entity) {
if (entity != null) {
boolean result = this.removeById(entity.getId());
if (result) {
CompletableFuture.runAsync(() -> spacecontractService.delData(entity.getContractNumber()));
}
this.removeById(entity.getId());
}
}
@ -486,6 +487,11 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
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 "请输入正确的联系方式";
}
}
//子表字段验证
if (form.getSpacecontractList() != null) {
for (SpacecontractModel t : form.getSpacecontractList()) {
@ -547,13 +553,13 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
Map<String, ParkEntity> map = list.stream().collect(Collectors.toMap(ParkEntity::getId, Function.identity()));
List<SpacecontractEntity> tableField130 = JsonUtil.getJsonToList(contractForm.getSpacecontractList(), SpacecontractEntity.class);
int i = 1;
for (SpacecontractEntity entitys : tableField130) {
if (entitys.getSpaceId().contains(",")) {
String spaceId;
spaceId = entitys.getSpaceId().substring(1, entitys.getSpaceId().length() - 1).replaceAll("\"", "");
String[] numbers = spaceId.split(",");
entitys.setSpaceId(numbers[numbers.length - 1].trim());
//假如选择了相同的空间 后端直接去重
List<SpacecontractEntity> list1 = tableField130.stream().collect(Collectors.toMap(SpacecontractEntity::getSpaceId, obj -> obj, (o1, o2) -> o1)).values().stream().collect(Collectors.toList());
for (SpacecontractEntity entitys : list1) {
if (StringUtils.isBlank(entitys.getSpaceId())) {
continue;
}
entitys.setContractName(contractForm.getContractName());
entitys.setId(RandomUtil.uuId());
entitys.setContractNumber(entity.getContractNumber());
entitys.setContractLineNumber(String.valueOf(i));

@ -29,7 +29,7 @@ import java.util.stream.Collectors;
* 2024-07-16
*/
@Service
public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, SpacecontractEntity> implements SpacecontractService {
public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, SpacecontractEntity> implements SpacecontractService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@ -50,14 +50,14 @@ public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, S
//子表过滤方法
@Override
public QueryWrapper<SpacecontractEntity> getChild(ContractPagination pagination, QueryWrapper<SpacecontractEntity> spacecontractQueryWrapper) {
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) {
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;
}

@ -48,7 +48,7 @@ import java.util.*;
*/
@Slf4j
@RestController
@Tag(name = "Contract", description = "example")
@Tag(name = "Contract" , description = "example")
@RequestMapping("/api/example/Contract")
public class ContractController {
@ -76,9 +76,9 @@ public class ContractController {
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody ContractPagination contractPagination) throws IOException {
List<ContractEntity> list = contractService.getList(contractPagination);
List<Map<String, Object>> realList = new ArrayList<>();
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"));
@ -89,7 +89,7 @@ public class ContractController {
realList.add(contractMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(), false);
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
@ -98,7 +98,6 @@ public class ContractController {
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
@ -108,18 +107,17 @@ public class ContractController {
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid ContractForm contractForm) {
String b = contractService.checkForm(contractForm, 0);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
String b = contractService.checkForm(contractForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try {
contractService.saveOrUpdate(contractForm, null, true);
} catch (Exception e) {
try{
contractService.saveOrUpdate(contractForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
@ -128,11 +126,11 @@ public class ContractController {
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody ContractPagination contractPagination) throws IOException {
if (StringUtil.isEmpty(contractPagination.getSelectKey())) {
if (StringUtil.isEmpty(contractPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<ContractEntity> list = contractService.getList(contractPagination);
List<Map<String, Object>> realList = new ArrayList<>();
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"));
@ -143,98 +141,98 @@ public class ContractController {
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);
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);
}
/**
*
*/
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");
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"));
for(String key:keys){
switch(key){
case "contractNumber" :
entitys.add(new ExcelExportEntity("合同编号" ,"contractNumber"));
break;
case "contractName":
entitys.add(new ExcelExportEntity("合同名称", "contractName"));
case "contractName" :
entitys.add(new ExcelExportEntity("合同名称" ,"contractName"));
break;
case "pricingMethod":
entitys.add(new ExcelExportEntity("计价方式", "pricingMethod"));
case "pricingMethod" :
entitys.add(new ExcelExportEntity("计价方式" ,"pricingMethod"));
break;
case "signingDate":
entitys.add(new ExcelExportEntity("签订日期", "signingDate"));
case "signingDate" :
entitys.add(new ExcelExportEntity("签订日期" ,"signingDate"));
break;
case "parkId":
entitys.add(new ExcelExportEntity("园区名称", "parkId"));
case "parkId" :
entitys.add(new ExcelExportEntity("园区名称" ,"parkId"));
break;
case "merchantId":
entitys.add(new ExcelExportEntity("商户名称", "merchantId"));
case "merchantId" :
entitys.add(new ExcelExportEntity("商户名称" ,"merchantId"));
break;
case "totalRentalPrice":
entitys.add(new ExcelExportEntity("租金总价", "totalRentalPrice"));
case "totalRentalPrice" :
entitys.add(new ExcelExportEntity("租金总价" ,"totalRentalPrice"));
break;
case "totalDeposit":
entitys.add(new ExcelExportEntity("押金总计", "totalDeposit"));
case "totalDeposit" :
entitys.add(new ExcelExportEntity("押金总计" ,"totalDeposit"));
break;
case "payDeposit":
entitys.add(new ExcelExportEntity("支付方式", "payDeposit"));
case "payDeposit" :
entitys.add(new ExcelExportEntity("支付方式" ,"payDeposit"));
break;
case "returnDeposit":
entitys.add(new ExcelExportEntity("退还方式", "returnDeposit"));
case "returnDeposit" :
entitys.add(new ExcelExportEntity("退还方式" ,"returnDeposit"));
break;
case "startTime":
entitys.add(new ExcelExportEntity("开始时间", "startTime"));
case "startTime" :
entitys.add(new ExcelExportEntity("开始时间" ,"startTime"));
break;
case "endTime":
entitys.add(new ExcelExportEntity("结束时间", "endTime"));
case "endTime" :
entitys.add(new ExcelExportEntity("结束时间" ,"endTime"));
break;
case "leaseTerm":
entitys.add(new ExcelExportEntity("租期", "leaseTerm"));
case "leaseTerm" :
entitys.add(new ExcelExportEntity("租期" ,"leaseTerm"));
break;
case "contacts":
entitys.add(new ExcelExportEntity("联系人", "contacts"));
case "contacts" :
entitys.add(new ExcelExportEntity("联系人" ,"contacts"));
break;
case "contactsPhone":
entitys.add(new ExcelExportEntity("联系电话", "contactsPhone"));
case "contactsPhone" :
entitys.add(new ExcelExportEntity("联系电话" ,"contactsPhone"));
break;
case "contractStatus":
entitys.add(new ExcelExportEntity("合同状态", "contractStatus"));
case "contractStatus" :
entitys.add(new ExcelExportEntity("合同状态" ,"contractStatus"));
break;
case "creationTime":
entitys.add(new ExcelExportEntity("创建时间", "creationTime"));
case "creationTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creationTime"));
break;
case "contractExplain":
entitys.add(new ExcelExportEntity("合同说明", "contractExplain"));
case "contractExplain" :
entitys.add(new ExcelExportEntity("合同说明" ,"contractExplain"));
break;
case "contractEnclosure":
entitys.add(new ExcelExportEntity("合同附件", "contractEnclosure"));
case "contractEnclosure" :
entitys.add(new ExcelExportEntity("合同附件" ,"contractEnclosure"));
break;
case "tableField130-contractLineNumber":
tableField130List.add(new ExcelExportEntity("合同行号", "contractLineNumber"));
tableField130List.add(new ExcelExportEntity("合同行号" ,"contractLineNumber"));
break;
case "tableField130-spaceId":
tableField130List.add(new ExcelExportEntity("空间名称", "spaceId"));
tableField130List.add(new ExcelExportEntity("空间名称" ,"spaceId"));
break;
case "tableField130-spaceArea":
tableField130List.add(new ExcelExportEntity("空间面积", "spaceArea"));
tableField130List.add(new ExcelExportEntity("空间面积" ,"spaceArea"));
break;
case "tableField130-totalRentalPrice":
tableField130List.add(new ExcelExportEntity("租金总价", "totalRentalPrice"));
tableField130List.add(new ExcelExportEntity("租金总价" ,"totalRentalPrice"));
break;
default:
break;
}
}
if (tableField130List.size() > 0) {
if(tableField130List.size() > 0){
tableField130ExcelEntity.setList(tableField130List);
entitys.add(tableField130ExcelEntity);
}
@ -242,10 +240,10 @@ public class ContractController {
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try {
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size() > 0) {
if (list.size() == 0) {
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//去除空数据
@ -255,8 +253,8 @@ public class ContractController {
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-"));
String field = key.substring(key.indexOf("-") + 1);
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;
@ -299,72 +297,66 @@ public class ContractController {
}
return vo;
}
/**
*
*
* @param id
* @param contractForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ContractForm contractForm,
@RequestParam(value = "isImport", required = false) boolean isImport) {
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);
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) {
ContractEntity entity= contractService.getInfo(id);
if(entity!=null){
try{
contractService.saveOrUpdate(contractForm,id,false);
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
} else {
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id) {
ContractEntity entity = contractService.getInfo(id);
if (entity != null) {
public ActionResult delete(@PathVariable("id") String id){
ContractEntity entity= contractService.getInfo(id);
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) {
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);
Map<String, Object> contractMap=JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id"));
//副表数据
//子表数据
@ -373,22 +365,20 @@ public class ContractController {
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) {
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);
Map<String, Object> contractMap=JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id"));
//副表数据
//子表数据

@ -15,114 +15,70 @@ import java.util.List;
*/
@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("merchantId")
private Object merchantId;
/**
*
**/
/** 租金总价 **/
@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;
}

@ -23,8 +23,7 @@ public class SpacecontractModel {
private String contractLineNumber;
/** 空间名称 **/
@JSONField(name = "spaceId")
private Object spaceId;
private String spaceId;
/** 空间面积 **/
@JSONField(name = "spaceArea")
private String spaceArea;

@ -1,116 +1,136 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<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="详情" />
<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">
<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>
<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>
<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">
<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>
<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="parkName">
<p>{{ dataForm.parkName }}</p>
<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="merchantId">
<p>{{ dataForm.merchantId }}</p>
<el-col :span="8" >
<jnpf-form-tip-item label="商户名称"
prop="merchantId" >
<p>{{dataForm.merchantId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="租金总价" prop="totalRentalPrice">
<p>{{ dataForm.totalRentalPrice }}</p>
<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>
<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">
<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">
<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>
<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>
<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>
<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>
<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>
<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">
<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>
<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="点击上传">
<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">
<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 :data="dataForm.tableField130" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="contractLineNumber" label="合同行号">
<el-table-column prop="contractLineNumber" label="合同行号" >
<template slot="header">
合同行号
<span slot="label">
@ -120,42 +140,42 @@
</span>
</template>
<template slot-scope="scope">
<p>{{ scope.row.contractLineNumber }}</p>
<p>{{scope.row.contractLineNumber}}</p>
</template>
</el-table-column>
<el-table-column prop="spaceId" label="空间名称">
<el-table-column prop="spaceId" label="空间名称" >
<template slot-scope="scope">
<p>{{ scope.row.spaceId }}</p>
<p>{{scope.row.spaceId}}</p>
</template>
</el-table-column>
<el-table-column prop="spaceArea" label="空间面积">
<el-table-column prop="spaceArea" label="空间面积" >
<template slot-scope="scope">
<p>{{ scope.row.spaceArea }}</p>
<p>{{scope.row.spaceArea}}</p>
</template>
</el-table-column>
<el-table-column prop="totalRentalPrice" label="租金总价">
<el-table-column prop="totalRentalPrice" label="租金总价" >
<template slot-scope="scope">
<p>{{ scope.row.totalRentalPrice }}</p>
<p>{{scope.row.totalRentalPrice}}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-form>
</el-row>
</div>
</transition>
</transition>
</template>
<script>
import request from '@/utils/request'
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 },
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 {
@ -164,40 +184,39 @@ export default {
loading: false,
dataForm: {
id: '',
contractNumber: '',
contractName: '',
pricingMethod: "",
signingDate: '',
parkId: "",
merchantId: "",
totalRentalPrice: "",
totalDeposit: '',
payDeposit: "",
returnDeposit: "",
startTime: '',
endTime: '',
leaseTerm: '',
contacts: '',
contactsPhone: '',
contractStatus: "10",
creationTime: "",
contractExplain: '',
contractEnclosure: [],
spacecontractList: [],
id :'',
contractNumber : '',
contractName : '',
pricingMethod : "",
signingDate : '',
parkId : "",
merchantId : "",
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": "name", "value": "code" },
merchantIdProps: { "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" },
pricingMethodOptions:[{"fullName":"月付","id":"1"},{"fullName":"季付","id":"2"},{"fullName":"年付","id":"3"}],
pricingMethodProps:{"label":"fullName","value":"id" },
parkIdProps:{"label":"name","value":"code" },
merchantIdProps:{"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" },
spaceIdProps: { "label": "name", "value": "id", "children": "children" },
}
},
computed: {},
@ -205,7 +224,7 @@ export default {
created() {
},
mounted() { },
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
@ -219,8 +238,8 @@ export default {
})
})
},
dataInfo(dataAll) {
let _dataAll = dataAll
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
@ -231,10 +250,10 @@ export default {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/Contract/detail/' + this.dataForm.id,
url: '/api/example/Contract/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
@ -245,6 +264,6 @@ export default {
})
},
},
}
}
</script>

@ -74,10 +74,10 @@
</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)"
<jnpf-form-tip-item label="商户名称" prop="merchantId">
<JnpfSelect v-model="dataForm.merchantId" @change="changeData('merchantId', -1)"
placeholder="请选择" clearable :style='{ "width": "100%" }' filterable
:options="merchantNameOptions" :props="merchantNameProps">
:options="merchantIdOptions" :props="merchantIdProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
@ -201,19 +201,19 @@
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="空间名称" prop="spaceName">
<el-table-column label="空间名称" prop="spaceId">
<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)"
<JnpfPopupSelect v-model="scope.row.spaceId"
@change="changeData('spacecontract-spaceId', 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
:templateJson="interfaceRes.spacecontractspaceId" placeholder="请选择空间"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' :field="'spaceId' + scope.$index"
interfaceId="584015452494104389" :pageSize="20"
:columnOptions="spacecontractspaceIdcolumnOptions" clearable
:style='{ "width": "100%" }'>
</JnpfPopupSelect>
</template>
@ -225,7 +225,7 @@
<template slot-scope="scope">
<JnpfInput v-model="scope.row.spaceArea"
@change="changeData('spacecontract-spaceArea', scope.$index)"
placeholder="请输入空间面积" disabled clearable :style='{ "width": "100%" }'>
placeholder="选择空间自动生成" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
@ -303,8 +303,8 @@ export default {
spacecontractList: {
contractLineNumber: '',
contractLineNumberOptions: [],
spaceName: '',
spaceNameOptions: [],
spaceId: '',
spaceIdOptions: [],
spaceArea: '',
spaceAreaOptions: [],
totalRentalPrice: '',
@ -320,7 +320,7 @@ export default {
pricingMethod: undefined,
signingDate: undefined,
parkId: undefined,
merchantName: undefined,
merchantId: undefined,
totalRentalPrice: undefined,
totalDeposit: undefined,
payDeposit: undefined,
@ -368,7 +368,7 @@ export default {
trigger: 'change'
},
],
merchantName: [
merchantId: [
{
required: true,
message: '请选择',
@ -416,7 +416,7 @@ export default {
startTime: [
{
required: true,
message: '请选择',
message: '请选择开始时间',
trigger: 'change'
},
],
@ -467,16 +467,16 @@ export default {
pricingMethodOptions: [{ "fullName": "月付", "id": "1" }, { "fullName": "季付", "id": "2" }, { "fullName": "年付", "id": "3" }],
pricingMethodProps: { "label": "fullName", "value": "id" },
parkIdOptions: [],
parkIdProps: { "label": "name", "value": "id" },
merchantNameOptions: [],
merchantNameProps: { "label": "cmp_nm", "value": "id" },
parkIdProps: { "label": "name", "value": "code" },
merchantIdOptions: [],
merchantIdProps: { "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" }],
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" },],
spacecontractspaceIdcolumnOptions: [{ "label": "空间名称", "value": "name" }, { "label": "园区名称", "value": "park_name" }, { "label": "区域名称", "value": "area_name" },],
childIndex: -1,
isEdit: false,
interfaceRes: {
@ -485,7 +485,7 @@ export default {
pricingMethod: [],
signingDate: [],
parkId: [],
merchantName: [],
merchantId: [],
totalRentalPrice: [],
totalDeposit: [],
payDeposit: [],
@ -500,7 +500,7 @@ export default {
contractExplain: [],
contractEnclosure: [],
spacecontractcontractLineNumber: [],
spacecontractspaceName: [],
spacecontractspaceId: [],
spacecontractspaceArea: [],
spacecontracttotalRentalPrice: [],
},
@ -625,7 +625,7 @@ export default {
},
dataAll() {
this.getparkIdOptions();
this.getmerchantNameOptions();
this.getmerchantIdOptions();
},
spacecontractExist() {
let isOk = true;
@ -674,9 +674,9 @@ export default {
this.changeDataFormData(1, 'parkId', 'parkId', index, '')
})
},
getmerchantNameOptions() {
getmerchantIdOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.merchantName))
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.merchantId))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if (json.relationField) {
@ -695,8 +695,8 @@ export default {
}
getDataInterfaceRes('582842667524685829', template).then(res => {
let data = res.data
this.merchantNameOptions = data
this.changeDataFormData(1, 'merchantName', 'merchantName', index, '')
this.merchantIdOptions = data
this.changeDataFormData(1, 'merchantId', 'merchantId', index, '')
})
},
goBack() {
@ -815,7 +815,7 @@ export default {
addspacecontractList() {
let item = {
contractLineNumber: undefined,
spaceName: '',
spaceId: '',
spaceArea: undefined,
totalRentalPrice: undefined,
}

@ -96,7 +96,7 @@
{{ scope.row.contractStatus }}
</template>
</el-table-column>
<el-table-column prop="parkName" label="园区名称" align="left">
<el-table-column prop="parkId" label="园区名称" align="left">
</el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="left">
</el-table-column>
@ -262,9 +262,9 @@ export default {
returnDepositProps: { "label": "fullName", "value": "id" },
contractStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已结案", "id": "30" }, { "fullName": "合同变更", "id": "21" }],
contractStatusProps: { "label": "fullName", "value": "id" },
tableField130_spaceIdOptions: [],
tableField130_spaceIdProps: { "label": "name", "value": "id", "children": "children" },
tableField130_spaceIdcolumnOptions: [{ "label": "空间名称", "value": "name" }, { "label": "园区名称", "value": "park_name" }, { "label": "区域名称", "value": "area_name" },],
interfaceRes: {
tableField130_spaceId: [],
},
}
},

Loading…
Cancel
Save