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

master
jiyufei 3 months ago
parent cb06375025
commit 3feac22f86

@ -2,7 +2,9 @@ package jnpf.service;
import jnpf.model.contract.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.entity.ContractEntity;
import jnpf.entity.SpacecontractEntity;
@ -22,7 +24,7 @@ import java.util.List;
public interface ContractService extends IService<ContractEntity> {
List<ContractEntity> getList(ContractPagination contractPagination);
List<ContractEntity> getTypeList(ContractPagination contractPagination,String dataType);
List<ContractEntity> getTypeList(ContractPagination contractPagination, String dataType);
ContractEntity getInfo(String id);
@ -33,14 +35,14 @@ public interface ContractService extends IService<ContractEntity> {
boolean update(String id, ContractEntity entity);
//子表方法
List<SpacecontractEntity> getSpacecontractList(String id,ContractPagination contractPagination);
List<SpacecontractEntity> getSpacecontractList(String id, ContractPagination contractPagination);
List<SpacecontractEntity> getSpacecontractList(String id);
//副表数据方法
String checkForm(ContractForm form,int i);
String checkForm(ContractForm form, int i);
void saveOrUpdate(ContractForm contractForm,String id, boolean isSave) throws Exception;
void saveOrUpdate(ContractForm contractForm, String id, boolean isSave) throws Exception;
/**
*
@ -73,4 +75,20 @@ public interface ContractService extends IService<ContractEntity> {
* @return code
*/
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;
/**
* 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
*/
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 lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
@ -610,8 +611,6 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
entity.setVersion(0);
entity.setSubmitter(userInfo.getUserId());
entity.setSubmissionTime(DateUtil.getNowDate());
entity.setConfirmPersonnel(userInfo.getUserId());
entity.setConfirmTime(DateUtil.getNowDate());
} else {
entity.setCreationTime(DateUtil.getNowDate());
}
@ -625,9 +624,15 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
}
if (billTableForm.getBillspacedetailList() != null) {
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.setBillNumber(entity.getBillNumbe());
entitys.setCreateBy(userInfo.getUserId());
entitys.setCreationTime(DateUtil.getNowDate());
if (isSave) {
} else {
}
@ -642,9 +647,15 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
}
if (billTableForm.getBilldevicedeatialList() != null) {
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.setBillNumber(entity.getBillNumbe());
entitys.setCreateBy(userInfo.getUserId());
entitys.setCreationTime(DateUtil.getNowDate());
if (isSave) {
} else {
}
@ -662,6 +673,8 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
for (BillotherdeatialEntity entitys : tableField166) {
entitys.setId(RandomUtil.uuId());
entitys.setBillNumber(entity.getBillNumbe());
entitys.setCreateBy(userInfo.getUserId());
entitys.setCreationTime(DateUtil.getNowDate());
if (isSave) {
} else {
}
@ -681,6 +694,8 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
entity.setBillStatus("20");
entity.setUpdateBy(userProvider.get().getUserId());
entity.setUpdateTime(DateUtil.getNowDate());
entity.setConfirmPersonnel(userProvider.get().getUserId());
entity.setConfirmTime(DateUtil.getNowDate());
boolean result = this.updateById(entity);
if (result) {
return "确认成功";
@ -695,6 +710,7 @@ public class BillTableServiceImpl extends ServiceImpl<BillTableMapper, BillTable
if (ObjectUtil.isNull(entity)) {
return "账单不存在";
}
entity.setBillAttachment(billTableForm.getBillAttachment().toString());
entity.setPayStatus(billTableForm.getPayStatus().toString());
entity.setUpdateBy(userProvider.get().getUserId());
entity.setUpdateTime(DateUtil.getNowDate());

@ -1,5 +1,6 @@
package jnpf.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -11,16 +12,14 @@ import jnpf.base.UserInfo;
import jnpf.base.model.ColumnDataModel;
import jnpf.database.model.superQuery.SuperJsonModel;
import jnpf.entity.ContractEntity;
import jnpf.entity.EquipmentRentalRecordsEntity;
import jnpf.entity.ParkEntity;
import jnpf.entity.SpacecontractEntity;
import jnpf.mapper.ContractMapper;
import jnpf.model.QueryModel;
import jnpf.model.contract.*;
import jnpf.permission.entity.UserEntity;
import jnpf.service.ContractService;
import jnpf.service.EnterpriseMerchantsService;
import jnpf.service.ParkService;
import jnpf.service.SpacecontractService;
import jnpf.service.*;
import jnpf.util.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -31,7 +30,6 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
@ -65,6 +63,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
@Resource
private ParkService parkService;
@Resource
private EquipmentRentalRecordsService equipmentRentalRecordsService;
@Override
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);
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) {
if (StringUtils.isBlank(entitys.getSpaceId())) {
continue;
@ -660,4 +663,44 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEnt
}
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;
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 jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.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 java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
* EquipmentRentalRecords
@ -314,7 +302,7 @@ public class EquipmentRentalRecordsServiceImpl extends ServiceImpl<EquipmentRent
public String update(String id, EquipmentRentalRecordsEntity entity) {
//判断设备是否是可用状态
EquipmentEntity equipment = equipmentService.getById(entity.getEquipmentId());
if ("1".equals(equipment.getStatus())) {
if (!"2".equals(equipment.getStatus())) {
return "该设备未归还,不可删除!";
}
//异步更改状态
@ -407,4 +395,18 @@ public class EquipmentRentalRecordsServiceImpl extends ServiceImpl<EquipmentRent
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.UserProvider;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -29,7 +30,7 @@ import java.util.stream.Collectors;
* 2024-07-16
*/
@Service
public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, SpacecontractEntity> implements SpacecontractService{
public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, SpacecontractEntity> implements SpacecontractService {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@ -50,14 +51,14 @@ public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, S
//子表过滤方法
@Override
public QueryWrapper<SpacecontractEntity> getChild(ContractPagination pagination, QueryWrapper<SpacecontractEntity> spacecontractQueryWrapper){
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?ContractConstant.getColumnData():ContractConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
public QueryWrapper<SpacecontractEntity> getChild(ContractPagination pagination, QueryWrapper<SpacecontractEntity> spacecontractQueryWrapper) {
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc ? ContractConstant.getColumnData() : ContractConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson, ColumnDataModel.class);
String ruleJson = isPc ? JsonUtil.getObjectToString(dataModel.getRuleList()) : JsonUtil.getObjectToString(dataModel.getRuleListApp());
if (isPc) {
}
return spacecontractQueryWrapper;
}
@ -68,4 +69,18 @@ public class SpacecontractServiceImpl extends ServiceImpl<SpacecontractMapper, S
SpacecontractqueryWrapper.lambda().eq(SpacecontractEntity::getContractNumber, contractNumber);
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"));
//副表数据
//子表数据
List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getId(), billTablePagination);
List<BillspacedetailEntity> billspacedetailList = billTableService.getBillspacedetailList(entity.getBillNumbe(), billTablePagination);
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)));
List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getId(), billTablePagination);
List<BillotherdeatialEntity> billotherdeatialList = billTableService.getBillotherdeatialList(entity.getBillNumbe(), billTablePagination);
billTableMap.put("tableField166", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(billotherdeatialList)));
realList.add(billTableMap);
}
@ -187,11 +187,11 @@ public class BillTableController {
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)));
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getId());
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getBillNumbe());
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 = generaterSwapUtil.swapDataDetail(billTableMap, BillTableConstant.getFormData(), "585025890216314949", false);
return ActionResult.success(billTableMap);
@ -215,11 +215,11 @@ public class BillTableController {
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)));
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getId());
List<BilldevicedeatialEntity> billdevicedeatialList = billTableService.getBilldevicedeatialList(entity.getBillNumbe());
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 = generaterSwapUtil.swapDataForm(billTableMap, BillTableConstant.getFormData(), BillTableConstant.TABLEFIELDKEY, BillTableConstant.TABLERENAMES);
return ActionResult.success(billTableMap);

@ -27,6 +27,7 @@ import jnpf.service.SpacecontractService;
import jnpf.util.*;
import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;
import oracle.jdbc.proxy.annotation.Post;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
@ -48,7 +49,7 @@ import java.util.*;
*/
@Slf4j
@RestController
@Tag(name = "Contract" , description = "example")
@Tag(name = "Contract", description = "example")
@RequestMapping("/api/example/Contract")
public class ContractController {
@ -69,16 +70,16 @@ public class ContractController {
private ConfigValueUtil configValueUtil;
/**
*
*
* @param contractPagination
* @return
*/
*
*
* @param contractPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody ContractPagination contractPagination)throws IOException{
List<ContractEntity> list= contractService.getList(contractPagination);
List<Map<String, Object>> realList=new ArrayList<>();
public ActionResult list(@RequestBody ContractPagination contractPagination) throws IOException {
List<ContractEntity> list = contractService.getList(contractPagination);
List<Map<String, Object>> realList = new ArrayList<>();
for (ContractEntity entity : list) {
Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id"));
@ -89,7 +90,7 @@ public class ContractController {
realList.add(contractMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(),false);
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(), false);
//返回对象
PageListVO vo = new PageListVO();
@ -98,39 +99,41 @@ public class ContractController {
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param contractForm
* @return
*/
*
*
* @param contractForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid ContractForm contractForm) {
String b = contractService.checkForm(contractForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
String b = contractService.checkForm(contractForm, 0);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
try{
contractService.saveOrUpdate(contractForm, null ,true);
}catch(Exception e){
try {
contractService.saveOrUpdate(contractForm, null, true);
} catch (Exception e) {
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody ContractPagination contractPagination) throws IOException {
if (StringUtil.isEmpty(contractPagination.getSelectKey())){
if (StringUtil.isEmpty(contractPagination.getSelectKey())) {
return ActionResult.fail("请选择导出字段");
}
List<ContractEntity> list= contractService.getList(contractPagination);
List<Map<String, Object>> realList=new ArrayList<>();
List<ContractEntity> list = contractService.getList(contractPagination);
List<Map<String, Object>> realList = new ArrayList<>();
for (ContractEntity entity : list) {
Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id"));
@ -141,98 +144,98 @@ public class ContractController {
realList.add(contractMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(contractPagination.getSelectKey())?contractPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
realList = generaterSwapUtil.swapDataList(realList, ContractConstant.getFormData(), ContractConstant.getColumnData(), contractPagination.getModuleId(), false);
String[] keys = !StringUtil.isEmpty(contractPagination.getSelectKey()) ? contractPagination.getSelectKey() : new String[0];
UserInfo userInfo = userProvider.get();
DownloadVO vo = this.creatModelExcel(configValueUtil.getTemporaryFilePath(), realList, keys, userInfo);
return ActionResult.success(vo);
}
/**
*
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
ExcelExportEntity tableField130ExcelEntity = new ExcelExportEntity("空间列表","tableField130");
*
*/
public DownloadVO creatModelExcel(String path, List<Map<String, Object>> list, String[] keys, UserInfo userInfo) {
DownloadVO vo = DownloadVO.builder().build();
List<ExcelExportEntity> entitys = new ArrayList<>();
if (keys.length > 0) {
ExcelExportEntity tableField130ExcelEntity = new ExcelExportEntity("空间列表", "tableField130");
List<ExcelExportEntity> tableField130List = new ArrayList<>();
for(String key:keys){
switch(key){
case "contractNumber" :
entitys.add(new ExcelExportEntity("合同编号" ,"contractNumber"));
break;
case "contractName" :
entitys.add(new ExcelExportEntity("合同名称" ,"contractName"));
break;
case "pricingMethod" :
entitys.add(new ExcelExportEntity("计价方式" ,"pricingMethod"));
break;
case "signingDate" :
entitys.add(new ExcelExportEntity("签订日期" ,"signingDate"));
break;
case "parkId" :
entitys.add(new ExcelExportEntity("园区名称" ,"parkId"));
break;
case "merchantId" :
entitys.add(new ExcelExportEntity("商户名称" ,"merchantId"));
break;
case "totalRentalPrice" :
entitys.add(new ExcelExportEntity("租金总价" ,"totalRentalPrice"));
break;
case "totalDeposit" :
entitys.add(new ExcelExportEntity("押金总计" ,"totalDeposit"));
break;
case "payDeposit" :
entitys.add(new ExcelExportEntity("支付方式" ,"payDeposit"));
break;
case "returnDeposit" :
entitys.add(new ExcelExportEntity("退还方式" ,"returnDeposit"));
break;
case "startTime" :
entitys.add(new ExcelExportEntity("开始时间" ,"startTime"));
break;
case "endTime" :
entitys.add(new ExcelExportEntity("结束时间" ,"endTime"));
break;
case "leaseTerm" :
entitys.add(new ExcelExportEntity("租期" ,"leaseTerm"));
break;
case "contacts" :
entitys.add(new ExcelExportEntity("联系人" ,"contacts"));
break;
case "contactsPhone" :
entitys.add(new ExcelExportEntity("联系电话" ,"contactsPhone"));
break;
case "contractStatus" :
entitys.add(new ExcelExportEntity("合同状态" ,"contractStatus"));
break;
case "creationTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creationTime"));
break;
case "contractExplain" :
entitys.add(new ExcelExportEntity("合同说明" ,"contractExplain"));
break;
case "contractEnclosure" :
entitys.add(new ExcelExportEntity("合同附件" ,"contractEnclosure"));
break;
for (String key : keys) {
switch (key) {
case "contractNumber":
entitys.add(new ExcelExportEntity("合同编号", "contractNumber"));
break;
case "contractName":
entitys.add(new ExcelExportEntity("合同名称", "contractName"));
break;
case "pricingMethod":
entitys.add(new ExcelExportEntity("计价方式", "pricingMethod"));
break;
case "signingDate":
entitys.add(new ExcelExportEntity("签订日期", "signingDate"));
break;
case "parkId":
entitys.add(new ExcelExportEntity("园区名称", "parkId"));
break;
case "merchantId":
entitys.add(new ExcelExportEntity("商户名称", "merchantId"));
break;
case "totalRentalPrice":
entitys.add(new ExcelExportEntity("租金总价", "totalRentalPrice"));
break;
case "totalDeposit":
entitys.add(new ExcelExportEntity("押金总计", "totalDeposit"));
break;
case "payDeposit":
entitys.add(new ExcelExportEntity("支付方式", "payDeposit"));
break;
case "returnDeposit":
entitys.add(new ExcelExportEntity("退还方式", "returnDeposit"));
break;
case "startTime":
entitys.add(new ExcelExportEntity("开始时间", "startTime"));
break;
case "endTime":
entitys.add(new ExcelExportEntity("结束时间", "endTime"));
break;
case "leaseTerm":
entitys.add(new ExcelExportEntity("租期", "leaseTerm"));
break;
case "contacts":
entitys.add(new ExcelExportEntity("联系人", "contacts"));
break;
case "contactsPhone":
entitys.add(new ExcelExportEntity("联系电话", "contactsPhone"));
break;
case "contractStatus":
entitys.add(new ExcelExportEntity("合同状态", "contractStatus"));
break;
case "creationTime":
entitys.add(new ExcelExportEntity("创建时间", "creationTime"));
break;
case "contractExplain":
entitys.add(new ExcelExportEntity("合同说明", "contractExplain"));
break;
case "contractEnclosure":
entitys.add(new ExcelExportEntity("合同附件", "contractEnclosure"));
break;
case "tableField130-contractLineNumber":
tableField130List.add(new ExcelExportEntity("合同行号" ,"contractLineNumber"));
break;
tableField130List.add(new ExcelExportEntity("合同行号", "contractLineNumber"));
break;
case "tableField130-spaceId":
tableField130List.add(new ExcelExportEntity("空间名称" ,"spaceId"));
break;
tableField130List.add(new ExcelExportEntity("空间名称", "spaceId"));
break;
case "tableField130-spaceArea":
tableField130List.add(new ExcelExportEntity("空间面积" ,"spaceArea"));
break;
tableField130List.add(new ExcelExportEntity("空间面积", "spaceArea"));
break;
case "tableField130-totalRentalPrice":
tableField130List.add(new ExcelExportEntity("租金总价" ,"totalRentalPrice"));
break;
tableField130List.add(new ExcelExportEntity("租金总价", "totalRentalPrice"));
break;
default:
break;
break;
}
}
if(tableField130List.size() > 0){
if (tableField130List.size() > 0) {
tableField130ExcelEntity.setList(tableField130List);
entitys.add(tableField130ExcelEntity);
}
@ -240,10 +243,10 @@ public class ContractController {
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
try {
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
if (entitys.size() > 0) {
if (list.size() == 0) {
list.add(new HashMap<>());
}
//去除空数据
@ -253,8 +256,8 @@ public class ContractController {
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
String tableField = key.substring(0, key.indexOf("-"));
String field = key.substring(key.indexOf("-") + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
@ -280,7 +283,7 @@ public class ContractController {
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
@ -297,66 +300,72 @@ public class ContractController {
}
return vo;
}
/**
*
* @param id
* @param contractForm
* @return
*/
*
*
* @param id
* @param contractForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid ContractForm contractForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ContractForm contractForm,
@RequestParam(value = "isImport", required = false) boolean isImport) {
contractForm.setId(id);
if (!isImport) {
String b = contractService.checkForm(contractForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
String b = contractService.checkForm(contractForm, 1);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
}
ContractEntity entity= contractService.getInfo(id);
if(entity!=null){
try{
contractService.saveOrUpdate(contractForm,id,false);
}catch(Exception e){
ContractEntity entity = contractService.getInfo(id);
if (entity != null) {
try {
contractService.saveOrUpdate(contractForm, id, false);
} catch (Exception e) {
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
} else {
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id
* @return
*/
*
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
ContractEntity entity= contractService.getInfo(id);
if(entity!=null){
public ActionResult delete(@PathVariable("id") String id) {
ContractEntity entity = contractService.getInfo(id);
if (entity != null) {
//假删除
entity.setDeleteMark(1);
contractService.update(id, entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
ContractEntity entity= contractService.getInfo(id);
if(entity==null){
public ActionResult detailInfo(@PathVariable("id") String id) {
ContractEntity entity = contractService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> contractMap=JsonUtil.entityToMap(entity);
Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id"));
//副表数据
//子表数据
@ -365,20 +374,22 @@ public class ContractController {
contractMap = generaterSwapUtil.swapDataDetail(contractMap, ContractConstant.getFormData(), "582839350958489605", false);
return ActionResult.success(contractMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
ContractEntity entity= contractService.getInfo(id);
if(entity==null){
public ActionResult info(@PathVariable("id") String id) {
ContractEntity entity = contractService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> contractMap=JsonUtil.entityToMap(entity);
Map<String, Object> contractMap = JsonUtil.entityToMap(entity);
contractMap.put("id", contractMap.get("id"));
//副表数据
//子表数据
@ -408,4 +419,24 @@ public class ContractController {
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 lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* Contract
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
@ -15,34 +16,62 @@ import java.util.List;
*/
@Data
public class ContractPagination extends Pagination {
/** 查询key */
private String[] selectKey;
/** json */
private String json;
/** 数据类型 0-当前页1-全部数据 */
private String dataType;
/** 高级查询 */
private String superQueryJson;
/** 功能id */
/**
* key
*/
private String[] selectKey;
/**
* json
*/
private String json;
/**
* 0-1-
*/
private String dataType;
/**
*
*/
private String superQueryJson;
/**
* id
*/
private String moduleId;
/** 菜单id */
/**
* id
*/
private String menuId;
/** 申请时间 */
/**
*
*/
@JsonProperty("creationTime")
private Object creationTime;
/** 商户名称 */
/**
*
*/
@JsonProperty("merchantName")
private Object merchantName;
/** 合同状态 */
/**
*
*/
@JsonProperty("contractStatus")
private Object contractStatus;
/** 合同名称 */
/**
*
*/
@JsonProperty("contractName")
private Object contractName;
/** 合同编号 */
/**
*
*/
@JsonProperty("contractNumber")
private Object contractNumber;
/** 园区名称 */
/**
*
*/
@JsonProperty("parkId")
private Object parkId;
/**
* id
**/
private String contractId;
}

@ -1,356 +1,332 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
content="详情"/>
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<jnpf-form-tip-item label="账单号"
prop="billNumbe" >
<p>{{dataForm.billNumbe}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="合同名称"
prop="contractId" >
<p>{{dataForm.contractId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="账单状态"
prop="billStatus" >
<p>{{ dataForm.billStatus }} </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="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="billAmount" >
<JnpfNumber v-model="dataForm.billAmount"
placeholder="账单金额" disabled
:step="1" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="通知方式"
prop="notificationMethod" >
<p>{{ dataForm.notificationMethod }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="通知时间"
prop="noticeTime" >
<p>{{dataForm.noticeTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="通知状态"
prop="notificationState" >
<p>{{ dataForm.notificationState }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="支付方式"
prop="payStatus" >
<p>{{ dataForm.payStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="支付金额"
prop="payAmount" >
<JnpfNumber v-model="dataForm.payAmount"
placeholder="支付金额" disabled
:step="1" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="确认人"
prop="confirmPersonnel" >
<p>{{dataForm.confirmPersonnel}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="确认时间"
prop="confirmTime" >
<p>{{dataForm.confirmTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="相关附件"
prop="billAttachment" >
<JnpfUploadFile v-model="dataForm.billAttachment"
disabled
detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传" >
</JnpfUploadFile>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activegecbmb" tab-position="top" class="mb-20">
<el-tab-pane label="空间租金" name="1">
<el-col :span="24" >
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.tableField140" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="spaceNumber" label="空间编码" >
<template slot-scope="scope">
<p>{{scope.row.spaceNumber}}</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="startTime" label="开始时间" >
<template slot-scope="scope">
<p>{{scope.row.startTime}}</p>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间" >
<template slot-scope="scope">
<p>{{scope.row.endTime}}</p>
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额" >
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount"
placeholder="账单金额" disabled
:step="1" >
</JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="costDescription" label="费用说明" >
<template slot-scope="scope">
<p>{{scope.row.costDescription}}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</el-tab-pane >
<el-tab-pane label="设备租金" name="2">
<el-col :span="24" >
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.tableField158" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="leaseNumber" label="租赁单号" >
<template slot-scope="scope">
<p>{{scope.row.leaseNumber}}</p>
</template>
</el-table-column>
<el-table-column prop="equipmentNumber" label="设备编码" >
<template slot-scope="scope">
<p>{{scope.row.equipmentNumber}}</p>
</template>
</el-table-column>
<el-table-column prop="equipmentName" label="设备名称" >
<template slot-scope="scope">
<p>{{scope.row.equipmentName}}</p>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" >
<template slot-scope="scope">
<p>{{scope.row.startTime}}</p>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间" >
<template slot-scope="scope">
<p>{{scope.row.endTime}}</p>
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额" >
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount"
placeholder="账单金额" disabled
:step="1" >
</JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="costDescription" label="费用说明" >
<template slot-scope="scope">
<p>{{scope.row.costDescription}}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</el-tab-pane >
<el-tab-pane label="其它费用" name="3KzarC2">
<el-col :span="24" >
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" content="详情" />
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-table :data="dataForm.tableField166" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="useAmount" label="使用量" >
<template slot-scope="scope">
<p>{{scope.row.useAmount}}</p>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" >
<template slot-scope="scope">
<p>{{scope.row.startTime}}</p>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间" >
<template slot-scope="scope">
<p>{{scope.row.endTime}}</p>
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额" >
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount"
placeholder="账单金额" disabled
:step="1" >
</JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="costDescription" label="费用说明" >
<template slot-scope="scope">
<p>{{scope.row.costDescription}}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</el-tab-pane >
</el-tabs>
</el-col>
</template>
</el-form>
</el-row>
</div>
</transition>
<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="billNumbe">
<p>{{ dataForm.billNumbe }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="合同名称" prop="contractId">
<p>{{ dataForm.contractId }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="账单状态" prop="billStatus">
<p>{{ dataForm.billStatus }} </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="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="billAmount">
<JnpfNumber v-model="dataForm.billAmount" placeholder="账单金额" disabled :step="1">
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="通知方式" prop="notificationMethod">
<p>{{ dataForm.notificationMethod }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="通知时间" prop="noticeTime">
<p>{{ dataForm.noticeTime }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="通知状态" prop="notificationState">
<p>{{ dataForm.notificationState }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="支付方式" prop="payStatus">
<p>{{ dataForm.payStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="支付金额" prop="payAmount">
<JnpfNumber v-model="dataForm.payAmount" placeholder="支付金额" disabled :step="1">
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="确认人" prop="confirmPersonnel">
<p>{{ dataForm.confirmPersonnel }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="确认时间" prop="confirmTime">
<p>{{ dataForm.confirmTime }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="相关附件" prop="billAttachment">
<JnpfUploadFile v-model="dataForm.billAttachment" disabled detailed :fileSize="10"
sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传">
</JnpfUploadFile>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activegecbmb" tab-position="top" class="mb-20">
<el-tab-pane label="空间租金" name="1">
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.tableField140" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="spaceNumber" label="空间编码">
<template slot-scope="scope">
<p>{{ scope.row.spaceNumber }}</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="startTime" label="开始时间">
<template slot-scope="scope">
<p>{{ scope.row.startTime }}</p>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间">
<template slot-scope="scope">
<p>{{ scope.row.endTime }}</p>
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额">
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount" placeholder="账单金额"
disabled :step="1">
</JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="costDescription" label="费用说明">
<template slot-scope="scope">
<p>{{ scope.row.costDescription }}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</el-tab-pane>
<el-tab-pane label="设备租金" name="2">
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.tableField158" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="leaseNumber" label="租赁单号">
<template slot-scope="scope">
<p>{{ scope.row.leaseNumber }}</p>
</template>
</el-table-column>
<el-table-column prop="equipmentNumber" label="设备编码">
<template slot-scope="scope">
<p>{{ scope.row.equipmentNumber }}</p>
</template>
</el-table-column>
<el-table-column prop="equipmentName" label="设备名称">
<template slot-scope="scope">
<p>{{ scope.row.equipmentName }}</p>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间">
<template slot-scope="scope">
<p>{{ scope.row.startTime }}</p>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间">
<template slot-scope="scope">
<p>{{ scope.row.endTime }}</p>
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额">
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount" placeholder="账单金额"
disabled :step="1">
</JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="costDescription" label="费用说明">
<template slot-scope="scope">
<p>{{ scope.row.costDescription }}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</el-tab-pane>
<el-tab-pane label="其它费用" name="3KzarC2">
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.tableField166" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="useAmount" label="使用量">
<template slot-scope="scope">
<p>{{ scope.row.useAmount }}</p>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间">
<template slot-scope="scope">
<p>{{ scope.row.startTime }}</p>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间">
<template slot-scope="scope">
<p>{{ scope.row.endTime }}</p>
</template>
</el-table-column>
<el-table-column prop="billAmount" label="账单金额">
<template slot-scope="scope">
<JnpfNumber v-model="scope.row.billAmount" placeholder="账单金额"
disabled :step="1">
</JnpfNumber>
</template>
</el-table-column>
<el-table-column prop="costDescription" label="费用说明">
<template slot-scope="scope">
<p>{{ scope.row.costDescription }}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</el-tab-pane>
</el-tabs>
</el-col>
</template>
</el-form>
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail },
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
billNumbe : '',
contractId : "",
billStatus : "10",
merchantId : '',
startTime : '',
endTime : '',
billAmount : '',
notificationMethod : "",
noticeTime : '',
notificationState : "2",
payStatus : "1",
payAmount : '',
confirmPersonnel : '',
confirmTime : "",
billAttachment : [],
contractName : '',
merchantName : '',
creationTime : "",
contractNumber : '',
billspacedetailList:[],
billdevicedeatialList:[],
billotherdeatialList:[],
id: '',
billNumbe: '',
contractId: "",
billStatus: "10",
merchantId: '',
startTime: '',
endTime: '',
billAmount: '',
notificationMethod: "",
noticeTime: '',
notificationState: "2",
payStatus: "1",
payAmount: '',
confirmPersonnel: '',
confirmTime: "",
billAttachment: [],
contractName: '',
merchantName: '',
creationTime: "",
contractNumber: '',
billspacedetailList: [],
billdevicedeatialList: [],
billotherdeatialList: [],
},
activegecbmb:'3KzarC2',
billStatusOptions:[{"fullName":"待确认","id":"10"},{"fullName":"已确认","id":"20"},{"fullName":"已驳回","id":"30"},{"fullName":"部分结算","id":"40"},{"fullName":"已结算","id":"50"}],
billStatusProps:{"label":"fullName","value":"id" },
notificationMethodOptions:[{"fullName":"口头","id":"1"},{"fullName":"书面","id":"2"}],
notificationMethodProps:{"label":"fullName","value":"id" },
notificationStateOptions:[{"fullName":"未通知","id":"1"},{"fullName":"已通知","id":"2"}],
notificationStateProps:{"label":"fullName","value":"id" },
payStatusOptions:[{"fullName":"现金","id":"1"},{"fullName":"转账","id":"2"},{"fullName":"汇票","id":"3"}],
payStatusProps:{"label":"fullName","value":"id" },
activegecbmb: '1',
billStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已驳回", "id": "30" }, { "fullName": "部分结算", "id": "40" }, { "fullName": "已结算", "id": "50" }],
billStatusProps: { "label": "fullName", "value": "id" },
notificationMethodOptions: [{ "fullName": "口头", "id": "1" }, { "fullName": "书面", "id": "2" }],
notificationMethodProps: { "label": "fullName", "value": "id" },
notificationStateOptions: [{ "fullName": "未通知", "id": "1" }, { "fullName": "已通知", "id": "2" }],
notificationStateProps: { "label": "fullName", "value": "id" },
payStatusOptions: [{ "fullName": "现金", "id": "1" }, { "fullName": "转账", "id": "2" }, { "fullName": "汇票", "id": "3" }],
payStatusProps: { "label": "fullName", "value": "id" },
}
},
computed: {},
watch: {},
created() {
},
mounted() { },
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
},
computed: {},
watch: {},
created() {
goBack() {
this.$emit('refresh')
},
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)
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/example/BillTable/detail/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
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/BillTable/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
})
},
}
},
}
</script>

File diff suppressed because one or more lines are too long

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