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

master
jiyufei 3 months ago
parent 25e6635588
commit 1e707e01db

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

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

@ -29,7 +29,7 @@ import java.util.stream.Collectors;
* 2024-07-16 * 2024-07-16
*/ */
@Service @Service
public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, SpacecontractEntity> implements SpacecontractService { public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, SpacecontractEntity> implements SpacecontractService{
@Autowired @Autowired
private GeneraterSwapUtil generaterSwapUtil; private GeneraterSwapUtil generaterSwapUtil;
@ -50,14 +50,14 @@ public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, S
//子表过滤方法 //子表过滤方法
@Override @Override
public QueryWrapper<SpacecontractEntity> getChild(ContractPagination pagination, QueryWrapper<SpacecontractEntity> spacecontractQueryWrapper) { public QueryWrapper<SpacecontractEntity> getChild(ContractPagination pagination, QueryWrapper<SpacecontractEntity> spacecontractQueryWrapper){
boolean pcPermission = false; boolean pcPermission = false;
boolean appPermission = false; boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc ? ContractConstant.getColumnData() : ContractConstant.getAppColumnData(); String ruleQueryJson = isPc?ContractConstant.getColumnData():ContractConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson, ColumnDataModel.class); ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc ? JsonUtil.getObjectToString(dataModel.getRuleList()) : JsonUtil.getObjectToString(dataModel.getRuleListApp()); String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if (isPc) { if(isPc){
} }
return spacecontractQueryWrapper; return spacecontractQueryWrapper;
} }

@ -48,7 +48,7 @@ import java.util.*;
*/ */
@Slf4j @Slf4j
@RestController @RestController
@Tag(name = "Contract", description = "example") @Tag(name = "Contract" , description = "example")
@RequestMapping("/api/example/Contract") @RequestMapping("/api/example/Contract")
public class ContractController { public class ContractController {
@ -69,16 +69,16 @@ public class ContractController {
private ConfigValueUtil configValueUtil; private ConfigValueUtil configValueUtil;
/** /**
* *
* *
* @param contractPagination * @param contractPagination
* @return * @return
*/ */
@Operation(summary = "获取列表") @Operation(summary = "获取列表")
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody ContractPagination contractPagination) throws IOException { public ActionResult list(@RequestBody ContractPagination contractPagination)throws IOException{
List<ContractEntity> list = contractService.getList(contractPagination); List<ContractEntity> list= contractService.getList(contractPagination);
List<Map<String, Object>> realList = new ArrayList<>(); List<Map<String, Object>> realList=new ArrayList<>();
for (ContractEntity entity : list) { for (ContractEntity entity : list) {
Map<String, Object> contractMap = JsonUtil.entityToMap(entity); Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id")); contractMap.put("id", contractMap.get("id"));
@ -89,7 +89,7 @@ public class ContractController {
realList.add(contractMap); 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(); PageListVO vo = new PageListVO();
@ -98,41 +98,39 @@ public class ContractController {
vo.setPagination(page); vo.setPagination(page);
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
* *
* @param contractForm * @param contractForm
* @return * @return
*/ */
@PostMapping() @PostMapping()
@Operation(summary = "创建") @Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid ContractForm contractForm) { public ActionResult create(@RequestBody @Valid ContractForm contractForm) {
String b = contractService.checkForm(contractForm, 0); String b = contractService.checkForm(contractForm,0);
if (StringUtil.isNotEmpty(b)) { if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b); return ActionResult.fail(b );
} }
try { try{
contractService.saveOrUpdate(contractForm, null, true); contractService.saveOrUpdate(contractForm, null ,true);
} catch (Exception e) { }catch(Exception e){
return ActionResult.fail("新增数据失败"); return ActionResult.fail("新增数据失败");
} }
return ActionResult.success("创建成功"); return ActionResult.success("创建成功");
} }
/** /**
* Excel * Excel
* *
* @return * @return
*/ */
@Operation(summary = "导出Excel") @Operation(summary = "导出Excel")
@PostMapping("/Actions/Export") @PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody ContractPagination contractPagination) throws IOException { public ActionResult Export(@RequestBody ContractPagination contractPagination) throws IOException {
if (StringUtil.isEmpty(contractPagination.getSelectKey())) { if (StringUtil.isEmpty(contractPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段"); return ActionResult.fail("请选择导出字段");
} }
List<ContractEntity> list = contractService.getList(contractPagination); List<ContractEntity> list= contractService.getList(contractPagination);
List<Map<String, Object>> realList = new ArrayList<>(); List<Map<String, Object>> realList=new ArrayList<>();
for (ContractEntity entity : list) { for (ContractEntity entity : list) {
Map<String, Object> contractMap = JsonUtil.entityToMap(entity); Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id")); contractMap.put("id", contractMap.get("id"));
@ -143,98 +141,98 @@ public class ContractController {
realList.add(contractMap); 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);
String[] keys = !StringUtil.isEmpty(contractPagination.getSelectKey()) ? contractPagination.getSelectKey() : new String[0]; String[]keys=!StringUtil.isEmpty(contractPagination.getSelectKey())?contractPagination.getSelectKey():new String[0];
UserInfo userInfo = userProvider.get(); UserInfo userInfo=userProvider.get();
DownloadVO vo = this.creatModelExcel(configValueUtil.getTemporaryFilePath(), realList, keys, userInfo); DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
*/ */
public DownloadVO creatModelExcel(String path, List<Map<String, Object>> list, String[] keys, UserInfo userInfo) { public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo = DownloadVO.builder().build(); DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys = new ArrayList<>(); List<ExcelExportEntity> entitys=new ArrayList<>();
if (keys.length > 0) { if(keys.length>0){
ExcelExportEntity tableField130ExcelEntity = new ExcelExportEntity("空间列表", "tableField130"); ExcelExportEntity tableField130ExcelEntity = new ExcelExportEntity("空间列表","tableField130");
List<ExcelExportEntity> tableField130List = new ArrayList<>(); List<ExcelExportEntity> tableField130List = new ArrayList<>();
for (String key : keys) { for(String key:keys){
switch (key) { switch(key){
case "contractNumber": case "contractNumber" :
entitys.add(new ExcelExportEntity("合同编号", "contractNumber")); entitys.add(new ExcelExportEntity("合同编号" ,"contractNumber"));
break; break;
case "contractName": case "contractName" :
entitys.add(new ExcelExportEntity("合同名称", "contractName")); entitys.add(new ExcelExportEntity("合同名称" ,"contractName"));
break; break;
case "pricingMethod": case "pricingMethod" :
entitys.add(new ExcelExportEntity("计价方式", "pricingMethod")); entitys.add(new ExcelExportEntity("计价方式" ,"pricingMethod"));
break; break;
case "signingDate": case "signingDate" :
entitys.add(new ExcelExportEntity("签订日期", "signingDate")); entitys.add(new ExcelExportEntity("签订日期" ,"signingDate"));
break; break;
case "parkId": case "parkId" :
entitys.add(new ExcelExportEntity("园区名称", "parkId")); entitys.add(new ExcelExportEntity("园区名称" ,"parkId"));
break; break;
case "merchantId": case "merchantId" :
entitys.add(new ExcelExportEntity("商户名称", "merchantId")); entitys.add(new ExcelExportEntity("商户名称" ,"merchantId"));
break; break;
case "totalRentalPrice": case "totalRentalPrice" :
entitys.add(new ExcelExportEntity("租金总价", "totalRentalPrice")); entitys.add(new ExcelExportEntity("租金总价" ,"totalRentalPrice"));
break; break;
case "totalDeposit": case "totalDeposit" :
entitys.add(new ExcelExportEntity("押金总计", "totalDeposit")); entitys.add(new ExcelExportEntity("押金总计" ,"totalDeposit"));
break; break;
case "payDeposit": case "payDeposit" :
entitys.add(new ExcelExportEntity("支付方式", "payDeposit")); entitys.add(new ExcelExportEntity("支付方式" ,"payDeposit"));
break; break;
case "returnDeposit": case "returnDeposit" :
entitys.add(new ExcelExportEntity("退还方式", "returnDeposit")); entitys.add(new ExcelExportEntity("退还方式" ,"returnDeposit"));
break; break;
case "startTime": case "startTime" :
entitys.add(new ExcelExportEntity("开始时间", "startTime")); entitys.add(new ExcelExportEntity("开始时间" ,"startTime"));
break; break;
case "endTime": case "endTime" :
entitys.add(new ExcelExportEntity("结束时间", "endTime")); entitys.add(new ExcelExportEntity("结束时间" ,"endTime"));
break; break;
case "leaseTerm": case "leaseTerm" :
entitys.add(new ExcelExportEntity("租期", "leaseTerm")); entitys.add(new ExcelExportEntity("租期" ,"leaseTerm"));
break; break;
case "contacts": case "contacts" :
entitys.add(new ExcelExportEntity("联系人", "contacts")); entitys.add(new ExcelExportEntity("联系人" ,"contacts"));
break; break;
case "contactsPhone": case "contactsPhone" :
entitys.add(new ExcelExportEntity("联系电话", "contactsPhone")); entitys.add(new ExcelExportEntity("联系电话" ,"contactsPhone"));
break; break;
case "contractStatus": case "contractStatus" :
entitys.add(new ExcelExportEntity("合同状态", "contractStatus")); entitys.add(new ExcelExportEntity("合同状态" ,"contractStatus"));
break; break;
case "creationTime": case "creationTime" :
entitys.add(new ExcelExportEntity("创建时间", "creationTime")); entitys.add(new ExcelExportEntity("创建时间" ,"creationTime"));
break; break;
case "contractExplain": case "contractExplain" :
entitys.add(new ExcelExportEntity("合同说明", "contractExplain")); entitys.add(new ExcelExportEntity("合同说明" ,"contractExplain"));
break; break;
case "contractEnclosure": case "contractEnclosure" :
entitys.add(new ExcelExportEntity("合同附件", "contractEnclosure")); entitys.add(new ExcelExportEntity("合同附件" ,"contractEnclosure"));
break; break;
case "tableField130-contractLineNumber": case "tableField130-contractLineNumber":
tableField130List.add(new ExcelExportEntity("合同行号", "contractLineNumber")); tableField130List.add(new ExcelExportEntity("合同行号" ,"contractLineNumber"));
break; break;
case "tableField130-spaceId": case "tableField130-spaceId":
tableField130List.add(new ExcelExportEntity("空间名称", "spaceId")); tableField130List.add(new ExcelExportEntity("空间名称" ,"spaceId"));
break; break;
case "tableField130-spaceArea": case "tableField130-spaceArea":
tableField130List.add(new ExcelExportEntity("空间面积", "spaceArea")); tableField130List.add(new ExcelExportEntity("空间面积" ,"spaceArea"));
break; break;
case "tableField130-totalRentalPrice": case "tableField130-totalRentalPrice":
tableField130List.add(new ExcelExportEntity("租金总价", "totalRentalPrice")); tableField130List.add(new ExcelExportEntity("租金总价" ,"totalRentalPrice"));
break; break;
default: default:
break; break;
} }
} }
if (tableField130List.size() > 0) { if(tableField130List.size() > 0){
tableField130ExcelEntity.setList(tableField130List); tableField130ExcelEntity.setList(tableField130List);
entitys.add(tableField130ExcelEntity); entitys.add(tableField130ExcelEntity);
} }
@ -242,10 +240,10 @@ public class ContractController {
ExportParams exportParams = new ExportParams(null, "表单信息"); ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF); exportParams.setType(ExcelType.XSSF);
try { try{
@Cleanup Workbook workbook = new HSSFWorkbook(); @Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size() > 0) { if (entitys.size()>0){
if (list.size() == 0) { if (list.size()==0){
list.add(new HashMap<>()); list.add(new HashMap<>());
} }
//去除空数据 //去除空数据
@ -255,8 +253,8 @@ public class ContractController {
for (String key : keys) { for (String key : keys) {
//子表 //子表
if (key.toLowerCase().startsWith("tablefield")) { if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-")); String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-") + 1); String field = key.substring(key.indexOf("-" ) + 1);
Object o = map.get(tableField); Object o = map.get(tableField);
if (o != null) { if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o; List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
@ -282,7 +280,7 @@ public class ContractController {
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList(); List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList); entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList); dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
} }
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
@ -299,72 +297,66 @@ public class ContractController {
} }
return vo; return vo;
} }
/** /**
* *
* * @param id
* @param id * @param contractForm
* @param contractForm * @return
* @return */
*/
@PutMapping("/{id}") @PutMapping("/{id}")
@Operation(summary = "更新") @Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ContractForm contractForm, public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid ContractForm contractForm,
@RequestParam(value = "isImport", required = false) boolean isImport) { @RequestParam(value = "isImport", required = false) boolean isImport){
contractForm.setId(id); contractForm.setId(id);
if (!isImport) { if (!isImport) {
String b = contractService.checkForm(contractForm, 1); String b = contractService.checkForm(contractForm,1);
if (StringUtil.isNotEmpty(b)) { if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b); return ActionResult.fail(b );
} }
} }
ContractEntity entity = contractService.getInfo(id); ContractEntity entity= contractService.getInfo(id);
if (entity != null) { if(entity!=null){
try { try{
contractService.saveOrUpdate(contractForm, id, false); contractService.saveOrUpdate(contractForm,id,false);
} catch (Exception e) { }catch(Exception e){
return ActionResult.fail("修改数据失败"); return ActionResult.fail("修改数据失败");
} }
return ActionResult.success("更新成功"); return ActionResult.success("更新成功");
} else { }else{
return ActionResult.fail("更新失败,数据不存在"); return ActionResult.fail("更新失败,数据不存在");
} }
} }
/** /**
* *
* * @param id
* @param id * @return
* @return */
*/
@Operation(summary = "删除") @Operation(summary = "删除")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Transactional @Transactional
public ActionResult delete(@PathVariable("id") String id) { public ActionResult delete(@PathVariable("id") String id){
ContractEntity entity = contractService.getInfo(id); ContractEntity entity= contractService.getInfo(id);
if (entity != null) { if(entity!=null){
//假删除 //假删除
entity.setDeleteMark(1); entity.setDeleteMark(1);
contractService.update(id, entity); contractService.update(id, entity);
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");
} }
/** /**
* () * ()
* 使- * 使-
* * @param id
* @param id * @return
* @return */
*/
@Operation(summary = "表单信息(详情页)") @Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id) { public ActionResult detailInfo(@PathVariable("id") String id){
ContractEntity entity = contractService.getInfo(id); ContractEntity entity= contractService.getInfo(id);
if (entity == null) { if(entity==null){
return ActionResult.fail("表单数据不存在!"); return ActionResult.fail("表单数据不存在!");
} }
Map<String, Object> contractMap = JsonUtil.entityToMap(entity); Map<String, Object> contractMap=JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id")); contractMap.put("id", contractMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
@ -373,22 +365,20 @@ public class ContractController {
contractMap = generaterSwapUtil.swapDataDetail(contractMap, ContractConstant.getFormData(), "582839350958489605", false); contractMap = generaterSwapUtil.swapDataDetail(contractMap, ContractConstant.getFormData(), "582839350958489605", false);
return ActionResult.success(contractMap); return ActionResult.success(contractMap);
} }
/** /**
* () * ()
* 使- * 使-
* * @param id
* @param id * @return
* @return */
*/
@Operation(summary = "信息") @Operation(summary = "信息")
@GetMapping("/{id}") @GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id) { public ActionResult info(@PathVariable("id") String id){
ContractEntity entity = contractService.getInfo(id); ContractEntity entity= contractService.getInfo(id);
if (entity == null) { if(entity==null){
return ActionResult.fail("表单数据不存在!"); return ActionResult.fail("表单数据不存在!");
} }
Map<String, Object> contractMap = JsonUtil.entityToMap(entity); Map<String, Object> contractMap=JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id")); contractMap.put("id", contractMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据

@ -14,115 +14,71 @@ import java.util.List;
* @ 2024-07-19 * @ 2024-07-19
*/ */
@Data @Data
public class ContractForm { public class ContractForm {
/** /** 主键 */
*
*/
private String id; private String id;
/** /** 子表数据 **/
*
**/
@JsonProperty("spacecontractList") @JsonProperty("spacecontractList")
private List<SpacecontractModel> spacecontractList; private List<SpacecontractModel> spacecontractList;
/** /** 乐观锁 **/
*
**/
@JsonProperty("version") @JsonProperty("version")
private Integer version; private Integer version;
/** /** 合同编号 **/
*
**/
@JsonProperty("contractNumber") @JsonProperty("contractNumber")
private String contractNumber; private String contractNumber;
/** /** 合同名称 **/
*
**/
@JsonProperty("contractName") @JsonProperty("contractName")
private String contractName; private String contractName;
/** /** 计价方式 **/
*
**/
@JsonProperty("pricingMethod") @JsonProperty("pricingMethod")
private Object pricingMethod; private Object pricingMethod;
/** /** 签订日期 **/
*
**/
@JsonProperty("signingDate") @JsonProperty("signingDate")
private String signingDate; private String signingDate;
/** /** 园区名称 **/
*
**/
@JsonProperty("parkId") @JsonProperty("parkId")
private Object parkId; private Object parkId;
/** /** 商户名称 **/
*
**/
@JsonProperty("merchantId") @JsonProperty("merchantId")
private Object merchantId; private Object merchantId;
/** /** 租金总价 **/
*
**/
@JsonProperty("totalRentalPrice") @JsonProperty("totalRentalPrice")
private String totalRentalPrice; private String totalRentalPrice;
/** /** 押金总计 **/
*
**/
@JsonProperty("totalDeposit") @JsonProperty("totalDeposit")
private String totalDeposit; private String totalDeposit;
/** /** 支付方式 **/
*
**/
@JsonProperty("payDeposit") @JsonProperty("payDeposit")
private Object payDeposit; private Object payDeposit;
/** /** 退还方式 **/
* 退
**/
@JsonProperty("returnDeposit") @JsonProperty("returnDeposit")
private Object returnDeposit; private Object returnDeposit;
/** /** 开始时间 **/
*
**/
@JsonProperty("startTime") @JsonProperty("startTime")
private String startTime; private String startTime;
/** /** 结束时间 **/
*
**/
@JsonProperty("endTime") @JsonProperty("endTime")
private String endTime; private String endTime;
/** /** 租期 **/
*
**/
@JsonProperty("leaseTerm") @JsonProperty("leaseTerm")
private String leaseTerm; private String leaseTerm;
/** /** 联系人 **/
*
**/
@JsonProperty("contacts") @JsonProperty("contacts")
private String contacts; private String contacts;
/** /** 联系电话 **/
*
**/
@JsonProperty("contactsPhone") @JsonProperty("contactsPhone")
private String contactsPhone; private String contactsPhone;
/** /** 合同状态 **/
*
**/
@JsonProperty("contractStatus") @JsonProperty("contractStatus")
private Object contractStatus; private Object contractStatus;
/** /** 创建时间 **/
*
**/
@JsonProperty("creationTime") @JsonProperty("creationTime")
private String creationTime; private String creationTime;
/** /** 合同说明 **/
*
**/
@JsonProperty("contractExplain") @JsonProperty("contractExplain")
private String contractExplain; private String contractExplain;
/** /** 合同附件 **/
*
**/
@JsonProperty("contractEnclosure") @JsonProperty("contractEnclosure")
private Object contractEnclosure; private Object contractEnclosure;
} }

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

@ -1,250 +1,269 @@
<template> <template>
<transition name="el-zoom-in-center"> <transition name="el-zoom-in-center">
<div class="JNPF-preview-main"> <div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" /> <Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header"> <div class="JNPF-common-page-header">
<el-page-header @back="goBack" content="详情" /> <el-page-header @back="goBack"
<div class="options"> content="详情"/>
<el-button @click="goBack"> </el-button> <div class="options">
</div> <el-button @click="goBack"> </el-button>
</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="parkName">
<p>{{ dataForm.parkName }}</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>
<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="spaceId" label="空间名称">
<template slot-scope="scope">
<p>{{ scope.row.spaceId }}</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> </div>
</transition> </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="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>
</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="spaceId" label="空间名称" >
<template slot-scope="scope">
<p>{{scope.row.spaceId}}</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> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev' import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf' import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail' import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
export default { export default {
components: { Detail }, components: { Detail},
props: [], props: [],
data() { data() {
return { return {
visible: false, visible: false,
detailVisible: false, detailVisible: false,
loading: false, loading: false,
dataForm: { dataForm: {
id: '', id :'',
contractNumber: '', contractNumber : '',
contractName: '', contractName : '',
pricingMethod: "", pricingMethod : "",
signingDate: '', signingDate : '',
parkId: "", parkId : "",
merchantId: "", merchantId : "",
totalRentalPrice: "", totalRentalPrice : "",
totalDeposit: '', totalDeposit : '',
payDeposit: "", payDeposit : "",
returnDeposit: "", returnDeposit : "",
startTime: '', startTime : '',
endTime: '', endTime : '',
leaseTerm: '', leaseTerm : '',
contacts: '', contacts : '',
contactsPhone: '', contactsPhone : '',
contractStatus: "10", contractStatus : "10",
creationTime: "", creationTime : "",
contractExplain: '', contractExplain : '',
contractEnclosure: [], contractEnclosure : [],
spacecontractList: [], spacecontractList:[],
}, },
pricingMethodOptions: [{ "fullName": "月付", "id": "1" }, { "fullName": "季付", "id": "2" }, { "fullName": "年付", "id": "3" }], pricingMethodOptions:[{"fullName":"月付","id":"1"},{"fullName":"季付","id":"2"},{"fullName":"年付","id":"3"}],
pricingMethodProps: { "label": "fullName", "value": "id" }, pricingMethodProps:{"label":"fullName","value":"id" },
parkIdProps: { "label": "name", "value": "code" }, parkIdProps:{"label":"name","value":"code" },
merchantIdProps: { "label": "cmp_nm", "value": "id" }, merchantIdProps:{"label":"cmp_nm","value":"id" },
payDepositOptions: [{ "fullName": "选项1", "id": "1" }, { "fullName": "选项2", "id": "2" }], payDepositOptions:[{"fullName":"选项1","id":"1"},{"fullName":"选项2","id":"2"}],
payDepositProps: { "label": "fullName", "value": "id" }, payDepositProps:{"label":"fullName","value":"id" },
returnDepositOptions: [{ "fullName": "选项一", "id": "1" }, { "fullName": "选项二", "id": "2" }], returnDepositOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],
returnDepositProps: { "label": "fullName", "value": "id" }, 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" }, contractStatusProps:{"label":"fullName","value":"id" },
spaceIdProps: { "label": "name", "value": "id", "children": "children" },
} }
},
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
}, },
computed: {},
watch: {},
created() {
goBack() {
this.$emit('refresh')
}, },
init(id) { mounted() {},
this.dataForm.id = id || 0; methods: {
this.visible = true; toDetail(defaultValue, modelId) {
this.$nextTick(() => { if (!defaultValue) return
if (this.dataForm.id) { getConfigData(modelId).then(res => {
this.loading = true if (!res.data || !res.data.formData) return
request({ let formData = JSON.parse(res.data.formData)
url: '/api/example/Contract/detail/' + this.dataForm.id, formData.popupType = 'general'
method: 'get' this.detailVisible = true
}).then(res => { this.$nextTick(() => {
this.dataInfo(res.data) this.$refs.Detail.init(formData, modelId, defaultValue)
this.loading = false
}) })
} })
},
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> </script>

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

@ -96,7 +96,7 @@
{{ scope.row.contractStatus }} {{ scope.row.contractStatus }}
</template> </template>
</el-table-column> </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>
<el-table-column prop="merchantName" label="商户名称" align="left"> <el-table-column prop="merchantName" label="商户名称" align="left">
</el-table-column> </el-table-column>
@ -262,9 +262,9 @@ export default {
returnDepositProps: { "label": "fullName", "value": "id" }, 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" }, contractStatusProps: { "label": "fullName", "value": "id" },
tableField130_spaceIdOptions: [], tableField130_spaceIdcolumnOptions: [{ "label": "空间名称", "value": "name" }, { "label": "园区名称", "value": "park_name" }, { "label": "区域名称", "value": "area_name" },],
tableField130_spaceIdProps: { "label": "name", "value": "id", "children": "children" },
interfaceRes: { interfaceRes: {
tableField130_spaceId: [],
}, },
} }
}, },

Loading…
Cancel
Save