feat(bill):账单生成前后端代码补充提交;

master
jiyufei 3 months ago
parent cb06375025
commit 3feac22f86

@ -2,7 +2,9 @@ package jnpf.service;
import jnpf.model.contract.*; import jnpf.model.contract.*;
import jnpf.entity.*; import jnpf.entity.*;
import java.util.*; 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;
@ -73,4 +75,20 @@ public interface ContractService extends IService<ContractEntity> {
* @return code * @return code
*/ */
String findCodeById(String id); String findCodeById(String id);
/**
* id
*
* @param contractPagination
* @return list
*/
List<ContractDTO> getSpacesById(ContractPagination contractPagination);
/**
* id
*
* @param contractPagination
* @return list
*/
List<ContractDevicesDTO> getDevicesById(ContractPagination contractPagination);
} }

@ -34,4 +34,12 @@ public interface EquipmentRentalRecordsService extends IService<EquipmentRentalR
void saveOrUpdate(EquipmentRentalRecordsForm equipmentRentalRecordsForm, String id, boolean isSave) throws Exception; void saveOrUpdate(EquipmentRentalRecordsForm equipmentRentalRecordsForm, String id, boolean isSave) throws Exception;
/**
* id
*
* @param merchantId id
* @param keyword
* @return list
*/
List<EquipmentRentalRecordsEntity> findByMerchantId(String merchantId, String keyword);
} }

@ -32,4 +32,13 @@ public interface SpacecontractService extends IService<SpacecontractEntity> {
* @param contractNumber * @param contractNumber
*/ */
void delData(String contractNumber); void delData(String contractNumber);
/**
*
*
* @param contractNumber
* @param keyWord
* @return list
*/
List<SpacecontractEntity> findByNum(String contractNumber,String keyWord);
} }

@ -30,6 +30,7 @@ import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel; import jnpf.base.model.ColumnDataModel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel; import jnpf.database.model.superQuery.SuperJsonModel;
@ -610,8 +611,6 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
entity.setVersion(0); entity.setVersion(0);
entity.setSubmitter(userInfo.getUserId()); entity.setSubmitter(userInfo.getUserId());
entity.setSubmissionTime(DateUtil.getNowDate()); entity.setSubmissionTime(DateUtil.getNowDate());
entity.setConfirmPersonnel(userInfo.getUserId());
entity.setConfirmTime(DateUtil.getNowDate());
} else { } else {
entity.setCreationTime(DateUtil.getNowDate()); entity.setCreationTime(DateUtil.getNowDate());
} }
@ -625,9 +624,15 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
} }
if (billTableForm.getBillspacedetailList() != null) { if (billTableForm.getBillspacedetailList() != null) {
List<BillspacedetailEntity> tableField140 = JsonUtil.getJsonToList(billTableForm.getBillspacedetailList(), BillspacedetailEntity.class); List<BillspacedetailEntity> tableField140 = JsonUtil.getJsonToList(billTableForm.getBillspacedetailList(), BillspacedetailEntity.class);
for (BillspacedetailEntity entitys : tableField140) { //假如选择了相同的空间 后端直接去重
List<BillspacedetailEntity> list1 = tableField140.stream()
.filter(obj -> StringUtils.isNoneBlank(obj.getSpaceId()))
.collect(Collectors.toMap(BillspacedetailEntity::getSpaceId, obj -> obj, (o1, o2) -> o1)).values().stream().collect(Collectors.toList());
for (BillspacedetailEntity entitys : list1) {
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setBillNumber(entity.getBillNumbe()); entitys.setBillNumber(entity.getBillNumbe());
entitys.setCreateBy(userInfo.getUserId());
entitys.setCreationTime(DateUtil.getNowDate());
if (isSave) { if (isSave) {
} else { } else {
} }
@ -642,9 +647,15 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
} }
if (billTableForm.getBilldevicedeatialList() != null) { if (billTableForm.getBilldevicedeatialList() != null) {
List<BilldevicedeatialEntity> tableField158 = JsonUtil.getJsonToList(billTableForm.getBilldevicedeatialList(), BilldevicedeatialEntity.class); List<BilldevicedeatialEntity> tableField158 = JsonUtil.getJsonToList(billTableForm.getBilldevicedeatialList(), BilldevicedeatialEntity.class);
for (BilldevicedeatialEntity entitys : tableField158) { //假如选择了相同的空间 后端直接去重
List<BilldevicedeatialEntity> list1 = tableField158.stream()
.filter(obj -> StringUtils.isNoneBlank(obj.getEquipmentNumber()))
.collect(Collectors.toMap(BilldevicedeatialEntity::getEquipmentNumber, obj -> obj, (o1, o2) -> o1)).values().stream().collect(Collectors.toList());
for (BilldevicedeatialEntity entitys : list1) {
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setBillNumber(entity.getBillNumbe()); entitys.setBillNumber(entity.getBillNumbe());
entitys.setCreateBy(userInfo.getUserId());
entitys.setCreationTime(DateUtil.getNowDate());
if (isSave) { if (isSave) {
} else { } else {
} }
@ -662,6 +673,8 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
for (BillotherdeatialEntity entitys : tableField166) { for (BillotherdeatialEntity entitys : tableField166) {
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setBillNumber(entity.getBillNumbe()); entitys.setBillNumber(entity.getBillNumbe());
entitys.setCreateBy(userInfo.getUserId());
entitys.setCreationTime(DateUtil.getNowDate());
if (isSave) { if (isSave) {
} else { } else {
} }
@ -681,6 +694,8 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
entity.setBillStatus("20"); entity.setBillStatus("20");
entity.setUpdateBy(userProvider.get().getUserId()); entity.setUpdateBy(userProvider.get().getUserId());
entity.setUpdateTime(DateUtil.getNowDate()); entity.setUpdateTime(DateUtil.getNowDate());
entity.setConfirmPersonnel(userProvider.get().getUserId());
entity.setConfirmTime(DateUtil.getNowDate());
boolean result = this.updateById(entity); boolean result = this.updateById(entity);
if (result) { if (result) {
return "确认成功"; return "确认成功";
@ -695,6 +710,7 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
if (ObjectUtil.isNull(entity)) { if (ObjectUtil.isNull(entity)) {
return "账单不存在"; return "账单不存在";
} }
entity.setBillAttachment(billTableForm.getBillAttachment().toString());
entity.setPayStatus(billTableForm.getPayStatus().toString()); entity.setPayStatus(billTableForm.getPayStatus().toString());
entity.setUpdateBy(userProvider.get().getUserId()); entity.setUpdateBy(userProvider.get().getUserId());
entity.setUpdateTime(DateUtil.getNowDate()); entity.setUpdateTime(DateUtil.getNowDate());

@ -1,5 +1,6 @@
package jnpf.service.impl; package jnpf.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -11,16 +12,14 @@ import jnpf.base.UserInfo;
import jnpf.base.model.ColumnDataModel; import jnpf.base.model.ColumnDataModel;
import jnpf.database.model.superQuery.SuperJsonModel; import jnpf.database.model.superQuery.SuperJsonModel;
import jnpf.entity.ContractEntity; import jnpf.entity.ContractEntity;
import jnpf.entity.EquipmentRentalRecordsEntity;
import jnpf.entity.ParkEntity; import jnpf.entity.ParkEntity;
import jnpf.entity.SpacecontractEntity; import jnpf.entity.SpacecontractEntity;
import jnpf.mapper.ContractMapper; import jnpf.mapper.ContractMapper;
import jnpf.model.QueryModel; import jnpf.model.QueryModel;
import jnpf.model.contract.*; import jnpf.model.contract.*;
import jnpf.permission.entity.UserEntity; import jnpf.permission.entity.UserEntity;
import jnpf.service.ContractService; import jnpf.service.*;
import jnpf.service.EnterpriseMerchantsService;
import jnpf.service.ParkService;
import jnpf.service.SpacecontractService;
import jnpf.util.*; import jnpf.util.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -31,7 +30,6 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
@ -65,6 +63,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
@Resource @Resource
private ParkService parkService; private ParkService parkService;
@Resource
private EquipmentRentalRecordsService equipmentRentalRecordsService;
@Override @Override
public List<ContractEntity> getList(ContractPagination contractPagination) { public List<ContractEntity> getList(ContractPagination contractPagination) {
@ -554,7 +555,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
List<SpacecontractEntity> tableField130 = JsonUtil.getJsonToList(contractForm.getSpacecontractList(), SpacecontractEntity.class); List<SpacecontractEntity> tableField130 = JsonUtil.getJsonToList(contractForm.getSpacecontractList(), SpacecontractEntity.class);
int i = 1; int i = 1;
//假如选择了相同的空间 后端直接去重 //假如选择了相同的空间 后端直接去重
List<SpacecontractEntity> list1 = tableField130.stream().collect(Collectors.toMap(SpacecontractEntity::getSpaceId, obj -> obj, (o1, o2) -> o1)).values().stream().collect(Collectors.toList()); List<SpacecontractEntity> list1 = tableField130.stream()
.filter(obj -> StringUtils.isNoneBlank(obj.getSpaceId()))
.collect(Collectors.toMap(SpacecontractEntity::getSpaceId, obj -> obj, (o1, o2) -> o1)).values().stream().collect(Collectors.toList());
for (SpacecontractEntity entitys : list1) { for (SpacecontractEntity entitys : list1) {
if (StringUtils.isBlank(entitys.getSpaceId())) { if (StringUtils.isBlank(entitys.getSpaceId())) {
continue; continue;
@ -660,4 +663,44 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
} }
return contract.getContractNumber(); return contract.getContractNumber();
} }
@Override
public List<ContractDTO> getSpacesById(ContractPagination contractPagination) {
ContractEntity contract = this.getById(contractPagination.getContractId());
if (ObjectUtil.isNull(contract)) {
return Collections.emptyList();
}
//查询绑定空间信息
List<SpacecontractEntity> byNum = spacecontractService.findByNum(contract.getContractNumber(), contractPagination.getKeyword());
if (ObjectUtil.isNull(byNum)) {
return Collections.emptyList();
}
return byNum.stream().map(obj -> {
ContractDTO contractDTO = BeanUtil.copyProperties(contract, ContractDTO.class);
contractDTO.setSpaceNumber(obj.getSpaceId());
contractDTO.setSpaceId(obj.getSpaceName());
return contractDTO;
}).collect(Collectors.toList());
}
@Override
public List<ContractDevicesDTO> getDevicesById(ContractPagination contractPagination) {
ContractEntity contract = this.getById(contractPagination.getContractId());
if (ObjectUtil.isNull(contract)) {
return Collections.emptyList();
}
//根据合同上的商户id 查询绑定的租赁设备
List<EquipmentRentalRecordsEntity> recordsEntities = equipmentRentalRecordsService.findByMerchantId(contract.getMerchantId(), contractPagination.getKeyword());
return recordsEntities.stream().map(obj -> {
ContractDevicesDTO devicesDTO = new ContractDevicesDTO();
devicesDTO.setId(contract.getId());
devicesDTO.setStartTime(obj.getStartTime());
devicesDTO.setEndTime(obj.getEndTime());
devicesDTO.setTotalRentalPrice(obj.getTotalLeasePrice());
devicesDTO.setLeaseNumber(obj.getLeaseNumber());
devicesDTO.setEquipmentNumber(obj.getEquipmentCoding());
devicesDTO.setEquipmentName(obj.getEquipmentName());
return devicesDTO;
}).collect(Collectors.toList());
}
} }

@ -1,50 +1,38 @@
package jnpf.service.impl; package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.EquipmentRentalRecordsMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.equipmentrentalrecords.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil; 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 com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.concurrent.CompletableFuture;
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 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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.base.model.ColumnDataModel;
import jnpf.database.model.superQuery.SuperJsonModel;
import jnpf.entity.EquipmentEntity;
import jnpf.entity.EquipmentRentalRecordsEntity;
import jnpf.mapper.EquipmentRentalRecordsMapper;
import jnpf.model.QueryModel;
import jnpf.model.equipmentrentalrecords.EquipmentRentalRecordsConstant;
import jnpf.model.equipmentrentalrecords.EquipmentRentalRecordsForm;
import jnpf.model.equipmentrentalrecords.EquipmentRentalRecordsPagination;
import jnpf.permission.entity.UserEntity; import jnpf.permission.entity.UserEntity;
import jnpf.service.EnterpriseMerchantsService;
import jnpf.service.EquipmentRentalRecordsService;
import jnpf.service.EquipmentService;
import jnpf.util.*;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/** /**
* EquipmentRentalRecords * EquipmentRentalRecords
@ -314,7 +302,7 @@ public class EquipmentRentalRecordsServiceImpl extends ServiceImpl<EquipmentRent
public String update(String id, EquipmentRentalRecordsEntity entity) { public String update(String id, EquipmentRentalRecordsEntity entity) {
//判断设备是否是可用状态 //判断设备是否是可用状态
EquipmentEntity equipment = equipmentService.getById(entity.getEquipmentId()); EquipmentEntity equipment = equipmentService.getById(entity.getEquipmentId());
if ("1".equals(equipment.getStatus())) { if (!"2".equals(equipment.getStatus())) {
return "该设备未归还,不可删除!"; return "该设备未归还,不可删除!";
} }
//异步更改状态 //异步更改状态
@ -407,4 +395,18 @@ public class EquipmentRentalRecordsServiceImpl extends ServiceImpl<EquipmentRent
CompletableFuture.runAsync(() -> equipmentService.updateStatus(entity.getEquipmentId(), status)); CompletableFuture.runAsync(() -> equipmentService.updateStatus(entity.getEquipmentId(), status));
} }
} }
@Override
public List<EquipmentRentalRecordsEntity> findByMerchantId(String merchantId, String keyword) {
QueryWrapper<EquipmentRentalRecordsEntity> entityQueryWrapper = new QueryWrapper<>();
entityQueryWrapper.lambda().eq(EquipmentRentalRecordsEntity::getMerchantId, merchantId);
if (StringUtils.isNoneBlank(keyword)) {
entityQueryWrapper.lambda().like(EquipmentRentalRecordsEntity::getEquipmentName, keyword);
}
List<EquipmentRentalRecordsEntity> list = this.list(entityQueryWrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list;
}
} }

@ -14,6 +14,7 @@ import jnpf.util.JsonUtil;
import jnpf.util.ServletUtil; import jnpf.util.ServletUtil;
import jnpf.util.UserProvider; import jnpf.util.UserProvider;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -68,4 +69,18 @@ public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, S
SpacecontractqueryWrapper.lambda().eq(SpacecontractEntity::getContractNumber, contractNumber); SpacecontractqueryWrapper.lambda().eq(SpacecontractEntity::getContractNumber, contractNumber);
this.remove(SpacecontractqueryWrapper); this.remove(SpacecontractqueryWrapper);
} }
@Override
public List<SpacecontractEntity> findByNum(String contractNumber, String keyWord) {
QueryWrapper<SpacecontractEntity> SpacecontractqueryWrapper = new QueryWrapper<>();
SpacecontractqueryWrapper.lambda().eq(SpacecontractEntity::getContractNumber, contractNumber);
if (StringUtils.isNoneBlank(keyWord)) {
SpacecontractqueryWrapper.lambda().like(SpacecontractEntity::getSpaceName, keyWord);
}
List<SpacecontractEntity> list = this.list(SpacecontractqueryWrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list;
}
} }

@ -80,11 +80,11 @@ public class BillTableController {
billTableMap.put("id", billTableMap.get("id")); billTableMap.put("id", billTableMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getId(), billTablePagination); List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getBillNumbe(), billTablePagination);
billTableMap.put("tableField140", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList))); billTableMap.put("tableField140", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList)));
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getId(), billTablePagination); List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getBillNumbe(), billTablePagination);
billTableMap.put("tableField158", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList))); billTableMap.put("tableField158", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList)));
List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getId(), billTablePagination); List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getBillNumbe(), billTablePagination);
billTableMap.put("tableField166", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList))); billTableMap.put("tableField166", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList)));
realList.add(billTableMap); realList.add(billTableMap);
} }
@ -187,11 +187,11 @@ public class BillTableController {
billTableMap.put("id", billTableMap.get("id")); billTableMap.put("id", billTableMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getId()); List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getBillNumbe());
billTableMap.put("tableField140", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList))); billTableMap.put("tableField140", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList)));
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getId()); List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getBillNumbe());
billTableMap.put("tableField158", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList))); billTableMap.put("tableField158", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList)));
List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getId()); List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getBillNumbe());
billTableMap.put("tableField166", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList))); billTableMap.put("tableField166", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList)));
billTableMap = generaterSwapUtil.swapDataDetail(billTableMap, BillTableConstant.getFormData(), "585025890216314949", false); billTableMap = generaterSwapUtil.swapDataDetail(billTableMap, BillTableConstant.getFormData(), "585025890216314949", false);
return ActionResult.success(billTableMap); return ActionResult.success(billTableMap);
@ -215,11 +215,11 @@ public class BillTableController {
billTableMap.put("id", billTableMap.get("id")); billTableMap.put("id", billTableMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getId()); List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getBillNumbe());
billTableMap.put("billspacedetailList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList))); billTableMap.put("billspacedetailList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billspacedetailList)));
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getId()); List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getBillNumbe());
billTableMap.put("billdevicedeatialList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList))); billTableMap.put("billdevicedeatialList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billdevicedeatialList)));
List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getId()); List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getBillNumbe());
billTableMap.put("billotherdeatialList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList))); billTableMap.put("billotherdeatialList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList)));
billTableMap = generaterSwapUtil.swapDataForm(billTableMap, BillTableConstant.getFormData(), BillTableConstant.TABLEFIELDKEY, BillTableConstant.TABLERENAMES); billTableMap = generaterSwapUtil.swapDataForm(billTableMap, BillTableConstant.getFormData(), BillTableConstant.TABLEFIELDKEY, BillTableConstant.TABLERENAMES);
return ActionResult.success(billTableMap); return ActionResult.success(billTableMap);

@ -27,6 +27,7 @@ import jnpf.service.SpacecontractService;
import jnpf.util.*; import jnpf.util.*;
import lombok.Cleanup; import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import oracle.jdbc.proxy.annotation.Post;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -98,6 +99,7 @@ public class ContractController {
vo.setPagination(page); vo.setPagination(page);
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
* *
@ -118,6 +120,7 @@ public class ContractController {
} }
return ActionResult.success("创建成功"); return ActionResult.success("创建成功");
} }
/** /**
* Excel * Excel
* *
@ -297,8 +300,10 @@ public class ContractController {
} }
return vo; return vo;
} }
/** /**
* *
*
* @param id * @param id
* @param contractForm * @param contractForm
* @return * @return
@ -326,8 +331,10 @@ public class ContractController {
return ActionResult.fail("更新失败,数据不存在"); return ActionResult.fail("更新失败,数据不存在");
} }
} }
/** /**
* *
*
* @param id * @param id
* @return * @return
*/ */
@ -343,9 +350,11 @@ public class ContractController {
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");
} }
/** /**
* () * ()
* 使- * 使-
*
* @param id * @param id
* @return * @return
*/ */
@ -365,9 +374,11 @@ 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
*/ */
@ -408,4 +419,24 @@ public class ContractController {
return ActionResult.success(result); return ActionResult.success(result);
} }
@Operation(summary = "根据合同id查询绑定空间信息")
@PostMapping("/getSpacesById")
public ActionResult getSpacesById(@RequestBody ContractPagination contractPagination) {
PageListVO vo = new PageListVO();
vo.setList(contractService.getSpacesById(contractPagination));
PaginationVO page = JsonUtil.getJsonToBean(contractPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
@Operation(summary = "根据合同id查询绑定商户的设备信息")
@PostMapping("/getDevicesById")
public ActionResult getDevicesById(@RequestBody ContractPagination contractPagination) {
PageListVO vo = new PageListVO();
vo.setList(contractService.getDevicesById(contractPagination));
PaginationVO page = JsonUtil.getJsonToBean(contractPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
} }

@ -0,0 +1,52 @@
package jnpf.model.contract;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ContractDTO implements Serializable {
/**
* id
*/
private String id;
/**
*
*/
private String contractNumber;
/**
*
*/
private String contractName;
/**
* id
*/
private String merchantId;
/**
* id
*/
private String merchantName;
/**
* id
*/
private String spaceNumber;
/**
*
*/
private String spaceId;
/**
*
*/
private Date startTime;
/**
*
*/
private Date endTime;
/**
*
*/
private BigDecimal totalRentalPrice;
}

@ -0,0 +1,45 @@
package jnpf.model.contract;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ContractDevicesDTO implements Serializable {
/**
* id
*/
private String id;
/**
*
*/
private Date startTime;
/**
*
*/
private Date endTime;
/**
*
*/
private BigDecimal totalRentalPrice;
/**
*
*/
private String leaseNumber;
/**
*
*/
private String equipmentNumber;
/**
*
*/
private String equipmentName;
}

@ -3,11 +3,12 @@ package jnpf.model.contract;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import jnpf.base.Pagination; import jnpf.base.Pagination;
import java.util.List; import java.util.List;
/** /**
*
* Contract * Contract
*
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
@ -15,34 +16,62 @@ import java.util.List;
*/ */
@Data @Data
public class ContractPagination extends Pagination { public class ContractPagination extends Pagination {
/** 查询key */ /**
* key
*/
private String[] selectKey; private String[] selectKey;
/** json */ /**
* json
*/
private String json; private String json;
/** 数据类型 0-当前页1-全部数据 */ /**
* 0-1-
*/
private String dataType; private String dataType;
/** 高级查询 */ /**
*
*/
private String superQueryJson; private String superQueryJson;
/** 功能id */ /**
* id
*/
private String moduleId; private String moduleId;
/** 菜单id */ /**
* id
*/
private String menuId; private String menuId;
/** 申请时间 */ /**
*
*/
@JsonProperty("creationTime") @JsonProperty("creationTime")
private Object creationTime; private Object creationTime;
/** 商户名称 */ /**
*
*/
@JsonProperty("merchantName") @JsonProperty("merchantName")
private Object merchantName; private Object merchantName;
/** 合同状态 */ /**
*
*/
@JsonProperty("contractStatus") @JsonProperty("contractStatus")
private Object contractStatus; private Object contractStatus;
/** 合同名称 */ /**
*
*/
@JsonProperty("contractName") @JsonProperty("contractName")
private Object contractName; private Object contractName;
/** 合同编号 */ /**
*
*/
@JsonProperty("contractNumber") @JsonProperty("contractNumber")
private Object contractNumber; private Object contractNumber;
/** 园区名称 */ /**
*
*/
@JsonProperty("parkId") @JsonProperty("parkId")
private Object parkId; private Object parkId;
/**
* id
**/
private String contractId;
} }

@ -3,8 +3,7 @@
<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" <el-page-header @back="goBack" content="详情" />
content="详情"/>
<div class="options"> <div class="options">
<el-button @click="goBack"> </el-button> <el-button @click="goBack"> </el-button>
</div> </div>
@ -13,101 +12,81 @@
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right"> <el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right">
<template v-if="!loading"> <template v-if="!loading">
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="账单号" <jnpf-form-tip-item label="账单号" prop="billNumbe">
prop="billNumbe" >
<p>{{ dataForm.billNumbe }}</p> <p>{{ dataForm.billNumbe }}</p>
</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="合同名称" <jnpf-form-tip-item label="合同名称" prop="contractId">
prop="contractId" >
<p>{{ dataForm.contractId }}</p> <p>{{ dataForm.contractId }}</p>
</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="账单状态" <jnpf-form-tip-item label="账单状态" prop="billStatus">
prop="billStatus" >
<p>{{ dataForm.billStatus }} </p> <p>{{ dataForm.billStatus }} </p>
</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="商户名称" <jnpf-form-tip-item label="商户名称" prop="merchantId">
prop="merchantId" >
<p>{{ dataForm.merchantId }}</p> <p>{{ dataForm.merchantId }}</p>
</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="开始时间" <jnpf-form-tip-item label="开始时间" prop="startTime">
prop="startTime" >
<p>{{ dataForm.startTime }}</p> <p>{{ dataForm.startTime }}</p>
</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="结束时间" <jnpf-form-tip-item label="结束时间" prop="endTime">
prop="endTime" >
<p>{{ dataForm.endTime }}</p> <p>{{ dataForm.endTime }}</p>
</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="账单金额" <jnpf-form-tip-item label="账单金额" prop="billAmount">
prop="billAmount" > <JnpfNumber v-model="dataForm.billAmount" placeholder="账单金额" disabled :step="1">
<JnpfNumber v-model="dataForm.billAmount"
placeholder="账单金额" disabled
:step="1" >
</JnpfNumber> </JnpfNumber>
</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="通知方式" <jnpf-form-tip-item label="通知方式" prop="notificationMethod">
prop="notificationMethod" >
<p>{{ dataForm.notificationMethod }} </p> <p>{{ dataForm.notificationMethod }} </p>
</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="通知时间" <jnpf-form-tip-item label="通知时间" prop="noticeTime">
prop="noticeTime" >
<p>{{ dataForm.noticeTime }}</p> <p>{{ dataForm.noticeTime }}</p>
</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="通知状态" <jnpf-form-tip-item label="通知状态" prop="notificationState">
prop="notificationState" >
<p>{{ dataForm.notificationState }} </p> <p>{{ dataForm.notificationState }} </p>
</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="支付方式" <jnpf-form-tip-item label="支付方式" prop="payStatus">
prop="payStatus" >
<p>{{ dataForm.payStatus }} </p> <p>{{ dataForm.payStatus }} </p>
</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="支付金额" <jnpf-form-tip-item label="支付金额" prop="payAmount">
prop="payAmount" > <JnpfNumber v-model="dataForm.payAmount" placeholder="支付金额" disabled :step="1">
<JnpfNumber v-model="dataForm.payAmount"
placeholder="支付金额" disabled
:step="1" >
</JnpfNumber> </JnpfNumber>
</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="确认人" <jnpf-form-tip-item label="确认人" prop="confirmPersonnel">
prop="confirmPersonnel" >
<p>{{ dataForm.confirmPersonnel }}</p> <p>{{ dataForm.confirmPersonnel }}</p>
</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="确认时间" <jnpf-form-tip-item label="确认时间" prop="confirmTime">
prop="confirmTime" >
<p>{{ dataForm.confirmTime }}</p> <p>{{ dataForm.confirmTime }}</p>
</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="相关附件" <jnpf-form-tip-item label="相关附件" prop="billAttachment">
prop="billAttachment" > <JnpfUploadFile v-model="dataForm.billAttachment" disabled detailed :fileSize="10"
<JnpfUploadFile v-model="dataForm.billAttachment" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传">
disabled
detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传" >
</JnpfUploadFile> </JnpfUploadFile>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -140,9 +119,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="billAmount" label="账单金额"> <el-table-column prop="billAmount" label="账单金额">
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount" <JnpfNumber v-model="scope.row.billAmount" placeholder="账单金额"
placeholder="账单金额" disabled disabled :step="1">
:step="1" >
</JnpfNumber> </JnpfNumber>
</template> </template>
</el-table-column> </el-table-column>
@ -190,9 +168,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="billAmount" label="账单金额"> <el-table-column prop="billAmount" label="账单金额">
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount" <JnpfNumber v-model="scope.row.billAmount" placeholder="账单金额"
placeholder="账单金额" disabled disabled :step="1">
:step="1" >
</JnpfNumber> </JnpfNumber>
</template> </template>
</el-table-column> </el-table-column>
@ -230,9 +207,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="billAmount" label="账单金额"> <el-table-column prop="billAmount" label="账单金额">
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount" <JnpfNumber v-model="scope.row.billAmount" placeholder="账单金额"
placeholder="账单金额" disabled disabled :step="1">
:step="1" >
</JnpfNumber> </JnpfNumber>
</template> </template>
</el-table-column> </el-table-column>
@ -294,7 +270,7 @@
billdevicedeatialList: [], billdevicedeatialList: [],
billotherdeatialList: [], billotherdeatialList: [],
}, },
activegecbmb:'3KzarC2', activegecbmb: '1',
billStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已驳回", "id": "30" }, { "fullName": "部分结算", "id": "40" }, { "fullName": "已结算", "id": "50" }], billStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已驳回", "id": "30" }, { "fullName": "部分结算", "id": "40" }, { "fullName": "已结算", "id": "50" }],
billStatusProps: { "label": "fullName", "value": "id" }, billStatusProps: { "label": "fullName", "value": "id" },
notificationMethodOptions: [{ "fullName": "口头", "id": "1" }, { "fullName": "书面", "id": "2" }], notificationMethodOptions: [{ "fullName": "口头", "id": "1" }, { "fullName": "书面", "id": "2" }],

File diff suppressed because one or more lines are too long

@ -0,0 +1,153 @@
<template>
<el-dialog title="选择空间" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
lock-scroll append-to-body width="800px">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="10">
<el-form-item label="关键词">
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable @keyup.enter.native="search()" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
</el-button>
</el-form-item>
</el-col>
</el-form>
<div class="JNPF-common-search-box-right">
<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="search()" />
</el-tooltip>
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false">
<el-table-column prop="leaseNumber" label="租赁单号" align="center" sortable>
</el-table-column>
<el-table-column prop="equipmentNumber" label="设备编码" align="center">
</el-table-column>
<el-table-column prop="equipmentName" label="设备名称" align="center">
</el-table-column>
<el-table-column prop="startTime" label="开始时间" align="center" sortable>
<template slot-scope="scope">
<span>{{ formatTimestamp(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间" align="center">
<template slot-scope="scope">
<span>{{ formatTimestamp(scope.row.endTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="totalRentalPrice" label="租金总价" align="center">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
GoodsList
} from '@/api/extend/order'
export default {
data() {
return {
visible: false,
listLoading: true,
keyword: '',
list: [],
total: 0,
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
excludeIdList: [],
checked: [],
contractId: ''
}
},
methods: {
formatTimestamp(timestamp) {
const date = new Date(timestamp);
return date.toLocaleString();
},
init(excludeIdList, contractId) {
this.visible = true
this.listLoading = true
if (excludeIdList && excludeIdList instanceof Array) {
this.excludeIdList = excludeIdList;
}
this.contractId = contractId
let query = {
...this.listQuery,
keyword: this.keyword,
excludeIdList: this.excludeIdList,
contractId: contractId,
}
console.log();
request({
url: `/api/example/Contract/getDevicesById`,
method: 'post',
data: query,
}).then(res => {
this.list = res.data.list
this.listLoading = false
this.total = res.data.list.length
if (res.data.list.length != 0) {
this.contractId = res.data.list[0].id
}
})
},
refresh() {
this.keyword = ''
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init(this.excludeIdList, this.contractId)
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init(this.excludeIdList, this.contractId)
},
select() {
if (!this.checked.length) return
this.visible = false
this.$emit('refreshDataList', this.checked)
},
handleSelectionChange(val) {
this.checked = val
}
}
}
</script>
<style lang="scss" scoped>
>>>.el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;
flex-direction: column;
overflow: hidden;
.JNPF-common-search-box {
margin-bottom: 0;
.JNPF-common-search-box-right {
padding: 10px 10px 0 0;
}
}
}
</style>

@ -46,7 +46,7 @@
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.contractId" :rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.contractId"
placeholder="请选择合同" propsValue="id" popupWidth="800px" popupTitle="选择数据" placeholder="请选择合同" propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='contract_name' field='contractId' popupType="dialog" relationField='contract_name' field='contractId'
interfaceId="585026575217461317" :pageSize="20" interfaceId="585391932604156741" :pageSize="20"
:columnOptions="contractIdcolumnOptions" clearable :style='{ "width": "100%" }'> :columnOptions="contractIdcolumnOptions" clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect> </JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -139,8 +139,8 @@
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="确认人" prop="confirmPersonnel"> <jnpf-form-tip-item label="确认人" prop="confirmPersonnel">
<JnpfInput v-model="dataForm.confirmPersonnel" <JnpfInput v-model="dataForm.confirmPersonnel"
@change="changeData('confirmPersonnel', -1)" placeholder="自动带入" disabled clearable @change="changeData('confirmPersonnel', -1)" placeholder="确认时自动带入" disabled
:style='{ "width": "100%" }'> clearable :style='{ "width": "100%" }'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -149,7 +149,7 @@
<jnpf-form-tip-item label="确认时间" prop="confirmTime"> <jnpf-form-tip-item label="确认时间" prop="confirmTime">
<JnpfDatePicker v-model="dataForm.confirmTime" @change="changeData('confirmTime', -1)" <JnpfDatePicker v-model="dataForm.confirmTime" @change="changeData('confirmTime', -1)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
placeholder="默认当前单据创建时间" disabled clearable :style='{ "width": "100%" }' type="date" placeholder="此单据确认的时间" disabled clearable :style='{ "width": "100%" }' type="date"
format="yyyy-MM-dd"> format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -202,8 +202,9 @@
<JnpfDatePicker v-model="scope.row.startTime" <JnpfDatePicker v-model="scope.row.startTime"
@change="changeData('billspacedetail-startTime', scope.$index)" @change="changeData('billspacedetail-startTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="添加自动带入" :endTime="dateTime(false, 1, 1, '', '')"
disabled clearable :style='{ "width": "100%" }' type="date" placeholder="添加自动带入" disabled clearable
:style='{ "width": "100%" }' type="date"
format="yyyy-MM-dd"> format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
@ -217,9 +218,9 @@
<JnpfDatePicker v-model="scope.row.endTime" <JnpfDatePicker v-model="scope.row.endTime"
@change="changeData('billspacedetail-endTime', scope.$index)" @change="changeData('billspacedetail-endTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择结束时间" :endTime="dateTime(false, 1, 1, '', '')"
clearable :style='{ "width": "100%" }' type="date" placeholder="请选择结束时间" clearable :style='{ "width": "100%" }'
format="yyyy-MM-dd"> type="date" format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
</el-table-column> </el-table-column>
@ -230,7 +231,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInputNumber v-model="scope.row.billAmount" <JnpfInputNumber v-model="scope.row.billAmount"
@change="changeData('billspacedetail-billAmount', scope.$index)" @change="changeData('billspacedetail-billAmount', scope.$index)"
placeholder="账单金额" :step="1"> placeholder="账单金额" :step="1" :min="0">
</JnpfInputNumber> </JnpfInputNumber>
</template> </template>
</el-table-column> </el-table-column>
@ -253,7 +254,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="table-actions" @click="addbillspacedetailList()"> <div class="table-actions" @click="choiceSpaces()">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -312,9 +313,9 @@
<JnpfDatePicker v-model="scope.row.startTime" <JnpfDatePicker v-model="scope.row.startTime"
@change="changeData('billdevicedeatial-startTime', scope.$index)" @change="changeData('billdevicedeatial-startTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择开始时间" :endTime="dateTime(false, 1, 1, '', '')"
clearable :style='{ "width": "100%" }' type="date" placeholder="请选择开始时间" clearable :style='{ "width": "100%" }'
format="yyyy-MM-dd"> type="date" format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
</el-table-column> </el-table-column>
@ -327,9 +328,9 @@
<JnpfDatePicker v-model="scope.row.endTime" <JnpfDatePicker v-model="scope.row.endTime"
@change="changeData('billdevicedeatial-endTime', scope.$index)" @change="changeData('billdevicedeatial-endTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择结束时间" :endTime="dateTime(false, 1, 1, '', '')"
clearable :style='{ "width": "100%" }' type="date" placeholder="请选择结束时间" clearable :style='{ "width": "100%" }'
format="yyyy-MM-dd"> type="date" format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
</el-table-column> </el-table-column>
@ -340,7 +341,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInputNumber v-model="scope.row.billAmount" <JnpfInputNumber v-model="scope.row.billAmount"
@change="changeData('billdevicedeatial-billAmount', scope.$index)" @change="changeData('billdevicedeatial-billAmount', scope.$index)"
placeholder="账单金额" :step="1"> placeholder="账单金额" :step="1" :min="0">
</JnpfInputNumber> </JnpfInputNumber>
</template> </template>
</el-table-column> </el-table-column>
@ -363,7 +364,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="table-actions" @click="addbilldevicedeatialList()"> <div class="table-actions" @click="choicedevices()">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -397,9 +398,9 @@
<JnpfDatePicker v-model="scope.row.startTime" <JnpfDatePicker v-model="scope.row.startTime"
@change="changeData('billotherdeatial-startTime', scope.$index)" @change="changeData('billotherdeatial-startTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择开始时间" :endTime="dateTime(false, 1, 1, '', '')"
clearable :style='{ "width": "100%" }' type="date" placeholder="请选择开始时间" clearable :style='{ "width": "100%" }'
format="yyyy-MM-dd"> type="date" format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
</el-table-column> </el-table-column>
@ -412,9 +413,9 @@
<JnpfDatePicker v-model="scope.row.endTime" <JnpfDatePicker v-model="scope.row.endTime"
@change="changeData('billotherdeatial-endTime', scope.$index)" @change="changeData('billotherdeatial-endTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择结束时间" :endTime="dateTime(false, 1, 1, '', '')"
clearable :style='{ "width": "100%" }' type="date" placeholder="请选择结束时间" clearable :style='{ "width": "100%" }'
format="yyyy-MM-dd"> type="date" format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</template> </template>
</el-table-column> </el-table-column>
@ -425,7 +426,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInputNumber v-model="scope.row.billAmount" <JnpfInputNumber v-model="scope.row.billAmount"
@change="changeData('billotherdeatial-billAmount', scope.$index)" @change="changeData('billotherdeatial-billAmount', scope.$index)"
placeholder="账单金额" :step="1"> placeholder="账单金额" :step="1" :min="0">
</JnpfInputNumber> </JnpfInputNumber>
</template> </template>
</el-table-column> </el-table-column>
@ -461,6 +462,8 @@
</el-form> </el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog" <SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible = false" /> @select="addForSelect" @close="selectDialogVisible = false" />
<Spaces v-if="spacesVisible" ref="spacesBox" @refreshDataList="initSpaceList" />
<Devices v-if="devicesVisible" ref="devicesBox" @refreshDataList="initDeviceList" />
</el-row> </el-row>
</div> </div>
</transition> </transition>
@ -476,11 +479,15 @@ import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize' import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js' import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
import Spaces from '@/views/scm/billtable/spaces'
import Devices from '@/views/scm/billtable/devices'
export default { export default {
components: {}, components: { Spaces ,Devices},
props: [], props: [],
data() { data() {
return { return {
spacesVisible: false,
devicesVisible: false,
dataFormSubmitType: 0, dataFormSubmitType: 0,
continueBtnLoading: false, continueBtnLoading: false,
index: 0, index: 0,
@ -580,7 +587,7 @@ export default {
version: 0, version: 0,
}, },
tableRequiredData: {}, tableRequiredData: {},
activegecbmb: '3KzarC2', activegecbmb: '1',
dataRule: dataRule:
{ {
contractId: [ contractId: [
@ -845,7 +852,7 @@ export default {
}, },
// //
initDefaultData() { initDefaultData() {
this.dataForm.confirmTime = new Date().getTime() // this.dataForm.confirmTime = new Date().getTime()
}, },
// //
@ -1102,6 +1109,51 @@ export default {
} }
this.childIndex = -1 this.childIndex = -1
}, },
choiceSpaces() {
if (this.dataForm.contractId == undefined) {
this.$message.error('请先选择合同名称!');
return;
}
this.spacesVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.billspacedetailList.length; i++) {
excludeIdList.push(this.dataForm.billspacedetailList[i].storageId);
}
this.$nextTick(() => {
this.$refs.spacesBox.init(excludeIdList, this.dataForm.contractId)
})
},
initSpaceList(list) {
for (let i = 0; i < list.length; i++) {
const e = list[i];
this.dataForm.billspacedetailList.push(e)
}
},
choicedevices() {
if (this.dataForm.contractId == undefined) {
this.$message.error('请先选择合同名称!');
return;
}
this.devicesVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.billdevicedeatialList.length; i++) {
excludeIdList.push(this.dataForm.billdevicedeatialList[i].storageId);
}
this.$nextTick(() => {
this.$refs.devicesBox.init(excludeIdList, this.dataForm.contractId)
})
},
initDeviceList(list) {
for (let i = 0; i < list.length; i++) {
const e = list[i];
this.dataForm.billdevicedeatialList.push(e)
}
},
}, },
} }

@ -0,0 +1,151 @@
<template>
<el-dialog title="选择空间" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
lock-scroll append-to-body width="800px">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="10">
<el-form-item label="关键词">
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable @keyup.enter.native="search()" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
</el-button>
</el-form-item>
</el-col>
</el-form>
<div class="JNPF-common-search-box-right">
<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="search()" />
</el-tooltip>
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false">
<el-table-column prop="spaceNumber" label="空间ID" align="center" sortable>
</el-table-column>
<el-table-column prop="spaceId" label="空间名称" align="center">
</el-table-column>
<el-table-column prop="startTime" label="开始时间" align="center" sortable>
<template slot-scope="scope">
<span>{{ formatTimestamp(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间" align="center">
<template slot-scope="scope">
<span>{{ formatTimestamp(scope.row.endTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="totalRentalPrice" label="租金总价" align="center">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
GoodsList
} from '@/api/extend/order'
export default {
data() {
return {
visible: false,
listLoading: true,
keyword: '',
list: [],
total: 0,
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
excludeIdList: [],
checked: [],
contractId: ''
}
},
methods: {
formatTimestamp(timestamp) {
const date = new Date(timestamp);
return date.toLocaleString();
},
init(excludeIdList, contractId) {
this.visible = true
this.listLoading = true
if (excludeIdList && excludeIdList instanceof Array) {
this.excludeIdList = excludeIdList;
}
this.contractId = contractId
let query = {
...this.listQuery,
keyword: this.keyword,
excludeIdList: this.excludeIdList,
contractId: contractId,
}
console.log();
request({
url: `/api/example/Contract/getSpacesById`,
method: 'post',
data: query,
}).then(res => {
this.list = res.data.list
this.listLoading = false
this.total = res.data.list.length
if (res.data.list.length != 0) {
this.contractId = res.data.list[0].id
}
})
},
refresh() {
this.keyword = ''
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init(this.excludeIdList, this.contractId)
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init(this.excludeIdList, this.contractId)
},
select() {
if (!this.checked.length) return
this.visible = false
this.$emit('refreshDataList', this.checked)
},
handleSelectionChange(val) {
this.checked = val
}
}
}
</script>
<style lang="scss" scoped>
>>>.el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;
flex-direction: column;
overflow: hidden;
.JNPF-common-search-box {
margin-bottom: 0;
.JNPF-common-search-box-right {
padding: 10px 10px 0 0;
}
}
}
</style>

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