采购模块提交

product
17602169347 2 years ago
parent 79d87eb781
commit b94dd215b6

@ -129,6 +129,7 @@ public class ContractFileController {
public ActionResult create(@RequestBody @Valid ContractFileCrForm contractFileCrForm) throws DataException { public ActionResult create(@RequestBody @Valid ContractFileCrForm contractFileCrForm) throws DataException {
String mainId = RandomUtil.uuId(); String mainId = RandomUtil.uuId();
UserInfo userInfo = userProvider.get(); UserInfo userInfo = userProvider.get();
contractFileCrForm.setStatus("1");
ContractFileEntity entity = JsonUtil.getJsonToBean(contractFileCrForm, ContractFileEntity.class); ContractFileEntity entity = JsonUtil.getJsonToBean(contractFileCrForm, ContractFileEntity.class);
entity.setId(mainId); entity.setId(mainId);
contractFileService.save(entity); contractFileService.save(entity);

@ -15,12 +15,20 @@ import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO; import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.poundlist.entity.PoundlistEntity;
import jnpf.poundlist.service.PoundlistService;
import jnpf.purchaseback.entity.PurchaseorderEntity;
import jnpf.purchaseback.service.PurchaseorderService;
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
import jnpf.purchaseorder.entity.PurchaseorderitemEntity;
import jnpf.purchaseorder.service.PurchaseorderitemService;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity; import jnpf.base.entity.ProvinceEntity;
import jnpf.invoices.model.invoices.*; import jnpf.invoices.model.invoices.*;
import jnpf.invoices.model.invoices.InvoicesPagination; import jnpf.invoices.model.invoices.InvoicesPagination;
import jnpf.invoices.entity.*; import jnpf.invoices.entity.*;
import jnpf.invoices.entity.Invoices_item0Entity; import jnpf.invoices.entity.InvoicesItem1Entity;
import jnpf.invoices.entity.InvoicesItem0Entity;
import jnpf.util.*; import jnpf.util.*;
import jnpf.base.util.*; import jnpf.base.util.*;
import jnpf.base.vo.ListVO; import jnpf.base.vo.ListVO;
@ -34,8 +42,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import jnpf.invoices.entity.InvoicesEntity; import jnpf.invoices.entity.InvoicesEntity;
import jnpf.invoices.service.InvoicesService; import jnpf.invoices.service.InvoicesService;
import jnpf.invoices.entity.Invoices_item0Entity; import jnpf.invoices.entity.InvoicesItem1Entity;
import jnpf.invoices.service.Invoices_item0Service; import jnpf.invoices.service.InvoicesItem1Service;
import jnpf.invoices.entity.InvoicesItem0Entity;
import jnpf.invoices.service.InvoicesItem0Service;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -51,15 +61,15 @@ import jnpf.util.enums.FileTypeEnum;
/** /**
* *
* invoices *
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-29 * @ 2023-02-22
*/ */
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "invoices" , value = "invoices") @Api(tags = "应付发票" , value = "invoices")
@RequestMapping("/api/invoices/Invoices") @RequestMapping("/api/invoices/Invoices")
public class InvoicesController { public class InvoicesController {
@ -76,9 +86,15 @@ public class InvoicesController {
private InvoicesService invoicesService; private InvoicesService invoicesService;
@Autowired @Autowired
private Invoices_item0Service invoices_item0Service; private InvoicesItem1Service invoicesItem1Service;
@Autowired
private InvoicesItem0Service invoicesItem0Service;
@Autowired
private PurchaseorderService purchaseorderService;
@Autowired
private PurchaseorderitemService purchaseorderitemService;
@Autowired
private PoundlistService poundlistService;
/** /**
* *
@ -86,21 +102,21 @@ public class InvoicesController {
* @param invoicesPagination * @param invoicesPagination
* @return * @return
*/ */
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody InvoicesPagination invoicesPagination)throws IOException{ public ActionResult list(@RequestBody InvoicesPagination invoicesPagination)throws IOException{
List<InvoicesEntity> list= invoicesService.getList(invoicesPagination); List<InvoicesEntity> list= invoicesService.getList(invoicesPagination);
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(InvoicesEntity entity:list){ for(InvoicesEntity entity:list){
Map<String,Object> purchaseorderIdMap = new HashMap<>(); Map<String,Object> purchaseorderIdMap = new HashMap<>();
entity.setPurchaseorderId(generaterSwapUtil.getPopupSelectValue("389673535976550149","id","document_no",entity.getPurchaseorderId(),purchaseorderIdMap)); entity.setPurchaseorderId(generaterSwapUtil.getPopupSelectValue("389673535976550149","id","document_no",entity.getPurchaseorderId(),purchaseorderIdMap));
Map<String,Object> contractIdMap = new HashMap<>(); Map<String,Object> contractIdMap = new HashMap<>();
entity.setContractId(generaterSwapUtil.getPopupSelectValue("389673903103979269","id","contract_name",entity.getContractId(),contractIdMap)); entity.setContractId(generaterSwapUtil.getPopupSelectValue("389673903103979269","id","contract_name",entity.getContractId(),contractIdMap));
Map<String,Object> supplierIdMap = new HashMap<>(); Map<String,Object> supplierIdMap = new HashMap<>();
entity.setSupplierId(generaterSwapUtil.getPopupSelectValue("389674191453990661","id","supplier_name",entity.getSupplierId(),supplierIdMap)); entity.setSupplierId(generaterSwapUtil.getPopupSelectValue("389674191453990661","id","supplier_name",entity.getSupplierId(),supplierIdMap));
} }
List<InvoicesListVO> listVO=JsonUtil.getJsonToList(list,InvoicesListVO.class); List<InvoicesListVO> listVO=JsonUtil.getJsonToList(list,InvoicesListVO.class);
for(InvoicesListVO invoicesVO:listVO){ for(InvoicesListVO invoicesVO:listVO){
} }
PageListVO vo=new PageListVO(); PageListVO vo=new PageListVO();
@ -122,33 +138,45 @@ public class InvoicesController {
public ActionResult create(@RequestBody @Valid InvoicesCrForm invoicesCrForm) throws DataException { public ActionResult create(@RequestBody @Valid InvoicesCrForm invoicesCrForm) throws DataException {
String mainId =RandomUtil.uuId(); String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
invoicesCrForm.setDocumentNo(generaterSwapUtil.getBillNumber("yffp", false));
InvoicesEntity entity = JsonUtil.getJsonToBean(invoicesCrForm, InvoicesEntity.class); InvoicesEntity entity = JsonUtil.getJsonToBean(invoicesCrForm, InvoicesEntity.class);
entity.setId(mainId); entity.setId(mainId);
invoicesService.save(entity); invoicesService.save(entity);
List<Invoices_item0Entity> Invoices_item0List = JsonUtil.getJsonToList(invoicesCrForm.getInvoices_item0List(),Invoices_item0Entity.class); List<InvoicesItem1Entity> InvoicesItem1List = JsonUtil.getJsonToList(invoicesCrForm.getInvoicesitem1List(),InvoicesItem1Entity.class);
for(Invoices_item0Entity entitys : Invoices_item0List){ for(InvoicesItem1Entity entitys : InvoicesItem1List){
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setInvoicesId(entity.getId()); entitys.setInvoicesId(entity.getId());
invoicesItem1Service.save(entitys);
}
List<InvoicesItem0Entity> InvoicesItem0List = JsonUtil.getJsonToList(invoicesCrForm.getInvoicesitem0List(),InvoicesItem0Entity.class);
for(InvoicesItem0Entity entitys : InvoicesItem0List){
entitys.setId(RandomUtil.uuId());
invoices_item0Service.save(entitys); entitys.setInvoicesId(entity.getId());
} invoicesItem0Service.save(entitys);
}
//更新采购订单状态
PurchaseorderEntity purchaseorderEntity = purchaseorderService.getById(entity.getPurchaseorderId());
purchaseorderEntity.setStatus("1");//开票中
purchaseorderEntity.setInvoiceAmount(entity.getInvoiceAmount());
purchaseorderEntity.setInvoiceNum(entity.getInvoiceQuantity());
purchaseorderService.updateById(purchaseorderEntity);
List<Purchaseorder_item0Entity> jg_purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(entity.getPurchaseorderId());
for (Purchaseorder_item0Entity purchaseorder_item0Entity: jg_purchaseorder_item0List) {
PoundlistEntity poundlistEntity = poundlistService.getById(purchaseorder_item0Entity.getPoundlistId());
poundlistEntity.setPurchaseStatus("1");
poundlistEntity.setIsInvoicing("1");
poundlistService.updateById(poundlistEntity);
}
return ActionResult.success("创建成功"); return ActionResult.success("创建成功");
} }
/** /**
* *
* *
* @return * @return
*/ */
@ApiOperation("模板下载") @ApiOperation("模板下载")
@GetMapping("/templateDownload") @GetMapping("/templateDownload")
public ActionResult<DownloadVO> TemplateDownload(){ public ActionResult<DownloadVO> TemplateDownload(){
@ -163,10 +191,10 @@ public class InvoicesController {
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* Excel * Excel
* *
* @return * @return
*/ */
@ApiOperation("导出Excel") @ApiOperation("导出Excel")
@GetMapping("/Actions/Export") @GetMapping("/Actions/Export")
public ActionResult Export(InvoicesPaginationExportModel invoicesPaginationExportModel) throws IOException { public ActionResult Export(InvoicesPaginationExportModel invoicesPaginationExportModel) throws IOException {
@ -176,17 +204,17 @@ public class InvoicesController {
InvoicesPagination invoicesPagination=JsonUtil.getJsonToBean(invoicesPaginationExportModel, InvoicesPagination.class); InvoicesPagination invoicesPagination=JsonUtil.getJsonToBean(invoicesPaginationExportModel, InvoicesPagination.class);
List<InvoicesEntity> list= invoicesService.getTypeList(invoicesPagination,invoicesPaginationExportModel.getDataType()); List<InvoicesEntity> list= invoicesService.getTypeList(invoicesPagination,invoicesPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(InvoicesEntity entity:list){ for(InvoicesEntity entity:list){
Map<String,Object> purchaseorderIdMap = new HashMap<>(); Map<String,Object> purchaseorderIdMap = new HashMap<>();
entity.setPurchaseorderId(generaterSwapUtil.getPopupSelectValue("389673535976550149","id","document_no",entity.getPurchaseorderId(),purchaseorderIdMap)); entity.setPurchaseorderId(generaterSwapUtil.getPopupSelectValue("389673535976550149","id","document_no",entity.getPurchaseorderId(),purchaseorderIdMap));
Map<String,Object> contractIdMap = new HashMap<>(); Map<String,Object> contractIdMap = new HashMap<>();
entity.setContractId(generaterSwapUtil.getPopupSelectValue("389673903103979269","id","contract_name",entity.getContractId(),contractIdMap)); entity.setContractId(generaterSwapUtil.getPopupSelectValue("389673903103979269","id","contract_name",entity.getContractId(),contractIdMap));
Map<String,Object> supplierIdMap = new HashMap<>(); Map<String,Object> supplierIdMap = new HashMap<>();
entity.setSupplierId(generaterSwapUtil.getPopupSelectValue("389674191453990661","id","supplier_name",entity.getSupplierId(),supplierIdMap)); entity.setSupplierId(generaterSwapUtil.getPopupSelectValue("389674191453990661","id","supplier_name",entity.getSupplierId(),supplierIdMap));
} }
List<InvoicesListVO> listVO=JsonUtil.getJsonToList(list,InvoicesListVO.class); List<InvoicesListVO> listVO=JsonUtil.getJsonToList(list,InvoicesListVO.class);
for(InvoicesListVO invoicesVO:listVO){ for(InvoicesListVO invoicesVO:listVO){
} }
//转换为map输出 //转换为map输出
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss")); List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss"));
@ -198,34 +226,34 @@ public class InvoicesController {
//导出表格 //导出表格
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){ public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build(); DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>(); List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){ if(keys.length>0){
for(String key:keys){ for(String key:keys){
switch(key){ switch(key){
case "documentNo" : case "documentNo" :
entitys.add(new ExcelExportEntity("单据编号" ,"documentNo")); entitys.add(new ExcelExportEntity("单据编号" ,"documentNo"));
break; break;
case "businessDate" : case "businessDate" :
entitys.add(new ExcelExportEntity("业务日期" ,"businessDate")); entitys.add(new ExcelExportEntity("业务日期" ,"businessDate"));
break; break;
case "amount" : case "amount" :
entitys.add(new ExcelExportEntity("金额" ,"amount")); entitys.add(new ExcelExportEntity("金额" ,"amount"));
break; break;
case "quantity" : case "quantity" :
entitys.add(new ExcelExportEntity("数量" ,"quantity")); entitys.add(new ExcelExportEntity("数量" ,"quantity"));
break; break;
case "invoiceType" : case "invoiceType" :
entitys.add(new ExcelExportEntity("发票类型" ,"invoiceType")); entitys.add(new ExcelExportEntity("发票类型" ,"invoiceType"));
break; break;
case "currency" : case "currency" :
entitys.add(new ExcelExportEntity("币别 " ,"currency")); entitys.add(new ExcelExportEntity("币别 " ,"currency"));
break; break;
case "remark" : case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark")); entitys.add(new ExcelExportEntity("备注" ,"remark"));
break; break;
case "invoiceAmount" : case "invoiceAmount" :
entitys.add(new ExcelExportEntity("发票金额" ,"invoiceAmount")); entitys.add(new ExcelExportEntity("发票金额" ,"invoiceAmount"));
break; break;
case "invoiceQuantity" : case "invoiceQuantity" :
entitys.add(new ExcelExportEntity("发票数量" ,"invoiceQuantity")); entitys.add(new ExcelExportEntity("发票数量" ,"invoiceQuantity"));
break; break;
@ -236,37 +264,37 @@ public class InvoicesController {
entitys.add(new ExcelExportEntity("制单人" ,"creatorUserName")); entitys.add(new ExcelExportEntity("制单人" ,"creatorUserName"));
break; break;
case "purchaseorderId" : case "purchaseorderId" :
entitys.add(new ExcelExportEntity("采购订单号" ,"purchaseorderId")); entitys.add(new ExcelExportEntity("采购订单号" ,"purchaseorderId"));
break; break;
case "contractId" : case "contractId" :
entitys.add(new ExcelExportEntity("合同名称" ,"contractId")); entitys.add(new ExcelExportEntity("合同名称" ,"contractId"));
break; break;
case "supplierId" : case "supplierId" :
entitys.add(new ExcelExportEntity("供应商" ,"supplierId")); entitys.add(new ExcelExportEntity("供应商" ,"supplierId"));
break; break;
default: default:
break; break;
}
} }
} }
}
ExportParams exportParams = new ExportParams(null, "表单信息"); ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF); exportParams.setType(ExcelType.XSSF);
try{ try{
@Cleanup Workbook workbook = new HSSFWorkbook(); @Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){ if (entitys.size()>0){
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
} }
String name = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx"; String name = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
String fileName = configValueUtil.getTemporaryFilePath() + name; String fileName = configValueUtil.getTemporaryFilePath() + name;
@Cleanup FileOutputStream output = new FileOutputStream(XSSEscape.escapePath(fileName)); @Cleanup FileOutputStream output = new FileOutputStream(XSSEscape.escapePath(fileName));
workbook.write(output); workbook.write(output);
//上传文件 //上传文件
UploadUtil.uploadFile(configValueUtil.getFileType(), fileName, FileTypeEnum.TEMPORARY, name); UploadUtil.uploadFile(configValueUtil.getFileType(), fileName, FileTypeEnum.TEMPORARY, name);
vo.setName(name); vo.setName(name);
vo.setUrl(UploaderUtil.uploaderFile(userInfo.getId() + "#" + name + "#" + "Temporary")); vo.setUrl(UploaderUtil.uploaderFile(userInfo.getId() + "#" + name + "#" + "Temporary"));
} catch (Exception e) { } catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage()); log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace(); e.printStackTrace();
@ -285,7 +313,7 @@ public class InvoicesController {
@Transactional @Transactional
public ActionResult batchRemove(@PathVariable("ids") String ids){ public ActionResult batchRemove(@PathVariable("ids") String ids){
String[] idList = ids.split(","); String[] idList = ids.split(",");
int i =0; int i =0;
for (String allId : idList){ for (String allId : idList){
this.delete(allId); this.delete(allId);
i++; i++;
@ -293,49 +321,60 @@ public class InvoicesController {
if (i == 0 ){ if (i == 0 ){
return ActionResult.fail("删除失败"); return ActionResult.fail("删除失败");
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");
} }
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@GetMapping("/{id}") @GetMapping("/{id}")
public ActionResult<InvoicesInfoVO> info(@PathVariable("id") String id){ public ActionResult<InvoicesInfoVO> info(@PathVariable("id") String id){
InvoicesEntity entity= invoicesService.getInfo(id); InvoicesEntity entity= invoicesService.getInfo(id);
InvoicesInfoVO vo=JsonUtil.getJsonToBean(entity, InvoicesInfoVO.class); InvoicesInfoVO vo=JsonUtil.getJsonToBean(entity, InvoicesInfoVO.class);
//子表 //子表
List<Invoices_item0Entity> Invoices_item0List = invoicesService.GetInvoices_item0List(id); List<InvoicesItem1Entity> InvoicesItem1List = invoicesService.GetInvoicesItem1List(id);
for(Invoices_item0Entity invoices_item0Entity : Invoices_item0List){ for(InvoicesItem1Entity invoicesitem1Entity : InvoicesItem1List){
} }
vo.setInvoices_item0List(JsonUtil.getJsonToList(Invoices_item0List,Invoices_item0Model.class )); vo.setInvoicesItem1List(JsonUtil.getJsonToList(InvoicesItem1List,InvoicesItem1Model.class ));
//副表 List<InvoicesItem0Entity> InvoicesItem0List = invoicesService.GetInvoicesItem0List(id);
for(InvoicesItem0Entity invoicesitem0Entity : InvoicesItem0List){
}
vo.setInvoicesItem0List(JsonUtil.getJsonToList(InvoicesItem0List,InvoicesItem0Model.class ));
//副表
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* () * ()
* *
* @param id * @param id
* @return * @return
*/ */
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ActionResult<InvoicesInfoVO> detailInfo(@PathVariable("id") String id){ public ActionResult<InvoicesInfoVO> detailInfo(@PathVariable("id") String id){
InvoicesEntity entity= invoicesService.getInfo(id); InvoicesEntity entity= invoicesService.getInfo(id);
InvoicesInfoVO vo=JsonUtil.getJsonToBean(entity, InvoicesInfoVO.class); InvoicesInfoVO vo=JsonUtil.getJsonToBean(entity, InvoicesInfoVO.class);
//子表数据转换 //子表数据转换
List<Invoices_item0Entity> jg_invoices_item0List = invoicesService.GetInvoices_item0List(id); List<InvoicesItem1Entity> jg_invoices_item1List = invoicesService.GetInvoicesItem1List(id);
List<Invoices_item0Model> jg_invoices_item0ModelList = JsonUtil.getJsonToList(jg_invoices_item0List,Invoices_item0Model.class); List<InvoicesItem1Model> jg_invoices_item1ModelList = JsonUtil.getJsonToList(jg_invoices_item1List,InvoicesItem1Model.class);
for(Invoices_item0Model jg_invoices_item0Model : jg_invoices_item0ModelList){ for(InvoicesItem1Model jg_invoices_item1Model : jg_invoices_item1ModelList){
} Map<String,Object> materialIdMap = new HashMap<>();
vo.setInvoices_item0List(jg_invoices_item0ModelList); jg_invoices_item1Model.setMaterialId(generaterSwapUtil.getPopupSelectValue("397736371898382533","id","item_name",jg_invoices_item1Model.getMaterialId(),materialIdMap));
}
vo.setInvoicesItem1List(jg_invoices_item1ModelList);
List<InvoicesItem0Entity> jg_invoices_item0List = invoicesService.GetInvoicesItem0List(id);
List<InvoicesItem0Model> jg_invoices_item0ModelList = JsonUtil.getJsonToList(jg_invoices_item0List,InvoicesItem0Model.class);
for(InvoicesItem0Model jg_invoices_item0Model : jg_invoices_item0ModelList){
}
vo.setInvoicesItem0List(jg_invoices_item0ModelList);
//附表数据转换 //附表数据转换
//添加到详情表单对象中 //添加到详情表单对象中
Map<String,Object> purchaseorderIdMap = new HashMap<>(); Map<String,Object> purchaseorderIdMap = new HashMap<>();
@ -346,17 +385,17 @@ public class InvoicesController {
vo.setSupplierId(generaterSwapUtil.getPopupSelectValue("389674191453990661","id","supplier_name",vo.getSupplierId(),supplierIdMap)); vo.setSupplierId(generaterSwapUtil.getPopupSelectValue("389674191453990661","id","supplier_name",vo.getSupplierId(),supplierIdMap));
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@PutMapping("/{id}") @PutMapping("/{id}")
@Transactional @Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid InvoicesUpForm invoicesUpForm) throws DataException { public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid InvoicesUpForm invoicesUpForm) throws DataException {
@ -365,24 +404,38 @@ public class InvoicesController {
if(entity!=null){ if(entity!=null){
InvoicesEntity subentity=JsonUtil.getJsonToBean(invoicesUpForm, InvoicesEntity.class); InvoicesEntity subentity=JsonUtil.getJsonToBean(invoicesUpForm, InvoicesEntity.class);
invoicesService.update(id, subentity); invoicesService.update(id, subentity);
QueryWrapper<InvoicesItem1Entity> InvoicesItem1queryWrapper = new QueryWrapper<>();
QueryWrapper<Invoices_item0Entity> Invoices_item0queryWrapper = new QueryWrapper<>(); InvoicesItem1queryWrapper.lambda().eq(InvoicesItem1Entity::getInvoicesId, entity.getId());
Invoices_item0queryWrapper.lambda().eq(Invoices_item0Entity::getInvoicesId, entity.getId()); invoicesItem1Service.remove(InvoicesItem1queryWrapper);
invoices_item0Service.remove(Invoices_item0queryWrapper); List<InvoicesItem1Entity> InvoicesItem1List = JsonUtil.getJsonToList(invoicesUpForm.getInvoicesitem1List(),InvoicesItem1Entity.class);
for(InvoicesItem1Entity entitys : InvoicesItem1List){
List<Invoices_item0Entity> Invoices_item0List = JsonUtil.getJsonToList(invoicesUpForm.getInvoices_item0List(),Invoices_item0Entity.class);
for(Invoices_item0Entity entitys : Invoices_item0List){
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setInvoicesId(entity.getId()); entitys.setInvoicesId(entity.getId());
invoices_item0Service.save(entitys); invoicesItem1Service.save(entitys);
} }
QueryWrapper<InvoicesItem0Entity> InvoicesItem0queryWrapper = new QueryWrapper<>();
return ActionResult.success("更新成功"); InvoicesItem0queryWrapper.lambda().eq(InvoicesItem0Entity::getInvoicesId, entity.getId());
invoicesItem0Service.remove(InvoicesItem0queryWrapper);
List<InvoicesItem0Entity> InvoicesItem0List = JsonUtil.getJsonToList(invoicesUpForm.getInvoicesitem0List(),InvoicesItem0Entity.class);
for(InvoicesItem0Entity entitys : InvoicesItem0List){
entitys.setId(RandomUtil.uuId());
entitys.setInvoicesId(entity.getId());
invoicesItem0Service.save(entitys);
}
//更新采购订单状态
PurchaseorderEntity purchaseorderEntity = purchaseorderService.getById(entity.getPurchaseorderId());
purchaseorderEntity.setStatus("1");//开票中
purchaseorderEntity.setInvoiceAmount(entity.getInvoiceAmount());
purchaseorderEntity.setInvoiceNum(entity.getInvoiceQuantity());
purchaseorderService.updateById(purchaseorderEntity);
List<Purchaseorder_item0Entity> jg_purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(entity.getPurchaseorderId());
for (Purchaseorder_item0Entity purchaseorder_item0Entity: jg_purchaseorder_item0List) {
PoundlistEntity poundlistEntity = poundlistService.getById(purchaseorder_item0Entity.getPoundlistId());
poundlistEntity.setPurchaseStatus("1");
poundlistEntity.setIsInvoicing("1");
poundlistService.updateById(poundlistEntity);
}
return ActionResult.success("更新成功");
}else{ }else{
return ActionResult.fail("更新失败,数据不存在"); return ActionResult.fail("更新失败,数据不存在");
} }
@ -390,21 +443,24 @@ public class InvoicesController {
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Transactional @Transactional
public ActionResult delete(@PathVariable("id") String id){ public ActionResult delete(@PathVariable("id") String id){
InvoicesEntity entity= invoicesService.getInfo(id); InvoicesEntity entity= invoicesService.getInfo(id);
if(entity!=null){ if(entity!=null){
invoicesService.delete(entity); invoicesService.delete(entity);
QueryWrapper<Invoices_item0Entity> queryWrapperInvoices_item0=new QueryWrapper<>(); QueryWrapper<InvoicesItem1Entity> queryWrapperInvoicesItem1=new QueryWrapper<>();
queryWrapperInvoices_item0.lambda().eq(Invoices_item0Entity::getInvoicesId,entity.getId()); queryWrapperInvoicesItem1.lambda().eq(InvoicesItem1Entity::getInvoicesId,entity.getId());
invoices_item0Service.remove(queryWrapperInvoices_item0); invoicesItem1Service.remove(queryWrapperInvoicesItem1);
QueryWrapper<InvoicesItem0Entity> queryWrapperInvoicesItem0=new QueryWrapper<>();
queryWrapperInvoicesItem0.lambda().eq(InvoicesItem0Entity::getInvoicesId,entity.getId());
invoicesItem0Service.remove(queryWrapperInvoicesItem0);
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");

@ -1,150 +0,0 @@
package jnpf.invoices.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-29
*/
@Data
@TableName("jg_contract")
public class ContractinvoicesEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deleteTime;
@TableField("DELETE_MARK")
private String deleteMark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("CONTRACT_CODE")
private String contractCode;
@TableField("CONTRACT_NAME")
private String contractName;
@TableField("CONTRACT_NO")
private String contractNo;
@TableField("CONTRACT_TYPE")
private String contractType;
@TableField("CLASSIFICATION")
private String classification;
@TableField("DECLARATION_DATE")
private Date declarationDate;
@TableField("CODE")
private String code;
@TableField("NAME")
private String name;
@TableField("NUM")
private BigDecimal num;
@TableField("AMOUNT")
private BigDecimal amount;
@TableField("DEPT_CODE")
private String deptCode;
@TableField("DEPT_NAME")
private String deptName;
@TableField("STATUS")
private String status;
@TableField("BID_OPENING_DATE")
private Date bidOpeningDate;
@TableField("START_DATE")
private Date startDate;
@TableField("AUDIT_DATE")
private Date auditDate;
@TableField("COMPLETION_DATE")
private Date completionDate;
@TableField("CLOSING_DATE")
private Date closingDate;
@TableField("COLLECTION_CYCLE")
private Integer collectionCycle;
@TableField("SIGNING_DATE")
private Date signingDate;
@TableField("END_DATE")
private Date endDate;
@TableField("CURRENCY")
private String currency;
@TableField("ORGANIZATION")
private String organization;
@TableField("REMARK")
private String remark;
@TableField("APPROVAL")
private String approval;
@TableField("EXCHANGE_RATE")
private String exchangeRate;
@TableField("BANK_NO")
private String bankNo;
@TableField("TAX_NO")
private String taxNo;
}

@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-29 * @ 2023-02-22
*/ */
@Data @Data
@TableName("jg_invoices") @TableName("jg_invoices")

@ -20,11 +20,11 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-29 * @ 2023-02-22
*/ */
@Data @Data
@TableName("jg_invoices_item0") @TableName("jg_invoices_item0")
public class Invoices_item0Entity { public class InvoicesItem0Entity {
@TableId("ID") @TableId("ID")
private String id; private String id;
@ -101,4 +101,10 @@ public class Invoices_item0Entity {
@TableField("INVOICES_ID") @TableField("INVOICES_ID")
private String invoicesId; private String invoicesId;
@TableField("MATERIAL_NAME")
private String materialName;
@TableField("PURCHASEORDER_ID")
private String purchaseorderId;
} }

@ -21,11 +21,11 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-29 * @ 2023-02-22
*/ */
@Data @Data
@TableName("jg_invoices_item1") @TableName("jg_invoices_item1")
public class Invoices_item1Entity { public class InvoicesItem1Entity {
@TableId("ID") @TableId("ID")
private String id; private String id;

@ -1,149 +0,0 @@
package jnpf.invoices.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-29
*/
@Data
@TableName("jg_purchaseorder")
public class PurchaseorderinvoicesEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deleteTime;
@TableField("DELETE_MARK")
private String deleteMark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("DOCUMENT_NO")
private String documentNo;
@TableField("ERP_NO")
private String erpNo;
@TableField("CONTRACT_CODE")
private String contractCode;
@TableField("CONTRACT_NAME")
private String contractName;
@TableField("CONTRACT_NO")
private String contractNo;
@TableField("SUPPLIER_CODE")
private String supplierCode;
@TableField("SUPPLIER_NAME")
private String supplierName;
@TableField("NUM")
private BigDecimal num;
@TableField("AMOUNT")
private BigDecimal amount;
@TableField("NOT_AMOUNT")
private BigDecimal notAmount;
@TableField("RATE")
private BigDecimal rate;
@TableField("POUND_NUM")
private Integer poundNum;
@TableField("CURRENCY")
private String currency;
@TableField("ADVANCE_AMOUNT")
private BigDecimal advanceAmount;
@TableField("PAY_PRICE")
private BigDecimal payPrice;
@TableField("INVOICE_NUM")
private BigDecimal invoiceNum;
@TableField("INVOICE_AMOUNT")
private BigDecimal invoiceAmount;
@TableField("REFUNDABLE_NUM")
private BigDecimal refundableNum;
@TableField("REFUNDABLE_AMOUNT")
private BigDecimal refundableAmount;
@TableField("STATUS")
private String status;
@TableField("SOURCE_SYSTEM")
private String sourceSystem;
@TableField("IS_SETTLE")
private String isSettle;
@TableField("ISSUE")
private String issue;
@TableField("IS_TRANSFER")
private String isTransfer;
@TableField("REMARK")
private String remark;
}

@ -1,103 +0,0 @@
package jnpf.invoices.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-29
*/
@Data
@TableName("jg_supplier")
public class SupplierinvoicesEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deleteTime;
@TableField("DELETE_MARK")
private String deleteMark;
@TableField("SUPPLIER_CODE")
private String supplierCode;
@TableField("SUPPLIER_NAME")
private String supplierName;
@TableField("SUPPLIER_SITE_ID")
private String supplierSiteId;
@TableField("SUPPLIER_SITE_CODE")
private String supplierSiteCode;
@TableField("COMPANY_ID")
private String companyId;
@TableField("COMPANY_NAME")
private String companyName;
@TableField("VAT_REGISTRATION_NUM")
private String vatRegistrationNum;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("SUPPLY")
private Integer supply;
@TableField("CONTACT_NAME")
private String contactName;
@TableField("CONTACT_PHONE")
private String contactPhone;
@TableField("SUPPLIER_LEVEL")
private String supplierLevel;
@TableField("ADDRESS")
private String address;
@TableField("STATUS")
private String status;
}

@ -1,17 +0,0 @@
package jnpf.invoices.mapper;
import jnpf.invoices.entity.ContractinvoicesEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
*
* jg_contract
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-29
*/
public interface ContractinvoicesMapper extends BaseMapper<ContractinvoicesEntity> {
}

@ -1,7 +1,7 @@
package jnpf.invoices.mapper; package jnpf.invoices.mapper;
import jnpf.invoices.entity.Invoices_item0Entity; import jnpf.invoices.entity.InvoicesItem0Entity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
@ -10,8 +10,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-29 * 2023-02-22
*/ */
public interface Invoices_item0Mapper extends BaseMapper<Invoices_item0Entity> { public interface InvoicesItem0Mapper extends BaseMapper<InvoicesItem0Entity> {
} }

@ -1,7 +1,7 @@
package jnpf.invoices.mapper; package jnpf.invoices.mapper;
import jnpf.invoices.entity.Invoices_item1Entity; import jnpf.invoices.entity.InvoicesItem1Entity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
@ -10,8 +10,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-29 * 2023-02-22
*/ */
public interface Invoices_item1Mapper extends BaseMapper<Invoices_item1Entity> { public interface InvoicesItem1Mapper extends BaseMapper<InvoicesItem1Entity> {
} }

@ -6,11 +6,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* *
* invoices *
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-29 * 2023-02-22
*/ */
public interface InvoicesMapper extends BaseMapper<InvoicesEntity> { public interface InvoicesMapper extends BaseMapper<InvoicesEntity> {

@ -1,17 +0,0 @@
package jnpf.invoices.mapper;
import jnpf.invoices.entity.PurchaseorderinvoicesEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
*
* jg_purchaseorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-29
*/
public interface PurchaseorderinvoicesMapper extends BaseMapper<PurchaseorderinvoicesEntity> {
}

@ -1,17 +0,0 @@
package jnpf.invoices.mapper;
import jnpf.invoices.entity.SupplierinvoicesEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
*
* jg_supplier
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-29
*/
public interface SupplierinvoicesMapper extends BaseMapper<SupplierinvoicesEntity> {
}

@ -2,8 +2,11 @@
package jnpf.invoices.model.invoices; package jnpf.invoices.model.invoices;
import jnpf.invoices.model.invoices.Invoices_item0Model; import jnpf.invoices.model.invoices.InvoicesItem1Model;
import jnpf.invoices.model.invoices.InvoicesItem0Model;
import lombok.Data; import lombok.Data;
import java.util.Date;
import java.util.List; import java.util.List;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -15,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-29 * @ 2023-02-22
*/ */
@Data @Data
public class InvoicesCrForm { public class InvoicesCrForm {
@ -26,15 +29,15 @@ public class InvoicesCrForm {
/** 业务日期 **/ /** 业务日期 **/
@JsonProperty("businessDate") @JsonProperty("businessDate")
private Long businessDate; private Date businessDate;
/** 金额 **/ /** 金额 **/
@JsonProperty("amount") @JsonProperty("amount")
private String amount; private BigDecimal amount;
/** 数量 **/ /** 数量 **/
@JsonProperty("quantity") @JsonProperty("quantity")
private String quantity; private BigDecimal quantity;
/** 发票类型 **/ /** 发票类型 **/
@JsonProperty("invoiceType") @JsonProperty("invoiceType")
@ -48,21 +51,17 @@ public class InvoicesCrForm {
@JsonProperty("remark") @JsonProperty("remark")
private String remark; private String remark;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 发票金额 **/ /** 发票金额 **/
@JsonProperty("invoiceAmount") @JsonProperty("invoiceAmount")
private String invoiceAmount; private BigDecimal invoiceAmount;
/** 发票数量 **/ /** 发票数量 **/
@JsonProperty("invoiceQuantity") @JsonProperty("invoiceQuantity")
private String invoiceQuantity; private BigDecimal invoiceQuantity;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 制单人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 采购订单号 **/ /** 采购订单号 **/
@JsonProperty("purchaseorderId") @JsonProperty("purchaseorderId")
@ -77,8 +76,11 @@ public class InvoicesCrForm {
private String supplierId; private String supplierId;
/** 子表数据 **/ /** 子表数据 **/
@JsonProperty("invoices_item0List") @JsonProperty("invoicesitem1List")
private List<Invoices_item0Model> invoices_item0List; private List<InvoicesItem1Model> invoicesitem1List;
/** 子表数据 **/
@JsonProperty("invoicesitem0List")
private List<InvoicesItem0Model> invoicesitem0List;
} }

@ -3,7 +3,8 @@
package jnpf.invoices.model.invoices; package jnpf.invoices.model.invoices;
import jnpf.invoices.model.invoices.Invoices_item0Model; import jnpf.invoices.model.invoices.InvoicesItem1Model;
import jnpf.invoices.model.invoices.InvoicesItem0Model;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List; import java.util.List;
@ -16,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-29 * @ 2023-02-22
*/ */
@Data @Data
public class InvoicesInfoVO{ public class InvoicesInfoVO{
@ -34,11 +35,11 @@ public class InvoicesInfoVO{
/** 金额 **/ /** 金额 **/
@JsonProperty("amount") @JsonProperty("amount")
private String amount; private BigDecimal amount;
/** 数量 **/ /** 数量 **/
@JsonProperty("quantity") @JsonProperty("quantity")
private String quantity; private BigDecimal quantity;
/** 发票类型 **/ /** 发票类型 **/
@JsonProperty("invoiceType") @JsonProperty("invoiceType")
@ -52,21 +53,17 @@ public class InvoicesInfoVO{
@JsonProperty("remark") @JsonProperty("remark")
private String remark; private String remark;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 发票金额 **/ /** 发票金额 **/
@JsonProperty("invoiceAmount") @JsonProperty("invoiceAmount")
private String invoiceAmount; private BigDecimal invoiceAmount;
/** 发票数量 **/ /** 发票数量 **/
@JsonProperty("invoiceQuantity") @JsonProperty("invoiceQuantity")
private String invoiceQuantity; private BigDecimal invoiceQuantity;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 制单人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 采购订单号 **/ /** 采购订单号 **/
@JsonProperty("purchaseorderId") @JsonProperty("purchaseorderId")
@ -81,6 +78,9 @@ public class InvoicesInfoVO{
private String supplierId; private String supplierId;
/** 子表数据 **/ /** 子表数据 **/
@JsonProperty("invoices_item0List") @JsonProperty("invoicesitem1List")
private List<Invoices_item0Model> invoices_item0List; private List<InvoicesItem1Model> invoicesItem1List;
/** 子表数据 **/
@JsonProperty("invoicesitem0List")
private List<InvoicesItem0Model> invoicesItem0List;
} }

@ -13,10 +13,14 @@ import com.alibaba.fastjson.annotation.JSONField;
* V3.2.0 * V3.2.0
* : LINKAGE-BOOT * : LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-29 * 2023-02-22
*/ */
@Data @Data
public class Invoices_item0Model { public class InvoicesItem0Model {
/** 物料名称 **/
@JsonProperty("materialName")
private String materialName;
/** 发票代码 **/ /** 发票代码 **/
@JsonProperty("invoiceCode") @JsonProperty("invoiceCode")
@ -26,6 +30,26 @@ public class Invoices_item0Model {
@JsonProperty("invoiceNo") @JsonProperty("invoiceNo")
private String invoiceNo; private String invoiceNo;
/** 发票数量 **/
@JsonProperty("invoiceQuantity")
private String invoiceQuantity;
/** 发票金额 **/
@JsonProperty("invoiceAmount")
private String invoiceAmount;
/** 税率 **/
@JsonProperty("taxRate")
private String taxRate;
/** 税额 **/
@JsonProperty("taxAmount")
private String taxAmount;
/** 不含税金额 **/
@JsonProperty("amountNotTax")
private String amountNotTax;
/** 发票状态 **/ /** 发票状态 **/
@JsonProperty("invoiceStatus") @JsonProperty("invoiceStatus")
private String invoiceStatus; private String invoiceStatus;
@ -38,7 +62,4 @@ public class Invoices_item0Model {
@JsonProperty("invoicingDate") @JsonProperty("invoicingDate")
private Long invoicingDate; private Long invoicingDate;
/** 备注信息 **/
@JsonProperty("remark")
private String remark;
} }

@ -0,0 +1,54 @@
package jnpf.invoices.model.invoices;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
*
* V3.2.0
* : LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-22
*/
@Data
public class InvoicesItem1Model {
/** 物料 **/
@JsonProperty("materialId")
private String materialId;
/** 数量 **/
@JsonProperty("quantity")
private String quantity;
/** 单价 **/
@JsonProperty("unitPrice")
private String unitPrice;
/** 金额 **/
@JsonProperty("amount")
private String amount;
/** 税率 **/
@JsonProperty("taxRate")
private String taxRate;
/** 税额 **/
@JsonProperty("taxAmount")
private String taxAmount;
/** 不含税金额 **/
@JsonProperty("amountNotTax")
private String amountNotTax;
/** 备注信息 **/
@JsonProperty("remark")
private String remark;
}

@ -10,7 +10,7 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-29 * @ 2023-02-22
*/ */
@Data @Data
public class InvoicesListQuery extends Pagination { public class InvoicesListQuery extends Pagination {

@ -15,7 +15,7 @@ import java.math.BigDecimal;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-29 * @ 2023-02-22
*/ */
@Data @Data
public class InvoicesListVO{ public class InvoicesListVO{
@ -37,13 +37,11 @@ public class InvoicesListVO{
/** 金额 **/ /** 金额 **/
@JsonProperty("amount") @JsonProperty("amount")
private String amount; private BigDecimal amount;
/** 数量 **/ /** 数量 **/
@JsonProperty("quantity") @JsonProperty("quantity")
private String quantity; private BigDecimal quantity;
/** 发票类型 **/ /** 发票类型 **/
@JsonProperty("invoiceType") @JsonProperty("invoiceType")
@ -60,25 +58,18 @@ public class InvoicesListVO{
private String remark; private String remark;
/** 发票金额 **/
@JsonProperty("invoiceAmount")
private String invoiceAmount;
/** 发票数量 **/
@JsonProperty("invoiceQuantity")
private String invoiceQuantity;
/** 单据状态 **/ /** 单据状态 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;
/** 制单人 **/ /** 发票金额 **/
@JsonProperty("creatorUserName") @JsonProperty("invoiceAmount")
private String creatorUserName; private BigDecimal invoiceAmount;
/** 发票数量 **/
@JsonProperty("invoiceQuantity")
private BigDecimal invoiceQuantity;
/** 采购订单号 **/ /** 采购订单号 **/
@JsonProperty("purchaseorderId") @JsonProperty("purchaseorderId")

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-29 * @ 2023-02-22
*/ */
@Data @Data
public class InvoicesPagination extends Pagination { public class InvoicesPagination extends Pagination {

@ -9,7 +9,7 @@ import java.util.*;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-29 * @ 2023-02-22
*/ */
@Data @Data
public class InvoicesPaginationExportModel extends Pagination { public class InvoicesPaginationExportModel extends Pagination {

@ -2,7 +2,8 @@
package jnpf.invoices.model.invoices; package jnpf.invoices.model.invoices;
import jnpf.invoices.model.invoices.Invoices_item0Model; import jnpf.invoices.model.invoices.InvoicesItem1Model;
import jnpf.invoices.model.invoices.InvoicesItem0Model;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -16,7 +17,7 @@ import lombok.Data;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-29 * @ 2023-02-22
*/ */
@Data @Data
public class InvoicesUpForm{ public class InvoicesUpForm{
@ -36,12 +37,12 @@ public class InvoicesUpForm{
/** 金额 **/ /** 金额 **/
@JsonProperty("amount") @JsonProperty("amount")
private String amount; private BigDecimal amount;
/** 数量 **/ /** 数量 **/
@JsonProperty("quantity") @JsonProperty("quantity")
private String quantity; private BigDecimal quantity;
/** 发票类型 **/ /** 发票类型 **/
@ -59,24 +60,19 @@ public class InvoicesUpForm{
private String remark; private String remark;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 发票金额 **/ /** 发票金额 **/
@JsonProperty("invoiceAmount") @JsonProperty("invoiceAmount")
private String invoiceAmount; private BigDecimal invoiceAmount;
/** 发票数量 **/ /** 发票数量 **/
@JsonProperty("invoiceQuantity") @JsonProperty("invoiceQuantity")
private String invoiceQuantity; private BigDecimal invoiceQuantity;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 制单人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 采购订单号 **/ /** 采购订单号 **/
@ -94,7 +90,10 @@ public class InvoicesUpForm{
private String supplierId; private String supplierId;
/** 子表数据 **/ /** 子表数据 **/
@JsonProperty("invoices_item0List") @JsonProperty("invoicesitem1List")
private List<Invoices_item0Model> invoices_item0List; private List<InvoicesItem1Model> invoicesitem1List;
/** 子表数据 **/
@JsonProperty("invoicesitem0List")
private List<InvoicesItem0Model> invoicesitem0List;
} }

@ -1,15 +0,0 @@
package jnpf.invoices.service;
import jnpf.invoices.entity.ContractinvoicesEntity;
import com.baomidou.mybatisplus.extension.service.IService;
/**
*
* jg_contract
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-29
*/
public interface ContractinvoicesService extends IService<ContractinvoicesEntity> {
}

@ -1,6 +1,6 @@
package jnpf.invoices.service; package jnpf.invoices.service;
import jnpf.invoices.entity.Invoices_item0Entity; import jnpf.invoices.entity.InvoicesItem0Entity;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
/** /**
* *
@ -8,8 +8,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-29 * 2023-02-22
*/ */
public interface Invoices_item0Service extends IService<Invoices_item0Entity> { public interface InvoicesItem0Service extends IService<InvoicesItem0Entity> {
} }

@ -1,6 +1,6 @@
package jnpf.invoices.service; package jnpf.invoices.service;
import jnpf.invoices.entity.Invoices_item1Entity; import jnpf.invoices.entity.InvoicesItem1Entity;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
/** /**
* *
@ -8,8 +8,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-29 * 2023-02-22
*/ */
public interface Invoices_item1Service extends IService<Invoices_item1Entity> { public interface InvoicesItem1Service extends IService<InvoicesItem1Entity> {
} }

@ -1,6 +1,8 @@
package jnpf.invoices.service; package jnpf.invoices.service;
import jnpf.invoices.entity.Invoices_item0Entity; import jnpf.invoices.entity.InvoicesItem1Entity;
import jnpf.invoices.service.Invoices_item0Service; import jnpf.invoices.service.InvoicesItem1Service;
import jnpf.invoices.entity.InvoicesItem0Entity;
import jnpf.invoices.service.InvoicesItem0Service;
import jnpf.invoices.entity.InvoicesEntity; import jnpf.invoices.entity.InvoicesEntity;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@ -8,17 +10,17 @@ import jnpf.invoices.model.invoices.InvoicesPagination;
import java.util.*; import java.util.*;
/** /**
* *
* invoices *
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-29 * 2023-02-22
*/ */
public interface InvoicesService extends IService<InvoicesEntity> { public interface InvoicesService extends IService<InvoicesEntity> {
List<InvoicesEntity> getList(InvoicesPagination invoicesPagination); List<InvoicesEntity> getList(InvoicesPagination invoicesPagination);
List<InvoicesEntity> getTypeList(InvoicesPagination invoicesPagination,String dataType); List<InvoicesEntity> getTypeList(InvoicesPagination invoicesPagination, String dataType);
@ -28,10 +30,11 @@ public interface InvoicesService extends IService<InvoicesEntity> {
void create(InvoicesEntity entity); void create(InvoicesEntity entity);
boolean update( String id, InvoicesEntity entity); boolean update(String id, InvoicesEntity entity);
// 子表方法 // 子表方法
List<Invoices_item0Entity> GetInvoices_item0List(String id); List<InvoicesItem1Entity> GetInvoicesItem1List(String id);
List<InvoicesItem0Entity> GetInvoicesItem0List(String id);
//列表子表数据方法 //列表子表数据方法
} }

@ -1,15 +0,0 @@
package jnpf.invoices.service;
import jnpf.invoices.entity.PurchaseorderinvoicesEntity;
import com.baomidou.mybatisplus.extension.service.IService;
/**
*
* jg_purchaseorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-29
*/
public interface PurchaseorderinvoicesService extends IService<PurchaseorderinvoicesEntity> {
}

@ -1,15 +0,0 @@
package jnpf.invoices.service;
import jnpf.invoices.entity.SupplierinvoicesEntity;
import com.baomidou.mybatisplus.extension.service.IService;
/**
*
* jg_supplier
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-29
*/
public interface SupplierinvoicesService extends IService<SupplierinvoicesEntity> {
}

@ -1,41 +0,0 @@
package jnpf.invoices.service.impl;
import jnpf.invoices.entity.*;
import jnpf.invoices.mapper.ContractinvoicesMapper;
import jnpf.invoices.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.*;
/**
*
* jg_contract
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-29
*/
@Service
public class ContractinvoicesServiceImpl extends ServiceImpl<ContractinvoicesMapper, ContractinvoicesEntity> implements ContractinvoicesService{
}

@ -1,7 +1,7 @@
package jnpf.invoices.service.impl; package jnpf.invoices.service.impl;
import jnpf.invoices.entity.*; import jnpf.invoices.entity.*;
import jnpf.invoices.mapper.Invoices_item0Mapper; import jnpf.invoices.mapper.InvoicesItem0Mapper;
import jnpf.invoices.service.*; import jnpf.invoices.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil; import jnpf.util.RandomUtil;
@ -32,10 +32,10 @@ import java.util.*;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-29 * 2023-02-22
*/ */
@Service @Service
public class Invoices_item0ServiceImpl extends ServiceImpl<Invoices_item0Mapper, Invoices_item0Entity> implements Invoices_item0Service{ public class InvoicesItem0ServiceImpl extends ServiceImpl<InvoicesItem0Mapper, InvoicesItem0Entity> implements InvoicesItem0Service{
} }

@ -1,7 +1,7 @@
package jnpf.invoices.service.impl; package jnpf.invoices.service.impl;
import jnpf.invoices.entity.*; import jnpf.invoices.entity.*;
import jnpf.invoices.mapper.Invoices_item1Mapper; import jnpf.invoices.mapper.InvoicesItem1Mapper;
import jnpf.invoices.service.*; import jnpf.invoices.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil; import jnpf.util.RandomUtil;
@ -32,10 +32,10 @@ import java.util.*;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-29 * 2023-02-22
*/ */
@Service @Service
public class Invoices_item1ServiceImpl extends ServiceImpl<Invoices_item1Mapper, Invoices_item1Entity> implements Invoices_item1Service{ public class InvoicesItem1ServiceImpl extends ServiceImpl<InvoicesItem1Mapper, InvoicesItem1Entity> implements InvoicesItem1Service{
} }

@ -34,11 +34,11 @@ import java.util.*;
/** /**
* *
* invoices *
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-29 * 2023-02-22
*/ */
@Service @Service
public class InvoicesServiceImpl extends ServiceImpl<InvoicesMapper, InvoicesEntity> implements InvoicesService{ public class InvoicesServiceImpl extends ServiceImpl<InvoicesMapper, InvoicesEntity> implements InvoicesService{
@ -52,7 +52,10 @@ public class InvoicesServiceImpl extends ServiceImpl<InvoicesMapper, InvoicesEnt
@Autowired @Autowired
private Invoices_item0Service invoices_item0Service; private InvoicesItem1Service invoicesItem1Service;
@Autowired
private InvoicesItem0Service invoicesItem0Service;
@ -64,16 +67,10 @@ public class InvoicesServiceImpl extends ServiceImpl<InvoicesMapper, InvoicesEnt
int total=0; int total=0;
int invoicesNum =0; int invoicesNum =0;
QueryWrapper<InvoicesEntity> invoicesQueryWrapper=new QueryWrapper<>(); QueryWrapper<InvoicesEntity> invoicesQueryWrapper=new QueryWrapper<>();
int invoices_item0Num =0; int invoicesItem0Num =0;
QueryWrapper<Invoices_item0Entity> invoices_item0QueryWrapper=new QueryWrapper<>(); QueryWrapper<InvoicesItem0Entity> invoicesItem0QueryWrapper=new QueryWrapper<>();
int invoices_item1Num =0; int invoicesItem1Num =0;
QueryWrapper<Invoices_item1Entity> invoices_item1QueryWrapper=new QueryWrapper<>(); QueryWrapper<InvoicesItem1Entity> invoicesItem1QueryWrapper=new QueryWrapper<>();
int purchaseorderinvoicesNum =0;
QueryWrapper<PurchaseorderinvoicesEntity> purchaseorderinvoicesQueryWrapper=new QueryWrapper<>();
int contractinvoicesNum =0;
QueryWrapper<ContractinvoicesEntity> contractinvoicesQueryWrapper=new QueryWrapper<>();
int supplierinvoicesNum =0;
QueryWrapper<SupplierinvoicesEntity> supplierinvoicesQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false; boolean pcPermission = false;
boolean appPermission = false; boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
@ -86,40 +83,19 @@ public class InvoicesServiceImpl extends ServiceImpl<InvoicesMapper, InvoicesEnt
invoicesQueryWrapper = (QueryWrapper<InvoicesEntity>)invoicesObj; invoicesQueryWrapper = (QueryWrapper<InvoicesEntity>)invoicesObj;
invoicesNum++; invoicesNum++;
} }
Object invoices_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoices_item0QueryWrapper,invoicesPagination.getMenuId(),"invoices_item0")); Object invoicesItem0Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoicesItem0QueryWrapper,invoicesPagination.getMenuId(),"invoicesItem0"));
if (ObjectUtil.isEmpty(invoices_item0Obj)){ if (ObjectUtil.isEmpty(invoicesItem0Obj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
invoices_item0QueryWrapper = (QueryWrapper<Invoices_item0Entity>)invoices_item0Obj; invoicesItem0QueryWrapper = (QueryWrapper<InvoicesItem0Entity>)invoicesItem0Obj;
invoices_item0Num++; invoicesItem0Num++;
} }
Object invoices_item1Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoices_item1QueryWrapper,invoicesPagination.getMenuId(),"invoices_item1")); Object invoicesItem1Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoicesItem1QueryWrapper,invoicesPagination.getMenuId(),"invoicesItem1"));
if (ObjectUtil.isEmpty(invoices_item1Obj)){ if (ObjectUtil.isEmpty(invoicesItem1Obj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
invoices_item1QueryWrapper = (QueryWrapper<Invoices_item1Entity>)invoices_item1Obj; invoicesItem1QueryWrapper = (QueryWrapper<InvoicesItem1Entity>)invoicesItem1Obj;
invoices_item1Num++; invoicesItem1Num++;
}
Object purchaseorderinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorderinvoicesQueryWrapper,invoicesPagination.getMenuId(),"purchaseorderinvoices"));
if (ObjectUtil.isEmpty(purchaseorderinvoicesObj)){
return new ArrayList<>();
} else {
purchaseorderinvoicesQueryWrapper = (QueryWrapper<PurchaseorderinvoicesEntity>)purchaseorderinvoicesObj;
purchaseorderinvoicesNum++;
}
Object contractinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(contractinvoicesQueryWrapper,invoicesPagination.getMenuId(),"contractinvoices"));
if (ObjectUtil.isEmpty(contractinvoicesObj)){
return new ArrayList<>();
} else {
contractinvoicesQueryWrapper = (QueryWrapper<ContractinvoicesEntity>)contractinvoicesObj;
contractinvoicesNum++;
}
Object supplierinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierinvoicesQueryWrapper,invoicesPagination.getMenuId(),"supplierinvoices"));
if (ObjectUtil.isEmpty(supplierinvoicesObj)){
return new ArrayList<>();
} else {
supplierinvoicesQueryWrapper = (QueryWrapper<SupplierinvoicesEntity>)supplierinvoicesObj;
supplierinvoicesNum++;
} }
} }
} }
@ -134,48 +110,21 @@ public class InvoicesServiceImpl extends ServiceImpl<InvoicesMapper, InvoicesEnt
} }
Object invoices_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoices_item0QueryWrapper,invoicesPagination.getMenuId(),"invoices_item0")); Object invoicesItem0Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoicesItem0QueryWrapper,invoicesPagination.getMenuId(),"invoicesItem0"));
if (ObjectUtil.isEmpty(invoices_item0Obj)){ if (ObjectUtil.isEmpty(invoicesItem0Obj)){
return new ArrayList<>();
} else {
invoices_item0QueryWrapper = (QueryWrapper<Invoices_item0Entity>)invoices_item0Obj;
invoices_item0Num++;
}
Object invoices_item1Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoices_item1QueryWrapper,invoicesPagination.getMenuId(),"invoices_item1"));
if (ObjectUtil.isEmpty(invoices_item1Obj)){
return new ArrayList<>();
} else {
invoices_item1QueryWrapper = (QueryWrapper<Invoices_item1Entity>)invoices_item1Obj;
invoices_item1Num++;
}
Object purchaseorderinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorderinvoicesQueryWrapper,invoicesPagination.getMenuId(),"purchaseorderinvoices"));
if (ObjectUtil.isEmpty(purchaseorderinvoicesObj)){
return new ArrayList<>();
} else {
purchaseorderinvoicesQueryWrapper = (QueryWrapper<PurchaseorderinvoicesEntity>)purchaseorderinvoicesObj;
purchaseorderinvoicesNum++;
}
Object contractinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(contractinvoicesQueryWrapper,invoicesPagination.getMenuId(),"contractinvoices"));
if (ObjectUtil.isEmpty(contractinvoicesObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
contractinvoicesQueryWrapper = (QueryWrapper<ContractinvoicesEntity>)contractinvoicesObj; invoicesItem0QueryWrapper = (QueryWrapper<InvoicesItem0Entity>)invoicesItem0Obj;
contractinvoicesNum++; invoicesItem0Num++;
} }
Object supplierinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierinvoicesQueryWrapper,invoicesPagination.getMenuId(),"supplierinvoices")); Object invoicesItem1Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoicesItem1QueryWrapper,invoicesPagination.getMenuId(),"invoicesItem1"));
if (ObjectUtil.isEmpty(supplierinvoicesObj)){ if (ObjectUtil.isEmpty(invoicesItem1Obj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
supplierinvoicesQueryWrapper = (QueryWrapper<SupplierinvoicesEntity>)supplierinvoicesObj; invoicesItem1QueryWrapper = (QueryWrapper<InvoicesItem1Entity>)invoicesItem1Obj;
supplierinvoicesNum++; invoicesItem1Num++;
} }
@ -220,16 +169,10 @@ public class InvoicesServiceImpl extends ServiceImpl<InvoicesMapper, InvoicesEnt
int total=0; int total=0;
int invoicesNum =0; int invoicesNum =0;
QueryWrapper<InvoicesEntity> invoicesQueryWrapper=new QueryWrapper<>(); QueryWrapper<InvoicesEntity> invoicesQueryWrapper=new QueryWrapper<>();
int invoices_item0Num =0; int invoicesItem0Num =0;
QueryWrapper<Invoices_item0Entity> invoices_item0QueryWrapper=new QueryWrapper<>(); QueryWrapper<InvoicesItem0Entity> invoicesItem0QueryWrapper=new QueryWrapper<>();
int invoices_item1Num =0; int invoicesItem1Num =0;
QueryWrapper<Invoices_item1Entity> invoices_item1QueryWrapper=new QueryWrapper<>(); QueryWrapper<InvoicesItem1Entity> invoicesItem1QueryWrapper=new QueryWrapper<>();
int purchaseorderinvoicesNum =0;
QueryWrapper<PurchaseorderinvoicesEntity> purchaseorderinvoicesQueryWrapper=new QueryWrapper<>();
int contractinvoicesNum =0;
QueryWrapper<ContractinvoicesEntity> contractinvoicesQueryWrapper=new QueryWrapper<>();
int supplierinvoicesNum =0;
QueryWrapper<SupplierinvoicesEntity> supplierinvoicesQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false; boolean pcPermission = false;
boolean appPermission = false; boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
@ -242,40 +185,19 @@ public class InvoicesServiceImpl extends ServiceImpl<InvoicesMapper, InvoicesEnt
invoicesQueryWrapper = (QueryWrapper<InvoicesEntity>)invoicesObj; invoicesQueryWrapper = (QueryWrapper<InvoicesEntity>)invoicesObj;
invoicesNum++; invoicesNum++;
} }
Object invoices_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoices_item0QueryWrapper,invoicesPagination.getMenuId(),"invoices_item0")); Object invoicesItem0Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoicesItem0QueryWrapper,invoicesPagination.getMenuId(),"invoicesItem0"));
if (ObjectUtil.isEmpty(invoices_item0Obj)){ if (ObjectUtil.isEmpty(invoicesItem0Obj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
invoices_item0QueryWrapper = (QueryWrapper<Invoices_item0Entity>)invoices_item0Obj; invoicesItem0QueryWrapper = (QueryWrapper<InvoicesItem0Entity>)invoicesItem0Obj;
invoices_item0Num++; invoicesItem0Num++;
} }
Object invoices_item1Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoices_item1QueryWrapper,invoicesPagination.getMenuId(),"invoices_item1")); Object invoicesItem1Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoicesItem1QueryWrapper,invoicesPagination.getMenuId(),"invoicesItem1"));
if (ObjectUtil.isEmpty(invoices_item1Obj)){ if (ObjectUtil.isEmpty(invoicesItem1Obj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
invoices_item1QueryWrapper = (QueryWrapper<Invoices_item1Entity>)invoices_item1Obj; invoicesItem1QueryWrapper = (QueryWrapper<InvoicesItem1Entity>)invoicesItem1Obj;
invoices_item1Num++; invoicesItem1Num++;
}
Object purchaseorderinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorderinvoicesQueryWrapper,invoicesPagination.getMenuId(),"purchaseorderinvoices"));
if (ObjectUtil.isEmpty(purchaseorderinvoicesObj)){
return new ArrayList<>();
} else {
purchaseorderinvoicesQueryWrapper = (QueryWrapper<PurchaseorderinvoicesEntity>)purchaseorderinvoicesObj;
purchaseorderinvoicesNum++;
}
Object contractinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(contractinvoicesQueryWrapper,invoicesPagination.getMenuId(),"contractinvoices"));
if (ObjectUtil.isEmpty(contractinvoicesObj)){
return new ArrayList<>();
} else {
contractinvoicesQueryWrapper = (QueryWrapper<ContractinvoicesEntity>)contractinvoicesObj;
contractinvoicesNum++;
}
Object supplierinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierinvoicesQueryWrapper,invoicesPagination.getMenuId(),"supplierinvoices"));
if (ObjectUtil.isEmpty(supplierinvoicesObj)){
return new ArrayList<>();
} else {
supplierinvoicesQueryWrapper = (QueryWrapper<SupplierinvoicesEntity>)supplierinvoicesObj;
supplierinvoicesNum++;
} }
} }
} }
@ -290,48 +212,21 @@ public class InvoicesServiceImpl extends ServiceImpl<InvoicesMapper, InvoicesEnt
} }
Object invoices_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoices_item0QueryWrapper,invoicesPagination.getMenuId(),"invoices_item0")); Object invoicesItem0Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoicesItem0QueryWrapper,invoicesPagination.getMenuId(),"invoicesItem0"));
if (ObjectUtil.isEmpty(invoices_item0Obj)){ if (ObjectUtil.isEmpty(invoicesItem0Obj)){
return new ArrayList<>();
} else {
invoices_item0QueryWrapper = (QueryWrapper<Invoices_item0Entity>)invoices_item0Obj;
invoices_item0Num++;
}
Object invoices_item1Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoices_item1QueryWrapper,invoicesPagination.getMenuId(),"invoices_item1"));
if (ObjectUtil.isEmpty(invoices_item1Obj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
invoices_item1QueryWrapper = (QueryWrapper<Invoices_item1Entity>)invoices_item1Obj; invoicesItem0QueryWrapper = (QueryWrapper<InvoicesItem0Entity>)invoicesItem0Obj;
invoices_item1Num++; invoicesItem0Num++;
} }
Object purchaseorderinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorderinvoicesQueryWrapper,invoicesPagination.getMenuId(),"purchaseorderinvoices")); Object invoicesItem1Obj=authorizeService.getCondition(new AuthorizeConditionModel(invoicesItem1QueryWrapper,invoicesPagination.getMenuId(),"invoicesItem1"));
if (ObjectUtil.isEmpty(purchaseorderinvoicesObj)){ if (ObjectUtil.isEmpty(invoicesItem1Obj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
purchaseorderinvoicesQueryWrapper = (QueryWrapper<PurchaseorderinvoicesEntity>)purchaseorderinvoicesObj; invoicesItem1QueryWrapper = (QueryWrapper<InvoicesItem1Entity>)invoicesItem1Obj;
purchaseorderinvoicesNum++; invoicesItem1Num++;
}
Object contractinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(contractinvoicesQueryWrapper,invoicesPagination.getMenuId(),"contractinvoices"));
if (ObjectUtil.isEmpty(contractinvoicesObj)){
return new ArrayList<>();
} else {
contractinvoicesQueryWrapper = (QueryWrapper<ContractinvoicesEntity>)contractinvoicesObj;
contractinvoicesNum++;
}
Object supplierinvoicesObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierinvoicesQueryWrapper,invoicesPagination.getMenuId(),"supplierinvoices"));
if (ObjectUtil.isEmpty(supplierinvoicesObj)){
return new ArrayList<>();
} else {
supplierinvoicesQueryWrapper = (QueryWrapper<SupplierinvoicesEntity>)supplierinvoicesObj;
supplierinvoicesNum++;
} }
@ -399,10 +294,16 @@ public class InvoicesServiceImpl extends ServiceImpl<InvoicesMapper, InvoicesEnt
} }
//子表方法 //子表方法
@Override @Override
public List<Invoices_item0Entity> GetInvoices_item0List(String id){ public List<InvoicesItem1Entity> GetInvoicesItem1List(String id){
QueryWrapper<Invoices_item0Entity> queryWrapper = new QueryWrapper<>(); QueryWrapper<InvoicesItem1Entity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(Invoices_item0Entity::getInvoicesId, id); queryWrapper.lambda().eq(InvoicesItem1Entity::getInvoicesId, id);
return invoices_item0Service.list(queryWrapper); return invoicesItem1Service.list(queryWrapper);
}
@Override
public List<InvoicesItem0Entity> GetInvoicesItem0List(String id){
QueryWrapper<InvoicesItem0Entity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(InvoicesItem0Entity::getInvoicesId, id);
return invoicesItem0Service.list(queryWrapper);
} }
//列表子表数据方法 //列表子表数据方法

@ -1,41 +0,0 @@
package jnpf.invoices.service.impl;
import jnpf.invoices.entity.*;
import jnpf.invoices.mapper.PurchaseorderinvoicesMapper;
import jnpf.invoices.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.*;
/**
*
* jg_purchaseorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-29
*/
@Service
public class PurchaseorderinvoicesServiceImpl extends ServiceImpl<PurchaseorderinvoicesMapper, PurchaseorderinvoicesEntity> implements PurchaseorderinvoicesService{
}

@ -1,41 +0,0 @@
package jnpf.invoices.service.impl;
import jnpf.invoices.entity.*;
import jnpf.invoices.mapper.SupplierinvoicesMapper;
import jnpf.invoices.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.*;
/**
*
* jg_supplier
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-29
*/
@Service
public class SupplierinvoicesServiceImpl extends ServiceImpl<SupplierinvoicesMapper, SupplierinvoicesEntity> implements SupplierinvoicesService{
}

@ -16,11 +16,21 @@ import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO; import jnpf.base.vo.DownloadVO;
import jnpf.collection.model.collection.Collection_item0Model; import jnpf.collection.model.collection.Collection_item0Model;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.contractfile.entity.ContractFileEntity;
import jnpf.contractfile.service.ContractFileService;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.paymentdoc.entity.Paymentdoc_item0Entity; import jnpf.paymentdoc.entity.PaymentdocEntity;
import jnpf.paymentdoc.service.Paymentdoc_item0Service; import jnpf.paymentdoc.entity.PaymentdocItem0Entity;
import jnpf.paymentdoc.service.PaymentdocItem0Service;
import jnpf.paymentdoc.service.PaymentdocService;
import jnpf.poundlist.entity.PoundlistEntity;
import jnpf.poundlist.service.PoundlistService;
import jnpf.purchaseback.entity.PurchaseorderEntity; import jnpf.purchaseback.entity.PurchaseorderEntity;
import jnpf.purchaseback.service.PurchaseorderService; import jnpf.purchaseback.service.PurchaseorderService;
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
import jnpf.purchaseorder.entity.PurchaseorderitemEntity;
import jnpf.purchaseorder.service.PurchaseorderitemService;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity; import jnpf.base.entity.ProvinceEntity;
@ -88,36 +98,73 @@ public class PaymentController {
private Payment_item0Service payment_item0Service; private Payment_item0Service payment_item0Service;
@Autowired @Autowired
private Paymentdoc_item0Service paymentdoc_item0Service; private PaymentdocItem0Service paymentdoc_item0Service;
@Autowired @Autowired
private PurchaseorderService purchaseorderService; private PurchaseorderitemService purchaseorderitemService;
@Autowired
private ContractFileService contractFileService;
@Autowired
private PaymentdocService paymentdocService;
@Autowired
private PoundlistService poundlistService;
@PostMapping("/submitprice")
@Transactional
public ActionResult submitprice(@RequestBody PaymentListVO paymentListVO) {
PaymentEntity paymentEntity = paymentService.getById(paymentListVO.getId());
paymentEntity.setStatus("1");
paymentService.updateById(paymentEntity);
QueryWrapper<PaymentdocEntity> paymentdocQueryWrapper=new QueryWrapper<>();
paymentdocQueryWrapper.lambda().eq(PaymentdocEntity::getDocumentNo, paymentEntity.getPaymentno());
List<PaymentdocEntity> paymentdocList = paymentdocService.list(paymentdocQueryWrapper);
for (PaymentdocEntity paymentdocEntity : paymentdocList) {
paymentdocEntity.setDocStatus("3");
paymentdocEntity.setPaymentAmount(paymentEntity.getPaymentamount());
paymentdocEntity.setUnpaymentAmount(paymentdocEntity.getRamount().subtract(paymentdocEntity.getPaymentAmount()));
paymentdocService.updateById(paymentdocEntity);
}
return ActionResult.success("提交成功");
}
@PostMapping("/confirmprice") @PostMapping("/confirmprice")
@Transactional @Transactional
public ActionResult confirmPrice(@RequestBody PaymentListVO paymentListVO) { public ActionResult confirmPrice(@RequestBody PaymentListVO paymentListVO) {
PaymentEntity paymentEntity = paymentService.getInfo(paymentListVO.getId()); PaymentEntity paymentEntity = paymentService.getById(paymentListVO.getId());
if (!paymentEntity.getStatus().equals("2")){ paymentEntity.setStatus("2");
return ActionResult.fail("审核中,请先通过审核"); paymentService.updateById(paymentEntity);
} List<Payment_item0Entity> Payment_item0List = paymentService.GetPayment_item0List(paymentEntity.getId());
QueryWrapper<Payment_item0Entity> queryWrapper = new QueryWrapper<>(); for (Payment_item0Entity payment_item0Entity: Payment_item0List) {
queryWrapper.lambda().eq(Payment_item0Entity::getPaymentId,paymentListVO.getId()); PaymentdocItem0Entity paymentdocItem0Entity = paymentdoc_item0Service.getById(payment_item0Entity.getPaymentdocitemId());
List<Payment_item0Entity> dList = payment_item0Service.list(queryWrapper); PurchaseorderitemEntity purchaseorderitemEntity = purchaseorderitemService.getById(paymentdocItem0Entity.getPurchaseorderId());
for (Payment_item0Entity payment_item0Entity : dList){ purchaseorderitemEntity.setPayPrice(purchaseorderitemEntity.getPayPrice().add(paymentdocItem0Entity.getAmount()));
Paymentdoc_item0Entity paymentdoc_item0Entity = paymentdoc_item0Service.getById(payment_item0Entity.getPaymentdocitemId()); purchaseorderitemService.updateById(purchaseorderitemEntity);
PurchaseorderEntity purchaseorderEntity = purchaseorderService.getById(paymentdoc_item0Entity.getPurchaseorderId()); List<Purchaseorder_item0Entity> Purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(purchaseorderitemEntity.getId());
if (purchaseorderEntity.getPayPrice().equals(purchaseorderEntity.getAmount())){ List<String> poundlistIds = new ArrayList<>();
return ActionResult.fail("回款金额等于金额"); for (Purchaseorder_item0Entity purchaseorder_item0Entity: Purchaseorder_item0List) {
poundlistIds.add(purchaseorder_item0Entity.getPoundlistId());
}
QueryWrapper<PoundlistEntity> poundlistQueryWrapper=new QueryWrapper<>();
poundlistQueryWrapper.lambda().in(PoundlistEntity::getId, poundlistIds).orderByAsc(PoundlistEntity::getPoundDate);
List<PoundlistEntity> poundlistEntityList = poundlistService.list(poundlistQueryWrapper);
Purchaseorder_item0Entity orderItem = Purchaseorder_item0List.stream().filter(item0 -> ObjectUtil.equals(item0.getPoundlistId(), poundlistEntityList.get(0).getId())).findAny().get();
BigDecimal total = orderItem.getAmount();
int i = 0;
while (purchaseorderitemEntity.getPayPrice().compareTo(total) >= 0){
i++;
if(i < poundlistEntityList.size()){
String poundlistId = poundlistEntityList.get(i).getId();
orderItem = Purchaseorder_item0List.stream().filter(item0 -> ObjectUtil.equals(item0.getPoundlistId(), poundlistId)).findAny().get();
total = total.add(orderItem.getAmount());
}else{
break;
}
} }
BigDecimal sum = purchaseorderEntity.getPayPrice().add(payment_item0Entity.getAmount()); for (int j = 0;j<i;j++) {
if (sum.compareTo(purchaseorderEntity.getAmount()) > 0){ poundlistEntityList.get(j).setIsPay("1");
return ActionResult.fail("总回款金额大于金额"); poundlistEntityList.get(j).setPayDate(new Date());
poundlistService.updateById(poundlistEntityList.get(j));
} }
purchaseorderEntity.setPayPrice(sum);
purchaseorderEntity.setStatus("1");
purchaseorderService.updateById(purchaseorderEntity);
} }
return ActionResult.success("认款成功"); return ActionResult.success("认款成功");
} }
@ -341,18 +388,26 @@ public class PaymentController {
List<Payment_item0Model> payment_item0Models = new ArrayList<>(); List<Payment_item0Model> payment_item0Models = new ArrayList<>();
Payment_item0Model payment_item0Model = new Payment_item0Model(); Payment_item0Model payment_item0Model = new Payment_item0Model();
for(Payment_item0Entity payment_item0Entity : Payment_item0List){ for(Payment_item0Entity payment_item0Entity : Payment_item0List){
Paymentdoc_item0Entity paymentdoc_item0Entity = paymentdoc_item0Service.getById(payment_item0Entity.getPaymentdocitemId()); PaymentdocItem0Entity paymentdoc_item0Entity = paymentdoc_item0Service.getById(payment_item0Entity.getPaymentdocitemId());
PurchaseorderEntity purchaseorderEntity = purchaseorderService.getById(paymentdoc_item0Entity.getPurchaseorderId()); PurchaseorderitemEntity purchaseorderEntity = purchaseorderitemService.getById(paymentdoc_item0Entity.getPurchaseorderId());
payment_item0Model.setAmount(String.valueOf(payment_item0Entity.getAmount())); if(purchaseorderEntity != null && StringUtils.isNotEmpty(purchaseorderEntity.getContractCode())){
// payment_item0Model.setAmount(String.valueOf(purchaseorderEntity.getAmount())); ContractFileEntity contractFileEntity = contractFileService.getById(purchaseorderEntity.getContractCode());
// payment_item0Model.setAmount(String.valueOf(purchaseorderEntity.getAmount())); if(contractFileEntity != null && StringUtils.isNotEmpty(contractFileEntity.getContractName())){
payment_item0Model.setPayPrice(String.valueOf(purchaseorderEntity.getPayPrice())); purchaseorderEntity.setContractNo(contractFileEntity.getContractCode());
payment_item0Model.setDocumentNo(String.valueOf(purchaseorderEntity.getDocumentNo())); }
payment_item0Model.setContractCode(String.valueOf(purchaseorderEntity.getContractCode())); }
payment_item0Model.setNum(String.valueOf(purchaseorderEntity.getNum())); payment_item0Model.setPaymentdocitemId(payment_item0Entity.getPaymentdocitemId());
payment_item0Model.setAdvanceAmount(String.valueOf(purchaseorderEntity.getAdvanceAmount())); payment_item0Model.setAmount(payment_item0Entity.getAmount());
payment_item0Model.setRate(String.valueOf(purchaseorderEntity.getRate())); payment_item0Model.setAllAmount(purchaseorderEntity.getAmount());
payment_item0Model.setNotAmount(String.valueOf(purchaseorderEntity.getNotAmount())); payment_item0Model.setRequestAmount(purchaseorderEntity.getAmount());
payment_item0Model.setPayPrice(purchaseorderEntity.getPayPrice());
payment_item0Model.setDocumentNo(purchaseorderEntity.getDocumentNo());
payment_item0Model.setContractNo(purchaseorderEntity.getContractNo());
payment_item0Model.setNum(purchaseorderEntity.getNum());
payment_item0Model.setAdvanceAmount(purchaseorderEntity.getAdvanceAmount());
payment_item0Model.setRate(purchaseorderEntity.getRate());
payment_item0Model.setNotAmount(purchaseorderEntity.getNotAmount());
payment_item0Model.setCreatorTime(purchaseorderEntity.getCreatorTime());
payment_item0Models.add(payment_item0Model); payment_item0Models.add(payment_item0Model);
} }
vo.setPayment_item0List(payment_item0Models); vo.setPayment_item0List(payment_item0Models);

@ -20,7 +20,7 @@ public class Payment_item0Model {
/** 付款金额 **/ /** 付款金额 **/
@JsonProperty("amount") @JsonProperty("amount")
private String amount; private BigDecimal amount;
/** 采购订单主表id **/ /** 采购订单主表id **/
@JsonProperty("id") @JsonProperty("id")
@ -30,9 +30,14 @@ public class Payment_item0Model {
@JsonProperty("paymentdocitemId") @JsonProperty("paymentdocitemId")
private String paymentdocitemId; private String paymentdocitemId;
// /** 申请金额 **/ /** 申请金额 **/
// @JsonProperty("amount") @JsonProperty("allAmount")
// private String amount; private BigDecimal allAmount;
/** 合同编码 **/
@JsonProperty("contractNo")
private String contractNo;
// //
// /** 订单金额 **/ // /** 订单金额 **/
// @JsonProperty("amount") // @JsonProperty("amount")
@ -40,7 +45,7 @@ public class Payment_item0Model {
/** 已付金额 **/ /** 已付金额 **/
@JsonProperty("payPrice") @JsonProperty("payPrice")
private String payPrice; private BigDecimal payPrice;
/** 订单编号 **/ /** 订单编号 **/
@JsonProperty("documentNo") @JsonProperty("documentNo")
@ -52,22 +57,25 @@ public class Payment_item0Model {
/** 重量 **/ /** 重量 **/
@JsonProperty("num") @JsonProperty("num")
private String num; private BigDecimal num;
/** 垫资金额 **/ /** 垫资金额 **/
@JsonProperty("advanceAmount") @JsonProperty("advanceAmount")
private String advanceAmount; private BigDecimal advanceAmount;
/** 税额 **/ /** 税额 **/
@JsonProperty("rate") @JsonProperty("rate")
private String rate; private BigDecimal rate;
/** 不含税金额 **/ /** 不含税金额 **/
@JsonProperty("notAmount") @JsonProperty("notAmount")
private String notAmount; private BigDecimal notAmount;
/** 业务日期 **/ /** 业务日期 **/
@JsonProperty("creatorTime") @JsonProperty("creatorTime")
private Long creatorTime; private Date creatorTime;
/** 业务日期 **/
@JsonProperty("requestAmount")
private BigDecimal requestAmount;
} }

@ -1,10 +1,8 @@
package jnpf.paymentdoc.controller; package jnpf.paymentdoc.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -14,31 +12,42 @@ import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO; import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.contractfile.entity.ContractFileEntity;
import jnpf.contractfile.service.ContractFileService;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.payment.entity.PaymentEntity; import jnpf.purchaseback.entity.PurchaseorderEntity;
import jnpf.payment.entity.Payment_item0Entity; import jnpf.purchaseback.service.PurchaseorderService;
import jnpf.payment.mapper.PaymentMapper; import org.apache.commons.lang3.StringUtils;
import jnpf.payment.model.payment.PaymentCrForm;
import jnpf.payment.service.PaymentService;
import jnpf.payment.service.Payment_item0Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity;
import jnpf.paymentdoc.model.paymentdoc.*; import jnpf.paymentdoc.model.paymentdoc.*;
import jnpf.paymentdoc.model.paymentdoc.PaymentdocPagination; import jnpf.paymentdoc.model.paymentdoc.PaymentdocPagination;
import jnpf.paymentdoc.entity.Paymentdoc_item0Entity; import jnpf.paymentdoc.entity.*;
import jnpf.paymentdoc.entity.PaymentdocItem0Entity;
import jnpf.util.*; import jnpf.util.*;
import jnpf.base.util.*;
import jnpf.base.vo.ListVO;
import jnpf.util.context.SpringContext;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import lombok.Cleanup; import lombok.Cleanup;
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.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.base.entity.VisualdevEntity;
import jnpf.paymentdoc.entity.PaymentdocEntity; import jnpf.paymentdoc.entity.PaymentdocEntity;
import jnpf.paymentdoc.service.PaymentdocService; import jnpf.paymentdoc.service.PaymentdocService;
import jnpf.paymentdoc.service.Paymentdoc_item0Service; import jnpf.paymentdoc.entity.PaymentdocItem0Entity;
import jnpf.paymentdoc.service.PaymentdocItem0Service;
import jnpf.exception.WorkFlowException;
import jnpf.engine.enums.FlowStatusEnum;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import jnpf.util.GeneraterSwapUtil; import jnpf.util.GeneraterSwapUtil;
@ -47,25 +56,25 @@ import java.util.*;
import jnpf.util.file.UploadUtil; import jnpf.util.file.UploadUtil;
import jnpf.util.enums.FileTypeEnum; import jnpf.util.enums.FileTypeEnum;
/** /**
* *
* paymentdoc * paymentdoc
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-02-09 * @ 2023-02-23
*/ */
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "paymentdoc" , value = "example") @Api(tags = "paymentdoc" , value = "paymentdoc")
@RequestMapping("/api/example/Paymentdoc") @RequestMapping("/api/paymentdoc/Paymentdoc")
public class PaymentdocController { public class PaymentdocController {
@Autowired @Autowired
private GeneraterSwapUtil generaterSwapUtil; private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private ConfigValueUtil configValueUtil;
@Autowired @Autowired
private UserProvider userProvider; private UserProvider userProvider;
@ -74,78 +83,13 @@ public class PaymentdocController {
private PaymentdocService paymentdocService; private PaymentdocService paymentdocService;
@Autowired @Autowired
private Paymentdoc_item0Service paymentdoc_item0Service; private PaymentdocItem0Service paymentdocItem0Service;
@Autowired
private PaymentService paymentService;
@Autowired
private PaymentMapper paymentMapper;
@Autowired
private Payment_item0Service payment_item0Service;
/**
*
*
* @param
* @return
*/
// @GetMapping("/{id}")
@PostMapping("/paymentapplylist")
public ActionResult paymentapplylist(@RequestBody PaymentdocCrForms paymentdocCrForms) throws DataException {
PaymentEntity paymentEntity = new PaymentEntity();
PaymentCrForm paymentCrForm =new PaymentCrForm();
// String mainId =RandomUtil.uuId();
// UserInfo userInfo=userProvider.get();
// paymentEntity.setCreatorUserName(paymentdocUpForms.getCreatorUserName());
// paymentEntity.setCreatorTime(new Date());
PaymentEntity entity = JsonUtil.getJsonToBean(paymentEntity, PaymentEntity.class);
// entity.setId(mainId);
PaymentdocEntity paymentdocEntity=paymentdocService.getById(paymentdocCrForms.getId());
//添加到付款单
// paymentEntity.setId(paymentdocUpForms.getId());
paymentEntity.setDocumentno(generaterSwapUtil.getBillNumber("payment" ,false));
paymentEntity.setPaymentno(paymentdocCrForms.getDocumentNo());
paymentEntity.setPaymentamount(paymentdocCrForms.getPaymentAmount());
paymentEntity.setRequestedamount(paymentdocCrForms.getRamount());
paymentEntity.setBusinessdate(paymentdocCrForms.getBusinessDate());
paymentEntity.setDuedate(paymentdocCrForms.getDueDate());
paymentEntity.setStatus(paymentdocCrForms.getStatus());
paymentEntity.setSuppliercode(paymentdocCrForms.getSupplierCode());
paymentEntity.setSuppliername(paymentdocCrForms.getSupplierName());
paymentEntity.setCurrency(paymentCrForm.getCurrency());
paymentEntity.setPaymenttype(paymentdocCrForms.getPaymentType());
paymentEntity.setSettlementtype(paymentdocCrForms.getSettlementType());
paymentEntity.setRemark(paymentdocCrForms.getRemark());
paymentEntity.setCollectionaccount(paymentdocCrForms.getCollectionAccount());
paymentEntity.setCollectionbank(paymentdocCrForms.getColectionBank());
paymentEntity.setCreatorUserId(paymentdocCrForms.getCreatorUserId());
paymentEntity.setCreatorUserName(paymentdocCrForms.getCreatorUserName());
paymentEntity.setCreatorTime(paymentdocCrForms.getCreatorTime());
paymentEntity.setLastModifyUserId(paymentdocCrForms.getLastModifyUserId());
paymentEntity.setLastModifyUserName(paymentdocCrForms.getLastModifyUserName());
paymentEntity.setLastModifyTime(paymentdocCrForms.getLastModifyTime());
paymentMapper.insert(paymentEntity);
//修改付款状态
paymentdocEntity.setIsPay("1");
paymentdocService.updateById(paymentdocEntity);
//子表
List<Paymentdoc_item0Entity> Paymentdoc_item0List = JsonUtil.getJsonToList(paymentdocCrForms.getPaymentdoc_item0List(),Paymentdoc_item0Entity.class);
List<Payment_item0Entity> Payment_item0List = JsonUtil.getJsonToList(paymentdocCrForms.getPayment_item0List(),Payment_item0Entity.class);
for(Payment_item0Entity entitys : Payment_item0List){
entitys.setId(RandomUtil.uuId());
entitys.setPaymentId(entity.getId());
payment_item0Service.save(entitys);
}
return ActionResult.success("修改(付款)成功");
}
@Autowired
private PurchaseorderService purchaseorderService;
@Autowired
private ContractFileService contractFileService;
/** /**
* *
@ -153,22 +97,33 @@ public class PaymentdocController {
* @param paymentdocPagination * @param paymentdocPagination
* @return * @return
*/ */
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody PaymentdocPagination paymentdocPagination)throws IOException{ public ActionResult list(@RequestBody PaymentdocPagination paymentdocPagination)throws IOException{
List<PaymentdocEntity> list= paymentdocService.getList(paymentdocPagination); List<PaymentdocEntity> list= paymentdocService.getList(paymentdocPagination);
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(PaymentdocEntity entity:list){ for(PaymentdocEntity entity:list){
Map<String,Object> supplierNameMap = new HashMap<>(); Map<String,Object> purchaseIdMap = new HashMap<>();
entity.setSupplierName(generaterSwapUtil.getPopupSelectValue("393307526961100037","supplier_name","supplier_name",entity.getSupplierName(),supplierNameMap)); entity.setPurchaseId(generaterSwapUtil.getPopupSelectValue("389673535976550149","id","document_no",entity.getPurchaseId(),purchaseIdMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName())); Map<String,Object> contractIdMap = new HashMap<>();
// entity.setCreatorTime(generaterSwapUtil.userSelectValue(entity.getCreatorTime())); entity.setContractId(generaterSwapUtil.getPopupSelectValue("389673903103979269","id","contract_name",entity.getContractId(),contractIdMap));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName())); Map<String,Object> supplierIdMap = new HashMap<>();
} entity.setSupplierId(generaterSwapUtil.getPopupSelectValue("389674191453990661","id","supplier_name",entity.getSupplierId(),supplierIdMap));
List<PaymentdocListVO> listVO=JsonUtil.getJsonToList(list,PaymentdocListVO.class); }
for(PaymentdocListVO paymentdocVO:listVO){ List<PaymentdocListVO> listVO=JsonUtil.getJsonToList(list,PaymentdocListVO.class);
} for(PaymentdocListVO paymentdocVO:listVO){
}
for(PaymentdocListVO vo:listVO){
FlowTaskEntity flowTaskEntity = generaterSwapUtil.getInfoSubmit(vo.getId(), FlowTaskEntity::getStatus);
if (flowTaskEntity!=null){
vo.setFlowState(flowTaskEntity.getStatus());
}else{
vo.setFlowState(null);
}
}
PageListVO vo=new PageListVO(); PageListVO vo=new PageListVO();
vo.setList(listVO); vo.setList(listVO);
PaginationVO page=JsonUtil.getJsonToBean(paymentdocPagination,PaginationVO.class); PaginationVO page=JsonUtil.getJsonToBean(paymentdocPagination,PaginationVO.class);
@ -180,337 +135,163 @@ public class PaymentdocController {
/** /**
* *
* *
* @param paymentdocCrForm * @param crData
* @return * @return
*/ */
@PostMapping @PostMapping
@Transactional @Transactional
public ActionResult create(@RequestBody @Valid PaymentdocCrForm paymentdocCrForm) throws DataException { public ActionResult create(@RequestBody @Valid Map<String,Object> crData) throws DataException {
PaymentdocCrForm paymentdocCrForm = JsonUtil.getJsonToBean(crData,PaymentdocCrForm.class);
String visualId ="398482034802139205";
VisualdevEntity visualdevEntity =generaterSwapUtil.getVisualEntity(visualId);
String mainId =RandomUtil.uuId(); String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
paymentdocCrForm.setDocumentNo(generaterSwapUtil.getBillNumber("fukuanshenqing", false)); paymentdocCrForm.setDocumentNo(generaterSwapUtil.getBillNumber("fukuanshenqing", false));
paymentdocCrForm.setCreatorUserName(userInfo.getUserId());
paymentdocCrForm.setCreatorTime(userInfo.getUserId());
PaymentdocEntity entity = JsonUtil.getJsonToBean(paymentdocCrForm, PaymentdocEntity.class); PaymentdocEntity entity = JsonUtil.getJsonToBean(paymentdocCrForm, PaymentdocEntity.class);
entity.setId(mainId); entity.setId(mainId);
paymentdocService.save(entity); paymentdocService.save(entity);
List<Paymentdoc_item0Entity> Paymentdoc_item0List = JsonUtil.getJsonToList(paymentdocCrForm.getPaymentdoc_item0List(),Paymentdoc_item0Entity.class); List<PaymentdocItem0Entity> PaymentdocItem0List = JsonUtil.getJsonToList(paymentdocCrForm.getPaymentdocitem0List(),PaymentdocItem0Entity.class);
for(Paymentdoc_item0Entity entitys : Paymentdoc_item0List){
entitys.setId(RandomUtil.uuId());
entitys.setPaymentdocId(entity.getId());
paymentdoc_item0Service.save(entitys);
}
return ActionResult.success("创建成功");
}
for(PaymentdocItem0Entity entitys : PaymentdocItem0List){
entitys.setId(RandomUtil.uuId());
entitys.setPaymentdocId(entity.getId());
/** paymentdocItem0Service.save(entitys);
*
*
* @return
*/
@ApiOperation("模板下载")
@GetMapping("/templateDownload")
public ActionResult<DownloadVO> TemplateDownload(){
UserInfo userInfo=userProvider.get();
DownloadVO vo=DownloadVO.builder().build();
try{
vo.setName("职员信息.xlsx");
vo.setUrl(UploaderUtil.uploaderFile("/api/Common/DownloadModel?encryption=" ,userInfo.getId()+"#"+"职员信息.xlsx"+"#"+"Temporary"));
}catch(Exception e){
log.error("信息导出Excel错误:{}" ,e.getMessage());
} }
return ActionResult.success(vo); if (FlowStatusEnum.submit.getMessage().equals(paymentdocCrForm.getStatus())){
} try {
/** generaterSwapUtil.submitFlowTask(visualdevEntity,mainId,paymentdocCrForm,userInfo,paymentdocCrForm.getCandidateList());
* Excel } catch (WorkFlowException e) {
* e.printStackTrace();
* @return
*/
@ApiOperation("导出Excel")
@GetMapping("/Actions/Export")
public ActionResult Export(PaymentdocPaginationExportModel paymentdocPaginationExportModel) throws IOException {
if (StringUtil.isEmpty(paymentdocPaginationExportModel.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
PaymentdocPagination paymentdocPagination=JsonUtil.getJsonToBean(paymentdocPaginationExportModel, PaymentdocPagination.class);
List<PaymentdocEntity> list= paymentdocService.getTypeList(paymentdocPagination,paymentdocPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除
for(PaymentdocEntity entity:list){
Map<String,Object> supplierNameMap = new HashMap<>();
entity.setSupplierName(generaterSwapUtil.getPopupSelectValue("393307526961100037","supplier_name","supplier_name",entity.getSupplierName(),supplierNameMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
// entity.setCreatorTime(generaterSwapUtil.userSelectValue(entity.getCreatorTime()));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
}
List<PaymentdocListVO> listVO=JsonUtil.getJsonToList(list,PaymentdocListVO.class);
for(PaymentdocListVO paymentdocVO:listVO){
} }
//提交流程,状态改为 1审批中
//转换为map输出 entity.setDocStatus("1");
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss")); paymentdocService.updateById(entity);
String[]keys=!StringUtil.isEmpty(paymentdocPaginationExportModel.getSelectKey())?paymentdocPaginationExportModel.getSelectKey().split(","):new String[0]; return ActionResult.success("提交成功,请耐心等待");
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),mapList,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){
for(String key:keys){
switch(key){
case "documentNo" :
entitys.add(new ExcelExportEntity("单据编号" ,"documentNo"));
break;
case "businessDate" :
entitys.add(new ExcelExportEntity("申请时间" ,"businessDate"));
break;
case "supplierName" :
entitys.add(new ExcelExportEntity("供应商名称" ,"supplierName"));
break;
case "paymentType" :
entitys.add(new ExcelExportEntity("付款类型" ,"paymentType"));
break;
case "ramount" :
entitys.add(new ExcelExportEntity("申请金额" ,"ramount"));
break;
case "dueDate" :
entitys.add(new ExcelExportEntity("应付日期" ,"dueDate"));
break;
case "currency" :
entitys.add(new ExcelExportEntity("币别 " ,"currency"));
break;
case "collectionAccount" :
entitys.add(new ExcelExportEntity("收款账户" ,"collectionAccount"));
break;
case "colectionBank" :
entitys.add(new ExcelExportEntity("收款银行" ,"colectionBank"));
break;
case "settlementType" :
entitys.add(new ExcelExportEntity("结算类型" ,"settlementType"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "paymentAmount" :
entitys.add(new ExcelExportEntity("付款金额" ,"paymentAmount"));
break;
case "unpaymentAmount" :
entitys.add(new ExcelExportEntity("未付款金额" ,"unpaymentAmount"));
break;
case "status" :
entitys.add(new ExcelExportEntity("单据状态 " ,"status"));
break;
case "creatorUserName" :
entitys.add(new ExcelExportEntity("制单人" ,"creatorUserName"));
break;
case "creatorTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime"));
break;
case "lastModifyUserName" :
entitys.add(new ExcelExportEntity("修改人名称" ,"lastModifyUserName"));
break;
case "lastModifyTime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime"));
break;
default:
break;
}
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
} }
String name = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx"; return ActionResult.success("保存成功");
String fileName = configValueUtil.getTemporaryFilePath() + name;
@Cleanup FileOutputStream output = new FileOutputStream(XSSEscape.escapePath(fileName));
workbook.write(output);
//上传文件
UploadUtil.uploadFile(configValueUtil.getFileType(), fileName, FileTypeEnum.TEMPORARY, name);
vo.setName(name);
vo.setUrl(UploaderUtil.uploaderFile(userInfo.getId() + "#" + name + "#" + "Temporary"));
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
} }
/** /**
* *
* *
* @param ids * @param id
* @return * @return
*/ */
@DeleteMapping("/batchRemove/{ids}")
@Transactional
public ActionResult batchRemove(@PathVariable("ids") String ids){
String[] idList = ids.split(",");
int i =0;
for (String allId : idList){
this.delete(allId);
i++;
}
if (i == 0 ){
return ActionResult.fail("删除失败");
}
return ActionResult.success("删除成功");
}
/**
*
*
* @param id
* @return
*/
@GetMapping("/{id}") @GetMapping("/{id}")
public ActionResult<PaymentdocInfoVO> info(@PathVariable("id") String id){ public ActionResult<PaymentdocInfoVO> info(@PathVariable("id") String id){
PaymentdocEntity entity= paymentdocService.getInfo(id); PaymentdocEntity entity= paymentdocService.getInfo(id);
PaymentdocInfoVO vo=JsonUtil.getJsonToBean(entity, PaymentdocInfoVO.class); PaymentdocInfoVO vo=JsonUtil.getJsonToBean(entity, PaymentdocInfoVO.class);
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
vo.setCreatorTime(generaterSwapUtil.userSelectValue(vo.getCreatorTime()));
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
if(vo.getLastModifyTime()!=null){
vo.setLastModifyTime(vo.getLastModifyTime());
}
//子表 //子表
List<Paymentdoc_item0Entity> Paymentdoc_item0List = paymentdocService.GetPaymentdoc_item0List(id); List<String> purchaseorderIdList = new ArrayList<>();
for(Paymentdoc_item0Entity paymentdoc_item0Entity : Paymentdoc_item0List){ List<PurchaseorderEntity> purchaseorderEntityList = new ArrayList<>();
} List<PaymentdocItem0Entity> PaymentdocItem0List = paymentdocService.GetPaymentdocItem0List(id);
vo.setPaymentdoc_item0List(JsonUtil.getJsonToList(Paymentdoc_item0List,Paymentdoc_item0Model.class )); List<PaymentdocItem0Model> list = JsonUtil.getJsonToList(PaymentdocItem0List,PaymentdocItem0Model.class );
//副表 for (PaymentdocItem0Model paymentdocItem0Model : list) {
PurchaseorderEntity purchaseorderEntity = purchaseorderService.getById(paymentdocItem0Model.getPurchaseorderId());
if(purchaseorderEntity != null && StringUtils.isNotEmpty(purchaseorderEntity.getContractCode())){
ContractFileEntity contractFileEntity = contractFileService.getById(purchaseorderEntity.getContractCode());
if(contractFileEntity != null && StringUtils.isNotEmpty(contractFileEntity.getContractName())){
purchaseorderEntity.setContractNo(contractFileEntity.getContractCode());
}
}
paymentdocItem0Model.setAllAmount(purchaseorderEntity.getAmount());
paymentdocItem0Model.setPayPrice(purchaseorderEntity.getPayPrice());
paymentdocItem0Model.setDocumentNo(purchaseorderEntity.getDocumentNo());
paymentdocItem0Model.setContractNo(purchaseorderEntity.getContractNo());
paymentdocItem0Model.setNum(purchaseorderEntity.getNum());
paymentdocItem0Model.setAdvanceAmount(purchaseorderEntity.getAdvanceAmount());
paymentdocItem0Model.setRate(purchaseorderEntity.getRate());
paymentdocItem0Model.setNotAmount(purchaseorderEntity.getNotAmount());
paymentdocItem0Model.setCreatorTime(purchaseorderEntity.getCreatorTime());
}
vo.setPaymentdocItem0List(list);
//副表
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/**
* ()
*
* @param id
* @return
*/
@GetMapping("/detail/{id}")
public ActionResult<PaymentdocInfoVO> detailInfo(@PathVariable("id") String id){
PaymentdocEntity entity= paymentdocService.getInfo(id);
PaymentdocInfoVO vo=JsonUtil.getJsonToBean(entity, PaymentdocInfoVO.class);
//子表数据转换
List<Paymentdoc_item0Entity> jg_paymentdoc_item0List = paymentdocService.GetPaymentdoc_item0List(id);
List<Paymentdoc_item0Model> jg_paymentdoc_item0ModelList = JsonUtil.getJsonToList(jg_paymentdoc_item0List,Paymentdoc_item0Model.class);
for(Paymentdoc_item0Model jg_paymentdoc_item0Model : jg_paymentdoc_item0ModelList){
Map<String,Object> purchaseorderIdMap = new HashMap<>();
jg_paymentdoc_item0Model.setPurchaseorderId(generaterSwapUtil.getPopupSelectValue("393348986343324485","id","document_no",jg_paymentdoc_item0Model.getPurchaseorderId(),purchaseorderIdMap));
}
vo.setPaymentdoc_item0List(jg_paymentdoc_item0ModelList);
//附表数据转换
//添加到详情表单对象中
Map<String,Object> supplierNameMap = new HashMap<>();
vo.setSupplierName(generaterSwapUtil.getPopupSelectValue("393307526961100037","supplier_name","supplier_name",vo.getSupplierName(),supplierNameMap));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
vo.setCreatorTime(generaterSwapUtil.userSelectValue(vo.getCreatorTime()));
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
return ActionResult.success(vo);
}
/**
*
/** *
* * @param id
* * @return
* @param id */
* @return
*/
@PutMapping("/{id}") @PutMapping("/{id}")
@Transactional @Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid PaymentdocUpForm paymentdocUpForm) throws DataException { public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid Map<String,Object> upData) throws DataException {
PaymentdocUpForm paymentdocUpForm = JsonUtil.getJsonToBean(upData,PaymentdocUpForm.class);
String visualId ="398482034802139205";
VisualdevEntity visualdevEntity =generaterSwapUtil.getVisualEntity(visualId);
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
PaymentdocEntity entity= paymentdocService.getInfo(id); PaymentdocEntity entity= paymentdocService.getInfo(id);
if(entity!=null){ if(entity!=null){
paymentdocUpForm.setLastModifyUserName(userInfo.getUserId());
paymentdocUpForm.setLastModifyTime(DateUtil.getNow());
PaymentdocEntity subentity=JsonUtil.getJsonToBean(paymentdocUpForm, PaymentdocEntity.class); PaymentdocEntity subentity=JsonUtil.getJsonToBean(paymentdocUpForm, PaymentdocEntity.class);
subentity.setCreatorUserName(entity.getCreatorUserName());
subentity.setCreatorTime(entity.getCreatorTime());
paymentdocService.update(id, subentity); paymentdocService.update(id, subentity);
QueryWrapper<Paymentdoc_item0Entity> Paymentdoc_item0queryWrapper = new QueryWrapper<>(); QueryWrapper<PaymentdocItem0Entity> PaymentdocItem0queryWrapper = new QueryWrapper<>();
Paymentdoc_item0queryWrapper.lambda().eq(Paymentdoc_item0Entity::getPaymentdocId, entity.getId()); PaymentdocItem0queryWrapper.lambda().eq(PaymentdocItem0Entity::getPaymentdocId, entity.getId());
paymentdoc_item0Service.remove(Paymentdoc_item0queryWrapper); paymentdocItem0Service.remove(PaymentdocItem0queryWrapper);
List<Paymentdoc_item0Entity> Paymentdoc_item0List = JsonUtil.getJsonToList(paymentdocUpForm.getPaymentdoc_item0List(),Paymentdoc_item0Entity.class);
for(Paymentdoc_item0Entity entitys : Paymentdoc_item0List){
List<PaymentdocItem0Entity> PaymentdocItem0List = JsonUtil.getJsonToList(paymentdocUpForm.getPaymentdocitem0List(),PaymentdocItem0Entity.class);
for(PaymentdocItem0Entity entitys : PaymentdocItem0List){
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setPaymentdocId(entity.getId()); entitys.setPaymentdocId(entity.getId());
paymentdoc_item0Service.save(entitys); paymentdocItem0Service.save(entitys);
} }
return ActionResult.success("更新成功");
if (FlowStatusEnum.submit.getMessage().equals(paymentdocUpForm.getStatus())){
try {
generaterSwapUtil.submitFlowTask(visualdevEntity,id,subentity,userInfo,paymentdocUpForm.getCandidateList());
//提交流程,状态改为 1审批中
entity.setDocStatus("1");
paymentdocService.updateById(entity);
} catch (WorkFlowException e) {
e.printStackTrace();
}
return ActionResult.success("提交成功,请耐心等待");
}
return ActionResult.success("更新成功");
}else{ }else{
return ActionResult.fail("更新失败,数据不存在"); return ActionResult.fail("更新失败,数据不存在");
} }
} }
/**
*
/** *
* * @param id
* * @return
* @param id */
* @return
*/
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Transactional @Transactional
public ActionResult delete(@PathVariable("id") String id){ public ActionResult delete(@PathVariable("id") String id){
PaymentdocEntity entity= paymentdocService.getInfo(id); PaymentdocEntity entity= paymentdocService.getInfo(id);
if(entity!=null){ if(entity!=null){
FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(id, FlowTaskEntity::getId, FlowTaskEntity::getStatus);
if (taskEntity != null) {
try {
generaterSwapUtil.deleteFlowTask(taskEntity);
} catch (WorkFlowException e) {
e.printStackTrace();
}
}
paymentdocService.delete(entity); paymentdocService.delete(entity);
QueryWrapper<Paymentdoc_item0Entity> queryWrapperPaymentdoc_item0=new QueryWrapper<>(); QueryWrapper<PaymentdocItem0Entity> queryWrapperPaymentdocItem0=new QueryWrapper<>();
queryWrapperPaymentdoc_item0.lambda().eq(Paymentdoc_item0Entity::getPaymentdocId,entity.getId()); queryWrapperPaymentdocItem0.lambda().eq(PaymentdocItem0Entity::getPaymentdocId,entity.getId());
paymentdoc_item0Service.remove(queryWrapperPaymentdoc_item0); paymentdocItem0Service.remove(queryWrapperPaymentdocItem0);
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");
} }
} }

@ -7,19 +7,17 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* *
* *
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-02-09 * @ 2023-02-23
*/ */
@Data @Data
@TableName("jg_paymentdoc") @TableName("jg_paymentdoc")
@ -76,8 +74,8 @@ public class PaymentdocEntity {
@TableField("RAMOUNT") @TableField("RAMOUNT")
private BigDecimal ramount; private BigDecimal ramount;
@TableField("STATUS") @TableField("DOC_STATUS")
private String status; private String docStatus;
@TableField("SUPPLIER_CODE") @TableField("SUPPLIER_CODE")
private String supplierCode; private String supplierCode;
@ -118,4 +116,13 @@ public class PaymentdocEntity {
@TableField("IS_PAY") @TableField("IS_PAY")
private String isPay; private String isPay;
@TableField("SUPPLIER_ID")
private String supplierId;
@TableField("PURCHASE_ID")
private String purchaseId;
@TableField("CONTRACT_ID")
private String contractId;
} }

@ -7,21 +7,19 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
/** /**
* *
* *
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-02-09 * @ 2023-02-23
*/ */
@Data @Data
@TableName("jg_paymentdoc_item0") @TableName("jg_paymentdoc_item0")
public class Paymentdoc_item0Entity { public class PaymentdocItem0Entity {
@TableId("ID") @TableId("ID")
private String id; private String id;

@ -1,7 +1,7 @@
package jnpf.paymentdoc.mapper; package jnpf.paymentdoc.mapper;
import jnpf.paymentdoc.entity.Paymentdoc_item0Entity; import jnpf.paymentdoc.entity.PaymentdocItem0Entity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
@ -10,8 +10,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-02-09 * 2023-02-23
*/ */
public interface Paymentdoc_item0Mapper extends BaseMapper<Paymentdoc_item0Entity> { public interface PaymentdocItem0Mapper extends BaseMapper<PaymentdocItem0Entity> {
} }

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-02-09 * 2023-02-23
*/ */
public interface PaymentdocMapper extends BaseMapper<PaymentdocEntity> { public interface PaymentdocMapper extends BaseMapper<PaymentdocEntity> {

@ -2,13 +2,12 @@
package jnpf.paymentdoc.model.paymentdoc; package jnpf.paymentdoc.model.paymentdoc;
import com.baomidou.mybatisplus.annotation.TableField; import jnpf.paymentdoc.model.paymentdoc.PaymentdocItem0Model;
import jnpf.paymentdoc.model.paymentdoc.Paymentdoc_item0Model;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
/** /**
* *
@ -16,87 +15,101 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-02-09 * @ 2023-02-23
*/ */
@Data @Data
public class PaymentdocCrForm { public class PaymentdocCrForm {
/** 流程状态 **/
@JsonProperty("status")
private String status;
private Map<String, List<String>> candidateList;
/** 单据编号 **/ /** 单据编号 **/
@JsonProperty("documentNo") @JsonProperty("documentNo")
private String documentNo; private String documentNo;
/** 申请时间 **/
@JsonProperty("businessDate")
private Long businessDate;
/** 供应商名称 **/ /** 采购订单 **/
@JsonProperty("supplierName") @JsonProperty("purchaseId")
private String supplierName; private String purchaseId;
/** 合同 **/
@JsonProperty("contractId")
private String contractId;
/** 供应商 **/
@JsonProperty("supplierId")
private String supplierId;
/** 付款类型 **/ /** 付款类型 **/
@JsonProperty("paymentType") @JsonProperty("paymentType")
private String paymentType; private String paymentType;
/** 申请金额 **/
@JsonProperty("ramount")
private String ramount;
/** 应付日期 **/ /** 业务日期 **/
@JsonProperty("dueDate") @JsonProperty("businessDate")
private Long dueDate; private Long businessDate;
/** 币别 **/ /** 币别 **/
@JsonProperty("currency") @JsonProperty("currency")
private String currency; private String currency;
/** 收款账户 **/
@JsonProperty("collectionAccount")
private String collectionAccount;
/** 收款银行 **/
@JsonProperty("colectionBank")
private String colectionBank;
/** 结算类型 **/ /** 结算类型 **/
@JsonProperty("settlementType") @JsonProperty("settlementType")
private String settlementType; private String settlementType;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 付款金额 **/ /** 申请金额 **/
@JsonProperty("ramount")
private BigDecimal ramount;
/** 付款金额 **/
@JsonProperty("paymentAmount") @JsonProperty("paymentAmount")
private String paymentAmount; private BigDecimal paymentAmount;
/** 未付款金额 **/
/** 未付款金额 **/
@JsonProperty("unpaymentAmount") @JsonProperty("unpaymentAmount")
private String unpaymentAmount; private BigDecimal unpaymentAmount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 制单人 **/ /** 收款账户 **/
@JsonProperty("creatorUserName") @JsonProperty("collectionAccount")
private String creatorUserName; private String collectionAccount;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 修改人名称 **/ /** 收款银行 **/
@JsonProperty("lastModifyUserName") @JsonProperty("colectionBank")
private String lastModifyUserName; private String colectionBank;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 子表数据 **/ /** 应付日期 **/
@JsonProperty("paymentdoc_item0List") @JsonProperty("dueDate")
private List<Paymentdoc_item0Model> paymentdoc_item0List; private Long dueDate;
/** 是否付款 **/
@JsonProperty("isPay") @JsonProperty("isPay")
private String isPay; private String isPay;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 状态 **/
@JsonProperty("docStatus")
private String docStatus;
/** 子表数据 **/
@JsonProperty("paymentdocitem0List")
private List<PaymentdocItem0Model> paymentdocitem0List;
} }

@ -1,121 +0,0 @@
package jnpf.paymentdoc.model.paymentdoc;
import com.fasterxml.jackson.annotation.JsonProperty;
import jnpf.payment.entity.PaymentEntity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-09
*/
@Data
public class PaymentdocCrForms {
/** id **/
@JsonProperty("id")
private String id;
/** 单据编号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 供应商编码 **/
@JsonProperty("supplierCode")
private String supplierCode;
/** 供应商名称 **/
@JsonProperty("supplierName")
private String supplierName;
/** 付款类型 **/
@JsonProperty("paymentType")
private String paymentType;
/** 申请金额 **/
@JsonProperty("ramount")
private BigDecimal ramount;
/** 申请时间 **/
@JsonProperty("businessDate")
private String businessDate;
/** 应付日期 **/
@JsonProperty("dueDate")
private Date dueDate;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 收款账户 **/
@JsonProperty("collectionAccount")
private String collectionAccount;
/** 收款银行 **/
@JsonProperty("colectionBank")
private String colectionBank;
/** 结算类型 **/
@JsonProperty("settlementType")
private String settlementType;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 付款金额 **/
@JsonProperty("paymentAmount")
private BigDecimal paymentAmount;
/** 未付款金额 **/
@JsonProperty("unpaymentAmount")
private String unpaymentAmount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 制单人id **/
@JsonProperty("CreatorUserId")
private String CreatorUserId;
/** 制单人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 修改人ID **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
@JsonProperty("isPay")
private String isPay;
/** 子表数据 **/
@JsonProperty("paymentdoc_item0List")
private List<Paymentdoc_item0Model> paymentdoc_item0List;
/** 子表数据付款 **/
@JsonProperty("payment_item0List")
private List<PaymentEntity> payment_item0List;
}

@ -1,9 +1,8 @@
package jnpf.paymentdoc.model.paymentdoc; package jnpf.paymentdoc.model.paymentdoc;
import jnpf.paymentdoc.model.paymentdoc.Paymentdoc_item0Model; import jnpf.paymentdoc.model.paymentdoc.PaymentdocItem0Model;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List; import java.util.List;
@ -16,7 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-02-09 * @ 2023-02-23
*/ */
@Data @Data
public class PaymentdocInfoVO{ public class PaymentdocInfoVO{
@ -28,79 +27,75 @@ public class PaymentdocInfoVO{
@JsonProperty("documentNo") @JsonProperty("documentNo")
private String documentNo; private String documentNo;
/** 申请时间 **/ /** 采购订单 **/
@JsonProperty("businessDate") @JsonProperty("purchaseId")
private Long businessDate; private String purchaseId;
/** 供应商名称 **/ /** 合同 **/
@JsonProperty("supplierName") @JsonProperty("contractId")
private String supplierName; private String contractId;
/** 供应商 **/
@JsonProperty("supplierId")
private String supplierId;
/** 付款类型 **/ /** 付款类型 **/
@JsonProperty("paymentType") @JsonProperty("paymentType")
private String paymentType; private String paymentType;
/** 申请金额 **/ /** 业务日期 **/
@JsonProperty("ramount") @JsonProperty("businessDate")
private String ramount; private Long businessDate;
/** 应付日期 **/
@JsonProperty("dueDate")
private Long dueDate;
/** 币别 **/ /** 币别 **/
@JsonProperty("currency") @JsonProperty("currency")
private String currency; private String currency;
/** 收款账户 **/
@JsonProperty("collectionAccount")
private String collectionAccount;
/** 收款银行 **/
@JsonProperty("colectionBank")
private String colectionBank;
/** 结算类型 **/ /** 结算类型 **/
@JsonProperty("settlementType") @JsonProperty("settlementType")
private String settlementType; private String settlementType;
/** 备注 **/ /** 申请金额 **/
@JsonProperty("remark") @JsonProperty("ramount")
private String remark; private BigDecimal ramount;
/** 付款金额 **/ /** 付款金额 **/
@JsonProperty("paymentAmount") @JsonProperty("paymentAmount")
private String paymentAmount; private BigDecimal paymentAmount;
/** 未付款金额 **/ /** 未付款金额 **/
@JsonProperty("unpaymentAmount") @JsonProperty("unpaymentAmount")
private String unpaymentAmount; private BigDecimal unpaymentAmount;
/** 单据状态 **/ /** 收款账户 **/
@JsonProperty("status") @JsonProperty("collectionAccount")
private String status; private String collectionAccount;
/** 收款银行 **/
@JsonProperty("colectionBank")
private String colectionBank;
/** 应付日期 **/
@JsonProperty("dueDate")
private Long dueDate;
/** 制单人 **/ /** 是否付款 **/
@JsonProperty("creatorUserName") @JsonProperty("isPay")
private String creatorUserName; private String isPay;
/** 创建时间 **/ /** 单据状态 **/
@JsonProperty("creatorTime") @JsonProperty("status")
private String creatorTime; private String status;
/** 修改人名称 **/ /** 备注 **/
@JsonProperty("lastModifyUserName") @JsonProperty("remark")
private String lastModifyUserName; private String remark;
/** 修改时间 **/ /** 状态 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonProperty("docStatus")
@JsonProperty("lastModifyTime") private String docStatus;
private Date lastModifyTime;
/** 子表数据 **/ /** 子表数据 **/
@JsonProperty("paymentdoc_item0List") @JsonProperty("paymentdocitem0List")
private List<Paymentdoc_item0Model> paymentdoc_item0List; private List<PaymentdocItem0Model> paymentdocItem0List;
@JsonProperty("isPay")
private String isPay;
} }

@ -0,0 +1,112 @@
package jnpf.paymentdoc.model.paymentdoc;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
*
* V3.2.0
* : LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-23
*/
@Data
public class PaymentdocItem0Model {
/** id **/
@JsonProperty("id")
private String id;
/** 申请金额 **/
@JsonProperty("amount")
private String amount;
@JsonProperty("purchaseorderId")
private String purchaseorderId;
@JsonProperty("documentNo")
private String documentNo;
@JsonProperty("erpNo")
private String erpNo;
@JsonProperty("contractCode")
private String contractCode;
@JsonProperty("contractName")
private String contractName;
@JsonProperty("contractNo")
private String contractNo;
@JsonProperty("supplierCode")
private String supplierCode;
@JsonProperty("supplierName")
private String supplierName;
@JsonProperty("num")
private BigDecimal num;
@JsonProperty("allAmount")
private BigDecimal allAmount;
@JsonProperty("notAmount")
private BigDecimal notAmount;
@JsonProperty("rate")
private BigDecimal rate;
@JsonProperty("poundNum")
private Integer poundNum;
@JsonProperty("currency")
private String currency;
@JsonProperty("advanceAmount")
private BigDecimal advanceAmount;
@JsonProperty("payPrice")
private BigDecimal payPrice;
@JsonProperty("invoiceNum")
private BigDecimal invoiceNum;
@JsonProperty("invoiceAmount")
private BigDecimal invoiceAmount;
@JsonProperty("refundableNum")
private BigDecimal refundableNum;
@JsonProperty("refundableAmount")
private BigDecimal refundableAmount;
@JsonProperty("status")
private String status;
@JsonProperty("sourceSystem")
private String sourceSystem;
@JsonProperty("isSettle")
private String isSettle;
@JsonProperty("issue")
private String issue;
@JsonProperty("isTransfer")
private String isTransfer;
@JsonProperty("remark")
private String remark;
@JsonProperty("supplierId")
private String supplierId;
@JsonProperty("creatorTime")
private Date creatorTime;
}

@ -10,16 +10,13 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-02-09 * @ 2023-02-23
*/ */
@Data @Data
public class PaymentdocListQuery extends Pagination { public class PaymentdocListQuery extends Pagination {
/** 单据编号 */ /** 单据编号 */
private String documentNo; private String documentNo;
/** 单据状态 */
private String status;
/** /**
* id * id
*/ */

@ -15,107 +15,120 @@ import java.math.BigDecimal;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-02-09 * @ 2023-02-23
*/ */
@Data @Data
public class PaymentdocListVO{ public class PaymentdocListVO{
/** 主键 */ /** 主键 */
private String id; private String id;
/** 单据编号 **/ /** 单据编号 **/
@JsonProperty("documentNo") @JsonProperty("documentNo")
private String documentNo; private String documentNo;
/** 采购订单 **/
@JsonProperty("purchaseId")
private String purchaseId;
/** 合同 **/
@JsonProperty("contractId")
private String contractId;
/** 供应商 **/
@JsonProperty("supplierId")
private String supplierId;
/** 付款类型 **/
@JsonProperty("paymentType")
private String paymentType;
/** 业务日期 **/
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
@JsonProperty("businessDate")
private Date businessDate;
/** 申请时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("businessDate")
private Date businessDate;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 供应商名称 **/
@JsonProperty("supplierName")
private String supplierName;
/** 付款类型 **/ /** 结算类型 **/
@JsonProperty("paymentType") @JsonProperty("settlementType")
private String paymentType; private String settlementType;
/** 申请金额 **/
@JsonProperty("ramount")
private String ramount;
/** 申请金额 **/
@JsonProperty("ramount")
private BigDecimal ramount;
/** 应付日期 **/
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
@JsonProperty("dueDate")
private Date dueDate;
/** 币别 **/ /** 付款金额 **/
@JsonProperty("currency") @JsonProperty("paymentAmount")
private String currency; private BigDecimal paymentAmount;
/** 收款账户 **/
@JsonProperty("collectionAccount")
private String collectionAccount;
/** 未付款金额 **/
@JsonProperty("unpaymentAmount")
private BigDecimal unpaymentAmount;
/** 收款银行 **/
@JsonProperty("colectionBank")
private String colectionBank;
/** 结算类型 **/ /** 收款账户 **/
@JsonProperty("settlementType") @JsonProperty("collectionAccount")
private String settlementType; private String collectionAccount;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 收款银行 **/
@JsonProperty("colectionBank")
private String colectionBank;
/** 付款金额 **/
@JsonProperty("paymentAmount")
private String paymentAmount;
/** 未付款金额 **/ /** 应付日期 **/
@JsonProperty("unpaymentAmount") @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private String unpaymentAmount; @JsonProperty("dueDate")
private Date dueDate;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 是否付款 **/
@JsonProperty("isPay")
private String isPay;
/** 制单人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 创建时间 **/ /** 单据状态 **/
@JsonProperty("creatorTime") @JsonProperty("status")
private String creatorTime; private String status;
/** 修改人名称 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 修改时间 **/ /** 状态 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonProperty("docStatus")
@JsonProperty("lastModifyTime") private String docStatus;
private Date lastModifyTime;
@JsonProperty("isPay") @JsonProperty("flowState")
private String isPay; private Integer flowState;
} }

@ -11,18 +11,15 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-02-09 * @ 2023-02-23
*/ */
@Data @Data
public class PaymentdocPagination extends Pagination { public class PaymentdocPagination extends Pagination {
/** 单据编号 */ /** 单据编号 */
private String documentNo; private String documentNo;
/** 单据状态 */
private String status;
/** /**
* id * id
*/ */
private String menuId; private String menuId;
} }

@ -9,7 +9,7 @@ import java.util.*;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-02-09 * @ 2023-02-23
*/ */
@Data @Data
public class PaymentdocPaginationExportModel extends Pagination { public class PaymentdocPaginationExportModel extends Pagination {
@ -23,7 +23,4 @@ public class PaymentdocPaginationExportModel extends Pagination {
/** 单据编号 */ /** 单据编号 */
private String documentNo; private String documentNo;
/** 单据状态 */
private String status;
} }

@ -2,13 +2,12 @@
package jnpf.paymentdoc.model.paymentdoc; package jnpf.paymentdoc.model.paymentdoc;
import jnpf.paymentdoc.model.paymentdoc.Paymentdoc_item0Model; import jnpf.paymentdoc.model.paymentdoc.PaymentdocItem0Model;
import lombok.Data; import lombok.Data;
import java.util.Date;
import java.util.List; import java.util.List;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
import lombok.Data; import lombok.Data;
@ -18,107 +17,89 @@ import lombok.Data;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-02-09 * @ 2023-02-23
*/ */
@Data @Data
public class PaymentdocUpForm{ public class PaymentdocUpForm{
/** 主键 */ /** 主键 */
private String id; private String id;
/** 流程状态 **/
@JsonProperty("status")
private String status;
private Map<String, List<String>> candidateList;
/** 单据编号 **/ /** 单据编号 **/
@JsonProperty("documentNo") @JsonProperty("documentNo")
private String documentNo; private String documentNo;
/** 采购订单 **/
@JsonProperty("purchaseId")
private String purchaseId;
/** 申请时间 **/ /** 合同 **/
@JsonProperty("businessDate") @JsonProperty("contractId")
private Long businessDate; private String contractId;
/** 供应商名称 **/
@JsonProperty("supplierName")
private String supplierName;
/** 供应商 **/
@JsonProperty("supplierId")
private String supplierId;
/** 付款类型 **/ /** 付款类型 **/
@JsonProperty("paymentType") @JsonProperty("paymentType")
private String paymentType; private String paymentType;
/** 业务日期 **/
@JsonProperty("businessDate")
private Long businessDate;
/** 申请金额 **/ /** 币别 **/
@JsonProperty("ramount")
private String ramount;
/** 应付日期 **/
@JsonProperty("dueDate")
private Date dueDate;
/** 币别 **/
@JsonProperty("currency") @JsonProperty("currency")
private String currency; private String currency;
/** 收款账户 **/
@JsonProperty("collectionAccount")
private String collectionAccount;
/** 收款银行 **/
@JsonProperty("colectionBank")
private String colectionBank;
/** 结算类型 **/ /** 结算类型 **/
@JsonProperty("settlementType") @JsonProperty("settlementType")
private String settlementType; private String settlementType;
/** 申请金额 **/
/** 备注 **/ @JsonProperty("ramount")
@JsonProperty("remark") private BigDecimal ramount;
private String remark;
/** 付款金额 **/ /** 付款金额 **/
@JsonProperty("paymentAmount") @JsonProperty("paymentAmount")
private String paymentAmount; private BigDecimal paymentAmount;
/** 未付款金额 **/ /** 未付款金额 **/
@JsonProperty("unpaymentAmount") @JsonProperty("unpaymentAmount")
private String unpaymentAmount; private BigDecimal unpaymentAmount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 制单人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 收款账户 **/
@JsonProperty("collectionAccount")
private String collectionAccount;
/** 创建时间 **/ /** 收款银行 **/
@JsonProperty("creatorTime") @JsonProperty("colectionBank")
private String creatorTime; private String colectionBank;
/** 应付日期 **/
@JsonProperty("dueDate")
private Long dueDate;
/** 修改人名称 **/ /** 是否付款 **/
@JsonProperty("lastModifyUserName") @JsonProperty("isPay")
private String lastModifyUserName; private String isPay;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 修改时间 **/ /** 状态 **/
@JsonProperty("lastModifyTime") @JsonProperty("docStatus")
private String lastModifyTime; private String docStatus;
/** 子表数据 **/ /** 子表数据 **/
@JsonProperty("paymentdoc_item0List") @JsonProperty("paymentdocitem0List")
private List<Paymentdoc_item0Model> paymentdoc_item0List; private List<PaymentdocItem0Model> paymentdocitem0List;
@JsonProperty("isPay")
private String isPay;
} }

@ -1,70 +0,0 @@
package jnpf.paymentdoc.model.paymentdoc;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
*
* V3.2.0
* : LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-09
*/
@Data
public class Paymentdoc_item0Model {
/** 申请金额 **/
@JsonProperty("amount")
private String amount;
/** 订单金额 **/
@JsonProperty("creatorUserId")
private String creatorUserId;
/** 已付金额 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 订单编号 **/
@JsonProperty("purchaseorderId")
private String purchaseorderId;
/** 合同编号 **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
/** 重量 **/
@JsonProperty("lastModifyUserName")
private String lastModifyUserName;
/** 税率(%) **/
@JsonProperty("deleteMark")
private String deleteMark;
/** 垫资金额 **/
@JsonProperty("departmentId")
private String departmentId;
/** 税额 **/
@JsonProperty("orgnizeId")
private String orgnizeId;
/** 不含税金额 **/
@JsonProperty("deleteUserId")
private String deleteUserId;
/** 业务类型 **/
@JsonProperty("deleteUserName")
private String deleteUserName;
/** 业务日期 **/
@JsonProperty("creatorTime")
private String creatorTime;
}

@ -1,6 +1,6 @@
package jnpf.paymentdoc.service; package jnpf.paymentdoc.service;
import jnpf.paymentdoc.entity.Paymentdoc_item0Entity; import jnpf.paymentdoc.entity.PaymentdocItem0Entity;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
/** /**
* *
@ -8,8 +8,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-02-09 * 2023-02-23
*/ */
public interface Paymentdoc_item0Service extends IService<Paymentdoc_item0Entity> { public interface PaymentdocItem0Service extends IService<PaymentdocItem0Entity> {
} }

@ -1,6 +1,6 @@
package jnpf.paymentdoc.service; package jnpf.paymentdoc.service;
import jnpf.paymentdoc.entity.Paymentdoc_item0Entity; import jnpf.paymentdoc.entity.PaymentdocItem0Entity;
import jnpf.paymentdoc.service.Paymentdoc_item0Service; import jnpf.paymentdoc.service.PaymentdocItem0Service;
import jnpf.paymentdoc.entity.PaymentdocEntity; import jnpf.paymentdoc.entity.PaymentdocEntity;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@ -12,13 +12,13 @@ import java.util.*;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-02-09 * 2023-02-23
*/ */
public interface PaymentdocService extends IService<PaymentdocEntity> { public interface PaymentdocService extends IService<PaymentdocEntity> {
List<PaymentdocEntity> getList(PaymentdocPagination paymentdocPagination); List<PaymentdocEntity> getList(PaymentdocPagination paymentdocPagination);
List<PaymentdocEntity> getTypeList(PaymentdocPagination paymentdocPagination,String dataType); List<PaymentdocEntity> getTypeList(PaymentdocPagination paymentdocPagination, String dataType);
@ -28,10 +28,10 @@ public interface PaymentdocService extends IService<PaymentdocEntity> {
void create(PaymentdocEntity entity); void create(PaymentdocEntity entity);
boolean update( String id, PaymentdocEntity entity); boolean update(String id, PaymentdocEntity entity);
// 子表方法 // 子表方法
List<Paymentdoc_item0Entity> GetPaymentdoc_item0List(String id); List<PaymentdocItem0Entity> GetPaymentdocItem0List(String id);
//列表子表数据方法 //列表子表数据方法
} }

@ -1,12 +1,11 @@
package jnpf.paymentdoc.service.impl; package jnpf.paymentdoc.service.impl;
import jnpf.paymentdoc.entity.*; import jnpf.paymentdoc.entity.*;
import jnpf.paymentdoc.mapper.Paymentdoc_item0Mapper; import jnpf.paymentdoc.mapper.PaymentdocItem0Mapper;
import jnpf.paymentdoc.service.*; import jnpf.paymentdoc.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil; import jnpf.util.RandomUtil;
import java.math.BigDecimal; import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel; import jnpf.permission.model.authorize.AuthorizeConditionModel;
@ -32,10 +31,9 @@ import java.util.*;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-02-09 * 2023-02-23
*/ */
@Service @Service
public class Paymentdoc_item0ServiceImpl extends ServiceImpl<Paymentdoc_item0Mapper, Paymentdoc_item0Entity> implements Paymentdoc_item0Service{ public class PaymentdocItem0ServiceImpl extends ServiceImpl<PaymentdocItem0Mapper, PaymentdocItem0Entity> implements PaymentdocItem0Service {
} }

@ -6,13 +6,13 @@ import jnpf.paymentdoc.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil; import jnpf.util.RandomUtil;
import java.math.BigDecimal; import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel; import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.paymentdoc.model.paymentdoc.PaymentdocPagination; import jnpf.paymentdoc.model.paymentdoc.PaymentdocPagination;
import jnpf.permission.service.AuthorizeService; import jnpf.permission.service.AuthorizeService;
import cn.hutool.core.util.ObjectUtil;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -38,10 +38,10 @@ import java.util.*;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-02-09 * 2023-02-23
*/ */
@Service @Service
public class PaymentdocServiceImpl extends ServiceImpl<PaymentdocMapper, PaymentdocEntity> implements PaymentdocService{ public class PaymentdocServiceImpl extends ServiceImpl<PaymentdocMapper, PaymentdocEntity> implements PaymentdocService {
@Autowired @Autowired
@ -52,79 +52,71 @@ public class PaymentdocServiceImpl extends ServiceImpl<PaymentdocMapper, Payment
@Autowired @Autowired
private Paymentdoc_item0Service paymentdoc_item0Service; private PaymentdocItem0Service paymentdocItem0Service;
@Override @Override
public List<PaymentdocEntity> getList(PaymentdocPagination paymentdocPagination){ public List<PaymentdocEntity> getList(PaymentdocPagination paymentdocPagination){
String userId=userProvider.get().getUserId(); String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList(); List<String> AllIdList =new ArrayList();
int total=0; int total=0;
int paymentdocNum =0; int paymentdocNum =0;
QueryWrapper<PaymentdocEntity> paymentdocQueryWrapper=new QueryWrapper<>(); QueryWrapper<PaymentdocEntity> paymentdocQueryWrapper=new QueryWrapper<>();
int paymentdoc_item0Num =0; int paymentdocItem0Num =0;
QueryWrapper<Paymentdoc_item0Entity> paymentdoc_item0QueryWrapper=new QueryWrapper<>(); QueryWrapper<PaymentdocItem0Entity> paymentdocItem0QueryWrapper=new QueryWrapper<>();
boolean pcPermission = false; boolean pcPermission = false;
boolean appPermission = false; boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){ if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){ if (!userProvider.get().getIsAdministrator()){
Object paymentdocObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocQueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc")); Object paymentdocObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocQueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc"));
if (ObjectUtil.isEmpty(paymentdocObj)){ if (ObjectUtil.isEmpty(paymentdocObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
paymentdocQueryWrapper = (QueryWrapper<PaymentdocEntity>)paymentdocObj; paymentdocQueryWrapper = (QueryWrapper<PaymentdocEntity>)paymentdocObj;
paymentdocNum++; paymentdocNum++;
}
Object paymentdocItem0Obj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocItem0QueryWrapper,paymentdocPagination.getMenuId(),"paymentdocItem0"));
if (ObjectUtil.isEmpty(paymentdocItem0Obj)){
return new ArrayList<>();
} else {
paymentdocItem0QueryWrapper = (QueryWrapper<PaymentdocItem0Entity>)paymentdocItem0Obj;
paymentdocItem0Num++;
}
} }
Object paymentdoc_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdoc_item0QueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc_item0")); }
if (ObjectUtil.isEmpty(paymentdoc_item0Obj)){ if(!isPc && appPermission){
return new ArrayList<>(); if (!userProvider.get().getIsAdministrator()){
} else { Object paymentdocObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocQueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc"));
paymentdoc_item0QueryWrapper = (QueryWrapper<Paymentdoc_item0Entity>)paymentdoc_item0Obj; if (ObjectUtil.isEmpty(paymentdocObj)){
paymentdoc_item0Num++; return new ArrayList<>();
} else {
paymentdocQueryWrapper = (QueryWrapper<PaymentdocEntity>)paymentdocObj;
paymentdocNum++;
}
Object paymentdocItem0Obj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocItem0QueryWrapper,paymentdocPagination.getMenuId(),"paymentdocItem0"));
if (ObjectUtil.isEmpty(paymentdocItem0Obj)){
return new ArrayList<>();
} else {
paymentdocItem0QueryWrapper = (QueryWrapper<PaymentdocItem0Entity>)paymentdocItem0Obj;
paymentdocItem0Num++;
}
} }
} }
} if(StringUtil.isNotEmpty(paymentdocPagination.getDocumentNo())){
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object paymentdocObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocQueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc"));
if (ObjectUtil.isEmpty(paymentdocObj)){
return new ArrayList<>();
} else {
paymentdocQueryWrapper = (QueryWrapper<PaymentdocEntity>)paymentdocObj;
paymentdocNum++;
}
Object paymentdoc_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdoc_item0QueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc_item0"));
if (ObjectUtil.isEmpty(paymentdoc_item0Obj)){
return new ArrayList<>();
} else {
paymentdoc_item0QueryWrapper = (QueryWrapper<Paymentdoc_item0Entity>)paymentdoc_item0Obj;
paymentdoc_item0Num++;
}
}
}
if(StringUtil.isNotEmpty(paymentdocPagination.getDocumentNo())){
paymentdocNum++; paymentdocNum++;
paymentdocQueryWrapper.lambda().like(PaymentdocEntity::getDocumentNo,paymentdocPagination.getDocumentNo()); paymentdocQueryWrapper.lambda().like(PaymentdocEntity::getDocumentNo,paymentdocPagination.getDocumentNo());
} }
if(StringUtil.isNotEmpty(paymentdocPagination.getStatus())){
paymentdocNum++;
paymentdocQueryWrapper.lambda().eq(PaymentdocEntity::getStatus,paymentdocPagination.getStatus());
}
if(AllIdList.size()>0){ if(AllIdList.size()>0){
paymentdocQueryWrapper.lambda().in(PaymentdocEntity::getId, AllIdList); paymentdocQueryWrapper.lambda().in(PaymentdocEntity::getId, AllIdList);
} }
//排序 //排序
if(StringUtil.isEmpty(paymentdocPagination.getSidx())){ if(StringUtil.isEmpty(paymentdocPagination.getSidx())){
paymentdocQueryWrapper.lambda().orderByDesc(PaymentdocEntity::getId); paymentdocQueryWrapper.lambda().orderByDesc(PaymentdocEntity::getId);
}else{ }else{
try { try {
String sidx = paymentdocPagination.getSidx(); String sidx = paymentdocPagination.getSidx();
@ -138,9 +130,9 @@ public class PaymentdocServiceImpl extends ServiceImpl<PaymentdocMapper, Payment
} }
} }
if((total>0 && AllIdList.size()>0) || total==0){ if((total>0 && AllIdList.size()>0) || total==0){
Page<PaymentdocEntity> page=new Page<>(paymentdocPagination.getCurrentPage(), paymentdocPagination.getPageSize()); Page<PaymentdocEntity> page=new Page<>(paymentdocPagination.getCurrentPage(), paymentdocPagination.getPageSize());
IPage<PaymentdocEntity> userIPage=this.page(page, paymentdocQueryWrapper); IPage<PaymentdocEntity> userIPage=this.page(page, paymentdocQueryWrapper);
return paymentdocPagination.setData(userIPage.getRecords(),userIPage.getTotal()); return paymentdocPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{ }else{
List<PaymentdocEntity> list = new ArrayList(); List<PaymentdocEntity> list = new ArrayList();
return paymentdocPagination.setData(list, list.size()); return paymentdocPagination.setData(list, list.size());
@ -150,78 +142,69 @@ public class PaymentdocServiceImpl extends ServiceImpl<PaymentdocMapper, Payment
public List<PaymentdocEntity> getTypeList(PaymentdocPagination paymentdocPagination,String dataType){ public List<PaymentdocEntity> getTypeList(PaymentdocPagination paymentdocPagination,String dataType){
String userId=userProvider.get().getUserId(); String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList(); List<String> AllIdList =new ArrayList();
int total=0; int total=0;
int paymentdocNum =0; int paymentdocNum =0;
QueryWrapper<PaymentdocEntity> paymentdocQueryWrapper=new QueryWrapper<>(); QueryWrapper<PaymentdocEntity> paymentdocQueryWrapper=new QueryWrapper<>();
int paymentdoc_item0Num =0; int paymentdocItem0Num =0;
QueryWrapper<Paymentdoc_item0Entity> paymentdoc_item0QueryWrapper=new QueryWrapper<>(); QueryWrapper<PaymentdocItem0Entity> paymentdocItem0QueryWrapper=new QueryWrapper<>();
boolean pcPermission = false; boolean pcPermission = false;
boolean appPermission = false; boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){ if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){ if (!userProvider.get().getIsAdministrator()){
Object paymentdocObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocQueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc")); Object paymentdocObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocQueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc"));
if (ObjectUtil.isEmpty(paymentdocObj)){ if (ObjectUtil.isEmpty(paymentdocObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
paymentdocQueryWrapper = (QueryWrapper<PaymentdocEntity>)paymentdocObj; paymentdocQueryWrapper = (QueryWrapper<PaymentdocEntity>)paymentdocObj;
paymentdocNum++; paymentdocNum++;
}
Object paymentdocItem0Obj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocItem0QueryWrapper,paymentdocPagination.getMenuId(),"paymentdocItem0"));
if (ObjectUtil.isEmpty(paymentdocItem0Obj)){
return new ArrayList<>();
} else {
paymentdocItem0QueryWrapper = (QueryWrapper<PaymentdocItem0Entity>)paymentdocItem0Obj;
paymentdocItem0Num++;
}
} }
Object paymentdoc_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdoc_item0QueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc_item0")); }
if (ObjectUtil.isEmpty(paymentdoc_item0Obj)){ if(!isPc && appPermission){
return new ArrayList<>(); if (!userProvider.get().getIsAdministrator()){
} else { Object paymentdocObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocQueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc"));
paymentdoc_item0QueryWrapper = (QueryWrapper<Paymentdoc_item0Entity>)paymentdoc_item0Obj; if (ObjectUtil.isEmpty(paymentdocObj)){
paymentdoc_item0Num++; return new ArrayList<>();
} else {
paymentdocQueryWrapper = (QueryWrapper<PaymentdocEntity>)paymentdocObj;
paymentdocNum++;
}
Object paymentdocItem0Obj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocItem0QueryWrapper,paymentdocPagination.getMenuId(),"paymentdocItem0"));
if (ObjectUtil.isEmpty(paymentdocItem0Obj)){
return new ArrayList<>();
} else {
paymentdocItem0QueryWrapper = (QueryWrapper<PaymentdocItem0Entity>)paymentdocItem0Obj;
paymentdocItem0Num++;
}
} }
} }
} if(StringUtil.isNotEmpty(paymentdocPagination.getDocumentNo())){
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object paymentdocObj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdocQueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc"));
if (ObjectUtil.isEmpty(paymentdocObj)){
return new ArrayList<>();
} else {
paymentdocQueryWrapper = (QueryWrapper<PaymentdocEntity>)paymentdocObj;
paymentdocNum++;
}
Object paymentdoc_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(paymentdoc_item0QueryWrapper,paymentdocPagination.getMenuId(),"paymentdoc_item0"));
if (ObjectUtil.isEmpty(paymentdoc_item0Obj)){
return new ArrayList<>();
} else {
paymentdoc_item0QueryWrapper = (QueryWrapper<Paymentdoc_item0Entity>)paymentdoc_item0Obj;
paymentdoc_item0Num++;
}
}
}
if(StringUtil.isNotEmpty(paymentdocPagination.getDocumentNo())){
paymentdocNum++; paymentdocNum++;
paymentdocQueryWrapper.lambda().like(PaymentdocEntity::getDocumentNo,paymentdocPagination.getDocumentNo()); paymentdocQueryWrapper.lambda().like(PaymentdocEntity::getDocumentNo,paymentdocPagination.getDocumentNo());
} }
if(StringUtil.isNotEmpty(paymentdocPagination.getStatus())){
paymentdocNum++;
paymentdocQueryWrapper.lambda().eq(PaymentdocEntity::getStatus,paymentdocPagination.getStatus());
}
if(AllIdList.size()>0){ if(AllIdList.size()>0){
paymentdocQueryWrapper.lambda().in(PaymentdocEntity::getId, AllIdList); paymentdocQueryWrapper.lambda().in(PaymentdocEntity::getId, AllIdList);
} }
//排序 //排序
if(StringUtil.isEmpty(paymentdocPagination.getSidx())){ if(StringUtil.isEmpty(paymentdocPagination.getSidx())){
paymentdocQueryWrapper.lambda().orderByDesc(PaymentdocEntity::getId); paymentdocQueryWrapper.lambda().orderByDesc(PaymentdocEntity::getId);
}else{ }else{
try { try {
String sidx = paymentdocPagination.getSidx(); String sidx = paymentdocPagination.getSidx();
PaymentdocEntity paymentdocEntity = new PaymentdocEntity(); PaymentdocEntity paymentdocEntity = new PaymentdocEntity();
Field declaredField = paymentdocEntity.getClass().getDeclaredField(sidx); Field declaredField = paymentdocEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true); declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value(); String value = declaredField.getAnnotation(TableField.class).value();
paymentdocQueryWrapper="asc".equals(paymentdocPagination.getSort().toLowerCase())?paymentdocQueryWrapper.orderByAsc(value):paymentdocQueryWrapper.orderByDesc(value); paymentdocQueryWrapper="asc".equals(paymentdocPagination.getSort().toLowerCase())?paymentdocQueryWrapper.orderByAsc(value):paymentdocQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) { } catch (NoSuchFieldException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -264,14 +247,13 @@ public class PaymentdocServiceImpl extends ServiceImpl<PaymentdocMapper, Payment
} }
} }
//子表方法 //子表方法
@Override @Override
public List<Paymentdoc_item0Entity> GetPaymentdoc_item0List(String id){ public List<PaymentdocItem0Entity> GetPaymentdocItem0List(String id){
QueryWrapper<Paymentdoc_item0Entity> queryWrapper = new QueryWrapper<>(); QueryWrapper<PaymentdocItem0Entity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(Paymentdoc_item0Entity::getPaymentdocId, id); queryWrapper.lambda().eq(PaymentdocItem0Entity::getPaymentdocId, id);
return paymentdoc_item0Service.list(queryWrapper); return paymentdocItem0Service.list(queryWrapper);
} }
//列表子表数据方法 //列表子表数据方法
} }

@ -52,7 +52,7 @@ import jnpf.util.enums.FileTypeEnum;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-02-21 * @ 2023-01-05
*/ */
@Slf4j @Slf4j
@RestController @RestController

@ -162,5 +162,14 @@ public class PoundlistListVO{
@JsonProperty("remark") @JsonProperty("remark")
private String remark; private String remark;
@JsonProperty("isInvoicing")
private String isInvoicing;
/** 采购单格 **/
@JsonProperty("price")
private String price;
/** 税率 **/
@JsonProperty("rate")
private String rate;
} }

@ -15,6 +15,10 @@ import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO; import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.poundlist.entity.PoundlistEntity;
import jnpf.poundlist.service.PoundlistService;
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
import jnpf.purchaseorder.service.Purchaseorder_item0Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity; import jnpf.base.entity.ProvinceEntity;
import jnpf.purchaseback.model.purchaseback.*; import jnpf.purchaseback.model.purchaseback.*;
@ -81,7 +85,10 @@ public class PurchasebackController {
@Autowired @Autowired
private PurchaseorderService purchaseorderService; private PurchaseorderService purchaseorderService;
@Autowired
private Purchaseorder_item0Service purchaseorder_item0Service;
@Autowired
private PoundlistService poundlistService;
/** /**
* *
@ -126,6 +133,7 @@ public class PurchasebackController {
public ActionResult create(@RequestBody @Valid PurchasebackCrForm purchasebackCrForm) throws DataException { public ActionResult create(@RequestBody @Valid PurchasebackCrForm purchasebackCrForm) throws DataException {
String mainId =RandomUtil.uuId(); String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
purchasebackCrForm.setDocumentNo(generaterSwapUtil.getBillNumber("cgth", false));
purchasebackCrForm.setCreatorTime(DateUtil.getNow()); purchasebackCrForm.setCreatorTime(DateUtil.getNow());
purchasebackCrForm.setCreatorUserName(userInfo.getUserId()); purchasebackCrForm.setCreatorUserName(userInfo.getUserId());
PurchasebackEntity entity = JsonUtil.getJsonToBean(purchasebackCrForm, PurchasebackEntity.class); PurchasebackEntity entity = JsonUtil.getJsonToBean(purchasebackCrForm, PurchasebackEntity.class);
@ -338,6 +346,10 @@ public class PurchasebackController {
//子表 //子表
List<Purchaseback_item0Entity> Purchaseback_item0List = purchasebackService.GetPurchaseback_item0List(id); List<Purchaseback_item0Entity> Purchaseback_item0List = purchasebackService.GetPurchaseback_item0List(id);
for(Purchaseback_item0Entity purchaseback_item0Entity : Purchaseback_item0List){ for(Purchaseback_item0Entity purchaseback_item0Entity : Purchaseback_item0List){
Purchaseorder_item0Entity purchaseorder_item0Entity = purchaseorder_item0Service.getById(purchaseback_item0Entity.getPurchaseorderItem0Id());
PoundlistEntity poundlistEntity = poundlistService.getById(purchaseorder_item0Entity.getPoundlistId());
purchaseback_item0Entity.setMaterialId(poundlistEntity.getMaterialId());
purchaseback_item0Entity.setVehicleId(poundlistEntity.getVehicleId());
} }
vo.setPurchaseback_item0List(JsonUtil.getJsonToList(Purchaseback_item0List,Purchaseback_item0Model.class )); vo.setPurchaseback_item0List(JsonUtil.getJsonToList(Purchaseback_item0List,Purchaseback_item0Model.class ));
//副表 //副表

@ -104,4 +104,9 @@ public class Purchaseback_item0Entity {
@TableField("NOT_AMOUNT") @TableField("NOT_AMOUNT")
private BigDecimal notAmount; private BigDecimal notAmount;
@TableField(exist = false)
private String vehicleId;
@TableField(exist = false)
private String materialId;
} }

@ -58,5 +58,17 @@ public class Purchaseback_item0Model {
@JsonProperty("pountType") @JsonProperty("pountType")
private String pountType; private String pountType;
/** 磅单类型 **/
@JsonProperty("poundlistId")
private String poundlistId;
/** 磅单类型 **/
@JsonProperty("purchaseorderItem0Id")
private String purchaseorderItem0Id;
@JsonProperty("vehicleId")
private String vehicleId;
@JsonProperty("materialId")
private String materialId;
} }

@ -14,11 +14,21 @@ import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO; import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.contractfile.entity.ContractFileEntity;
import jnpf.contractfile.service.ContractFileService;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.materialvo.entity.MaterialEntity;
import jnpf.materialvo.service.MaterialService;
import jnpf.poundlist.entity.PoundlistEntity;
import jnpf.poundlist.service.PoundlistService;
import jnpf.purchaseback.entity.PurchaseorderEntity; import jnpf.purchaseback.entity.PurchaseorderEntity;
import jnpf.purchaseback.service.PurchaseorderService; import jnpf.purchaseback.service.PurchaseorderService;
import jnpf.purchaseorder.entity.*; import jnpf.purchaseorder.entity.*;
import jnpf.purchaseorder.service.*; import jnpf.purchaseorder.service.*;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import jnpf.reservoirarea.service.ReservoirareaService;
import jnpf.warehouse.service.WareHouseService;
import org.apache.commons.lang3.StringUtils;
import org.bytedeco.opencv.presets.opencv_core; import org.bytedeco.opencv.presets.opencv_core;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import jnpf.purchaseorder.model.purchaseorder.*; import jnpf.purchaseorder.model.purchaseorder.*;
@ -85,7 +95,16 @@ public class PurchaseorderController {
private InvoicesitemService invoicesitemService; private InvoicesitemService invoicesitemService;
@Autowired @Autowired
private PurchaseorderService purchaseorderService; private PurchaseorderService purchaseorderService;
@Autowired
private PoundlistService poundlistService;
@Autowired
private MaterialService materialService;
@Autowired
private ReservoirareaService reservoirareaService;
@Autowired
private WareHouseService wareHouseService;
@Autowired
private ContractFileService contractFileService;
/** /**
* *
@ -144,20 +163,21 @@ public class PurchaseorderController {
* @param purchaseorderPagination * @param purchaseorderPagination
* @return * @return
*/ */
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody PurchaseorderPagination purchaseorderPagination)throws IOException{ public ActionResult list(@RequestBody PurchaseorderPagination purchaseorderPagination)throws IOException{
List<PurchaseorderitemEntity> list= purchaseorderitemService.getList(purchaseorderPagination); List<PurchaseorderitemEntity> list= purchaseorderitemService.getList(purchaseorderPagination);
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(PurchaseorderitemEntity entity:list){ for(PurchaseorderitemEntity entity:list){
Map<String,Object> contractNameMap = new HashMap<>(); Map<String,Object> contractCodeMap = new HashMap<>();
entity.setContractName(generaterSwapUtil.getPopupSelectValue("390143765857220229","contract_name","contract_name",entity.getContractName(),contractNameMap)); entity.setContractName(generaterSwapUtil.getPopupSelectValue("390143765857220229","id","contract_name",entity.getContractCode(),contractCodeMap));
Map<String,Object> supplierIdMap = new HashMap<>();
entity.setSupplierName(generaterSwapUtil.getPopupSelectValue("397751667988199621","id","supplier_name",entity.getSupplierId(),supplierIdMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName())); entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
}
List<PurchaseorderListVO> listVO=JsonUtil.getJsonToList(list,PurchaseorderListVO.class);
for(PurchaseorderListVO purchaseorderVO:listVO){
}
}
List<PurchaseorderListVO> listVO=JsonUtil.getJsonToList(list,PurchaseorderListVO.class);
for(PurchaseorderListVO purchaseorderVO:listVO){
}
PageListVO vo=new PageListVO(); PageListVO vo=new PageListVO();
vo.setList(listVO); vo.setList(listVO);
PaginationVO page=JsonUtil.getJsonToBean(purchaseorderPagination,PaginationVO.class); PaginationVO page=JsonUtil.getJsonToBean(purchaseorderPagination,PaginationVO.class);
@ -180,16 +200,24 @@ public class PurchaseorderController {
purchaseorderCrForm.setDocumentNo(generaterSwapUtil.getBillNumber("cgdj", false)); purchaseorderCrForm.setDocumentNo(generaterSwapUtil.getBillNumber("cgdj", false));
purchaseorderCrForm.setCreatorUserName(userInfo.getUserId()); purchaseorderCrForm.setCreatorUserName(userInfo.getUserId());
purchaseorderCrForm.setCreatorTime(DateUtil.getNow()); purchaseorderCrForm.setCreatorTime(DateUtil.getNow());
purchaseorderCrForm.setStatus("0");//待开票
purchaseorderCrForm.setSourceSystem("0");//人工创建
purchaseorderCrForm.setIsSettle("0");//未结算
purchaseorderCrForm.setIsTransfer("0");//未转销售
PurchaseorderitemEntity entity = JsonUtil.getJsonToBean(purchaseorderCrForm, PurchaseorderitemEntity.class); PurchaseorderitemEntity entity = JsonUtil.getJsonToBean(purchaseorderCrForm, PurchaseorderitemEntity.class);
entity.setId(mainId); entity.setId(mainId);
entity.setStatus(null); purchaseorderitemService.save(entity);
purchaseorderitemService.save(entity); List<Purchaseorder_item0Entity> Purchaseorder_item0List = JsonUtil.getJsonToList(purchaseorderCrForm.getPurchaseorder_item0List(),Purchaseorder_item0Entity.class);
List<Purchaseorder_item0Entity> Purchaseorder_item0List = JsonUtil.getJsonToList(purchaseorderCrForm.getPurchaseorder_item0List(),Purchaseorder_item0Entity.class); for(Purchaseorder_item0Entity entitys : Purchaseorder_item0List){
for(Purchaseorder_item0Entity entitys : Purchaseorder_item0List){ entitys.setId(RandomUtil.uuId());
entitys.setId(RandomUtil.uuId()); entitys.setPurchaseorderId(entity.getId());
entitys.setPurchaseorderId(entity.getId()); purchaseorder_item0Service.save(entitys);
purchaseorder_item0Service.save(entitys); PoundlistEntity poundlistEntity = poundlistService.getById(entitys.getPoundlistId());
} poundlistEntity.setSettlement(entitys.getSettlement());
poundlistEntity.setPurchasePrice(entitys.getPrice());
poundlistEntity.setPurchaseStatus("0");
poundlistService.update(entitys.getPoundlistId(), poundlistEntity);
}
// //
// List<Invoices_item0itemEntity> Invoices_item0itemList = JsonUtil.getJsonToList(purchaseorderCrForm.getInvoices_item0itemList(),Invoices_item0itemEntity.class); // List<Invoices_item0itemEntity> Invoices_item0itemList = JsonUtil.getJsonToList(purchaseorderCrForm.getInvoices_item0itemList(),Invoices_item0itemEntity.class);
// for(Invoices_item0itemEntity entitys : Invoices_item0itemList){ // for(Invoices_item0itemEntity entitys : Invoices_item0itemList){
@ -219,15 +247,15 @@ public class PurchaseorderController {
// collectionpoService.save(entitys); // collectionpoService.save(entitys);
// } // }
return ActionResult.success("创建成功"); return ActionResult.success("创建成功");
} }
/** /**
* *
* *
* @return * @return
*/ */
@ApiOperation("模板下载") @ApiOperation("模板下载")
@GetMapping("/templateDownload") @GetMapping("/templateDownload")
public ActionResult<DownloadVO> TemplateDownload(){ public ActionResult<DownloadVO> TemplateDownload(){
@ -242,10 +270,10 @@ public class PurchaseorderController {
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* Excel * Excel
* *
* @return * @return
*/ */
@ApiOperation("导出Excel") @ApiOperation("导出Excel")
@GetMapping("/Actions/Export") @GetMapping("/Actions/Export")
public ActionResult Export(PurchaseorderPaginationExportModel purchaseorderPaginationExportModel) throws IOException { public ActionResult Export(PurchaseorderPaginationExportModel purchaseorderPaginationExportModel) throws IOException {
@ -255,14 +283,14 @@ public class PurchaseorderController {
PurchaseorderPagination purchaseorderPagination=JsonUtil.getJsonToBean(purchaseorderPaginationExportModel, PurchaseorderPagination.class); PurchaseorderPagination purchaseorderPagination=JsonUtil.getJsonToBean(purchaseorderPaginationExportModel, PurchaseorderPagination.class);
List<PurchaseorderitemEntity> list= purchaseorderitemService.getTypeList(purchaseorderPagination,purchaseorderPaginationExportModel.getDataType()); List<PurchaseorderitemEntity> list= purchaseorderitemService.getTypeList(purchaseorderPagination,purchaseorderPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(PurchaseorderitemEntity entity:list){ for(PurchaseorderitemEntity entity:list){
Map<String,Object> contractNameMap = new HashMap<>(); Map<String,Object> contractNameMap = new HashMap<>();
entity.setContractName(generaterSwapUtil.getPopupSelectValue("390143765857220229","contract_name","contract_name",entity.getContractName(),contractNameMap)); entity.setContractName(generaterSwapUtil.getPopupSelectValue("390143765857220229","contract_name","contract_name",entity.getContractName(),contractNameMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName())); entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
} }
List<PurchaseorderListVO> listVO=JsonUtil.getJsonToList(list,PurchaseorderListVO.class); List<PurchaseorderListVO> listVO=JsonUtil.getJsonToList(list,PurchaseorderListVO.class);
for(PurchaseorderListVO purchaseorderVO:listVO){ for(PurchaseorderListVO purchaseorderVO:listVO){
} }
//转换为map输出 //转换为map输出
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss")); List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss"));
@ -274,84 +302,84 @@ public class PurchaseorderController {
//导出表格 //导出表格
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){ public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build(); DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>(); List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){ if(keys.length>0){
for(String key:keys){ for(String key:keys){
switch(key){ switch(key){
case "documentNo" : case "documentNo" :
entitys.add(new ExcelExportEntity("单据编号" ,"documentNo")); entitys.add(new ExcelExportEntity("单据编号" ,"documentNo"));
break; break;
case "contractName" : case "contractName" :
entitys.add(new ExcelExportEntity("合同名称" ,"contractName")); entitys.add(new ExcelExportEntity("合同名称" ,"contractName"));
break; break;
case "supplierName" : case "supplierName" :
entitys.add(new ExcelExportEntity("供应商名称" ,"supplierName")); entitys.add(new ExcelExportEntity("供应商名称" ,"supplierName"));
break; break;
case "currency" : case "currency" :
entitys.add(new ExcelExportEntity("币种" ,"currency")); entitys.add(new ExcelExportEntity("币种" ,"currency"));
break; break;
case "contractNo" : case "contractNo" :
entitys.add(new ExcelExportEntity("对方合同号" ,"contractNo")); entitys.add(new ExcelExportEntity("对方合同号" ,"contractNo"));
break; break;
case "advanceAmount" : case "advanceAmount" :
entitys.add(new ExcelExportEntity("垫资金额" ,"advanceAmount")); entitys.add(new ExcelExportEntity("垫资金额" ,"advanceAmount"));
break; break;
case "num" : case "num" :
entitys.add(new ExcelExportEntity("重量" ,"num")); entitys.add(new ExcelExportEntity("重量" ,"num"));
break; break;
case "amount" : case "amount" :
entitys.add(new ExcelExportEntity("金额" ,"amount")); entitys.add(new ExcelExportEntity("金额" ,"amount"));
break; break;
case "notAmount" : case "notAmount" :
entitys.add(new ExcelExportEntity("不含税金额" ,"notAmount")); entitys.add(new ExcelExportEntity("不含税金额" ,"notAmount"));
break; break;
case "remark" : case "remark" :
entitys.add(new ExcelExportEntity("备注信息" ,"remark")); entitys.add(new ExcelExportEntity("备注信息" ,"remark"));
break; break;
case "creatorUserName" : case "creatorUserName" :
entitys.add(new ExcelExportEntity("制单人" ,"creatorUserName")); entitys.add(new ExcelExportEntity("制单人" ,"creatorUserName"));
break; break;
case "creatorTime" : case "creatorTime" :
entitys.add(new ExcelExportEntity("制单时间" ,"creatorTime")); entitys.add(new ExcelExportEntity("制单时间" ,"creatorTime"));
break; break;
case "erpNo" : case "erpNo" :
entitys.add(new ExcelExportEntity("ERP订单号" ,"erpNo")); entitys.add(new ExcelExportEntity("ERP订单号" ,"erpNo"));
break; break;
case "payPrice" : case "payPrice" :
entitys.add(new ExcelExportEntity("已付款金额" ,"payPrice")); entitys.add(new ExcelExportEntity("已付款金额" ,"payPrice"));
break; break;
case "invoiceNum" : case "invoiceNum" :
entitys.add(new ExcelExportEntity("发票数量" ,"invoiceNum")); entitys.add(new ExcelExportEntity("发票数量" ,"invoiceNum"));
break; break;
case "invoiceAmount" : case "invoiceAmount" :
entitys.add(new ExcelExportEntity("发票金额" ,"invoiceAmount")); entitys.add(new ExcelExportEntity("发票金额" ,"invoiceAmount"));
break; break;
case "status" : case "status" :
entitys.add(new ExcelExportEntity("单据状态 " ,"status")); entitys.add(new ExcelExportEntity("单据状态 " ,"status"));
break; break;
default: default:
break; break;
}
} }
} }
}
ExportParams exportParams = new ExportParams(null, "表单信息"); ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF); exportParams.setType(ExcelType.XSSF);
try{ try{
@Cleanup Workbook workbook = new HSSFWorkbook(); @Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){ if (entitys.size()>0){
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
} }
String name = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx"; String name = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
String fileName = configValueUtil.getTemporaryFilePath() + name; String fileName = configValueUtil.getTemporaryFilePath() + name;
@Cleanup FileOutputStream output = new FileOutputStream(XSSEscape.escapePath(fileName)); @Cleanup FileOutputStream output = new FileOutputStream(XSSEscape.escapePath(fileName));
workbook.write(output); workbook.write(output);
//上传文件 //上传文件
UploadUtil.uploadFile(configValueUtil.getFileType(), fileName, FileTypeEnum.TEMPORARY, name); UploadUtil.uploadFile(configValueUtil.getFileType(), fileName, FileTypeEnum.TEMPORARY, name);
vo.setName(name); vo.setName(name);
vo.setUrl(UploaderUtil.uploaderFile(userInfo.getId() + "#" + name + "#" + "Temporary")); vo.setUrl(UploaderUtil.uploaderFile(userInfo.getId() + "#" + name + "#" + "Temporary"));
} catch (Exception e) { } catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage()); log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace(); e.printStackTrace();
@ -370,7 +398,7 @@ public class PurchaseorderController {
@Transactional @Transactional
public ActionResult batchRemove(@PathVariable("ids") String ids){ public ActionResult batchRemove(@PathVariable("ids") String ids){
String[] idList = ids.split(","); String[] idList = ids.split(",");
int i =0; int i =0;
for (String allId : idList){ for (String allId : idList){
this.delete(allId); this.delete(allId);
i++; i++;
@ -378,41 +406,75 @@ public class PurchaseorderController {
if (i == 0 ){ if (i == 0 ){
return ActionResult.fail("删除失败"); return ActionResult.fail("删除失败");
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");
} }
/** /**
* *
* *
* @param id * @param ids
* @return * @return
*/ */
@GetMapping("/batchQueryPurchaseorder/{ids}")
@Transactional
public ActionResult<List<PurchaseorderitemEntity>> batchQueryPurchaseorder(@PathVariable("ids") String ids){
List<PurchaseorderitemEntity> list = new ArrayList<>();
String[] idList = ids.split(",");
for (String id: idList) {
PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id);
if(entity != null && StringUtils.isNotEmpty(entity.getContractCode())){
ContractFileEntity contractFileEntity = contractFileService.getById(entity.getContractCode());
if(contractFileEntity != null && StringUtils.isNotEmpty(contractFileEntity.getContractName())){
entity.setContractNo(contractFileEntity.getContractCode());
}
}
list.add(entity);
}
return ActionResult.success(list);
}
/**
*
*
* @param id
* @return
*/
@GetMapping("/{id}") @GetMapping("/{id}")
public ActionResult<PurchaseorderInfoVO> info(@PathVariable("id") String id){ public ActionResult<PurchaseorderInfoVO> info(@PathVariable("id") String id){
PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id); PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id);
PurchaseorderInfoVO vo=JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class); PurchaseorderInfoVO vo=JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class);
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName())); vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
if(vo.getCreatorTime()!=null){ if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime()); vo.setCreatorTime(vo.getCreatorTime());
} }
//子表 //子表
List<Purchaseorder_item0Entity> Purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(id); List<Purchaseorder_item0Entity> Purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(id);
for(Purchaseorder_item0Entity purchaseorder_item0Entity : Purchaseorder_item0List){ for(Purchaseorder_item0Entity purchaseorder_item0Entity : Purchaseorder_item0List){
} if(StringUtils.isNotEmpty(purchaseorder_item0Entity.getMaterialId())){
vo.setPurchaseorder_item0List(JsonUtil.getJsonToList(Purchaseorder_item0List,Purchaseorder_item0Model.class )); MaterialEntity materialEntity = materialService.getById(purchaseorder_item0Entity.getMaterialId());
QueryWrapper<InvoicesitemEntity> invoicesitemWrapper = new QueryWrapper<>(); if(materialEntity != null && StringUtils.isNotEmpty(materialEntity.getInArea())){
invoicesitemWrapper.lambda().eq(InvoicesitemEntity::getPurchaseorderId,id); purchaseorder_item0Entity.setReservoirareaId(materialEntity.getInArea());
List<InvoicesitemEntity> invoicesitemList = invoicesitemService.list(invoicesitemWrapper); ReservoirareaEntity reservoirareaEntity = reservoirareaService.getById(materialEntity.getInArea());
List<Invoices_item0itemEntity> Invoices_item0itemList = new ArrayList<>(); if(reservoirareaEntity != null && StringUtils.isNotEmpty(reservoirareaEntity.getWarehouseId())){
for (InvoicesitemEntity invoicesitemEntity : invoicesitemList){ purchaseorder_item0Entity.setWarehouseId(reservoirareaEntity.getWarehouseId());
}
}
}
}
vo.setPurchaseorder_item0List(JsonUtil.getJsonToList(Purchaseorder_item0List,Purchaseorder_item0Model.class ));
QueryWrapper<InvoicesitemEntity> invoicesitemWrapper = new QueryWrapper<>();
invoicesitemWrapper.lambda().eq(InvoicesitemEntity::getPurchaseorderId,id);
List<InvoicesitemEntity> invoicesitemList = invoicesitemService.list(invoicesitemWrapper);
List<Invoices_item0itemEntity> Invoices_item0itemList = new ArrayList<>();
for (InvoicesitemEntity invoicesitemEntity : invoicesitemList){
List<Invoices_item0itemEntity> invoices_item0itemList = purchaseorderitemService.GetInvoices_item0itemList(invoicesitemEntity.getId()); List<Invoices_item0itemEntity> invoices_item0itemList = purchaseorderitemService.GetInvoices_item0itemList(invoicesitemEntity.getId());
Invoices_item0itemList.addAll(invoices_item0itemList); Invoices_item0itemList.addAll(invoices_item0itemList);
} }
for(Invoices_item0itemEntity invoices_item0itemEntity : Invoices_item0itemList){ for(Invoices_item0itemEntity invoices_item0itemEntity : Invoices_item0itemList){
} }
vo.setInvoices_item0itemList(JsonUtil.getJsonToList(Invoices_item0itemList,Invoices_item0itemModel.class )); vo.setInvoices_item0itemList(JsonUtil.getJsonToList(Invoices_item0itemList,Invoices_item0itemModel.class ));
QueryWrapper<PaymentdocpoEntity> PaymentdocpoWrapper = new QueryWrapper<>(); QueryWrapper<PaymentdocpoEntity> PaymentdocpoWrapper = new QueryWrapper<>();
PaymentdocpoWrapper.lambda().eq(PaymentdocpoEntity::getPurchaseOrderNo,entity.getDocumentNo()); PaymentdocpoWrapper.lambda().eq(PaymentdocpoEntity::getPurchaseOrderNo,entity.getDocumentNo());
@ -422,45 +484,61 @@ public class PurchaseorderController {
List<PaymentitemEntity> paymentitemlist = purchaseorderitemService.GetPaymentitemList(paymentdocpoEntity.getDocumentNo()); List<PaymentitemEntity> paymentitemlist = purchaseorderitemService.GetPaymentitemList(paymentdocpoEntity.getDocumentNo());
PaymentitemList.addAll(paymentitemlist); PaymentitemList.addAll(paymentitemlist);
} }
for(PaymentitemEntity paymentitemEntity : PaymentitemList){ for(PaymentitemEntity paymentitemEntity : PaymentitemList){
} }
vo.setPaymentitemList(JsonUtil.getJsonToList(PaymentitemList,PaymentitemModel.class )); vo.setPaymentitemList(JsonUtil.getJsonToList(PaymentitemList,PaymentitemModel.class ));
List<PurchasebackitemEntity> PurchasebackitemList = purchaseorderitemService.GetPurchasebackitemList(id); List<PurchasebackitemEntity> PurchasebackitemList = purchaseorderitemService.GetPurchasebackitemList(id);
for(PurchasebackitemEntity purchasebackitemEntity : PurchasebackitemList){ for(PurchasebackitemEntity purchasebackitemEntity : PurchasebackitemList){
} }
vo.setPurchasebackitemList(JsonUtil.getJsonToList(PurchasebackitemList,PurchasebackitemModel.class )); vo.setPurchasebackitemList(JsonUtil.getJsonToList(PurchasebackitemList,PurchasebackitemModel.class ));
List<CollectionpoEntity> CollectionitemList = purchaseorderitemService.GetCollectionitemList(entity.getDocumentNo()); List<CollectionpoEntity> CollectionitemList = purchaseorderitemService.GetCollectionitemList(entity.getDocumentNo());
for(CollectionpoEntity collectionpoEntity : CollectionitemList){ for(CollectionpoEntity collectionpoEntity : CollectionitemList){
} }
vo.setCollectionitemList(JsonUtil.getJsonToList(CollectionitemList,CollectionitemModel.class )); vo.setCollectionitemList(JsonUtil.getJsonToList(CollectionitemList,CollectionitemModel.class ));
//副表 //副表
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* () *
* *
* @param id * @param id
* @return * @return
*/ */
@GetMapping("guidang/{id}")
public ActionResult<PurchaseorderInfoVO> guidang(@PathVariable("id") String id){
PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id);
entity.setStatus("3");
purchaseorderitemService.updateById(entity);
return ActionResult.success("归档成功");
}
/**
* ()
*
* @param id
* @return
*/
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ActionResult<PurchaseorderInfoVO> detailInfo(@PathVariable("id") String id) throws IOException { public ActionResult<PurchaseorderInfoVO> detailInfo(@PathVariable("id") String id) throws IOException {
PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id); PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id);
PurchaseorderInfoVO vo=JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class); PurchaseorderInfoVO vo=JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class);
//子表数据转换 //子表数据转换
List<Purchaseorder_item0Entity> jg_purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(id); List<Purchaseorder_item0Entity> jg_purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(id);
List<Purchaseorder_item0Model> jg_purchaseorder_item0ModelList = JsonUtil.getJsonToList(jg_purchaseorder_item0List,Purchaseorder_item0Model.class); List<Purchaseorder_item0Model> jg_purchaseorder_item0ModelList = JsonUtil.getJsonToList(jg_purchaseorder_item0List,Purchaseorder_item0Model.class);
for(Purchaseorder_item0Model jg_purchaseorder_item0Model : jg_purchaseorder_item0ModelList){ for(Purchaseorder_item0Model jg_purchaseorder_item0Model : jg_purchaseorder_item0ModelList){
// Map<String,Object> licenseNumMap = new HashMap<>(); Map<String,Object> vehicleIdMap = new HashMap<>();
// jg_purchaseorder_item0Model.setLicenseNum(generaterSwapUtil.getPopupSelectValue("389754644018016581","license_no","license_no",jg_purchaseorder_item0Model.getLicenseNum(),licenseNumMap)); jg_purchaseorder_item0Model.setVehicleId(generaterSwapUtil.getPopupSelectValue("389754644018016581","vehicle_id","ticketno",jg_purchaseorder_item0Model.getVehicleId(),vehicleIdMap));
Map<String,Object> materialIdMap = new HashMap<>();
jg_purchaseorder_item0Model.setMaterialId(generaterSwapUtil.getPopupSelectValue("397736371898382533","id","item_name",jg_purchaseorder_item0Model.getMaterialId(),materialIdMap));
}
vo.setPurchaseorder_item0List(jg_purchaseorder_item0ModelList);
List<Invoices_item0itemEntity> jg_invoices_item0List = purchaseorderitemService.GetInvoices_item0itemList(id);
List<Invoices_item0itemModel> jg_invoices_item0ModelList = JsonUtil.getJsonToList(jg_invoices_item0List,Invoices_item0itemModel.class);
for(Invoices_item0itemModel jg_invoices_item0Model : jg_invoices_item0ModelList){
} }
vo.setPurchaseorder_item0List(jg_purchaseorder_item0ModelList); vo.setInvoices_item0itemList(jg_invoices_item0ModelList);
// List<Invoices_item0itemEntity> jg_invoices_item0List = purchaseorderitemService.GetInvoices_item0itemList(id);
// List<Invoices_item0itemModel> jg_invoices_item0ModelList = JsonUtil.getJsonToList(jg_invoices_item0List,Invoices_item0itemModel.class);
// for(Invoices_item0itemModel jg_invoices_item0Model : jg_invoices_item0ModelList){
// }
// vo.setInvoices_item0itemList(jg_invoices_item0ModelList);
QueryWrapper<InvoicesitemEntity> invoicesitemWrapper = new QueryWrapper<>(); QueryWrapper<InvoicesitemEntity> invoicesitemWrapper = new QueryWrapper<>();
invoicesitemWrapper.lambda().eq(InvoicesitemEntity::getPurchaseorderId,id); invoicesitemWrapper.lambda().eq(InvoicesitemEntity::getPurchaseorderId,id);
@ -474,11 +552,11 @@ public class PurchaseorderController {
} }
vo.setInvoices_item0itemList(JsonUtil.getJsonToList(Invoices_item0itemList,Invoices_item0itemModel.class )); vo.setInvoices_item0itemList(JsonUtil.getJsonToList(Invoices_item0itemList,Invoices_item0itemModel.class ));
// List<PaymentitemEntity> jg_paymentList = purchaseorderitemService.GetPaymentitemList(id); List<PaymentitemEntity> jg_paymentList = purchaseorderitemService.GetPaymentitemList(id);
// List<PaymentitemModel> jg_paymentModelList = JsonUtil.getJsonToList(jg_paymentList,PaymentitemModel.class); List<PaymentitemModel> jg_paymentModelList = JsonUtil.getJsonToList(jg_paymentList,PaymentitemModel.class);
// for(PaymentitemModel jg_paymentModel : jg_paymentModelList){ for(PaymentitemModel jg_paymentModel : jg_paymentModelList){
// } }
// vo.setPaymentitemList(jg_paymentModelList); vo.setPaymentitemList(jg_paymentModelList);
QueryWrapper<PaymentdocpoEntity> PaymentdocpoWrapper = new QueryWrapper<>(); QueryWrapper<PaymentdocpoEntity> PaymentdocpoWrapper = new QueryWrapper<>();
PaymentdocpoWrapper.lambda().eq(PaymentdocpoEntity::getPurchaseOrderNo,entity.getDocumentNo()); PaymentdocpoWrapper.lambda().eq(PaymentdocpoEntity::getPurchaseOrderNo,entity.getDocumentNo());
@ -493,102 +571,104 @@ public class PurchaseorderController {
vo.setPaymentitemList(JsonUtil.getJsonToList(PaymentitemList,PaymentitemModel.class )); vo.setPaymentitemList(JsonUtil.getJsonToList(PaymentitemList,PaymentitemModel.class ));
List<PurchasebackitemEntity> jg_purchasebackList = purchaseorderitemService.GetPurchasebackitemList(id); List<PurchasebackitemEntity> jg_purchasebackList = purchaseorderitemService.GetPurchasebackitemList(id);
List<PurchasebackitemModel> jg_purchasebackModelList = JsonUtil.getJsonToList(jg_purchasebackList,PurchasebackitemModel.class); List<PurchasebackitemModel> jg_purchasebackModelList = JsonUtil.getJsonToList(jg_purchasebackList,PurchasebackitemModel.class);
for(PurchasebackitemModel jg_purchasebackModel : jg_purchasebackModelList){ for(PurchasebackitemModel jg_purchasebackModel : jg_purchasebackModelList){
}
vo.setPurchasebackitemList(jg_purchasebackModelList);
List<CollectionpoEntity> jg_collectionList = purchaseorderitemService.GetCollectionitemList(id);
List<CollectionitemModel> jg_collectionModelList = JsonUtil.getJsonToList(jg_collectionList,CollectionitemModel.class);
for(CollectionitemModel jg_collectionModel : jg_collectionModelList){
} }
vo.setPurchasebackitemList(jg_purchasebackModelList); vo.setCollectionitemList(jg_collectionModelList);
// List<CollectionpoEntity> jg_collectionList = purchaseorderitemService.GetCollectionitemList(id);
// List<CollectionitemModel> jg_collectionModelList = JsonUtil.getJsonToList(jg_collectionList,CollectionitemModel.class);
// for(CollectionitemModel jg_collectionModel : jg_collectionModelList){
// }
// vo.setCollectionitemList(jg_collectionModelList);
List<CollectionpoEntity> CollectionitemList = purchaseorderitemService.GetCollectionitemList(entity.getDocumentNo()); List<CollectionpoEntity> CollectionitemList = purchaseorderitemService.GetCollectionitemList(entity.getDocumentNo());
for(CollectionpoEntity collectionpoEntity : CollectionitemList){ for(CollectionpoEntity collectionpoEntity : CollectionitemList){
} }
vo.setCollectionitemList(JsonUtil.getJsonToList(CollectionitemList,CollectionitemModel.class )); vo.setCollectionitemList(JsonUtil.getJsonToList(CollectionitemList,CollectionitemModel.class ));
//附表数据转换 //附表数据转换
//添加到详情表单对象中 //添加到详情表单对象中
Map<String,Object> contractNameMap = new HashMap<>(); Map<String,Object> contractCodeMap = new HashMap<>();
vo.setContractName(generaterSwapUtil.getPopupSelectValue("390143765857220229","contract_name","contract_name",vo.getContractName(),contractNameMap)); vo.setContractCode(generaterSwapUtil.getPopupSelectValue("390143765857220229","id","contract_name",vo.getContractCode(),contractCodeMap));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName())); Map<String,Object> supplierIdMap = new HashMap<>();
vo.setSupplierId(generaterSwapUtil.getPopupSelectValue("397751667988199621","id","supplier_name",vo.getSupplierId(),supplierIdMap));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@PutMapping("/{id}") @PutMapping("/{id}")
@Transactional @Transactional
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid PurchaseorderUpForm purchaseorderUpForm) throws DataException { public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid PurchaseorderUpForm purchaseorderUpForm) throws DataException {
UserInfo userInfo = userProvider.get(); UserInfo userInfo = userProvider.get();
PurchaseorderitemEntity entity = purchaseorderitemService.getInfo(id); PurchaseorderitemEntity entity = purchaseorderitemService.getInfo(id);
if(!entity.getStatus().equals("0")){ if(!entity.getStatus().equals("0")){
String info = ""; String info = "";
switch (entity.getStatus()) { switch (entity.getStatus()) {
case "1": case "1":
info = "开票中"; info = "开票中";
break; break;
case "2": case "2":
info = "付款中"; info = "付款中";
break; break;
case "3": case "3":
info = "归档"; info = "归档";
break; break;
} }
return ActionResult.fail("已"+info+",无法编辑!"); return ActionResult.fail("已"+info+",无法编辑!");
} }
if (entity != null) { if (entity != null) {
PurchaseorderitemEntity subentity = JsonUtil.getJsonToBean(purchaseorderUpForm, PurchaseorderitemEntity.class); PurchaseorderitemEntity subentity = JsonUtil.getJsonToBean(purchaseorderUpForm, PurchaseorderitemEntity.class);
subentity.setCreatorUserName(entity.getCreatorUserName()); subentity.setCreatorUserName(entity.getCreatorUserName());
subentity.setCreatorTime(entity.getCreatorTime()); subentity.setCreatorTime(entity.getCreatorTime());
purchaseorderitemService.update(id, subentity); purchaseorderitemService.update(id, subentity);
QueryWrapper<Purchaseorder_item0Entity> Purchaseorder_item0queryWrapper = new QueryWrapper<>(); QueryWrapper<Purchaseorder_item0Entity> Purchaseorder_item0queryWrapper = new QueryWrapper<>();
Purchaseorder_item0queryWrapper.lambda().eq(Purchaseorder_item0Entity::getPurchaseorderId, entity.getId()); Purchaseorder_item0queryWrapper.lambda().eq(Purchaseorder_item0Entity::getPurchaseorderId, entity.getId());
purchaseorder_item0Service.remove(Purchaseorder_item0queryWrapper); purchaseorder_item0Service.remove(Purchaseorder_item0queryWrapper);
List<Purchaseorder_item0Entity> Purchaseorder_item0List = JsonUtil.getJsonToList(purchaseorderUpForm.getPurchaseorder_item0List(), Purchaseorder_item0Entity.class); List<Purchaseorder_item0Entity> Purchaseorder_item0List = JsonUtil.getJsonToList(purchaseorderUpForm.getPurchaseorder_item0List(), Purchaseorder_item0Entity.class);
for (Purchaseorder_item0Entity entitys : Purchaseorder_item0List) { for (Purchaseorder_item0Entity entitys : Purchaseorder_item0List) {
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setPurchaseorderId(entity.getId()); entitys.setPurchaseorderId(entity.getId());
purchaseorder_item0Service.save(entitys); purchaseorder_item0Service.save(entitys);
} }
QueryWrapper<Invoices_item0itemEntity> Invoices_item0itemqueryWrapper = new QueryWrapper<>(); QueryWrapper<Invoices_item0itemEntity> Invoices_item0itemqueryWrapper = new QueryWrapper<>();
Invoices_item0itemqueryWrapper.lambda().eq(Invoices_item0itemEntity::getPurchaseorderId, entity.getId()); Invoices_item0itemqueryWrapper.lambda().eq(Invoices_item0itemEntity::getPurchaseorderId, entity.getId());
invoices_item0itemService.remove(Invoices_item0itemqueryWrapper); invoices_item0itemService.remove(Invoices_item0itemqueryWrapper);
List<Invoices_item0itemEntity> Invoices_item0itemList = JsonUtil.getJsonToList(purchaseorderUpForm.getInvoices_item0itemList(), Invoices_item0itemEntity.class); List<Invoices_item0itemEntity> Invoices_item0itemList = JsonUtil.getJsonToList(purchaseorderUpForm.getInvoices_item0itemList(), Invoices_item0itemEntity.class);
for (Invoices_item0itemEntity entitys : Invoices_item0itemList) { for (Invoices_item0itemEntity entitys : Invoices_item0itemList) {
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setPurchaseorderId(entity.getId()); entitys.setPurchaseorderId(entity.getId());
invoices_item0itemService.save(entitys); invoices_item0itemService.save(entitys);
} }
QueryWrapper<PaymentdocpoEntity> PaymentdocpoWrapper = new QueryWrapper<>(); QueryWrapper<PaymentdocpoEntity> PaymentdocpoWrapper = new QueryWrapper<>();
PaymentdocpoWrapper.lambda().eq(PaymentdocpoEntity::getPurchaseOrderNo,entity.getDocumentNo()); PaymentdocpoWrapper.lambda().eq(PaymentdocpoEntity::getPurchaseOrderNo,entity.getDocumentNo());
List<PaymentdocpoEntity> paymentdocList = paymentdocpoService.list(PaymentdocpoWrapper); List<PaymentdocpoEntity> paymentdocList = paymentdocpoService.list(PaymentdocpoWrapper);
for (PaymentdocpoEntity paymentdocpoEntity : paymentdocList) { for (PaymentdocpoEntity paymentdocpoEntity : paymentdocList) {
QueryWrapper<PaymentitemEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<PaymentitemEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(PaymentitemEntity::getPaymentno,paymentdocpoEntity.getDocumentNo()); queryWrapper.lambda().eq(PaymentitemEntity::getPaymentno,paymentdocpoEntity.getDocumentNo());
paymentitemService.remove(queryWrapper); paymentitemService.remove(queryWrapper);
} }
List<PaymentitemEntity> PaymentitemList = JsonUtil.getJsonToList(purchaseorderUpForm.getPaymentitemList(), PaymentitemEntity.class); List<PaymentitemEntity> PaymentitemList = JsonUtil.getJsonToList(purchaseorderUpForm.getPaymentitemList(), PaymentitemEntity.class);
for (PaymentitemEntity entitys : PaymentitemList) { for (PaymentitemEntity entitys : PaymentitemList) {
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setPaymentno(entitys.getPaymentno()); entitys.setPaymentno(entitys.getPaymentno());
paymentitemService.save(entitys); paymentitemService.save(entitys);
} }
// QueryWrapper<PaymentitemEntity> PaymentitemqueryWrapper = new QueryWrapper<>(); // QueryWrapper<PaymentitemEntity> PaymentitemqueryWrapper = new QueryWrapper<>();
// PaymentitemqueryWrapper.lambda().eq(PaymentitemEntity::getDocumentno, entity.getDocumentNo()); // PaymentitemqueryWrapper.lambda().eq(PaymentitemEntity::getDocumentno, entity.getDocumentNo());
// paymentitemService.remove(PaymentitemqueryWrapper); // paymentitemService.remove(PaymentitemqueryWrapper);
@ -599,41 +679,41 @@ public class PurchaseorderController {
// entitys.setDocumentno(entity.getDocumentNo()); // entitys.setDocumentno(entity.getDocumentNo());
// paymentitemService.save(entitys); // paymentitemService.save(entitys);
// } // }
QueryWrapper<PurchasebackitemEntity> PurchasebackitemqueryWrapper = new QueryWrapper<>(); QueryWrapper<PurchasebackitemEntity> PurchasebackitemqueryWrapper = new QueryWrapper<>();
PurchasebackitemqueryWrapper.lambda().eq(PurchasebackitemEntity::getPurchaseOrderId, entity.getId()); PurchasebackitemqueryWrapper.lambda().eq(PurchasebackitemEntity::getPurchaseOrderId, entity.getId());
purchasebackitemService.remove(PurchasebackitemqueryWrapper); purchasebackitemService.remove(PurchasebackitemqueryWrapper);
List<PurchasebackitemEntity> PurchasebackitemList = JsonUtil.getJsonToList(purchaseorderUpForm.getPurchasebackitemList(), PurchasebackitemEntity.class); List<PurchasebackitemEntity> PurchasebackitemList = JsonUtil.getJsonToList(purchaseorderUpForm.getPurchasebackitemList(), PurchasebackitemEntity.class);
for (PurchasebackitemEntity entitys : PurchasebackitemList) { for (PurchasebackitemEntity entitys : PurchasebackitemList) {
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setPurchaseOrderId(entity.getId()); entitys.setPurchaseOrderId(entity.getId());
purchasebackitemService.save(entitys); purchasebackitemService.save(entitys);
} }
QueryWrapper<CollectionpoEntity> CollectionitemqueryWrapper = new QueryWrapper<>(); QueryWrapper<CollectionpoEntity> CollectionitemqueryWrapper = new QueryWrapper<>();
CollectionitemqueryWrapper.lambda().eq(CollectionpoEntity::getSalesOrderNo, entity.getDocumentNo()); CollectionitemqueryWrapper.lambda().eq(CollectionpoEntity::getSalesOrderNo, entity.getDocumentNo());
collectionpoService.remove(CollectionitemqueryWrapper); collectionpoService.remove(CollectionitemqueryWrapper);
List<CollectionpoEntity> CollectionitemList = JsonUtil.getJsonToList(purchaseorderUpForm.getCollectionitemList(), CollectionpoEntity.class); List<CollectionpoEntity> CollectionitemList = JsonUtil.getJsonToList(purchaseorderUpForm.getCollectionitemList(), CollectionpoEntity.class);
for (CollectionpoEntity entitys : CollectionitemList) { for (CollectionpoEntity entitys : CollectionitemList) {
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setSalesOrderNo(entity.getDocumentNo()); entitys.setSalesOrderNo(entity.getDocumentNo());
collectionpoService.save(entitys); collectionpoService.save(entitys);
} }
return ActionResult.success("更新成功"); return ActionResult.success("更新成功");
} else { } else {
return ActionResult.fail("更新失败,数据不存在"); return ActionResult.fail("更新失败,数据不存在");
} }
} }
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Transactional @Transactional
public ActionResult delete(@PathVariable("id") String id){ public ActionResult delete(@PathVariable("id") String id){

@ -72,8 +72,8 @@ public class PaymentdocpoEntity {
@TableField("RAMOUNT") @TableField("RAMOUNT")
private BigDecimal ramount; private BigDecimal ramount;
@TableField("STATUS") @TableField("doc_status")
private String status; private String docStatus;
@TableField("SUPPLIER_CODE") @TableField("SUPPLIER_CODE")
private String supplierCode; private String supplierCode;

@ -75,6 +75,9 @@ public class Purchaseorder_item0Entity {
@TableField("LICENSE_NUM") @TableField("LICENSE_NUM")
private String licenseNum; private String licenseNum;
@TableField("vehicle_id")
private String vehicleId;
@TableField("MATERIAL_CODE") @TableField("MATERIAL_CODE")
private String materialCode; private String materialCode;
@ -84,6 +87,12 @@ public class Purchaseorder_item0Entity {
@TableField("SUPPLIER_NAME") @TableField("SUPPLIER_NAME")
private String supplierName; private String supplierName;
@TableField("MATERIAL_ID")
private String materialId;
@TableField("SUPPLIER_ID")
private String supplierId;
@TableField("POUNT_DATE") @TableField("POUNT_DATE")
private Date pountDate; private Date pountDate;
@ -126,4 +135,9 @@ public class Purchaseorder_item0Entity {
@TableField("REMARK") @TableField("REMARK")
private String remark; private String remark;
@TableField(exist = false)
private String reservoirareaId;
@TableField(exist = false)
private String warehouseId;
} }

@ -146,4 +146,7 @@ public class PurchaseorderitemEntity {
@TableField("REMARK") @TableField("REMARK")
private String remark; private String remark;
@TableField("SUPPLIER_ID")
private String supplierId;
} }

@ -60,6 +60,10 @@ public class PurchaseorderCrForm {
@JsonProperty("amount") @JsonProperty("amount")
private String amount; private String amount;
/** 税额 **/
@JsonProperty("rate")
private String rate;
/** 不含税金额 **/ /** 不含税金额 **/
@JsonProperty("notAmount") @JsonProperty("notAmount")
private String notAmount; private String notAmount;
@ -96,6 +100,20 @@ public class PurchaseorderCrForm {
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;
/** 来源 **/
@JsonProperty("sourceSystem")
private String sourceSystem;
@JsonProperty("isSettle")
private String isSettle;
@JsonProperty("isTransfer")
private String isTransfer;
/** 供应商名称 **/
@JsonProperty("supplierId")
private String supplierId;
/** 子表数据 **/ /** 子表数据 **/
@JsonProperty("purchaseorder_item0List") @JsonProperty("purchaseorder_item0List")
private List<Purchaseorder_item0Model> purchaseorder_item0List; private List<Purchaseorder_item0Model> purchaseorder_item0List;

@ -36,13 +36,9 @@ public class PurchaseorderInfoVO{
@JsonProperty("contractCode") @JsonProperty("contractCode")
private String contractCode; private String contractCode;
/** 合同名称 **/ /** 供应商 **/
@JsonProperty("contractName") @JsonProperty("supplierId")
private String contractName; private String supplierId;
/** 供应商名称 **/
@JsonProperty("supplierName")
private String supplierName;
/** 币种 **/ /** 币种 **/
@JsonProperty("currency") @JsonProperty("currency")
@ -54,23 +50,39 @@ public class PurchaseorderInfoVO{
/** 垫资金额 **/ /** 垫资金额 **/
@JsonProperty("advanceAmount") @JsonProperty("advanceAmount")
private String advanceAmount; private BigDecimal advanceAmount;
/** 重量 **/ /** 重量 **/
@JsonProperty("num") @JsonProperty("num")
private String num; private BigDecimal num;
/** 金额 **/ /** 金额 **/
@JsonProperty("amount") @JsonProperty("amount")
private String amount; private BigDecimal amount;
/** 税额 **/
@JsonProperty("rate")
private String rate;
/** 不含税金额 **/ /** 不含税金额 **/
@JsonProperty("notAmount") @JsonProperty("notAmount")
private String notAmount; private BigDecimal notAmount;
/** 备注信息 **/ /** 已付款金额 **/
@JsonProperty("remark") @JsonProperty("payPrice")
private String remark; private BigDecimal payPrice;
/** 发票数量 **/
@JsonProperty("invoiceNum")
private Integer invoiceNum;
/** 发票金额 **/
@JsonProperty("invoiceAmount")
private BigDecimal invoiceAmount;
/** ERP订单号 **/
@JsonProperty("erpNo")
private String erpNo;
/** 制单人 **/ /** 制单人 **/
@JsonProperty("creatorUserName") @JsonProperty("creatorUserName")
@ -81,25 +93,23 @@ public class PurchaseorderInfoVO{
@JsonProperty("creatorTime") @JsonProperty("creatorTime")
private Date creatorTime; private Date creatorTime;
/** ERP订单号 **/ /** 单据状态 **/
@JsonProperty("erpNo") @JsonProperty("status")
private String erpNo; private String status;
/** 已付款金额 **/ /** 来源 **/
@JsonProperty("payPrice") @JsonProperty("sourceSystem")
private String payPrice; private String sourceSystem;
/** 发票数量 **/ @JsonProperty("isSettle")
@JsonProperty("invoiceNum") private String isSettle;
private String invoiceNum;
/** 发票金额 **/ @JsonProperty("isTransfer")
@JsonProperty("invoiceAmount") private String isTransfer;
private String invoiceAmount;
/** 单据状态 **/ /** 备注信息 **/
@JsonProperty("status") @JsonProperty("remark")
private String status; private String remark;
/** 子表数据 **/ /** 子表数据 **/
@JsonProperty("purchaseorder_item0List") @JsonProperty("purchaseorder_item0List")

@ -67,6 +67,9 @@ public class PurchaseorderListVO{
@JsonProperty("amount") @JsonProperty("amount")
private String amount; private String amount;
/** 税额 **/
@JsonProperty("rate")
private String rate;
/** 不含税金额 **/ /** 不含税金额 **/
@JsonProperty("notAmount") @JsonProperty("notAmount")
@ -113,5 +116,16 @@ public class PurchaseorderListVO{
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;
/** 来源 **/
@JsonProperty("sourceSystem")
private String sourceSystem;
@JsonProperty("isSettle")
private String isSettle;
@JsonProperty("isTransfer")
private String isTransfer;
@JsonProperty("supplierId")
private String supplierId;
} }

@ -18,15 +18,19 @@ import com.alibaba.fastjson.annotation.JSONField;
@Data @Data
public class Purchaseorder_item0Model { public class Purchaseorder_item0Model {
/** 车牌号 **/ /** ID **/
@JsonProperty("licenseNum") @JsonProperty("id")
private String licenseNum; private String id;
/** 物料名称 **/ /** 车辆ID **/
@JsonProperty("materialName") @JsonProperty("vehicleId")
private String materialName; private String vehicleId;
/** 类型 **/ /** 物料 **/
@JsonProperty("materialId")
private String materialId;
/** 磅单类型 **/
@JsonProperty("pountType") @JsonProperty("pountType")
private String pountType; private String pountType;
@ -74,5 +78,15 @@ public class Purchaseorder_item0Model {
@JsonProperty("vehiclePictures") @JsonProperty("vehiclePictures")
private String vehiclePictures; private String vehiclePictures;
@JsonProperty("poundlistId")
private String poundlistId;
@JsonProperty("supplierId")
private String supplierId;
@JsonProperty("reservoirareaId")
private String reservoirareaId;
@JsonProperty("warehouseId")
private String warehouseId;
} }

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.purchaseorder.entity.*; import jnpf.purchaseorder.entity.*;
import jnpf.invoices.service.InvoicesService; import jnpf.invoices.service.InvoicesService;
import jnpf.invoices.service.Invoices_item0Service; import jnpf.invoices.service.InvoicesItem0Service;
import jnpf.permission.model.authorize.AuthorizeConditionModel; import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService; import jnpf.permission.service.AuthorizeService;
import jnpf.purchaseorder.mapper.InvoicesitemMapper; import jnpf.purchaseorder.mapper.InvoicesitemMapper;

@ -15,6 +15,8 @@ import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO; import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.purchaseback.entity.PurchaseorderEntity;
import jnpf.purchaseback.service.PurchaseorderService;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity; import jnpf.base.entity.ProvinceEntity;
import jnpf.receiptin.model.receiptin.*; import jnpf.receiptin.model.receiptin.*;
@ -78,7 +80,8 @@ public class ReceiptinController {
@Autowired @Autowired
private Receiptin_item0Service receiptin_item0Service; private Receiptin_item0Service receiptin_item0Service;
@Autowired
private PurchaseorderService purchaseorderService;
/** /**
* *
@ -86,18 +89,20 @@ public class ReceiptinController {
* @param receiptinPagination * @param receiptinPagination
* @return * @return
*/ */
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody ReceiptinPagination receiptinPagination)throws IOException{ public ActionResult list(@RequestBody ReceiptinPagination receiptinPagination)throws IOException{
List<ReceiptinEntity> list= receiptinService.getList(receiptinPagination); List<ReceiptinEntity> list= receiptinService.getList(receiptinPagination);
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(ReceiptinEntity entity:list){ for(ReceiptinEntity entity:list){
Map<String,Object> soucenoMap = new HashMap<>(); Map<String,Object> soucenoMap = new HashMap<>();
entity.setSouceno(generaterSwapUtil.getPopupSelectValue("392931756640102277","document_no","document_no",entity.getSouceno(),soucenoMap)); entity.setSouceno(generaterSwapUtil.getPopupSelectValue("392931756640102277","id","document_no",entity.getSouceno(),soucenoMap));
Map<String,Object> supplierIdMap = new HashMap<>();
entity.setSupplierId(generaterSwapUtil.getPopupSelectValue("397751667988199621","id","supplier_name",entity.getSupplierId(),supplierIdMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName())); entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
} }
List<ReceiptinListVO> listVO=JsonUtil.getJsonToList(list,ReceiptinListVO.class); List<ReceiptinListVO> listVO=JsonUtil.getJsonToList(list,ReceiptinListVO.class);
for(ReceiptinListVO receiptinVO:listVO){ for(ReceiptinListVO receiptinVO:listVO){
} }
PageListVO vo=new PageListVO(); PageListVO vo=new PageListVO();
@ -123,39 +128,32 @@ public class ReceiptinController {
receiptinCrForm.setCreatorTime(DateUtil.getNow()); receiptinCrForm.setCreatorTime(DateUtil.getNow());
receiptinCrForm.setCreatorUserName(userInfo.getUserId()); receiptinCrForm.setCreatorUserName(userInfo.getUserId());
ReceiptinEntity entity = JsonUtil.getJsonToBean(receiptinCrForm, ReceiptinEntity.class); ReceiptinEntity entity = JsonUtil.getJsonToBean(receiptinCrForm, ReceiptinEntity.class);
entity.setId(mainId); entity.setId(mainId);
receiptinService.save(entity); entity.setWarehousingdate(new Date());
List<Receiptin_item0Entity> Receiptin_item0List = JsonUtil.getJsonToList(receiptinCrForm.getReceiptin_item0List(),Receiptin_item0Entity.class); receiptinService.save(entity);
for(Receiptin_item0Entity entitys : Receiptin_item0List){ List<Receiptin_item0Entity> Receiptin_item0List = JsonUtil.getJsonToList(receiptinCrForm.getReceiptin_item0List(),Receiptin_item0Entity.class);
entitys.setId(RandomUtil.uuId()); for(Receiptin_item0Entity entitys : Receiptin_item0List){
entitys.setReceiptinId(entity.getId()); entitys.setId(RandomUtil.uuId());
entitys.setReceiptinId(entity.getId());
receiptin_item0Service.save(entitys);
}
//采购订单状态为2
if(ObjectUtil.equal("0", entity.getType())){//采购入库
PurchaseorderEntity purchaseorderEntity = purchaseorderService.getById(entity.getSouceno());
purchaseorderEntity.setStatus("2");
purchaseorderEntity.setIssue("1");
purchaseorderService.updateById(purchaseorderEntity);
}
receiptin_item0Service.save(entitys);
}
return ActionResult.success("创建成功"); return ActionResult.success("创建成功");
} }
/** /**
* *
* *
* @return * @return
*/ */
@ApiOperation("模板下载") @ApiOperation("模板下载")
@GetMapping("/templateDownload") @GetMapping("/templateDownload")
public ActionResult<DownloadVO> TemplateDownload(){ public ActionResult<DownloadVO> TemplateDownload(){
@ -170,10 +168,10 @@ public class ReceiptinController {
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* Excel * Excel
* *
* @return * @return
*/ */
@ApiOperation("导出Excel") @ApiOperation("导出Excel")
@GetMapping("/Actions/Export") @GetMapping("/Actions/Export")
public ActionResult Export(ReceiptinPaginationExportModel receiptinPaginationExportModel) throws IOException { public ActionResult Export(ReceiptinPaginationExportModel receiptinPaginationExportModel) throws IOException {
@ -183,14 +181,16 @@ public class ReceiptinController {
ReceiptinPagination receiptinPagination=JsonUtil.getJsonToBean(receiptinPaginationExportModel, ReceiptinPagination.class); ReceiptinPagination receiptinPagination=JsonUtil.getJsonToBean(receiptinPaginationExportModel, ReceiptinPagination.class);
List<ReceiptinEntity> list= receiptinService.getTypeList(receiptinPagination,receiptinPaginationExportModel.getDataType()); List<ReceiptinEntity> list= receiptinService.getTypeList(receiptinPagination,receiptinPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(ReceiptinEntity entity:list){ for(ReceiptinEntity entity:list){
Map<String,Object> soucenoMap = new HashMap<>(); Map<String,Object> soucenoMap = new HashMap<>();
entity.setSouceno(generaterSwapUtil.getPopupSelectValue("392931756640102277","document_no","document_no",entity.getSouceno(),soucenoMap)); entity.setSouceno(generaterSwapUtil.getPopupSelectValue("392931756640102277","id","document_no",entity.getSouceno(),soucenoMap));
Map<String,Object> supplierIdMap = new HashMap<>();
entity.setSupplierId(generaterSwapUtil.getPopupSelectValue("397751667988199621","id","supplier_name",entity.getSupplierId(),supplierIdMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName())); entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
} }
List<ReceiptinListVO> listVO=JsonUtil.getJsonToList(list,ReceiptinListVO.class); List<ReceiptinListVO> listVO=JsonUtil.getJsonToList(list,ReceiptinListVO.class);
for(ReceiptinListVO receiptinVO:listVO){ for(ReceiptinListVO receiptinVO:listVO){
} }
//转换为map输出 //转换为map输出
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss")); List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss"));
@ -202,69 +202,71 @@ public class ReceiptinController {
//导出表格 //导出表格
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){ public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build(); DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>(); List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){ if(keys.length>0){
for(String key:keys){ for(String key:keys){
switch(key){ switch(key){
case "documentno" : case "documentno" :
entitys.add(new ExcelExportEntity("单据编号" ,"documentno")); entitys.add(new ExcelExportEntity("单据编号" ,"documentno"));
break; break;
case "type" : case "type" :
entitys.add(new ExcelExportEntity("业务类型" ,"type")); entitys.add(new ExcelExportEntity("业务类型" ,"type"));
break; break;
case "souceno" : case "souceno" :
entitys.add(new ExcelExportEntity("来源单号" ,"souceno")); entitys.add(new ExcelExportEntity("来源单号" ,"souceno"));
break; break;
case "receiptamount" : case "receiptamount" :
entitys.add(new ExcelExportEntity("入库金额" ,"receiptamount")); entitys.add(new ExcelExportEntity("入库金额" ,"receiptamount"));
break; break;
case "currency" : case "currency" :
entitys.add(new ExcelExportEntity("币别" ,"currency")); entitys.add(new ExcelExportEntity("币别" ,"currency"));
break; break;
case "receiptnum" : case "receiptnum" :
entitys.add(new ExcelExportEntity("入库数量" ,"receiptnum")); entitys.add(new ExcelExportEntity("入库数量" ,"receiptnum"));
break; break;
case "suppliername" : case "suppliername" :
entitys.add(new ExcelExportEntity("供应商名称" ,"suppliername")); entitys.add(new ExcelExportEntity("供应商名称" ,"suppliername"));
break; break;
case "supplierId" :
entitys.add(new ExcelExportEntity("供应商id" ,"supplierId"));
case "remark" : case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark")); entitys.add(new ExcelExportEntity("备注" ,"remark"));
break; break;
case "warehousingdate" : case "warehousingdate" :
entitys.add(new ExcelExportEntity("入库日期" ,"warehousingdate")); entitys.add(new ExcelExportEntity("入库日期" ,"warehousingdate"));
break; break;
case "status" : case "status" :
entitys.add(new ExcelExportEntity("单据状态" ,"status")); entitys.add(new ExcelExportEntity("单据状态" ,"status"));
break; break;
case "creatorTime" : case "creatorTime" :
entitys.add(new ExcelExportEntity("创建日期" ,"creatorTime")); entitys.add(new ExcelExportEntity("创建日期" ,"creatorTime"));
break; break;
case "creatorUserName" : case "creatorUserName" :
entitys.add(new ExcelExportEntity("创建人" ,"creatorUserName")); entitys.add(new ExcelExportEntity("创建人" ,"creatorUserName"));
break; break;
default: default:
break; break;
}
} }
} }
}
ExportParams exportParams = new ExportParams(null, "表单信息"); ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF); exportParams.setType(ExcelType.XSSF);
try{ try{
@Cleanup Workbook workbook = new HSSFWorkbook(); @Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){ if (entitys.size()>0){
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
} }
String name = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx"; String name = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
String fileName = configValueUtil.getTemporaryFilePath() + name; String fileName = configValueUtil.getTemporaryFilePath() + name;
@Cleanup FileOutputStream output = new FileOutputStream(XSSEscape.escapePath(fileName)); @Cleanup FileOutputStream output = new FileOutputStream(XSSEscape.escapePath(fileName));
workbook.write(output); workbook.write(output);
//上传文件 //上传文件
UploadUtil.uploadFile(configValueUtil.getFileType(), fileName, FileTypeEnum.TEMPORARY, name); UploadUtil.uploadFile(configValueUtil.getFileType(), fileName, FileTypeEnum.TEMPORARY, name);
vo.setName(name); vo.setName(name);
vo.setUrl(UploaderUtil.uploaderFile(userInfo.getId() + "#" + name + "#" + "Temporary")); vo.setUrl(UploaderUtil.uploaderFile(userInfo.getId() + "#" + name + "#" + "Temporary"));
} catch (Exception e) { } catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage()); log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace(); e.printStackTrace();
@ -283,7 +285,7 @@ public class ReceiptinController {
@Transactional @Transactional
public ActionResult batchRemove(@PathVariable("ids") String ids){ public ActionResult batchRemove(@PathVariable("ids") String ids){
String[] idList = ids.split(","); String[] idList = ids.split(",");
int i =0; int i =0;
for (String allId : idList){ for (String allId : idList){
this.delete(allId); this.delete(allId);
i++; i++;
@ -291,16 +293,16 @@ public class ReceiptinController {
if (i == 0 ){ if (i == 0 ){
return ActionResult.fail("删除失败"); return ActionResult.fail("删除失败");
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");
} }
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@GetMapping("/{id}") @GetMapping("/{id}")
public ActionResult<ReceiptinInfoVO> info(@PathVariable("id") String id){ public ActionResult<ReceiptinInfoVO> info(@PathVariable("id") String id){
ReceiptinEntity entity= receiptinService.getInfo(id); ReceiptinEntity entity= receiptinService.getInfo(id);
@ -308,58 +310,64 @@ public class ReceiptinController {
if(vo.getCreatorTime()!=null){ if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime()); vo.setCreatorTime(vo.getCreatorTime());
} }
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName())); vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
//子表 //子表
List<Receiptin_item0Entity> Receiptin_item0List = receiptinService.GetReceiptin_item0List(id); List<Receiptin_item0Entity> Receiptin_item0List = receiptinService.GetReceiptin_item0List(id);
for(Receiptin_item0Entity receiptin_item0Entity : Receiptin_item0List){ for(Receiptin_item0Entity receiptin_item0Entity : Receiptin_item0List){
} }
vo.setReceiptin_item0List(JsonUtil.getJsonToList(Receiptin_item0List,Receiptin_item0Model.class )); vo.setReceiptin_item0List(JsonUtil.getJsonToList(Receiptin_item0List,Receiptin_item0Model.class ));
//副表 //副表
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* () * ()
* *
* @param id * @param id
* @return * @return
*/ */
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ActionResult<ReceiptinInfoVO> detailInfo(@PathVariable("id") String id){ public ActionResult<ReceiptinInfoVO> detailInfo(@PathVariable("id") String id){
ReceiptinEntity entity= receiptinService.getInfo(id); ReceiptinEntity entity= receiptinService.getInfo(id);
ReceiptinInfoVO vo=JsonUtil.getJsonToBean(entity, ReceiptinInfoVO.class); ReceiptinInfoVO vo=JsonUtil.getJsonToBean(entity, ReceiptinInfoVO.class);
//子表数据转换 //子表数据转换
List<Receiptin_item0Entity> jg_receiptin_item0List = receiptinService.GetReceiptin_item0List(id); List<Receiptin_item0Entity> jg_receiptin_item0List = receiptinService.GetReceiptin_item0List(id);
List<Receiptin_item0Model> jg_receiptin_item0ModelList = JsonUtil.getJsonToList(jg_receiptin_item0List,Receiptin_item0Model.class); List<Receiptin_item0Model> jg_receiptin_item0ModelList = JsonUtil.getJsonToList(jg_receiptin_item0List,Receiptin_item0Model.class);
for(Receiptin_item0Model jg_receiptin_item0Model : jg_receiptin_item0ModelList){ for(Receiptin_item0Model jg_receiptin_item0Model : jg_receiptin_item0ModelList){
Map<String,Object> licensenoMap = new HashMap<>(); Map<String,Object> vehicleIdMap = new HashMap<>();
jg_receiptin_item0Model.setLicenseno(generaterSwapUtil.getPopupSelectValue("392933121244325765","license_num","license_num",jg_receiptin_item0Model.getLicenseno(),licensenoMap)); jg_receiptin_item0Model.setVehicleId(generaterSwapUtil.getPopupSelectValue("392933121244325765","vehicle_id","ticketno",jg_receiptin_item0Model.getVehicleId(),vehicleIdMap));
Map<String,Object> reservoirareaIdMap = new HashMap<>(); Map<String,Object> materialIdMap = new HashMap<>();
jg_receiptin_item0Model.setReservoirareaId(generaterSwapUtil.getPopupSelectValue("392939299932268421","id","areaname",jg_receiptin_item0Model.getReservoirareaId(),reservoirareaIdMap)); jg_receiptin_item0Model.setMaterialId(generaterSwapUtil.getPopupSelectValue("398448695651178885","id","item_name",jg_receiptin_item0Model.getMaterialId(),materialIdMap));
} Map<String,Object> reservoirareaIdMap = new HashMap<>();
vo.setReceiptin_item0List(jg_receiptin_item0ModelList); jg_receiptin_item0Model.setReservoirareaId(generaterSwapUtil.getPopupSelectValue("392939299932268421","id","areaname",jg_receiptin_item0Model.getReservoirareaId(),reservoirareaIdMap));
Map<String,Object> warehouseIdMap = new HashMap<>();
jg_receiptin_item0Model.setWarehouseId(generaterSwapUtil.getPopupSelectValue("398450221434116485","id","name",jg_receiptin_item0Model.getWarehouseId(),warehouseIdMap));
}
vo.setReceiptin_item0List(jg_receiptin_item0ModelList);
//附表数据转换 //附表数据转换
//添加到详情表单对象中 //添加到详情表单对象中
Map<String,Object> soucenoMap = new HashMap<>(); Map<String,Object> soucenoMap = new HashMap<>();
vo.setSouceno(generaterSwapUtil.getPopupSelectValue("392931756640102277","document_no","document_no",vo.getSouceno(),soucenoMap)); vo.setSouceno(generaterSwapUtil.getPopupSelectValue("392931756640102277","id","document_no",vo.getSouceno(),soucenoMap));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName())); Map<String,Object> supplierIdMap = new HashMap<>();
vo.setSupplierId(generaterSwapUtil.getPopupSelectValue("397751667988199621","id","supplier_name",vo.getSupplierId(),supplierIdMap));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@PutMapping("/{id}") @PutMapping("/{id}")
@Transactional @Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid ReceiptinUpForm receiptinUpForm) throws DataException { public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid ReceiptinUpForm receiptinUpForm) throws DataException {
@ -367,8 +375,8 @@ public class ReceiptinController {
ReceiptinEntity entity= receiptinService.getInfo(id); ReceiptinEntity entity= receiptinService.getInfo(id);
if(entity!=null){ if(entity!=null){
ReceiptinEntity subentity=JsonUtil.getJsonToBean(receiptinUpForm, ReceiptinEntity.class); ReceiptinEntity subentity=JsonUtil.getJsonToBean(receiptinUpForm, ReceiptinEntity.class);
subentity.setCreatorTime(entity.getCreatorTime()); subentity.setCreatorTime(entity.getCreatorTime());
subentity.setCreatorUserName(entity.getCreatorUserName()); subentity.setCreatorUserName(entity.getCreatorUserName());
receiptinService.update(id, subentity); receiptinService.update(id, subentity);
QueryWrapper<Receiptin_item0Entity> Receiptin_item0queryWrapper = new QueryWrapper<>(); QueryWrapper<Receiptin_item0Entity> Receiptin_item0queryWrapper = new QueryWrapper<>();
@ -377,28 +385,18 @@ public class ReceiptinController {
List<Receiptin_item0Entity> Receiptin_item0List = JsonUtil.getJsonToList(receiptinUpForm.getReceiptin_item0List(),Receiptin_item0Entity.class); List<Receiptin_item0Entity> Receiptin_item0List = JsonUtil.getJsonToList(receiptinUpForm.getReceiptin_item0List(),Receiptin_item0Entity.class);
for(Receiptin_item0Entity entitys : Receiptin_item0List){ for(Receiptin_item0Entity entitys : Receiptin_item0List){
if (entitys.getUnit().equals("吨")){
entitys.setUnit("0");
}else if (entitys.getUnit().equals("千克")){
entitys.setUnit("1");
}
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setReceiptinId(entity.getId()); entitys.setReceiptinId(entity.getId());
receiptin_item0Service.save(entitys); receiptin_item0Service.save(entitys);
} }
//采购订单状态为2
return ActionResult.success("更新成功"); if(ObjectUtil.equal("0", entity.getType())){//采购入库
PurchaseorderEntity purchaseorderEntity = purchaseorderService.getById(entity.getSouceno());
purchaseorderEntity.setStatus("2");
purchaseorderEntity.setIssue("1");
purchaseorderService.updateById(purchaseorderEntity);
}
return ActionResult.success("更新成功");
}else{ }else{
return ActionResult.fail("更新失败,数据不存在"); return ActionResult.fail("更新失败,数据不存在");
} }
@ -406,12 +404,12 @@ public class ReceiptinController {
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Transactional @Transactional
public ActionResult delete(@PathVariable("id") String id){ public ActionResult delete(@PathVariable("id") String id){

@ -96,4 +96,6 @@ public class ReceiptinEntity {
@TableField("REMARK") @TableField("REMARK")
private String remark; private String remark;
@TableField("SUPPLIER_ID")
private String supplierId;
} }

@ -113,7 +113,10 @@ public class Receiptin_item0Entity {
@TableField("PURCHASEORDERITEM_ID") @TableField("PURCHASEORDERITEM_ID")
private String purchaseorderitemId; private String purchaseorderitemId;
@TableField("VEHICLE_ID") @TableField("vehicle_id")
private String vehicleId; private String vehicleId;
@TableField("material_id")
private String materialId;
} }

@ -48,6 +48,9 @@ public class ReceiptinCrForm {
@JsonProperty("suppliername") @JsonProperty("suppliername")
private String suppliername; private String suppliername;
@JsonProperty("supplierId")
private String supplierId;
/** 备注 **/ /** 备注 **/
@JsonProperty("remark") @JsonProperty("remark")
private String remark; private String remark;

@ -52,6 +52,9 @@ public class ReceiptinInfoVO{
@JsonProperty("suppliername") @JsonProperty("suppliername")
private String suppliername; private String suppliername;
@JsonProperty("supplierId")
private String supplierId;
/** 备注 **/ /** 备注 **/
@JsonProperty("remark") @JsonProperty("remark")
private String remark; private String remark;

@ -58,6 +58,8 @@ public class ReceiptinListVO{
@JsonProperty("suppliername") @JsonProperty("suppliername")
private String suppliername; private String suppliername;
@JsonProperty("supplierId")
private String supplierId;
/** 备注 **/ /** 备注 **/
@JsonProperty("remark") @JsonProperty("remark")

@ -58,6 +58,8 @@ public class ReceiptinUpForm{
@JsonProperty("suppliername") @JsonProperty("suppliername")
private String suppliername; private String suppliername;
@JsonProperty("supplierId")
private String supplierId;
/** 备注 **/ /** 备注 **/
@JsonProperty("remark") @JsonProperty("remark")

@ -35,6 +35,12 @@ public class Receiptin_item0Model {
@JsonProperty("warehouseId") @JsonProperty("warehouseId")
private String warehouseId; private String warehouseId;
@JsonProperty("poundlistId")
private String poundlistId;
@JsonProperty("purchaseorderitemId")
private String purchaseorderitemId;
/** 入库重量 **/ /** 入库重量 **/
@JsonProperty("num") @JsonProperty("num")
private String num; private String num;
@ -67,11 +73,13 @@ public class Receiptin_item0Model {
// @JsonProperty("lastModifyUserId") // @JsonProperty("lastModifyUserId")
// private String lastModifyUserId; // private String lastModifyUserId;
/** 磅单类型 **/ /** 磅单类型 **/
@TableField(exist = false) @JsonProperty("poundType")
private String pountType; private String poundType;
/** 车牌号 **/
@JsonProperty("vehicleId") @JsonProperty("vehicleId")
private String vehicleId; private String vehicleId;
@JsonProperty("materialId")
private String materialId;
} }

@ -203,7 +203,7 @@ public class TradeuploadController {
tradeuploadCrForm.setPoundDate(new Date()); tradeuploadCrForm.setPoundDate(new Date());
} }
if (StringUtils.isEmpty(DeliveryNumber)) { if (StringUtils.isEmpty(DeliveryNumber)) {
tradeuploadCrForm.setPoundlistNo(String.valueOf(new Date())); tradeuploadCrForm.setPoundlistNo("");
}else { }else {
tradeuploadCrForm.setPoundlistNo(DeliveryNumber); tradeuploadCrForm.setPoundlistNo(DeliveryNumber);
} }

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.invoices.mapper.InvoicesItem0Mapper">
</mapper>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.invoices.mapper.InvoicesItem1Mapper">
</mapper>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.paymentdoc.mapper.PaymentdocItem0Mapper">
</mapper>

21429
SC-web/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -5,7 +5,7 @@ Vue.use(Router)
/* Layout */ /* Layout */
import Layout from '@/layout' import Layout from '@/layout'
import pament from '@/views/scm/basicInformation/paymentdoc/Form' //import pament from '@/views/scm/basicInformation/paymentdoc/Form'
/* Router Modules */ /* Router Modules */

@ -0,0 +1,68 @@
<template>
<el-dialog title="导出数据" :close-on-click-modal="false" :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="600px">
<el-form label-position="top" label-width="80px">
<el-form-item label="数据选择">
<el-radio-group v-model="type">
<el-radio :label="0">当前页面数据</el-radio>
<el-radio :label="1">全部页面数据</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="导出字段">
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll"
@change="handleCheckAllChange">全选</el-checkbox>
<el-checkbox-group v-model="columns" @change="handleCheckedChange">
<el-checkbox v-for="item in columnList" :label="item.prop" :key="item.prop">
{{item.label}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible=false"> </el-button>
<el-button type="primary" @click="downLoad"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
visible: false,
btnLoading: false,
type: 0,
columns: [],
checkAll: true,
isIndeterminate: false,
columnList: []
}
},
methods: {
init(columnList) {
this.visible = true
this.checkAll = true
this.isIndeterminate = false
this.columnList = columnList
this.columns = columnList.map(o => o.prop)
},
handleCheckAllChange(val) {
this.columns = val ? this.columnList.map(o => o.prop) : [];
this.isIndeterminate = false;
},
handleCheckedChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.columnList.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.columnList.length;
},
downLoad() {
this.$emit('download', { dataType: this.type, selectKey: this.columns.join(',') })
}
}
}
</script>
<style lang="scss" scoped>
>>> .el-dialog__body {
padding: 20px !important;
}
</style>

@ -0,0 +1,684 @@
<template>
<div>
<el-row :gutter="15">
<el-form ref="elForm" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right"
:disabled="setting.readonly">
<template v-if="!loading && formOperates">
<el-col :span="8" v-if="judgeShow('documentNo')">
<el-form-item label="单据编号" prop="documentNo">
<el-input :disabled="judgeWrite('documentNo')" v-model="dataForm.documentNo" placeholder="系统自动生成"
readonly>
</el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="8" v-if="judgeShow('purchaseId')">
<el-form-item label="采购订单" prop="purchaseId">
<popupSelect :disabled="judgeWrite('purchaseId')" v-model="dataForm.purchaseId" placeholder="请选择"
clearable field="purchaseId" interfaceId="389673535976550149" :columnOptions="purchaseIdcolumnOptions"
propsValue="id" relationField="document_no" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('contractId')">
<el-form-item label="合同" prop="contractId">
<popupSelect :disabled="judgeWrite('contractId')" v-model="dataForm.contractId" placeholder="请选择"
clearable field="contractId" interfaceId="389673903103979269" :columnOptions="contractIdcolumnOptions"
propsValue="id" relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('supplierId')">
<el-form-item label="供应商" prop="supplierId">
<popupSelect :disabled="judgeWrite('supplierId')" v-model="dataForm.supplierId" placeholder="请选择"
clearable field="supplierId" interfaceId="389674191453990661" :columnOptions="supplierIdcolumnOptions"
propsValue="id" relationField="supplier_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20">
</popupSelect>
</el-form-item>
</el-col> -->
<el-col :span="8" v-if="judgeShow('paymentType')">
<el-form-item label="付款类型" prop="paymentType">
<el-select :disabled="judgeWrite('paymentType')" v-model="dataForm.paymentType" placeholder="请选择"
clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in paymentTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('businessDate')">
<el-form-item label="业务日期" prop="businessDate">
<el-date-picker :disabled="judgeWrite('businessDate')" v-model="dataForm.businessDate" placeholder="请选择"
clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('currency')">
<el-form-item label="币别" prop="currency">
<el-select :disabled="judgeWrite('currency')" v-model="dataForm.currency" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('settlementType')">
<el-form-item label="结算类型" prop="settlementType">
<el-select :disabled="judgeWrite('settlementType')" v-model="dataForm.settlementType" placeholder="请选择"
clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('ramount')">
<el-form-item label="申请金额" prop="ramount">
<el-input-number :disabled="judgeWrite('ramount')" v-model="dataForm.ramount" placeholder="数字文本" :step="1"
:precision="6" :style='{"width":"100%"}'>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('paymentAmount')">
<el-form-item label="付款金额" prop="paymentAmount">
<el-input-number :disabled="judgeWrite('paymentAmount')" v-model="dataForm.paymentAmount"
placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}'>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('unpaymentAmount')">
<el-form-item label="未付款金额" prop="unpaymentAmount">
<el-input-number :disabled="judgeWrite('unpaymentAmount')" v-model="dataForm.unpaymentAmount"
placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}'>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('collectionAccount')">
<el-form-item label="收款账户" prop="collectionAccount">
<el-input :disabled="judgeWrite('collectionAccount')" v-model="dataForm.collectionAccount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('colectionBank')">
<el-form-item label="收款银行" prop="colectionBank">
<el-input :disabled="judgeWrite('colectionBank')" v-model="dataForm.colectionBank" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('dueDate')">
<el-form-item label="应付日期" prop="dueDate">
<el-date-picker :disabled="judgeWrite('dueDate')" v-model="dataForm.dueDate" placeholder="请选择" clearable
:style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('isPay')">
<el-form-item label="是否付款" prop="isPay">
<el-select :disabled="judgeWrite('isPay')" v-model="dataForm.isPay" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in isPayOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('docStatus')">
<el-form-item label="单据状态" prop="docStatus">
<el-select :disabled="judgeWrite('docStatus')" v-model="dataForm.docStatus" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="16" v-if="judgeShow('remark')">
<el-form-item label="备注" prop="remark">
<el-input :disabled="judgeWrite('remark')" v-model="dataForm.remark" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" v-if="judgeShow('paymentdocitem0List') && formOperates">
<el-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.paymentdocitem0List" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="amount" width="200" label="申请金额" v-if="judgeShow('paymentdocitem0List-amount')" align="center">
<template slot="header" v-if="judgeRequired('paymentdocitem0List-amount')">
<span class="required-sign">*</span>申请金额
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.amount"
:disabled="judgeWrite('paymentdocitem0List') || judgeWrite('paymentdocitem0List-amount')"
placeholder="请输入" clearable :style='{"width":"100%"}' @change="amountChange(scope.row)">
</el-input>
</template>
</el-table-column>
<el-table-column prop="allAmount" width="200" label="订单金额" align="center">
<template slot="header">
订单金额
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.allAmount"
placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="payPrice" width="200" label="已付金额" align="center">
<template slot="header">
已付金额
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.payPrice"
placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="documentNo" width="200" label="订单编号" align="center">
<template slot="header">
订单编号
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.documentNo"
placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="contractNo" width="200" label="合同编号" align="center">
<template slot="header">
合同编号
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.contractNo"
placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="num" width="200" label="结算重量" align="center">
<template slot="header">
结算重量
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.num"
placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="advanceAmount" width="200" label="垫资金额" align="center">
<template slot="header">
垫资金额
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.advanceAmount"
placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="rate" width="200" label="税额" align="center">
<template slot="header">
税额
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.rate"
placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="notAmount" width="200" label="不含税金额" align="center">
<template slot="header">
不含税金额
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.notAmount"
placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="creatorTime" width="200" label="业务日期" align="center">
<template slot="header">
业务日期
</template>
<template slot-scope="scope">
<el-date-picker v-model="scope.row.creatorTime" placeholder="请选择"
clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" readonly>
</el-date-picker>
</template>
</el-table-column>
<el-table-column label="操作" width="50" v-if="!setting.readonly && !judgeWrite('paymentdocitem0List')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delpaymentdocitem0List(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addpaymentdocitem0List()"
v-if="!setting.readonly && !judgeWrite('paymentdocitem0List')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</el-form-item>
</el-col>
</template>
</el-form>
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
</div>
</template>
<script>
import request from '@/utils/request'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
visible: false,
loading: false,
setting: {},
eventType: '',
userBoxVisible: false,
dataForm: {
id: '',
flowId: '',
status: 1,
freeapproveruserid: '',
documentNo: '',
purchaseId: "",
contractId: "",
supplierId: "",
paymentType: "0",
businessDate: '',
currency: "0",
settlementType: "0",
ramount: 0,
paymentAmount: 0,
unpaymentAmount: 0,
collectionAccount: '',
colectionBank: '',
dueDate: '',
isPay: "0",
status: "0",
remark: '',
paymentdocitem0List: [],
},
tableRequiredData: {},
dataRule: {},
purchaseIdcolumnOptions: [{
"label": "采购订单号",
"value": "document_no"
}, {
"label": "合同",
"value": "contractName"
}, {
"label": "供应商",
"value": "supplier"
}, {
"label": "金额",
"value": "amount"
}, {
"label": "数量",
"value": "num"
}, ],
contractIdcolumnOptions: [{
"label": "合同编码",
"value": "contract_code"
}, {
"label": "合同名称",
"value": "contract_name"
}, ],
supplierIdcolumnOptions: [{
"label": "供应商编码",
"value": "supplier_code"
}, {
"label": "供应商名称",
"value": "supplier_name"
}, {
"label": "供应商地点",
"value": "supplier_site_code"
}, ],
paymentTypeOptions: [{
"fullName": "货款",
"id": "0"
}, {
"fullName": "运费",
"id": "1"
}, {
"fullName": "仓储",
"id": "2"
}],
currencyOptions: [{
"fullName": "人民币",
"id": "0"
}, {
"fullName": "美元",
"id": "1"
}, {
"fullName": "英镑",
"id": "2"
}],
settlementTypeOptions: [{
"fullName": "现金",
"id": "0"
}, {
"fullName": "赊购",
"id": "1"
}, {
"fullName": "网银",
"id": "2"
}, {
"fullName": "银企直连",
"id": "3"
}, {
"fullName": "银票",
"id": "4"
}, {
"fullName": "商票",
"id": "5"
}],
isPayOptions: [{
"fullName": "否",
"id": "0"
}, {
"fullName": "是",
"id": "1"
}],
statusOptions: [{
"fullName": "已保存",
"id": "0"
}, {
"fullName": "审批中",
"id": "1"
}, {
"fullName": "已审批",
"id": "2"
}, {
"fullName": "已付款",
"id": "3"
}],
}
},
computed: {
formOperates() {
return this.setting.formOperates
}
},
watch: {},
created() {},
mounted() {},
methods: {
amountChange(row){
var ramount = 0;
this.dataForm.paymentdocitem0List.forEach((item, index)=>{
ramount = ramount + parseFloat(item.amount);
});
this.dataForm.ramount = ramount;
},
judgeShow(id) {
if (!this.setting.formOperates || !this.setting.formOperates.length) return true
let arr = this.setting.formOperates.filter(o => o.id === id) || []
if (!arr.length) return true
let item = arr[0]
return item.read
},
judgeWrite(id) {
if (!this.setting.formOperates || !this.setting.formOperates.length) return false
let arr = this.setting.formOperates.filter(o => o.id === id) || []
if (!arr.length) return true
let item = arr[0]
return !item.write
},
goBack() {
this.$emit('refresh')
},
init(data) {
this.dataForm.id = data.id || "";
this.setting = data;
this.visible = true;
this.updateDataRule()
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/paymentdoc/Paymentdoc/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
if(data.purchaseorder && data.purchaseorder.length > 0){
this.dataForm.businessDate = new Date()
this.dataForm.dueDate = new Date()
var ramount = 0;
var paymentAmount = 0;
var unpaymentAmount = 0;
data.purchaseorder.forEach((item, index)=>{
item.allAmount = item.amount;
item.amount = item.allAmount- item.payPrice;
item.purchaseorderId = item.id;
item.id = '';
ramount = ramount + item.amount;//
paymentAmount = paymentAmount + item.payPrice;//
unpaymentAmount = item.allAmount - item.payPrice;//
});
this.dataForm.ramount = ramount;
this.dataForm.paymentAmount = paymentAmount;
this.dataForm.unpaymentAmount = unpaymentAmount;
this.dataForm.paymentdocitem0List = data.purchaseorder;
}
this.$emit('setPageLoad')
})
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
updateDataRule() {
let newRules = {}
for (let i = 0; i < this.setting.formOperates.length; i++) {
const item = this.setting.formOperates[i]
if (!item.id.includes('-')) {
const newRulesItem = {
required: item.required,
message: item.name + '不能为空',
trigger: item.trigger || 'blur'
}
if (!this.dataRule.hasOwnProperty(item.id)) {
if (item.required) this.$set(newRules, item.id, [newRulesItem])
} else {
let withoutRequiredItem = true
for (let i = 0; i < this.dataRule[item.id].length; i++) {
if (this.dataRule[item.id][i].hasOwnProperty('required')) {
this.dataRule[item.id][i].required = item.required
withoutRequiredItem = false
}
}
if (withoutRequiredItem && item.required) this.dataRule[item.id].push(newRulesItem)
}
} else {
let key = item.id.split('-')[0]
let newId = item.id.split('-')[1]
let newItem = {
...item,
id: newId
}
if (!this.tableRequiredData.hasOwnProperty(key)) {
this.$set(this.tableRequiredData, key, [newItem])
} else {
this.tableRequiredData[key].push(newItem)
}
}
}
this.dataRule = {
...this.dataRule,
...newRules
}
},
exist() {
let isOk = true
for (let key in this.tableRequiredData) {
if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
for (let i = 0; i < this.dataForm[key].length; i++) {
let item = this.dataForm[key][i]
inner: for (let id in item) {
let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
if (!arr.length) continue inner
if (arr[0].required) {
let msg = `${arr[0].name}不能为空`
let boo = true
if (arr[0].dataType === 'array') {
boo = !this.jnpf.isEmptyArray(item[id])
} else {
boo = !this.jnpf.isEmpty(item[id])
}
if (!boo) {
this.$message({
message: msg,
type: 'error',
duration: 1000
})
isOk = false
break
}
}
}
}
}
}
return isOk
},
judgeRequired(id) {
if (!this.formOperates || !this.formOperates.length) return false
let arr = this.formOperates.filter(o => o.id === id) || []
if (!arr.length) return false
let item = arr[0]
return item.required
},
//
dataFormSubmit(eventType) {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (this.exist && !this.exist()) return
if (eventType === 'audit' || eventType === 'reject') {
this.$emit('eventReceiver', this.dataForm, eventType)
return
}
this.dataForm.status = eventType === 'submit' ? 0 : 1
this.dataForm.flowId = this.setting.flowId
this.eventType = eventType
if (this.eventType === 'submit') {
this.$confirm('您确定要提交当前流程吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.request()
}).catch(() => {});
} else {
this.request()
}
}
})
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/paymentdoc/Paymentdoc',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('close', true)
}
})
})
} else {
request({
url: '/api/paymentdoc/Paymentdoc/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('close', true)
}
})
})
}
},
addpaymentdocitem0List() {
let item = {
amount: undefined,
}
this.dataForm.paymentdocitem0List.push(item)
},
delpaymentdocitem0List(index) {
this.dataForm.paymentdocitem0List.splice(index, 1);
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
for (let i = 0; i < _data.paymentdocitem0List.length; i++) {
var _list = _data.paymentdocitem0List[i];
}
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
for (let i = 0; i < _dataAll.paymentdocitem0List.length; i++) {
var _list = _dataAll.paymentdocitem0List[i];
}
this.dataForm = _dataAll
},
},
}
</script>

@ -0,0 +1,404 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="单据编号">
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="reset()" />
</el-tooltip>
<screenfull isContainer />
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'>
<el-table-column prop="documentNo" label="单据编号" width="200" align="center" sortable="custom" />
<el-table-column prop="purchaseId" label="采购订单" width="200" align="center" sortable="custom" />
<el-table-column prop="contractId" label="合同" width="150" align="center" sortable="custom" />
<el-table-column prop="supplierId" label="供应商" width="200" align="center" sortable="custom" />
<el-table-column label="付款类型" width="150" prop="paymentType" algin="center" sortable="custom">
<template slot-scope="scope">
{{ scope.row.paymentType | dynamicText(paymentTypeOptions) }}
</template>
</el-table-column>
<el-table-column prop="businessDate" label="业务日期" width="150" align="center" sortable="custom" />
<el-table-column label="币别" width="150" prop="currency" algin="center" sortable="custom">
<template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }}
</template>
</el-table-column>
<el-table-column label="结算类型" width="150" prop="settlementType" algin="center" sortable="custom">
<template slot-scope="scope">
{{ scope.row.settlementType | dynamicText(settlementTypeOptions) }}
</template>
</el-table-column>
<el-table-column prop="ramount" label="申请金额" width="150" align="center" sortable="custom" />
<el-table-column prop="paymentAmount" label="付款金额" width="150" align="center" sortable="custom" />
<el-table-column prop="unpaymentAmount" label="未付款金额" width="150" align="center" sortable="custom" />
<el-table-column prop="collectionAccount" label="收款账户" width="150" align="center" sortable="custom" />
<el-table-column prop="colectionBank" label="收款银行" width="150" align="center" sortable="custom" />
<el-table-column prop="dueDate" label="应付日期" width="150" align="center" sortable="custom" />
<el-table-column label="是否付款" width="150" prop="isPay" algin="center" sortable="custom">
<template slot-scope="scope">
{{ scope.row.isPay | dynamicText(isPayOptions) }}
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="150" align="center" sortable="custom" />
<el-table-column prop="flowState" label="状态" width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.flowState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
<el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==4">流程撤回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==5">审核终止</el-tag>
<el-tag type="warning" v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="addOrUpdateHandle(scope.row.id)">编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" :disabled="!!scope.row.flowState"
@click="handleDel(scope.row.id)">删除
</el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="addOrUpdateHandle(scope.row.id,scope.row.flowState)">详情</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
</div>
</div>
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
</div>
</template>
<script>
import request from '@/utils/request'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import FlowBox from '@/views/workFlow/components/FlowBox'
import ExportBox from './ExportBox'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
export default {
components: {
FlowBox,
ExportBox
},
data() {
return {
query: {
documentNo: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id'
},
list: [],
listLoading: true,
total: 0,
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
flowVisible: false,
exportBoxVisible: false,
columnList: [{
prop: 'documentNo',
label: '单据编号'
},
{
prop: 'purchaseId',
label: '采购订单'
},
{
prop: 'contractId',
label: '合同'
},
{
prop: 'supplierId',
label: '供应商'
},
{
prop: 'paymentType',
label: '付款类型'
},
{
prop: 'businessDate',
label: '业务日期'
},
{
prop: 'currency',
label: '币别'
},
{
prop: 'settlementType',
label: '结算类型'
},
{
prop: 'ramount',
label: '申请金额'
},
{
prop: 'paymentAmount',
label: '付款金额'
},
{
prop: 'unpaymentAmount',
label: '未付款金额'
},
{
prop: 'collectionAccount',
label: '收款账户'
},
{
prop: 'colectionBank',
label: '收款银行'
},
{
prop: 'dueDate',
label: '应付日期'
},
{
prop: 'isPay',
label: '是否付款'
},
{
prop: 'remark',
label: '备注'
},
],
paymentTypeOptions: [{
"fullName": "货款",
"id": "0"
}, {
"fullName": "运费",
"id": "1"
}, {
"fullName": "仓储",
"id": "2"
}],
paymentTypeProps: {
"label": "fullName",
"value": "id"
},
currencyOptions: [{
"fullName": "人民币",
"id": "0"
}, {
"fullName": "美元",
"id": "1"
}, {
"fullName": "英镑",
"id": "2"
}],
currencyProps: {
"label": "fullName",
"value": "id"
},
settlementTypeOptions: [{
"fullName": "现金",
"id": "0"
}, {
"fullName": "赊购",
"id": "1"
}, {
"fullName": "网银",
"id": "2"
}, {
"fullName": "银企直连",
"id": "3"
}, {
"fullName": "银票",
"id": "4"
}, {
"fullName": "商票",
"id": "5"
}],
settlementTypeProps: {
"label": "fullName",
"value": "id"
},
isPayOptions: [{
"fullName": "否",
"id": "0"
}, {
"fullName": "是",
"id": "1"
}],
isPayProps: {
"label": "fullName",
"value": "id"
},
statusOptions: [{
"fullName": "已保存",
"id": "0"
}, {
"fullName": "审批中",
"id": "1"
}, {
"fullName": "已审批",
"id": "2"
}, {
"fullName": "已付款",
"id": "3"
}],
statusProps: {
"label": "fullName",
"value": "id"
},
}
},
computed: {
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.initData()
},
methods: {
sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
menuId: this.menuId
};
request({
url: `/api/paymentdoc/Paymentdoc/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = [];
for (let i = 0; i < res.data.list.length; i++) {
let _data = res.data.list[i];
_list.push(_data)
}
this.list = _list
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/paymentdoc/Paymentdoc/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {});
},
addOrUpdateHandle(id, flowState) {
let data = {
id: id || '',
enCode: 'paymentdoc',
flowId: '398482034802139205',
formType: 1,
opType: flowState ? 0 : '-1',
status: flowState
}
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.columnList)
})
},
download(data) {
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({
url: `/api/paymentdoc/Paymentdoc/Actions/Export`,
method: 'GET',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery = {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
}
this.initData()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined
}
this.listQuery = {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
}
this.initData()
}
}
}
</script>

@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px"> :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right"> <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
<template v-if="!loading"> <template v-if="!loading">
@ -11,31 +11,15 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="8">-->
<!-- <el-form-item label="客户名称" prop="customerName">-->
<!-- <popupSelect v-model="dataForm.customerName" placeholder="请选择" clearable field="customerName"-->
<!-- interfaceId="393371066040385285" :columnOptions="customerNamecolumnOptions"-->
<!-- propsValue="supplier_nm"-->
<!-- relationField="supplier_nm" popupType="dialog" popupTitle="选择数据" popupWidth="800px"-->
<!-- @change="popupSelect">-->
<!-- </popupSelect>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="8"> <el-col :span="8">
<el-form-item label="客户名称" <el-form-item label="客户名称" prop="customerName">
prop="customerId"> <popupSelect v-model="dataForm.customerName" placeholder="请选择" clearable field="customerName"
<popupSelect v-model="dataForm.customerId" interfaceId="393371066040385285" :columnOptions="customerNamecolumnOptions" propsValue="supplier_nm"
placeholder="请选择" clearable field="customerId" interfaceId="393371066040385285" relationField="supplier_nm" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
:columnOptions="customerIdcolumnOptions" propsValue="id" relationField="supplier_nm" @change="popupSelect">
popupType="dialog"
popupTitle="选择数据" popupWidth="800px" >
</popupSelect> </popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="收款金额" prop="amountCollected"> <el-form-item label="收款金额" prop="amountCollected">
<el-input v-model="dataForm.amountCollected" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="dataForm.amountCollected" placeholder="请输入" clearable :style='{"width":"100%"}'>
@ -58,19 +42,19 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="收款类型" prop="paymentType"> <el-form-item label="收款类型 " prop="paymentType">
<el-select v-model="dataForm.paymentType" placeholder="请选择" clearable :style='{"width":"100%"}'> <el-select v-model="dataForm.paymentType" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in paymentTypeOptions" :key="index" :label="item.fullName" <el-option v-for="(item, index) in paymentTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option> :value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="币别" prop="currency"> <el-form-item label="币别 " prop="currency">
<el-select v-model="dataForm.currency" placeholder="请选择" clearable :style='{"width":"100%"}'> <el-select v-model="dataForm.currency" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" <el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option> :disabled="item.disabled"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -79,7 +63,7 @@
<el-form-item label="结算类型" prop="settlementType"> <el-form-item label="结算类型" prop="settlementType">
<el-select v-model="dataForm.settlementType" placeholder="请选择" clearable :style='{"width":"100%"}'> <el-select v-model="dataForm.settlementType" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName" <el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option> :value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -99,10 +83,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="单据状态" prop="status"> <el-form-item label="单据状态 " prop="status">
<el-select v-model="dataForm.status" placeholder="请选择" clearable :style='{"width":"100%"}'> <el-select v-model="dataForm.status" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option> :disabled="item.disabled"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -122,47 +106,45 @@
<div class="JNPF-common-title"> <div class="JNPF-common-title">
<h2></h2> <h2></h2>
</div> </div>
<el-table :data="dataForm.collection_item0List" size='mini' show-summary <el-table :data="dataForm.collection_item0List" size='mini' show-summary>
:summary-method="getSummaries"> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column type="index" width="50" label="序号" align="center"/> <el-table-column prop="amount" label="收款金额" align="center" >
<el-table-column prop="amount" label="收款金额" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="price" label="订单金额" align="center"> <el-table-column prop="creatorUserId" label="订单金额" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.price" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="scope.row.price" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="amountCollected" label="已收款金额" align="center"> <el-table-column prop="creatorUserName" label="已收款金额" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.amountCollected" placeholder="请输入" clearable <el-input v-model="scope.row.amountCollected" placeholder="请输入" clearable
:style='{"width":"100%"}'> :style='{"width":"100%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="coustomerCode" label="销售订单编号" align="center"> <el-table-column prop="deleteTime" label="销售订单编号" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<popupSelect v-model="scope.row.documentNo" placeholder="请选择" clearable <popupSelect v-model="scope.row.documentNo" placeholder="请选择" clearable
:field="'deleteTime'+scope.$index" interfaceId="393372436705378053" :field="'deleteTime'+scope.$index" interfaceId="393372436705378053"
:columnOptions="jg_collection_item0deleteTimecolumnOptions" :columnOptions="jg_collection_item0deleteTimecolumnOptions" propsValue="document_no"
propsValue="document_no" relationField="document_no" popupType="dialog" popupWidth="800px"
relationField="document_no" popupType="dialog" popupWidth="800px" :bissId="dataForm.customerCode" @change="popupSelect2">
:bissId="dataForm.customerCode" @change="popupSelect2">
</popupSelect> </popupSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="contractCode" label="合同编号" align="center"> <el-table-column prop="lastModifyUserId" label="合同编号" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.contractCode" placeholder="请输入" clearable <el-input v-model="scope.row.contractCode" placeholder="请输入" clearable
:style='{"width":"100%"}'> :style='{"width":"100%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="num" label="数量" align="center"> <el-table-column prop="lastModifyUserName" label="数量" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.num" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="scope.row.num" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
@ -176,38 +158,36 @@
<!-- </el-select>--> <!-- </el-select>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column prop="advanceAmount" label="垫资金额" align="center"> <el-table-column prop="lastModifyTime" label="垫资金额" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.advanceAmount" placeholder="请输入" clearable <el-input v-model="scope.row.advanceAmount" placeholder="请输入" clearable
:style='{"width":"100%"}'> :style='{"width":"100%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="rate" label="税额" align="center"> <el-table-column prop="deleteUserId" label="税额" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.rate" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="scope.row.rate" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="notPrice" label="不含税金额" align="center"> <el-table-column prop="deleteUserName" label="不含税金额" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.notPrice" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="scope.row.notPrice" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="creatorTime" label="业务日期" align="center"> <el-table-column prop="creatorTime" label="业务日期" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.creatorTime" placeholder="请选择" clearable <el-date-picker v-model="scope.row.creatorTime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="date" format="yyyy-MM-dd" :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp">
value-format="timestamp">
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="50"> <el-table-column label="操作" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" <el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delcollection_item0List(scope.$index)">删除 @click="delcollection_item0List(scope.$index)">删除</el-button>
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -236,11 +216,9 @@
import { import {
getDictionaryDataSelector getDictionaryDataSelector
} from '@/api/systemData/dictionary' } from '@/api/systemData/dictionary'
export default { export default {
components: {}, components: {},
props: [], props: [],
data() { data() {
return { return {
visible: false, visible: false,
@ -253,224 +231,177 @@
amountCollected: '', amountCollected: '',
collectionCount: '', collectionCount: '',
collectionBank: '', collectionBank: '',
paymentType: '0', paymentType: "0",
currency: '0', currency: "0",
settlementType: '0', settlementType: "0",
remark: '', remark: '',
voucher: [], voucher: [],
status: '0', status: "0",
creatorUserName: '', creatorUserName: '',
collection_item0List: [] collection_item0List: [],
}, },
activeojnisi: '0', activeojnisi: '0',
rules: {}, rules: {},
customerNamecolumnOptions: [{
customerIdcolumnOptions: [{ "label": "客户编码",
'label': '客户编码', "value": "supplier_cd"
'value': 'supplier_cd'
}, { }, {
'label': '客户名称', "label": "客户名称",
'value': 'supplier_nm' "value": "supplier_nm"
},{
'label': '客户id',
'value': 'id'
}, { }, {
'label': '客户地点名称', "label": "客户地点名称",
'value': 'supplier_site_code' "value": "supplier_site_code"
}, { }, {
'label': '客户等级', "label": "客户等级",
'value': 'customer_level' "value": "customer_level"
}], }, ],
jg_collection_item0deleteTimecolumnOptions: [{ jg_collection_item0deleteTimecolumnOptions: [{
'label': '销售订单ID', "label": "销售订单ID",
'value': 'id' "value": "id"
}, { }, {
'label': '销售订单编号', "label": "销售订单编号",
'value': 'document_no' "value": "document_no"
}, { }, {
'label': '合同编号', "label": "合同编号",
'value': 'contract_code' "value": "contract_code"
}, },
{ {
'label': '订单金额', "label": "订单金额",
'value': 'price' "value": "price"
}, { }, {
'label': '已收款金额', "label": "已收款金额",
'value': 'amount_collected' "value": "amount_collected"
}, },
{ {
'label': '重量', "label": "重量",
'value': 'num' "value": "num"
}, { }, {
'label': '垫资金额', "label": "垫资金额",
'value': 'advance_amount' "value": "advance_amount"
}, },
{ {
'label': '税额', "label": "税额",
'value': 'rate' "value": "rate"
}, { }, {
'label': '不含税金额', "label": "不含税金额",
'value': 'not_price' "value": "not_price"
}, { }, {
'label': '业务日期', "label": "业务日期",
'value': 'creator_time' "value": "creator_time"
} },
], ],
paymentTypeOptions: [{ paymentTypeOptions: [{
'fullName': '货款', "fullName": "货款",
'id': '0' "id": "0"
}, { }, {
'fullName': '运费', "fullName": "运费",
'id': '1' "id": "1"
}, { }, {
'fullName': '仓储', "fullName": "仓储",
'id': '2' "id": "2"
}], }],
currencyOptions: [{ currencyOptions: [{
'fullName': '人民币', "fullName": "人民币",
'id': '0' "id": "0"
}, { }, {
'fullName': '美元', "fullName": "美元",
'id': '1' "id": "1"
}, { }, {
'fullName': '英镑', "fullName": "英镑",
'id': '2' "id": "2"
}], }],
settlementTypeOptions: [{ settlementTypeOptions: [{
'fullName': '现金', "fullName": "现金",
'id': '0' "id": "0"
}, { }, {
'fullName': '赊购', "fullName": "赊购",
'id': '1' "id": "1"
}, { }, {
'fullName': '网银', "fullName": "网银",
'id': '2' "id": "2"
}, { }, {
'fullName': '银企直连', "fullName": "银企直连",
'id': '3' "id": "3"
}, { }, {
'fullName': '银票', "fullName": "银票",
'id': '4' "id": "4"
}, { }, {
'fullName': '商票', "fullName": "商票",
'id': '5' "id": "5"
}], }],
statusOptions: [{ statusOptions: [{
'fullName': '已保存', "fullName": "已保存",
'id': '0' "id": "0"
}, { }, {
'fullName': '审批中', "fullName": "审批中",
'id': '1' "id": "1"
}, { }, {
'fullName': '已审批', "fullName": "已审批",
'id': '2' "id": "2"
}, { }, {
'fullName': '已付款', "fullName": "已付款",
'id': '3' "id": "3"
}], }],
taxRateOptions: [{ taxRateOptions: [{
'fullName': '13', "fullName": "13",
'id': '0' "id": "0"
}, { }, {
'fullName': '9', "fullName": "9",
'id': '1' "id": "1"
}, { }, {
'fullName': '6', "fullName": "6",
'id': '2' "id": "2"
}, { }, {
'fullName': '5', "fullName": "5",
'id': '3' "id": "3"
}, { }, {
'fullName': '3', "fullName": "3",
'id': '4' "id": "4"
}, { }, {
'fullName': '0', "fullName": "0",
'id': '5' "id": "5"
}] }],
} }
}, },
computed: {}, computed: {},
watch: { watch: {},
dataForm: { created() {},
deep: true, mounted() {},
handler: function() {
this.popupnum()
}
}
},
created() {
},
mounted() {
},
methods: { methods: {
popupnum() {
let amount = 0
for (let i = 0; i < this.dataForm.collection_item0List.length; i++) {
amount = amount + parseFloat(this.dataForm.collection_item0List[i].amount)
}
parseFloat(this.dataForm.amountCollected = amount)
},
popupSelect(e, d) { popupSelect(e, d) {
this.dataForm.customerCode = d.id this.dataForm.customerCode = d.id;
}, },
popupSelect2(a, b) { popupSelect2(a, b) {
for (let i = 0; i < this.dataForm.collection_item0List.length; i++) { for (let i = 0; i < this.dataForm.collection_item0List.length; i++) {
if (a == this.dataForm.collection_item0List[i].documentNo) { if (a == this.dataForm.collection_item0List[i].documentNo) {
this.dataForm.collection_item0List[i].id = b.id this.dataForm.collection_item0List[i].id = b.id;
this.dataForm.collection_item0List[i].price = b.price this.dataForm.collection_item0List[i].price = b.price;
this.dataForm.collection_item0List[i].amountCollected = b.amount_collected this.dataForm.collection_item0List[i].amountCollected = b.amount_collected;
this.dataForm.collection_item0List[i].contractCode = b.contract_code this.dataForm.collection_item0List[i].contractCode = b.contract_code;
this.dataForm.collection_item0List[i].num = b.num this.dataForm.collection_item0List[i].num = b.num;
this.dataForm.collection_item0List[i].advanceAmount = b.advance_amount this.dataForm.collection_item0List[i].advanceAmount = b.advance_amount;
this.dataForm.collection_item0List[i].rate = b.rate this.dataForm.collection_item0List[i].rate = b.rate;
this.dataForm.collection_item0List[i].notPrice = b.not_price this.dataForm.collection_item0List[i].notPrice = b.not_price;
this.dataForm.collection_item0List[i].creatorTime = b.creator_time this.dataForm.collection_item0List[i].creatorTime = b.creator_time;
} }
} }
}, },
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value)) && (index === 1 || index === 2 || index === 3 || index === 6 || index === 7 || index === 8 || index === 9)) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
} else {
sums[index] = ''
}
})
return sums
},
collection_item0Exist() { collection_item0Exist() {
let isOk = true let isOk = true;
for (let i = 0; i < this.dataForm.collection_item0List.length; i++) { for (let i = 0; i < this.dataForm.collection_item0List.length; i++) {
const e = this.dataForm.collection_item0List[i] const e = this.dataForm.collection_item0List[i];
} }
return isOk return isOk;
}, },
clearData(data) { clearData(data) {
for (let key in data) { for (let key in data) {
if (data[key] instanceof Array) { if (data[key] instanceof Array) {
data[key] = [] data[key] = [];
} else if (data[key] instanceof Object) { } else if (data[key] instanceof Object) {
this.clearData(data[key]) this.clearData(data[key]);
} else { } else {
data[key] = '' data[key] = "";
} }
} }
// request({ // request({
@ -484,11 +415,11 @@
// }); // });
}, },
init(id, isDetail) { init(id, isDetail) {
this.dataForm.id = id || 0 this.dataForm.id = id || 0;
this.visible = true this.visible = true;
this.isDetail = isDetail || false this.isDetail = isDetail || false;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['elForm'].resetFields() this.$refs['elForm'].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
this.loading = true this.loading = true
request({ request({
@ -497,11 +428,11 @@
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
this.loading = false this.loading = false
}) });
} else { } else {
this.clearData(this.dataForm) this.clearData(this.dataForm)
} }
}) });
this.$store.commit('generator/UPDATE_RELATION_DATA', {}) this.$store.commit('generator/UPDATE_RELATION_DATA', {})
}, },
// //
@ -561,29 +492,29 @@
lastModifyTime: undefined, lastModifyTime: undefined,
deleteUserId: undefined, deleteUserId: undefined,
deleteUserName: undefined, deleteUserName: undefined,
creatorTime: undefined creatorTime: undefined,
} }
this.dataForm.collection_item0List.push(item) this.dataForm.collection_item0List.push(item)
}, },
delcollection_item0List(index) { delcollection_item0List(index) {
this.dataForm.collection_item0List.splice(index, 1) this.dataForm.collection_item0List.splice(index, 1);
}, },
dataList() { dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm)) var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.voucher = JSON.stringify(_data.voucher) _data.voucher = JSON.stringify(_data.voucher)
for (let i = 0; i < _data.collection_item0List.length; i++) { for (let i = 0; i < _data.collection_item0List.length; i++) {
var _list = _data.collection_item0List[i] var _list = _data.collection_item0List[i];
} }
return _data return _data;
}, },
dataInfo(dataAll) { dataInfo(dataAll) {
let _dataAll = dataAll let _dataAll = dataAll
_dataAll.voucher = JSON.parse(_dataAll.voucher) _dataAll.voucher = JSON.parse(_dataAll.voucher)
for (let i = 0; i < _dataAll.collection_item0List.length; i++) { for (let i = 0; i < _dataAll.collection_item0List.length; i++) {
var _list = _dataAll.collection_item0List[i] var _list = _dataAll.collection_item0List[i];
} }
this.dataForm = _dataAll this.dataForm = _dataAll
} },
} },
} }
</script> </script>

@ -387,7 +387,6 @@
} }
}); });
}) })
}
if (this.multipleSelection.length > 1) { if (this.multipleSelection.length > 1) {
this.$message({ this.$message({
type: 'error', type: 'error',
@ -395,6 +394,7 @@
duration: 1500 duration: 1500
}) })
} }
}
}, },
addOrUpdateHandle(id, isDetail) { addOrUpdateHandle(id, isDetail) {
this.formVisible = true this.formVisible = true

@ -25,16 +25,14 @@
<div class="JNPF-common-layout-main JNPF-flex-main"> <div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head"> <div class="JNPF-common-head">
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()"> <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">
</el-button> </el-button>
<!-- <el-button type="text" icon="=el-icon-detail" @click="goDetail(scope.row.id)">--> <!-- <el-button type="text" icon="=el-icon-detail" @click="goDetail(scope.row.id)">-->
<!-- </el-button>--> <!-- </el-button>-->
<el-button type="text" icon="el-icon-download" @click="exportData()"> <el-button type="text" icon="el-icon-download" @click="exportData()">
</el-button> </el-button>
<!-- <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">-->
<el-button type="text" icon="el-icon-upload2" @click="uploadForm"></el-button> <!-- </el-button>-->
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top"> <el-tooltip effect="dark" content="刷新" placement="top">
@ -46,7 +44,7 @@
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false" <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
@selection-change="handleSelectionChange" border> @selection-change="handleSelectionChange" border>
<el-table-column type="index" width="50" label="序号" fixed="left" align="center"/> <el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
<el-table-column prop="contractCode" label="合同编码" width="200" align="center" sortable fixed="left"/> <el-table-column prop="contractCode" label="合同编码" width="200" align="center" sortable fixed="left"/>
<el-table-column prop="contractName" label="合同名称" width="200" align="center" sortable fixed="left"/> <el-table-column prop="contractName" label="合同名称" width="200" align="center" sortable fixed="left"/>
<el-table-column prop="contractNo" label="对方合同号" width="200" align="center" sortable/> <el-table-column prop="contractNo" label="对方合同号" width="200" align="center" sortable/>
@ -56,13 +54,7 @@
{{ scope.row.contractType | dynamicText(contractTypeOptions) }} {{ scope.row.contractType | dynamicText(contractTypeOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="classification" label="合同分类 " width="120" align="center" sortable/>
<el-table-column prop="classification" label="合同分类 " width="120" align="center" sortable>
<template slot-scope="scope">
{{ scope.row.classification | dynamicText(classificationOptions) }}
</template>
</el-table-column>
<el-table-column prop="declarationDate" label="申报日期" width="120" align="center" sortable/> <el-table-column prop="declarationDate" label="申报日期" width="120" align="center" sortable/>
<el-table-column prop="name" label="供应商/客户名" width="200" align="center" sortable/> <el-table-column prop="name" label="供应商/客户名" width="200" align="center" sortable/>
<el-table-column prop="num" label="数量" width="120" align="center" sortable/> <el-table-column prop="num" label="数量" width="120" align="center" sortable/>
@ -106,15 +98,10 @@
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/> <JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/> <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/> <Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
<ImportForm v-if="importFormVisible" ref="importForm" @refresh="reset()"/>
</div> </div>
</template> </template>
<script> <script>
import ImportForm from './ImportForm'
import request from '@/utils/request' import request from '@/utils/request'
import { import {
getDictionaryDataSelector getDictionaryDataSelector
@ -126,14 +113,11 @@
} from '@/api/systemData/dataInterface' } from '@/api/systemData/dataInterface'
import Detail from './Detail' import Detail from './Detail'
export default { export default {
components: { components: {
JNPFForm, JNPFForm,
ExportBox, ExportBox,
Detail, Detail
ImportForm
}, },
data() { data() {
return { return {
@ -158,9 +142,6 @@
sidx: '' sidx: ''
}, },
formVisible: false, formVisible: false,
importFormVisible: false,
exportBoxVisible: false, exportBoxVisible: false,
columnList: [{ columnList: [{
prop: 'contractCode', prop: 'contractCode',
@ -221,10 +202,10 @@
], ],
contractTypeOptions: [{ contractTypeOptions: [{
'fullName': '采购合同', 'fullName': '采购合同',
'id': '0' 'id': '1'
}, { }, {
'fullName': '销售合同', 'fullName': '销售合同',
'id': '1' 'id': '2'
}, },
{ {
'fullName': '租赁合同', 'fullName': '租赁合同',
@ -244,21 +225,7 @@
statusOptions: [{ statusOptions: [{
"fullName": "进行中", "fullName": "进行中",
"id": "0", "id": "1"
}, {
"fullName": "审批中",
"id": "1",
}, {
"fullName": "审批结束",
"id": "2"
}],
classificationOptions: [{
"fullName": "采购类",
"id": "0",
}, {
"fullName": "销售类",
"id": "1",
}], }],
contractTypeProps: { contractTypeProps: {
@ -283,10 +250,10 @@
}) })
}, },
sortChange({ sortChange({
column, column,
prop, prop,
order order
}) { }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc' this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop this.listQuery.sidx = !order ? '' : prop
this.initData() this.initData()
@ -414,13 +381,6 @@
this.query[key] = undefined this.query[key] = undefined
} }
this.search() this.search()
},
uploadForm() {
this.importFormVisible = true
this.$nextTick(() => {
this.$refs.importForm.init()
})
} }
} }
} }

@ -48,6 +48,12 @@
<p>{{dataForm.remark}}</p> <p>{{dataForm.remark}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" >
<el-form-item label="单据状态"
prop="status" >
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="发票金额" <el-form-item label="发票金额"
prop="invoiceAmount" > prop="invoiceAmount" >
@ -60,18 +66,6 @@
<p>{{dataForm.invoiceQuantity}}</p> <p>{{dataForm.invoiceQuantity}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" >
<el-form-item label="单据状态"
prop="status" >
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="制单人"
prop="creatorUserName" >
<p>{{dataForm.creatorUserName}}</p>
</el-form-item>
</el-col>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="采购订单号" <el-form-item label="采购订单号"
prop="purchaseorderId" > prop="purchaseorderId" >
@ -91,8 +85,58 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activebnrhzx" tab-position="top" class="mb-20"> <el-tabs v-model="activebzsrnx" tab-position="top" class="mb-20">
<el-tab-pane label="应付明细"> <el-tab-pane label="应付明细">
<el-col :span="24" >
<el-form-item label-width="0">
<div class="JNPF-common-title">
<h2>设计子表</h2>
</div>
<el-table :data="dataForm.invoicesitem1List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="materialId" label="物料">
<template slot-scope="scope">
<p>{{scope.row.materialId}}</p>
</template>
</el-table-column>
<el-table-column prop="quantity" label="数量">
<template slot-scope="scope">
<p>{{scope.row.quantity}}</p>
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<p>{{scope.row.unitPrice}}</p>
</template>
</el-table-column>
<el-table-column prop="amount" label="金额">
<template slot-scope="scope">
<p>{{scope.row.amount}}</p>
</template>
</el-table-column>
<el-table-column prop="taxRate" label="税率">
<template slot-scope="scope">
<p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p>
</template>
</el-table-column>
<el-table-column prop="taxAmount" label="税额">
<template slot-scope="scope">
<p>{{scope.row.taxAmount}}</p>
</template>
</el-table-column>
<el-table-column prop="amountNotTax" label="不含税金额">
<template slot-scope="scope">
<p>{{scope.row.amountNotTax}}</p>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注信息">
<template slot-scope="scope">
<p>{{scope.row.remark}}</p>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-tab-pane > </el-tab-pane >
<el-tab-pane label="发票明细"> <el-tab-pane label="发票明细">
<el-col :span="24" > <el-col :span="24" >
@ -100,8 +144,13 @@
<div class="JNPF-common-title"> <div class="JNPF-common-title">
<h2></h2> <h2></h2>
</div> </div>
<el-table :data="dataForm.invoices_item0List" size='mini' > <el-table :data="dataForm.invoicesitem0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="materialName" label="物料名称">
<template slot-scope="scope">
<p>{{scope.row.materialName}}</p>
</template>
</el-table-column>
<el-table-column prop="invoiceCode" label="发票代码"> <el-table-column prop="invoiceCode" label="发票代码">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.invoiceCode}}</p> <p>{{scope.row.invoiceCode}}</p>
@ -111,6 +160,31 @@
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.invoiceNo}}</p> <p>{{scope.row.invoiceNo}}</p>
</template> </template>
</el-table-column>
<el-table-column prop="invoiceQuantity" label="发票数量">
<template slot-scope="scope">
<p>{{scope.row.invoiceQuantity}}</p>
</template>
</el-table-column>
<el-table-column prop="invoiceAmount" label="发票金额">
<template slot-scope="scope">
<p>{{scope.row.invoiceAmount}}</p>
</template>
</el-table-column>
<el-table-column prop="taxRate" label="税率">
<template slot-scope="scope">
<p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p>
</template>
</el-table-column>
<el-table-column prop="taxAmount" label="税额">
<template slot-scope="scope">
<p>{{scope.row.taxAmount}}</p>
</template>
</el-table-column>
<el-table-column prop="amountNotTax" label="不含税金额">
<template slot-scope="scope">
<p>{{scope.row.amountNotTax}}</p>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="invoiceStatus" label="发票状态 "> <el-table-column prop="invoiceStatus" label="发票状态 ">
<template slot-scope="scope"> <template slot-scope="scope">
@ -127,13 +201,6 @@
<p>{{jnpf.dateFormat(scope.row.invoicingDate)}}</p> <p>{{jnpf.dateFormat(scope.row.invoicingDate)}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注信息">
<template slot-scope="scope">
<p>{{scope.row.remark}}</p>
</template>
</el-table-column>
</el-table> </el-table>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -165,25 +232,27 @@
id :'', id :'',
documentNo : '', documentNo : '',
businessDate : '', businessDate : '',
amount : '', amount : 0,
quantity : '', quantity : 0,
invoiceType : "1", invoiceType : "1",
currency : "", currency : "",
remark : '', remark : '',
invoiceAmount : '',
invoiceQuantity : '',
status : "0", status : "0",
creatorUserName : '', invoiceAmount : 0,
invoiceQuantity : 0,
purchaseorderId : "", purchaseorderId : "",
contractId : "", contractId : "",
supplierId : "", supplierId : "",
invoices_item0List:[], invoicesitem1List:[],
invoicesitem0List:[],
}, },
activebnrhzx:'1', activebzsrnx:'1',
invoiceTypeOptions:[{"fullName":"普通增值税发票","id":"1"},{"fullName":"专用增值税发票","id":"2"},{"fullName":"增值税电子普通发票","id":"3"},{"fullName":"增值税电子发票","id":"4"}], invoiceTypeOptions:[{"fullName":"普通增值税发票","id":"1"},{"fullName":"专用增值税发票","id":"2"},{"fullName":"增值税电子普通发票","id":"3"},{"fullName":"增值税电子发票","id":"4"}],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}], currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}], statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
taxRateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}],
taxRateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}],
invoiceStatusOptions:[{"fullName":"正常","id":"0"},{"fullName":"红冲","id":"1"},{"fullName":"作废","id":"2"}], invoiceStatusOptions:[{"fullName":"正常","id":"0"},{"fullName":"红冲","id":"1"},{"fullName":"作废","id":"2"}],
} }
}, },
@ -196,8 +265,11 @@
methods: { methods: {
dataInfo(dataAll){ dataInfo(dataAll){
let _dataAll =dataAll let _dataAll =dataAll
for(let i=0;i<_dataAll.invoices_item0List.length;i++){ for(let i=0;i<_dataAll.invoicesitem1List.length;i++){
var _list = _dataAll.invoices_item0List[i]; var _list = _dataAll.invoicesitem1List[i];
}
for(let i=0;i<_dataAll.invoicesitem0List.length;i++){
var _list = _dataAll.invoicesitem0List[i];
_list.invoicingDate = _list.invoicingDate ? jnpf.dateFormat(_list.invoicingDate) : '' _list.invoicingDate = _list.invoicingDate ? jnpf.dateFormat(_list.invoicingDate) : ''
} }
this.dataForm = _dataAll this.dataForm = _dataAll

@ -1,159 +1,191 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
:close-on-click-modal="false" append-to-body :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1500px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right"> <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
<template v-if="!loading"> <template v-if="!loading">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="单据编号" <el-form-item label="单据编号" prop="documentNo">
prop="documentNo"> <el-input v-model="dataForm.documentNo" placeholder="请输入单据编号" clearable :style='{"width":"100%"}' readonly>
<el-input v-model="dataForm.documentNo"
placeholder="请输入单据编号" clearable :style='{"width":"100%"}' :disabled="true">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="业务日期" <el-form-item label="业务日期" prop="businessDate">
prop="businessDate"> <el-date-picker v-model="dataForm.businessDate" placeholder="请选择业务日期" clearable :style='{"width":"100%"}'
<el-date-picker v-model="dataForm.businessDate" type="date" format="yyyy-MM-dd" value-format="timestamp">
placeholder="请选择业务日期" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"
value-format="timestamp">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="金额" <el-form-item label="金额" prop="amount">
prop="amount"> <el-input-number v-model="dataForm.amount" placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}' readonly>
<el-input v-model="dataForm.amount"
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true">
</el-input> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="数量" <el-form-item label="数量" prop="quantity">
prop="quantity"> <el-input-number v-model="dataForm.quantity" placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}' readonly>
<el-input v-model="dataForm.quantity"
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true">
</el-input> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="发票类型" <el-form-item label="发票类型" prop="invoiceType">
prop="invoiceType"> <el-select v-model="dataForm.invoiceType" placeholder="请选择" :style='{"width":"100%"}'>
<el-select v-model="dataForm.invoiceType"
placeholder="请选择" :style='{"width":"100%"}'>
<el-option v-for="(item, index) in invoiceTypeOptions" :key="index" :label="item.fullName" <el-option v-for="(item, index) in invoiceTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option> :value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="币别 " <el-form-item label="币别 " prop="currency">
prop="currency"> <el-select v-model="dataForm.currency" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-select v-model="dataForm.currency"
placeholder="请选择" clearable :style='{"width":"100%"}' :disabled="true">
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" <el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option> :disabled="item.disabled"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="备注" <el-form-item label="备注" prop="remark">
prop="remark"> <el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票金额"
prop="invoiceAmount">
<el-input v-model="dataForm.invoiceAmount"
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="发票数量" <el-form-item label="单据状态" prop="status">
prop="invoiceQuantity"> <el-select v-model="dataForm.status" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-input v-model="dataForm.invoiceQuantity" <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true"> :disabled="item.disabled"></el-option>
</el-input> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="单据状态" <el-form-item label="发票金额" prop="invoiceAmount">
prop="status"> <el-input-number v-model="dataForm.invoiceAmount" placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}' readonly>
<el-select v-model="dataForm.status"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled" ></el-option>
</el-select> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="制单人" <el-form-item label="发票数量" prop="invoiceQuantity">
prop="creatorUserName"> <el-input-number v-model="dataForm.invoiceQuantity" placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}' readonly>
<el-input v-model="dataForm.creatorUserName"
placeholder="请输入制单人" clearable :style='{"width":"100%"}' :disabled="true">
</el-input> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="采购订单号" <el-form-item label="采购订单号" prop="purchaseorderId">
prop="purchaseorderId"> <popupSelect v-model="dataForm.purchaseorderId" placeholder="请选择" clearable field="purchaseorderId"
<popupSelect v-model="dataForm.purchaseorderId" interfaceId="389673535976550149" :columnOptions="purchaseorderIdcolumnOptions" propsValue="id"
placeholder="请选择" clearable field="purchaseorderId" interfaceId="389673535976550149" relationField="document_no" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:columnOptions="purchaseorderIdcolumnOptions" propsValue="id" relationField="document_no" :pageSize="20">
popupType="dialog"
popupTitle="选择数据" popupWidth="800px"
>
</popupSelect> </popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="合同名称" <el-form-item label="合同" prop="contractId">
prop="contractId"> <popupSelect v-model="dataForm.contractId" placeholder="请选择" clearable field="contractId"
<popupSelect v-model="dataForm.contractId" interfaceId="389673903103979269" :columnOptions="contractIdcolumnOptions" propsValue="id"
placeholder="请选择" clearable field="contractId" interfaceId="389673903103979269" relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:columnOptions="contractIdcolumnOptions" propsValue="id" relationField="contract_name" :pageSize="20">
popupType="dialog"
popupTitle="选择数据" popupWidth="800px"
>
</popupSelect> </popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="供应商" <el-form-item label="供应商" prop="supplierId">
prop="supplierId"> <popupSelect v-model="dataForm.supplierId" placeholder="请选择" clearable field="supplierId"
<popupSelect v-model="dataForm.supplierId" interfaceId="389674191453990661" :columnOptions="supplierIdcolumnOptions" propsValue="id"
placeholder="请选择" clearable field="supplierId" interfaceId="389674191453990661" relationField="supplier_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:columnOptions="supplierIdcolumnOptions" propsValue="id" relationField="supplier_name" :pageSize="20">
popupType="dialog"
popupTitle="选择数据" popupWidth="800px"
>
</popupSelect> </popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activebnrhzx" tab-position="top" class="mb-20"> <el-tabs v-model="activebzsrnx" tab-position="top" class="mb-20">
<el-tab-pane label="应付明细"> <el-tab-pane label="应付明细">
<el-col :span="24">
<el-form-item label-width="0">
<div class="JNPF-common-title">
</div>
<el-table :data="dataForm.invoicesitem1List" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="materialId" label="物料">
<template slot-scope="scope">
<popupSelect v-model="scope.row.materialId" placeholder="请选择" clearable
:field="'materialId'+scope.$index" interfaceId="397736371898382533"
:columnOptions="invoicesitem1materialIdcolumnOptions" propsValue="id"
relationField="item_name" popupType="dialog" popupWidth="800px" hasPage :pageSize="20" :disabled="true">
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="quantity" label="结算重量">
<template slot-scope="scope">
<el-input v-model="scope.row.quantity" placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<el-input v-model="scope.row.unitPrice" placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="amount" label="金额">
<template slot-scope="scope">
<el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="taxRate" label="税率">
<template slot-scope="scope">
<el-select v-model="scope.row.taxRate" placeholder="请选择 " clearable :style='{"width":"100%"}' :disabled="true">
<el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<!-- <el-table-column prop="taxAmount" label="税额">
<template slot-scope="scope">
<el-input v-model="scope.row.taxAmount" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column> -->
<el-table-column prop="amountNotTax" label="不含税金额">
<template slot-scope="scope">
<el-input v-model="scope.row.amountNotTax" placeholder="请输入" clearable
:style='{"width":"100%"}' :disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注信息">
<template slot-scope="scope">
<el-input v-model="scope.row.remark" placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delinvoicesitem1List(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addinvoicesitem1List()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</el-form-item>
</el-col>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="发票明细"> <el-tab-pane label="发票明细">
<el-col :span="24"> <el-col :span="24">
@ -161,64 +193,100 @@
<div class="JNPF-common-title"> <div class="JNPF-common-title">
<h2></h2> <h2></h2>
</div> </div>
<el-table :data="dataForm.invoices_item0List" size='mini'> <el-table :data="dataForm.invoicesitem0List" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center"/> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="materialName" label="物料名称">
<template slot-scope="scope">
<el-input v-model="scope.row.materialName" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="invoiceCode" label="发票代码"> <el-table-column prop="invoiceCode" label="发票代码">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.invoiceCode" <el-input v-model="scope.row.invoiceCode" placeholder="请输入" clearable
placeholder="请输入" clearable :style='{"width":"100%"}'> :style='{"width":"100%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="invoiceNo" label="发票号码"> <el-table-column prop="invoiceNo" label="发票号码">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.invoiceNo" <el-input v-model="scope.row.invoiceNo" placeholder="请输入" clearable :style='{"width":"100%"}'>
placeholder="请输入" clearable :style='{"width":"100%"}'> </el-input>
</template>
</el-table-column>
<el-table-column prop="invoiceQuantity" label="发票数量" width="150" >
<template slot-scope="scope">
<!-- <el-input v-model="scope.row.invoiceQuantity" placeholder="请输入" clearable
:style='{"width":"100%"}' @change="invoiceQuantityChange">
</el-input> -->
<el-input-number v-model="scope.row.invoiceQuantity" placeholder="数字文本" :step="1" :style='{"width":"100%"}' @change="invoiceQuantityChange">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="invoiceAmount" label="发票金额" width="150" >
<template slot-scope="scope">
<!-- <el-input v-model="scope.row.invoiceAmount" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input> -->
<el-input-number v-model="scope.row.invoiceAmount" placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}' @change="invoiceAmountChange">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="taxRate" label="税率">
<template slot-scope="scope">
<el-select v-model="scope.row.taxRate" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="taxAmount" label="税额">
<template slot-scope="scope">
<el-input v-model="scope.row.taxAmount" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="amountNotTax" label="不含税金额">
<template slot-scope="scope">
<el-input v-model="scope.row.amountNotTax" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="invoiceStatus" label="发票状态 "> <el-table-column prop="invoiceStatus" label="发票状态 ">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.invoiceStatus" <el-select v-model="scope.row.invoiceStatus" placeholder="请选择" clearable
placeholder="请选择" clearable :style='{"width":"100%"}'> :style='{"width":"100%"}'>
<el-option v-for="(item, index) in invoiceStatusOptions" :key="index" :label="item.fullName" <el-option v-for="(item, index) in invoiceStatusOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option> :value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="creatorUserName" label="开票人"> <el-table-column prop="creatorUserName" label="开票人">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.creatorUserName" <el-input v-model="scope.row.creatorUserName" placeholder="请输入" clearable
placeholder="请输入" clearable :style='{"width":"100%"}'> :style='{"width":"100%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="invoicingDate" label="开票日期"> <el-table-column prop="invoicingDate" label="开票日期">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.invoicingDate" <el-date-picker v-model="scope.row.invoicingDate" placeholder="请选择" clearable
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp">
format="yyyy-MM-dd" value-format="timestamp">
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注信息">
<template slot-scope="scope">
<el-input v-model="scope.row.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="50"> <el-table-column label="操作" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" <el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delinvoices_item0List(scope.$index)">删除 @click="delinvoicesitem0List(scope.$index)">删除</el-button>
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="table-actions" @click="addinvoices_item0List()"> <div class="table-actions" @click="addinvoicesitem0List()">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div>
</el-form-item> </el-form-item>
@ -230,98 +298,229 @@
</el-form> </el-form>
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button> <el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button> <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import {
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default { export default {
components: {}, components: {},
props: [], props: [],
data() { data() {
return { return {
excludeFields: [],
visible: false, visible: false,
loading: false, loading: false,
isDetail: false, isDetail: false,
dataForm: { dataForm: {
documentNo: '', documentNo: '',
businessDate: '', businessDate: '',
amount: '', amount: 0,
quantity: '', quantity: 0,
invoiceType: '1', invoiceType: "1",
currency: '', currency: "",
remark: '', remark: '',
invoiceAmount: '', status: "0",
invoiceQuantity: '', invoiceAmount: 0,
status: '0', invoiceQuantity: 0,
creatorUserName: '', purchaseorderId: "",
purchaseorderId: '', contractId: "",
contractId: '', supplierId: "",
supplierId: '', invoicesitem1List: [],
invoices_item0List: [] invoicesitem0List: [],
}, },
activebnrhzx: '1', activebzsrnx: '0',
rules: rules: {},
{}, invoiceTypeOptions: [{
invoiceTypeOptions: [{ 'fullName': '普通增值税发票', 'id': '1' }, { "fullName": "普通增值税发票",
'fullName': '专用增值税发票', "id": "1"
'id': '2' }, {
}, { 'fullName': '增值税电子普通发票', 'id': '3' }, { 'fullName': '增值税电子发票', 'id': '4' }], "fullName": "专用增值税发票",
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, { "id": "2"
'fullName': '英镑', }, {
'id': '2' "fullName": "增值税电子普通发票",
"id": "3"
}, {
"fullName": "增值税电子发票",
"id": "4"
}],
currencyOptions: [{
"fullName": "人民币",
"id": "0"
}, {
"fullName": "美元",
"id": "1"
}, {
"fullName": "英镑",
"id": "2"
}], }],
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, { statusOptions: [{
'fullName': '已审批', "fullName": "已保存",
'id': '2' "id": "0"
}, {
"fullName": "审批中",
"id": "1"
}, {
"fullName": "已审批",
"id": "2"
}], }],
purchaseorderIdcolumnOptions: [{ 'label': '采购订单号', 'value': 'document_no' }], purchaseorderIdcolumnOptions: [{
contractIdcolumnOptions: [{ 'label': 'ID', 'value': 'id' }, { 'label': '合同名称', 'value': 'contract_name' }], "label": "采购订单号",
supplierIdcolumnOptions: [{ 'label': 'ID', 'value': 'id' }, { 'label': '供应商名称', 'value': 'supplier_name' }], "value": "document_no"
}, {
"label": "合同",
"value": "contractName"
}, {
"label": "供应商",
"value": "supplier"
}, {
"label": "金额",
"value": "amount"
}, {
"label": "数量",
"value": "num"
}, ],
contractIdcolumnOptions: [{
"label": "合同编码",
"value": "contract_code"
}, {
"label": "合同名称",
"value": "contract_name"
}, ],
supplierIdcolumnOptions: [{
"label": "供应商编码",
"value": "supplier_code"
}, {
"label": "供应商名称",
"value": "supplier_name"
}, {
"label": "供应商地点",
"value": "supplier_site_code"
}, ],
invoiceStatusOptions: [{ 'fullName': '正常', 'id': '0' }, { 'fullName': '红冲', 'id': '1' }, { invoicesitem1materialIdcolumnOptions: [{
'fullName': '作废', "label": "物料编码",
'id': '2' "value": "item_code"
}] }, {
"label": "物料名称",
"value": "item_name"
}, {
"label": "单位",
"value": "primary_unit_of_measure"
}, {
"label": "可采购",
"value": "purchase_flag_name"
}, {
"label": "可销售",
"value": "sales_flag_name"
}, ],
taxRateOptions: [{
"fullName": "13",
"id": "0"
}, {
"fullName": "9",
"id": "1"
}, {
"fullName": "6",
"id": "2"
}, {
"fullName": "5",
"id": "3"
}, {
"fullName": "3",
"id": "4"
}, {
"fullName": "0",
"id": "5"
}],
taxRateOptions: [{
"fullName": "13",
"id": "0"
}, {
"fullName": "9",
"id": "1"
}, {
"fullName": "6",
"id": "2"
}, {
"fullName": "5",
"id": "3"
}, {
"fullName": "3",
"id": "4"
}, {
"fullName": "0",
"id": "5"
}],
invoiceStatusOptions: [{
"fullName": "正常",
"id": "0"
}, {
"fullName": "红冲",
"id": "1"
}, {
"fullName": "作废",
"id": "2"
}],
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {},
}, mounted() {},
mounted() {
},
methods: { methods: {
invoices_item0Exist() { invoiceQuantityChange(e){
let isOk = true var invoiceQuantity = 0;
for (let i = 0; i < this.dataForm.invoices_item0List.length; i++) { this.dataForm.invoicesitem0List.forEach((item, index)=>{
const e = this.dataForm.invoices_item0List[i] invoiceQuantity = invoiceQuantity + parseFloat(item.invoiceQuantity);
});
this.dataForm.invoiceQuantity = invoiceQuantity;
},
invoiceAmountChange(e){
var invoiceAmount = 0
this.dataForm.invoicesitem0List.forEach((item, index)=>{
invoiceAmount = invoiceAmount + parseFloat(item.invoiceAmount);
});
this.dataForm.invoiceAmount = invoiceAmount;
},
invoicesitem1Exist() {
let isOk = true;
for (let i = 0; i < this.dataForm.invoicesitem1List.length; i++) {
const e = this.dataForm.invoicesitem1List[i];
} }
return isOk return isOk;
},
invoicesitem0Exist() {
let isOk = true;
for (let i = 0; i < this.dataForm.invoicesitem0List.length; i++) {
const e = this.dataForm.invoicesitem0List[i];
}
return isOk;
}, },
clearData(data) { clearData(data) {
for (let key in data) { for (let key in data) {
if (data[key] instanceof Array) { if (data[key] instanceof Array) {
data[key] = [] data[key] = [];
} else if (data[key] instanceof Object) { } else if (data[key] instanceof Object) {
this.clearData(data[key]) this.clearData(data[key]);
} else { } else {
data[key] = '' data[key] = "";
} }
} }
}, },
init(id, isDetail) { init(id, isDetail) {
this.dataForm.id = id || 0 this.dataForm.id = id || 0;
this.visible = true this.visible = true;
this.isDetail = isDetail || false this.isDetail = isDetail || false;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['elForm'].resetFields() this.$refs['elForm'].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
this.loading = true this.loading = true
request({ request({
@ -330,18 +529,19 @@
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
this.loading = false this.loading = false
}) });
} else { } else {
this.clearData(this.dataForm) this.clearData(this.dataForm)
} }
}) });
this.$store.commit('generator/UPDATE_RELATION_DATA', {}) this.$store.commit('generator/UPDATE_RELATION_DATA', {})
}, },
// //
dataFormSubmit() { dataFormSubmit() {
this.$refs['elForm'].validate((valid) => { this.$refs['elForm'].validate((valid) => {
if (valid) { if (valid) {
if (!this.invoices_item0Exist()) return if (!this.invoicesitem1Exist()) return
if (!this.invoicesitem0Exist()) return
this.request() this.request()
} }
}) })
@ -382,34 +582,61 @@
}) })
} }
}, },
addinvoices_item0List() { addinvoicesitem1List() {
let item = {
materialId: undefined,
quantity: undefined,
unitPrice: undefined,
amount: undefined,
taxRate: undefined,
taxAmount: undefined,
amountNotTax: undefined,
remark: undefined,
}
this.dataForm.invoicesitem1List.push(item)
},
delinvoicesitem1List(index) {
this.dataForm.invoicesitem1List.splice(index, 1);
},
addinvoicesitem0List() {
let item = { let item = {
materialName: undefined,
invoiceCode: undefined, invoiceCode: undefined,
invoiceNo: undefined, invoiceNo: undefined,
invoiceQuantity: undefined,
invoiceAmount: undefined,
taxRate: undefined,
taxAmount: undefined,
amountNotTax: undefined,
invoiceStatus: undefined, invoiceStatus: undefined,
creatorUserName: undefined, creatorUserName: undefined,
invoicingDate: undefined invoicingDate: undefined,
} }
this.dataForm.invoices_item0List.push(item) this.dataForm.invoicesitem0List.push(item)
}, },
delinvoices_item0List(index) { delinvoicesitem0List(index) {
this.dataForm.invoices_item0List.splice(index, 1) this.dataForm.invoicesitem0List.splice(index, 1);
}, },
dataList() { dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm)) var _data = JSON.parse(JSON.stringify(this.dataForm));
for (let i = 0; i < _data.invoices_item0List.length; i++) { for (let i = 0; i < _data.invoicesitem1List.length; i++) {
var _list = _data.invoices_item0List[i] var _list = _data.invoicesitem1List[i];
}
for (let i = 0; i < _data.invoicesitem0List.length; i++) {
var _list = _data.invoicesitem0List[i];
} }
return _data return _data;
}, },
dataInfo(dataAll) { dataInfo(dataAll) {
let _dataAll = dataAll let _dataAll = dataAll
for (let i = 0; i < _dataAll.invoices_item0List.length; i++) { for (let i = 0; i < _dataAll.invoicesitem1List.length; i++) {
var _list = _dataAll.invoices_item0List[i] var _list = _dataAll.invoicesitem1List[i];
}
for (let i = 0; i < _dataAll.invoicesitem0List.length; i++) {
var _list = _dataAll.invoicesitem0List[i];
} }
this.dataForm = _dataAll this.dataForm = _dataAll
} },
} },
} }
</script> </script>

@ -6,7 +6,7 @@
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="单据编号"> <el-form-item label="单据编号">
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input> <el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -20,120 +20,92 @@
<div class="JNPF-common-layout-main JNPF-flex-main"> <div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head"> <div class="JNPF-common-head">
<div> <div>
<!-- <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">--> <el-button type="text" icon="el-icon-plus" @click="addOrUpdateHandle()">
<!-- </el-button>-->
<el-button type="text" icon="el-icon-download" @click="">编辑
</el-button> </el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()"> <el-button type="text" icon="el-icon-download" @click="exportData()">
</el-button>
<el-button type="text" icon="el-icon-download" @click="">审核
</el-button> </el-button>
<el-button type="text" icon="el-icon-download" @click="">弃审 <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">
</el-button>
<el-button type="text" icon="el-icon-download" @click="">提交
</el-button> </el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top"> <el-tooltip effect="dark" content="刷新" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" <el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="reset()" />
@click="reset()"/>
</el-tooltip> </el-tooltip>
<screenfull isContainer/> <screenfull isContainer />
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false" <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
@selection-change="handleSelectionChange" border> @selection-change="handleSelectionChange" border>
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" /> <el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
<el-table-column prop="businessDate" label="业务日期" width="120" align="center" fixed="left" sortable <el-table-column prop="documentNo" label="单据编号" fixed="left" width="200" align="center" sortable="custom" />
/> <el-table-column prop="businessDate" label="业务日期" fixed="left" width="150" align="center" sortable="custom" />
<el-table-column prop="documentNo" label="单据编号" width="200" align="center" fixed="left" sortable <el-table-column prop="purchaseorderId" label="采购订单号" width="150" align="center" sortable="custom" />
/> <el-table-column prop="contractId" label="合同名称" width="150" align="center" sortable="custom" />
<el-table-column prop="purchaseorderId" label="采购订单号" width="200" align="center" fixed="left" sortable <el-table-column prop="supplierId" label="供应商" width="150" align="center" sortable="custom" />
/> <el-table-column prop="amount" label="金额" width="150" align="center" sortable="custom" />
<el-table-column prop="amount" label="金额" width="150" align="center" sortable <el-table-column prop="quantity" label="结算重量" width="150" align="center" sortable="custom" />
/> <el-table-column label="发票类型" width="150" prop="invoiceType" align="center" sortable="custom">
<el-table-column prop="quantity" label="数量" width="120" align="center" sortable
/>
<el-table-column label="币别" width="80" sortable prop="currency" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }} {{ scope.row.invoiceType | dynamicText(invoiceTypeOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="invoiceAmount" label="发票金额" width="150" align="center" sortable <el-table-column label="币别 " width="150" prop="currency" align="center" sortable="custom">
/>
<el-table-column prop="invoiceQuantity" label="发票数量" width="120" align="center" sortable
/>
<el-table-column label="发票类型" width="120" prop="invoiceType" algin="center" sortable
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.invoiceType | dynamicText(invoiceTypeOptions) }} {{ scope.row.currency | dynamicText(currencyOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="contractId" label="合同名称" width="120" align="center" sortable <el-table-column prop="invoiceAmount" label="发票金额" width="150" align="center" sortable="custom" />
/> <el-table-column prop="invoiceQuantity" label="发票数量" width="150" align="center" sortable="custom" />
<el-table-column prop="supplierId" label="供应商" width="200" align="center" sortable <el-table-column label="单据状态" width="150" prop="status"sortable="custom" align="center" >
/>
<el-table-column label="单据状态" width="120" sortable prop="status" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.status | dynamicText(statusOptions) }} {{ scope.row.status | dynamicText(statusOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注" width="150" align="center" sortable="custom" />
<el-table-column prop="creatorUserName" label="制单人" width="120" align="center" sortable <el-table-column label="操作" fixed="right" width="150" align="center" >
/>
<el-table-column label="操作" fixed="right" align="center"
width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <el-button type="text" @click="addOrUpdateHandle(scope.row)">
@click="addOrUpdateHandle(scope.row.id)">编辑
</el-button>
<!-- <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">-->
<!-- </el-button>-->
<!-- <el-button type="text"-->
<!-- @click="goDetail(scope.row.id)">详情-->
<!-- </el-button>-->
<el-button type="text"
@click="">撤回申请
</el-button> </el-button>
<el-button type="text" <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
@click="">审核
</el-button> </el-button>
<el-button type="text" <el-button type="text" @click="goDetail(scope.row.id)">
@click="">弃审
</el-button>
<el-button type="text"
@click="">提交
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData"/> @pagination="initData" />
</div> </div>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/> <JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/> <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/> <Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
</div> </div>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './Form' import JNPFForm from './Form'
import ExportBox from './ExportBox' import ExportBox from './ExportBox'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import Detail from './Detail' import Detail from './Detail'
export default { export default {
components: { JNPFForm, ExportBox, Detail }, components: {
JNPFForm,
ExportBox,
Detail
},
data() { data() {
return { return {
detailVisible: false, detailVisible: false,
query: { query: {
documentNo: undefined documentNo: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -142,42 +114,114 @@
}, },
list: [], list: [],
listLoading: true, listLoading: true,
multipleSelection: [], total: 0, multipleSelection: [],
total: 0,
listQuery: { listQuery: {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: 'desc', sort: "desc",
sidx: '' sidx: "",
}, },
formVisible: false, formVisible: false,
exportBoxVisible: false, exportBoxVisible: false,
columnList: [ columnList: [{
{ prop: 'businessDate', label: '业务日期' }, prop: 'documentNo',
{ prop: 'documentNo', label: '单据编号' }, label: '单据编号'
{ prop: 'amount', label: '金额' }, },
{ prop: 'quantity', label: '数量' }, {
{ prop: 'currency', label: '币别 ' }, prop: 'businessDate',
{ prop: 'invoiceAmount', label: '发票金额' }, label: '业务日期'
{ prop: 'invoiceQuantity', label: '发票数量' }, },
{ prop: 'invoiceType', label: '发票类型' }, {
{ prop: 'status', label: '单据状态' }, prop: 'amount',
{ prop: 'creatorUserName', label: '制单人' } label: '金额'
},
{
prop: 'quantity',
label: '数量'
},
{
prop: 'invoiceType',
label: '发票类型'
},
{
prop: 'currency',
label: '币别 '
},
{
prop: 'remark',
label: '备注'
},
{
prop: 'status',
label: '单据状态'
},
{
prop: 'invoiceAmount',
label: '发票金额'
},
{
prop: 'invoiceQuantity',
label: '发票数量'
},
{
prop: 'purchaseorderId',
label: '采购订单号'
},
{
prop: 'contractId',
label: '合同名称'
},
{
prop: 'supplierId',
label: '供应商'
},
], ],
invoiceTypeOptions: [{ 'fullName': '普通增值税发票', 'id': '1' }, { invoiceTypeOptions: [{
'fullName': '专用增值税发票', "fullName": "普通增值税发票",
'id': '2' "id": "1"
}, { 'fullName': '增值税电子普通发票', 'id': '3' }, { 'fullName': '增值税电子发票', 'id': '4' }], }, {
invoiceTypeProps: { 'label': 'fullName', 'value': 'id' }, "fullName": "专用增值税发票",
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, { "id": "2"
'fullName': '英镑', }, {
'id': '2' "fullName": "增值税电子普通发票",
"id": "3"
}, {
"fullName": "增值税电子发票",
"id": "4"
}],
invoiceTypeProps: {
"label": "fullName",
"value": "id"
},
currencyOptions: [{
"fullName": "人民币",
"id": "0"
}, {
"fullName": "美元",
"id": "1"
}, {
"fullName": "英镑",
"id": "2"
}], }],
currencyProps: { 'label': 'fullName', 'value': 'id' }, currencyProps: {
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, { "label": "fullName",
'fullName': '已审批', "value": "id"
'id': '2' },
statusOptions: [{
"fullName": "已保存",
"id": "0"
}, {
"fullName": "审批中",
"id": "1"
}, {
"fullName": "已审批",
"id": "2"
}], }],
statusProps: { 'label': 'fullName', 'value': 'id' } statusProps: {
"label": "fullName",
"value": "id"
},
} }
}, },
computed: { computed: {
@ -195,32 +239,30 @@
this.$refs.Detail.init(id) this.$refs.Detail.init(id)
}) })
}, },
sortChange({ column, prop, order }) { sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc' this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop this.listQuery.sidx = !order ? '' : prop
this.initData() this.initData()
}, },
initData() { initData() {
this.listLoading = true this.listLoading = true;
let _query = { let _query = {
...this.listQuery, ...this.listQuery,
...this.query, ...this.query,
menuId: this.menuId menuId: this.menuId
} };
request({ request({
url: `/api/invoices/Invoices/getList`, url: `/api/invoices/Invoices/getList`,
method: 'post', method: 'post',
data: _query data: _query
}).then(res => { }).then(res => {
var _list = [] var _list = [];
for (let i = 0; i < res.data.list.length; i++) { for (let i = 0; i < res.data.list.length; i++) {
let _data = res.data.list[i];
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0,
10) : '';
res.data.list[i].businessDate = res.data.list[i].businessDate ? res.data.list[i].businessDate
.substring(0, 10) : '';
let _data = res.data.list[i]
_list.push(_data) _list.push(_data)
} }
this.list = _list this.list = _list
@ -243,10 +285,9 @@
onClose: () => { onClose: () => {
this.initData() this.initData()
} }
}) });
}) })
}).catch(() => { }).catch(() => {});
})
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
const res = val.map(item => item.id) const res = val.map(item => item.id)
@ -257,7 +298,7 @@
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请选择一条数据', message: '请选择一条数据',
duration: 1500 duration: 1500,
}) })
return return
} }
@ -275,12 +316,23 @@
onClose: () => { onClose: () => {
this.initData() this.initData()
} }
}) });
}) })
}).catch(() => { }).catch(() => {})
})
}, },
addOrUpdateHandle(id, isDetail) { addOrUpdateHandle(row, isDetail) {
var id = undefined;
if(row){
id = row.id;
if(row.status != '0'){
this.$message({
type: 'error',
message: '审批中或已审批无法编辑',
duration: 1500,
});
return
}
}
this.formVisible = true this.formVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail) this.$refs.JNPFForm.init(id, isDetail)
@ -293,7 +345,12 @@
}) })
}, },
download(data) { download(data) {
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId } let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({ request({
url: `/api/invoices/Invoices/Actions/Export`, url: `/api/invoices/Invoices/Actions/Export`,
method: 'GET', method: 'GET',
@ -309,8 +366,8 @@
this.listQuery = { this.listQuery = {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: 'desc', sort: "desc",
sidx: '' sidx: "",
} }
this.initData() this.initData()
}, },

@ -11,13 +11,13 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <!-- <el-col :span="8">
<el-form-item label="供应商" required prop="suppliername"> <el-form-item label="供应商" required prop="suppliername">
<el-input v-model="dataForm.suppliername" placeholder="请输入付款账户" clearable :style='{"width":"100%"}'> <el-input v-model="dataForm.suppliername" placeholder="请输入付款账户" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="8"> <el-col :span="8">
<el-form-item label="付款类型" prop="paymenttype"> <el-form-item label="付款类型" prop="paymenttype">
<el-select v-model="dataForm.paymenttype" placeholder="请选择付款类型" clearable :style='{"width":"100%"}'> <el-select v-model="dataForm.paymenttype" placeholder="请选择付款类型" clearable :style='{"width":"100%"}'>
@ -128,81 +128,75 @@
</div> </div>
<el-table :data="dataForm.payment_item0List" size='mini' show-summary :summary-method="getSummaries" > <el-table :data="dataForm.payment_item0List" size='mini' show-summary :summary-method="getSummaries" >
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="amount" label="付款金额" align="center" > <el-table-column prop="amount" width="150" label="付款金额" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="creatorUserId" label="申请金额">--> <el-table-column prop="requestAmount" width="150" label="申请金额">
<!-- <template slot-scope="scope">--> <template slot-scope="scope">
<!-- <el-input v-model="scope.row.creatorUserId"--> <el-input v-model="scope.row.requestAmount" placeholder="请输入" clearable
<!-- placeholder="请输入" clearable :style='{"width":"100%"}'>--> :style='{"width":"100%"}' readonly>
<!-- </el-input>--> </el-input>
<!-- </template>--> </template>
<!-- </el-table-column>--> </el-table-column>
<!-- <el-table-column prop="creatorUserName" label="订单金额">--> <el-table-column prop="allAmount" width="150" label="订单金额">
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.creatorUserName"-->
<!-- placeholder="请输入" clearable :style='{"width":"100%"}'>-->
<!-- </el-input>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="lastModifyUserId" label="已付金额" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.payPrice" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="scope.row.allAmount" placeholder="请输入" clearable
:style='{"width":"100%"}' readonly>
</el-input> </el-input>
</template> </template>
</el-table-column> --> </el-table-column>
<el-table-column prop="payPrice" label="已付金额" align="center"> <el-table-column prop="payPrice" width="150" label="已付金额" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.payPrice" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="scope.row.payPrice" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="documentNo" label="订单编号" align="center" > <el-table-column prop="documentNo" width="150" label="订单编号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.documentNo" placeholder="请输入" clearable <el-input v-model="scope.row.documentNo" placeholder="请输入" clearable
:style='{"width":"100%"}'> :style='{"width":"100%"}' readonly>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lastModifyTime" label="合同编码" align="center" > <el-table-column prop="contractNo" width="150" label="合同编码" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.contractCode" placeholder="请输入" clearable <el-input v-model="scope.row.contractNo" placeholder="请输入" clearable
:style='{"width":"100%"}'> :style='{"width":"100%"}' readonly>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="num" label="重量" align="center" > <el-table-column prop="num" width="150" label="结算重量" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.num" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="scope.row.num" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="advanceAmount" label="垫资金额" align="center" > <el-table-column prop="advanceAmount" width="150" label="垫资金额" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.advanceAmount" placeholder="请输入" clearable <el-input v-model="scope.row.advanceAmount" placeholder="请输入" clearable
:style='{"width":"100%"}'> :style='{"width":"100%"}' readonly>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="rate" label="税额" align="center" > <el-table-column prop="rate" width="150" label="税额" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.rate" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="scope.row.rate" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="notAmount" label="不含税金额" align="center" > <el-table-column prop="notAmount" width="150" label="不含税金额" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.notAmount" placeholder="请输入" clearable :style='{"width":"100%"}'> <el-input v-model="scope.row.notAmount" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="creatorTime" label="业务日期" align="center" width="160" > <el-table-column prop="creatorTime" label="业务日期" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.creatorTime" placeholder="请选择" clearable <el-date-picker v-model="scope.row.creatorTime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp"> :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" readonly>
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
@ -341,6 +335,7 @@
dataForm: { dataForm: {
deep: true, deep: true,
handler: function() { handler: function() {
this.popupSelect() this.popupSelect()
} }
} }

@ -26,11 +26,7 @@
</el-button> </el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()"> <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">
</el-button> </el-button>
<el-button type="text" icon="el-icon-check" @click="exportData()"> <el-button type="text" icon="el-icon-check" @click="submitprice()">
</el-button>
<el-button type="text" icon="el-icon-close" @click="exportData()">
</el-button>
<el-button type="text" icon="el-icon-check" @click="exportData()">
</el-button> </el-button>
<el-button type="text" icon="el-icon-check" @click="confirmprice()"> <el-button type="text" icon="el-icon-check" @click="confirmprice()">
</el-button> </el-button>
@ -47,7 +43,7 @@
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" /> <el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
<el-table-column prop="paymentno" label="来源单号" fixed="left" sortable width="200" align="center" /> <el-table-column prop="paymentno" label="来源单号" fixed="left" sortable width="200" align="center" />
<el-table-column prop="documentno" label="单据编号" fixed="left" sortable width="200" align="center" /> <el-table-column prop="documentno" label="单据编号" fixed="left" sortable width="200" align="center" />
<el-table-column prop="suppliername" label="供应商" fixed="left" sortable width="150" align="center" /> <!-- <el-table-column prop="suppliername" label="供应商" fixed="left" sortable width="150" align="center" /> -->
<el-table-column label="币别 " width="80" prop="currency" sortable align="center" > <el-table-column label="币别 " width="80" prop="currency" sortable align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }} {{ scope.row.currency | dynamicText(currencyOptions) }}
@ -74,16 +70,12 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="150" align="center" > <el-table-column label="操作" fixed="right" width="150" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)"> <el-button v-if="scope.row.status == 0" type="text" @click="addOrUpdateHandle(scope.row.id)">
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)"> <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button> </el-button>
<el-button type="text" @click="goDetail(scope.row.id)"> <el-button type="text" @click="goDetail(scope.row.id)">
</el-button> </el-button>
<el-button type="text" @click="">撤回申请</el-button>
<el-button type="text" @click="">审核</el-button>
<el-button type="text" @click="">弃审</el-button>
<el-button type="text" @click="">提交</el-button>
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </JNPF-table>
@ -129,6 +121,7 @@
list: [], list: [],
listLoading: true, listLoading: true,
multipleSelection: [], multipleSelection: [],
multipleSelectionItem: [],
total: 0, total: 0,
listQuery: { listQuery: {
currentPage: 1, currentPage: 1,
@ -238,14 +231,11 @@
"fullName": "已保存", "fullName": "已保存",
"id": "0" "id": "0"
}, { }, {
"fullName": "审批中", "fullName": "已提交",
"id": "1" "id": "1"
}, { }, {
"fullName": "已审批", "fullName": "已认款",
"id": "2" "id": "2"
}, {
"fullName": "已付款",
"id": "3"
}], }],
statusProps: { statusProps: {
"label": "fullName", "label": "fullName",
@ -319,6 +309,7 @@
}).catch(() => {}); }).catch(() => {});
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelectionItem = val
const res = val.map(item => item.id) const res = val.map(item => item.id)
this.multipleSelection = res this.multipleSelection = res
}, },
@ -349,36 +340,43 @@
}) })
}).catch(() => {}) }).catch(() => {})
}, },
confirmprice() { submitprice(){
if (!this.multipleSelection.length) { if (!this.multipleSelectionItem.length || this.multipleSelectionItem.length > 1) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
if(this.multipleSelectionItem[0].status == 1){
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请选择一条数据', message: '已提交,无需再次提交',
duration: 1500, duration: 1500,
}) })
return return
} }
let id = this.multipleSelection.join() if(this.multipleSelectionItem[0].status == 2){
if (this.multipleSelection.length === 1) { this.$message({
let info = {} type: 'error',
info = this.list.find(function(info) { message: '已认款,无需再次提交',
return info.id == id duration: 1500,
}) })
if (info.status != 2) { return
this.$message({ }
type: 'error', if(this.multipleSelectionItem[0].paymentamount <= 0){
message: '审核中,请先通过审核', this.$message({
duration: 1500 type: 'error',
}) message: '请先输入付款金额',
return duration: 1500,
} })
return
}
let param = {}; let param = {};
param = this.list.find(function(param) { param.id= this.multipleSelectionItem[0].id;
debugger
return param.id == id;
})
request({ request({
url: `/api/payment/Payment/confirmprice`, url: `/api/payment/Payment/submitprice`,
method: 'POST', method: 'POST',
data: param data: param
}).then(res => { }).then(res => {
@ -390,14 +388,55 @@
} }
}); });
}) })
},
confirmprice() {
if (!this.multipleSelectionItem.length || this.multipleSelectionItem.length > 1) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
} }
if (this.multipleSelection.length > 1) { if(this.multipleSelectionItem[0].status == 0){
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请选择单条数据', message: '付款提交中',
duration: 1500 duration: 1500,
}) })
return
}
if(this.multipleSelectionItem[0].status == 2){
this.$message({
type: 'error',
message: '已认款',
duration: 1500,
})
return
}
if(this.multipleSelectionItem[0].paymentamount <= 0){
this.$message({
type: 'error',
message: '请先输入付款金额',
duration: 1500,
})
return
} }
let param = {};
param.id= this.multipleSelectionItem[0].id;
request({
url: `/api/payment/Payment/confirmprice`,
method: 'POST',
data: param
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}, },
addOrUpdateHandle(id, isDetail) { addOrUpdateHandle(id, isDetail) {
this.formVisible = true this.formVisible = true

@ -1,448 +1,504 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" <div>
:close-on-click-modal="false" append-to-body <el-row :gutter="15">
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll <el-form ref="elForm" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right"
width="1500px"> :disabled="setting.readonly">
<el-row :gutter="15" class=""> <template v-if="!loading && formOperates">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right"> <el-col :span="8" v-if="judgeShow('documentNo')">
<template v-if="!loading"> <el-form-item label="单据编号" prop="documentNo">
<el-col :span="8"> <el-input :disabled="judgeWrite('documentNo')" v-model="dataForm.documentNo" placeholder="系统自动生成"
<el-form-item label="单据编号" readonly>
prop="documentNo">
<el-input v-model="dataForm.documentNo"
placeholder="系统自动生成" readonly :disabled="true">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="8">-->
<!-- <el-form-item label="申请时间"--> <el-col :span="8" v-if="judgeShow('purchaseId')">
<!-- prop="businessDate">--> <el-form-item label="采购订单" prop="purchaseId">
<!-- <el-date-picker v-model="dataForm.businessDate"--> <popupSelect :disabled="judgeWrite('purchaseId')" v-model="dataForm.purchaseId" placeholder="请选择"
<!-- placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime"--> clearable field="purchaseId" interfaceId="389673535976550149" :columnOptions="purchaseIdcolumnOptions"
<!-- format="yyyy-MM-dd HH:mm:ss" value-format="timestamp">--> propsValue="id" relationField="document_no" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20">
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="8">
<el-form-item label="供应商名称"
prop="supplierName">
<popupSelect v-model="dataForm.supplierName"
placeholder="请选择供应商名称" clearable field="supplierName" interfaceId="393307526961100037"
:columnOptions="supplierNamecolumnOptions" propsValue="supplier_name"
relationField="supplier_name" popupType="dialog"
popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20" @change="popupSelectourceNo">
>
</popupSelect> </popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="付款类型"
prop="paymentType">
<el-select v-model="dataForm.paymentType"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in paymentTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select> <el-col :span="8" v-if="judgeShow('contractId')">
<el-form-item label="合同" prop="contractId">
<popupSelect :disabled="judgeWrite('contractId')" v-model="dataForm.contractId" placeholder="请选择"
clearable field="contractId" interfaceId="389673903103979269" :columnOptions="contractIdcolumnOptions"
propsValue="id" relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20">
</popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="申请金额"
prop="ramount">
<el-input v-model="dataForm.ramount"
placeholder="请输入" readonly clearable :style='{"width":"100%"}' @input="inputChange()" :disabled="true">
</el-input> <el-col :span="8" v-if="judgeShow('supplierId')">
<el-form-item label="供应商" prop="supplierId">
<popupSelect :disabled="judgeWrite('supplierId')" v-model="dataForm.supplierId" placeholder="请选择"
clearable field="supplierId" interfaceId="389674191453990661" :columnOptions="supplierIdcolumnOptions"
propsValue="id" relationField="supplier_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('paymentType')">
<el-form-item label="付款类型" prop="paymentType">
<el-select :disabled="judgeWrite('paymentType')" v-model="dataForm.paymentType" placeholder="请选择"
clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in paymentTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="应付日期" <el-col :span="8" v-if="judgeShow('businessDate')">
prop="dueDate"> <el-form-item label="业务日期" prop="businessDate">
<el-date-picker v-model="dataForm.dueDate" <el-date-picker :disabled="judgeWrite('businessDate')" v-model="dataForm.businessDate" placeholder="请选择"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp">
value-format="timestamp">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="币别 " <el-col :span="8" v-if="judgeShow('currency')">
prop="currency"> <el-form-item label="币别" prop="currency">
<el-select v-model="dataForm.currency" <el-select :disabled="judgeWrite('currency')" v-model="dataForm.currency" placeholder="请选择" clearable
placeholder="请选择" clearable :style='{"width":"100%"}'> :style='{"width":"100%"}'>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" <el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option> :disabled="item.disabled"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="收款账户" <el-col :span="8" v-if="judgeShow('settlementType')">
prop="collectionAccount"> <el-form-item label="结算类型" prop="settlementType">
<el-input v-model="dataForm.collectionAccount" <el-select :disabled="judgeWrite('settlementType')" v-model="dataForm.settlementType" placeholder="请选择"
placeholder="请输入" clearable :style='{"width":"100%"}'> clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('ramount')">
<el-form-item label="申请金额" prop="ramount">
<el-input-number :disabled="judgeWrite('ramount')" v-model="dataForm.ramount" placeholder="数字文本" :step="1"
:precision="6">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('paymentAmount')">
<el-form-item label="付款金额" prop="paymentAmount">
<el-input-number :disabled="judgeWrite('paymentAmount')" v-model="dataForm.paymentAmount"
placeholder="数字文本" :step="1" :precision="6">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('unpaymentAmount')">
<el-form-item label="未付款金额" prop="unpaymentAmount">
<el-input-number :disabled="judgeWrite('unpaymentAmount')" v-model="dataForm.unpaymentAmount"
placeholder="数字文本" :step="1" :precision="6">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('collectionAccount')">
<el-form-item label="收款账户" prop="collectionAccount">
<el-input :disabled="judgeWrite('collectionAccount')" v-model="dataForm.collectionAccount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="收款银行" <el-col :span="8" v-if="judgeShow('colectionBank')">
prop="colectionBank"> <el-form-item label="收款银行" prop="colectionBank">
<el-input v-model="dataForm.colectionBank" <el-input :disabled="judgeWrite('colectionBank')" v-model="dataForm.colectionBank" placeholder="请输入"
placeholder="请输入" clearable :style='{"width":"100%"}'> clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="结算类型" <el-col :span="8" v-if="judgeShow('dueDate')">
prop="settlementType"> <el-form-item label="应付日期" prop="dueDate">
<el-select v-model="dataForm.settlementType" <el-date-picker :disabled="judgeWrite('dueDate')" v-model="dataForm.dueDate" placeholder="请选择" clearable
placeholder="请选择" clearable :style='{"width":"100%"}'> :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp">
<el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option> </el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" v-if="judgeShow('isPay')">
<el-form-item label="是否付款" prop="isPay">
<el-select :disabled="judgeWrite('isPay')" v-model="dataForm.isPay" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in isPayOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="备注" <el-col :span="8" v-if="judgeShow('status')">
prop="remark"> <el-form-item label="单据状态" prop="status">
<el-input v-model="dataForm.remark" <el-select :disabled="judgeWrite('status')" v-model="dataForm.status" placeholder="请选择" clearable
placeholder="请输入" clearable :style='{"width":"100%"}'> :style='{"width":"100%"}'>
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="16" v-if="judgeShow('remark')">
<el-form-item label="备注" prop="remark">
<el-input :disabled="judgeWrite('remark')" v-model="dataForm.remark" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="8">-->
<!-- <el-form-item label="付款金额"--> <el-col :span="24" v-if="judgeShow('paymentdocitem0List') && formOperates">
<!-- prop="paymentAmount">--> <el-form-item label-width="0">
<!-- <el-input v-model="dataForm.paymentAmount"--> <div class="JNPF-common-title">
<!-- placeholder="请输入" clearable :style='{"width":"100%"}'>--> <h2></h2>
</div>
<!-- </el-input>--> <el-table :data="dataForm.paymentdocitem0List" size='mini'>
<!-- </el-form-item>--> <el-table-column type="index" width="50" label="序号" align="center" />
<!-- </el-col>--> <el-table-column prop="amount" label="申请金额" v-if="judgeShow('paymentdocitem0List-amount')">
<!-- <el-col :span="8">--> <template slot="header" v-if="judgeRequired('paymentdocitem0List-amount')">
<!-- <el-form-item label="未付款金额"--> <span class="required-sign">*</span>申请金额
<!-- prop="unpaymentAmount">--> </template>
<!-- <el-input v-model="dataForm.unpaymentAmount"--> <template slot-scope="scope">
<!-- placeholder="请输入" clearable :style='{"width":"100%"}'>--> <el-input v-model="scope.row.amount"
:disabled="judgeWrite('paymentdocitem0List') || judgeWrite('paymentdocitem0List-amount')"
<!-- </el-input>--> placeholder="请输入" clearable :style='{"width":"100%"}'>
<!-- </el-form-item>--> </el-input>
<!-- </el-col>--> </template>
<!-- <el-col :span="8">--> </el-table-column>
<!-- <el-form-item label="单据状态 "--> <el-table-column label="操作" width="50" v-if="!setting.readonly && !judgeWrite('paymentdocitem0List')">
<!-- prop="status">--> <template slot-scope="scope">
<!-- <el-select v-model="dataForm.status"--> <el-button size="mini" type="text" class="JNPF-table-delBtn"
<!-- placeholder="请选择" clearable :style='{"width":"100%"}'>--> @click="delpaymentdocitem0List(scope.$index)">删除</el-button>
<!-- <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"--> </template>
<!-- :disabled="item.disabled"></el-option>--> </el-table-column>
</el-table>
<!-- </el-select>--> <div class="table-actions" @click="addpaymentdocitem0List()"
<!-- </el-form-item>--> v-if="!setting.readonly && !judgeWrite('paymentdocitem0List')">
<!-- </el-col>--> <el-button type="text" icon="el-icon-plus">添加</el-button>
<el-col :span="24"> </div>
<el-tabs v-model="activeshpeyb" tab-position="top" class="mb-20"> </el-form-item>
<el-tab-pane label="申请明细">
<el-col :span="24">
<el-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.paymentdoc_item0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center"/>
<el-table-column prop="amount" label="申请金额">
<template slot-scope="scope">
<el-input v-model="scope.row.amount"
placeholder="请输入" clearable @input="inputChange()" :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="creatorUserId" label="订单金额">
<template slot-scope="scope">
<el-input v-model="scope.row.creatorUserId"
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="creatorUserName" label="已付金额">
<template slot-scope="scope">
<el-input v-model="scope.row.creatorUserName"
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="purchaseorderId" label="订单编号">
<template slot-scope="scope">
<popupSelect v-model="scope.row.purchaseorderId"
placeholder="请选择" clearable :field="'purchaseorderId'+scope.$index"
interfaceId="393348986343324485" :bissId="dataForm.supplierName" :excludeFields="excludeFields"
:columnOptions="paymentdoc_item0purchaseorderIdcolumnOptions" propsValue="id"
relationField="document_no" popupType="dialog"
popupWidth="800px" @change="popupSelectorder"
hasPage :pageSize="20">
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="lastModifyUserId" label="合同编号" >
<template slot-scope="scope">
<el-input v-model="scope.row.lastModifyUserId"
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="lastModifyUserName" label="重量" >
<template slot-scope="scope">
<el-input v-model="scope.row.lastModifyUserName"
placeholder="请输入" clearable :style='{"width":"100%"}':disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="deleteMark" label="税率(%)">
<template slot-scope="scope">
<el-input v-model="scope.row.deleteMark"
placeholder="请输入" clearable :style='{"width":"100%"}':disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="departmentId" label="垫资金额">
<template slot-scope="scope">
<el-input v-model="scope.row.departmentId"
placeholder="请输入" clearable :style='{"width":"100%"}':disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="orgnizeId" label="税额">
<template slot-scope="scope">
<el-input v-model="scope.row.orgnizeId"
placeholder="请输入" clearable :style='{"width":"100%"}':disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="deleteUserId" label="不含税金额">
<template slot-scope="scope">
<el-input v-model="scope.row.deleteUserId"
placeholder="请输入" clearable :style='{"width":"100%"}':disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="deleteUserName" label="业务类型">
<template slot-scope="scope">
<el-input v-model="scope.row.deleteUserName"
placeholder="请输入" clearable :style='{"width":"100%"}':disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column prop="creatorTime" label="业务日期">
<template slot-scope="scope">
<el-input v-model="scope.row.creatorTime"
placeholder="请输入" clearable :style='{"width":"100%"}':disabled="true">
</el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delpaymentdoc_item0List(scope.$index)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addpaymentdoc_item0List()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</el-form-item>
</el-col>
</el-tab-pane>
</el-tabs>
</el-col> </el-col>
</template> </template>
</el-form> </el-form>
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
<el-button @click="visible = false"> </el-button> </div>
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import {
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default { export default {
components: {}, components: {},
props: [], props: [],
data() { data() {
return { return {
excludeFields: [],
visible: false, visible: false,
loading: false, loading: false,
isDetail: false, setting: {},
eventType: '',
userBoxVisible: false,
dataForm: { dataForm: {
id: '',
flowId: '',
status: 1,
freeapproveruserid: '',
documentNo: '', documentNo: '',
purchaseId: "",
contractId: "",
supplierId: "",
paymentType: "0",
businessDate: '', businessDate: '',
supplierName: '', currency: "0",
paymentType: '0', settlementType: "0",
ramount: '', ramount: 0,
dueDate: '', paymentAmount: 0,
currency: '0', unpaymentAmount: 0,
collectionAccount: '', collectionAccount: '',
colectionBank: '', colectionBank: '',
settlementType: '0', dueDate: '',
isPay: "0",
status: "0",
remark: '', remark: '',
paymentAmount: '', paymentdocitem0List: [],
unpaymentAmount: '',
status: '',
creatorUserName: '',
creatorTime: '',
lastModifyUserName: '',
lastModifyTime: '',
paymentdoc_item0List: []
}, },
activeshpeyb: '0', tableRequiredData: {},
rules: dataRule: {},
{ purchaseIdcolumnOptions: [{
supplierName: [ "label": "采购订单号",
{ "value": "document_no"
required: true, }, {
message: '请输入供应商', "label": "合同",
trigger: 'blur' "value": "contractName"
} }, {
], "label": "供应商",
dueDate: [ "value": "supplier"
{ }, {
required: true, "label": "金额",
message: '请输入应付日期', "value": "amount"
trigger: 'blur' }, {
} "label": "数量",
], "value": "num"
}, ],
amount: [{ required: true, message: '请输入', trigger: 'blur' }] contractIdcolumnOptions: [{
"label": "合同编码",
}, "value": "contract_code"
supplierNamecolumnOptions: [{ 'label': '供应商名称', 'value': 'supplier_name' }, { }, {
'label': '供应商编码', "label": "合同名称",
'value': 'supplier_code' "value": "contract_name"
}, { 'label': '供应商地点名称', 'value': 'supplier_site_code' }], }, ],
paymentTypeOptions: [{ 'fullName': '贷款', 'id': '0' }, { 'fullName': '物流运费', 'id': '1' }, { supplierIdcolumnOptions: [{
'fullName': '仓储费', "label": "供应商编码",
'id': '2' "value": "supplier_code"
}, { 'fullName': '委外加工费', 'id': '3' }, { 'fullName': '其他费用', 'id': '4' }], }, {
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, { "label": "供应商名称",
'fullName': '英镑', "value": "supplier_name"
'id': '2' }, {
"label": "供应商地点",
"value": "supplier_site_code"
}, ],
paymentTypeOptions: [{
"fullName": "货款",
"id": "0"
}, {
"fullName": "运费",
"id": "1"
}, {
"fullName": "仓储",
"id": "2"
}], }],
settlementTypeOptions: [{ 'fullName': '现金', 'id': '0' }, { 'fullName': '赊购', 'id': '1' }, { currencyOptions: [{
'fullName': '网银', "fullName": "人民币",
'id': '2' "id": "0"
}, { 'fullName': '银企直连', 'id': '3' }, { 'fullName': '银票', 'id': '4' }, { 'fullName': '商票', 'id': '5' }], }, {
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, { "fullName": "美元",
'fullName': '已审批', "id": "1"
'id': '2' }, {
}, { 'fullName': '已付款', 'id': '3' }], "fullName": "英镑",
"id": "2"
paymentdoc_item0purchaseorderIdcolumnOptions: [{ 'label': '单据编号', 'value': 'document_no' }, { }],
'label': '合同编码', settlementTypeOptions: [{
'value': 'contract_code' "fullName": "现金",
}, { 'label': '重量', 'value': 'num' }, { 'label': '税额', 'value': 'rate' }, { "id": "0"
'label': '不含税金额', }, {
'value': 'not_amount' "fullName": "赊购",
}] "id": "1"
}, {
"fullName": "网银",
"id": "2"
}, {
"fullName": "银企直连",
"id": "3"
}, {
"fullName": "银票",
"id": "4"
}, {
"fullName": "商票",
"id": "5"
}],
isPayOptions: [{
"fullName": "否",
"id": "0"
}, {
"fullName": "是",
"id": "1"
}],
statusOptions: [{
"fullName": "已保存",
"id": "0"
}, {
"fullName": "审批中",
"id": "1"
}, {
"fullName": "已审批",
"id": "2"
}, {
"fullName": "已付款",
"id": "3"
}],
} }
}, },
computed: {}, computed: {
watch: {}, formOperates() {
created() { return this.setting.formOperates
}, }
mounted() {
}, },
watch: {},
created() {},
mounted() {},
methods: { methods: {
judgeShow(id) {
inputChange(value){ if (!this.setting.formOperates || !this.setting.formOperates.length) return true
var amount = 0; let arr = this.setting.formOperates.filter(o => o.id === id) || []
for (let i = 0; i < this.dataForm.paymentdoc_item0List.length; i++) { if (!arr.length) return true
amount = amount + parseFloat(this.dataForm.paymentdoc_item0List[i].amount); let item = arr[0]
} return item.read
this.dataForm.ramount = amount;
}, },
popupSelectourceNo(e, d) { judgeWrite(id) {
this.excludeFields = []; if (!this.setting.formOperates || !this.setting.formOperates.length) return false
this.dataForm.paymentdoc_item0List = []; let arr = this.setting.formOperates.filter(o => o.id === id) || []
if (!arr.length) return true
let item = arr[0]
return !item.write
}, },
goBack() {
popupSelectorder(a, b) { this.$emit('refresh')
var excludeFields = [];
var amount = 0;
for (let i = 0; i < this.dataForm.paymentdoc_item0List.length; i++) {
excludeFields.push(this.dataForm.paymentdoc_item0List[i].purchaseorderId);
if (a == this.dataForm.paymentdoc_item0List[i].purchaseorderId) {
this.dataForm.paymentdoc_item0List[i].lastModifyUserId = b.contract_code
this.dataForm.paymentdoc_item0List[i].lastModifyUserName = b.num
this.dataForm.paymentdoc_item0List[i].departmentId = b.advance_amount
this.dataForm.paymentdoc_item0List[i].orgnizeId = b.rate
this.dataForm.paymentdoc_item0List[i].deleteUserId = b.not_amount
}
amount = amount + parseFloat(this.dataForm.paymentdoc_item0List[i].amount);
}
this.dataForm.ramount = amount;
this.excludeFields = excludeFields;
}, },
init(data) {
paymentdoc_item0Exist() { this.dataForm.id = data.id || "";
let isOk = true this.setting = data;
for (let i = 0; i < this.dataForm.paymentdoc_item0List.length; i++) { this.visible = true;
const e = this.dataForm.paymentdoc_item0List[i] this.updateDataRule()
}
return isOk
},
clearData(data) {
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = []
} else if (data[key] instanceof Object) {
this.clearData(data[key])
} else {
data[key] = ''
}
}
},
init(id, isDetail) {
this.dataForm.id = id || 0
this.visible = true
this.isDetail = isDetail || false
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['elForm'].resetFields() this.$refs['elForm'].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
this.loading = true this.loading = true
request({ request({
url: '/api/example/Paymentdoc/' + this.dataForm.id, url: '/api/paymentdoc/Paymentdoc/' + this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
this.loading = false this.loading = false
}) })
} else {
this.clearData(this.dataForm)
} }
this.$emit('setPageLoad')
}) })
this.$store.commit('generator/UPDATE_RELATION_DATA', {}) this.$store.commit('generator/UPDATE_RELATION_DATA', {})
}, },
updateDataRule() {
let newRules = {}
for (let i = 0; i < this.setting.formOperates.length; i++) {
const item = this.setting.formOperates[i]
if (!item.id.includes('-')) {
const newRulesItem = {
required: item.required,
message: item.name + '不能为空',
trigger: item.trigger || 'blur'
}
if (!this.dataRule.hasOwnProperty(item.id)) {
if (item.required) this.$set(newRules, item.id, [newRulesItem])
} else {
let withoutRequiredItem = true
for (let i = 0; i < this.dataRule[item.id].length; i++) {
if (this.dataRule[item.id][i].hasOwnProperty('required')) {
this.dataRule[item.id][i].required = item.required
withoutRequiredItem = false
}
}
if (withoutRequiredItem && item.required) this.dataRule[item.id].push(newRulesItem)
}
} else {
let key = item.id.split('-')[0]
let newId = item.id.split('-')[1]
let newItem = {
...item,
id: newId
}
if (!this.tableRequiredData.hasOwnProperty(key)) {
this.$set(this.tableRequiredData, key, [newItem])
} else {
this.tableRequiredData[key].push(newItem)
}
}
}
this.dataRule = {
...this.dataRule,
...newRules
}
},
exist() {
let isOk = true
for (let key in this.tableRequiredData) {
if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
for (let i = 0; i < this.dataForm[key].length; i++) {
let item = this.dataForm[key][i]
inner: for (let id in item) {
let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
if (!arr.length) continue inner
if (arr[0].required) {
let msg = `${arr[0].name}不能为空`
let boo = true
if (arr[0].dataType === 'array') {
boo = !this.jnpf.isEmptyArray(item[id])
} else {
boo = !this.jnpf.isEmpty(item[id])
}
if (!boo) {
this.$message({
message: msg,
type: 'error',
duration: 1000
})
isOk = false
break
}
}
}
}
}
}
return isOk
},
judgeRequired(id) {
if (!this.formOperates || !this.formOperates.length) return false
let arr = this.formOperates.filter(o => o.id === id) || []
if (!arr.length) return false
let item = arr[0]
return item.required
},
// //
dataFormSubmit() { dataFormSubmit(eventType) {
this.$refs['elForm'].validate((valid) => { this.$refs['elForm'].validate((valid) => {
if (valid) { if (valid) {
if (!this.paymentdoc_item0Exist()) return if (this.exist && !this.exist()) return
this.request() if (eventType === 'audit' || eventType === 'reject') {
this.$emit('eventReceiver', this.dataForm, eventType)
return
}
this.dataForm.status = eventType === 'submit' ? 0 : 1
this.dataForm.flowId = this.setting.flowId
this.eventType = eventType
if (this.eventType === 'submit') {
this.$confirm('您确定要提交当前流程吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.request()
}).catch(() => {});
} else {
this.request()
}
} }
}) })
}, },
@ -450,7 +506,7 @@
var _data = this.dataList() var _data = this.dataList()
if (!this.dataForm.id) { if (!this.dataForm.id) {
request({ request({
url: '/api/example/Paymentdoc', url: '/api/paymentdoc/Paymentdoc',
method: 'post', method: 'post',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -460,13 +516,13 @@
duration: 1000, duration: 1000,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refresh', true) this.$emit('close', true)
} }
}) })
}) })
} else { } else {
request({ request({
url: '/api/example/Paymentdoc/' + this.dataForm.id, url: '/api/paymentdoc/Paymentdoc/' + this.dataForm.id,
method: 'PUT', method: 'PUT',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -476,47 +532,35 @@
duration: 1000, duration: 1000,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refresh', true) this.$emit('close', true)
} }
}) })
}) })
} }
}, },
addpaymentdoc_item0List() { addpaymentdocitem0List() {
let item = { let item = {
amount: undefined, amount: undefined,
creatorUserId: undefined,
creatorUserName: undefined,
purchaseorderId: undefined,
lastModifyUserId: undefined,
lastModifyUserName: undefined,
deleteMark: undefined,
departmentId: undefined,
orgnizeId: undefined,
deleteUserId: undefined,
deleteUserName: undefined,
creatorTime: undefined
} }
this.dataForm.paymentdoc_item0List.push(item) this.dataForm.paymentdocitem0List.push(item)
}, },
delpaymentdoc_item0List(index) { delpaymentdocitem0List(index) {
this.dataForm.paymentdoc_item0List.splice(index, 1) this.dataForm.paymentdocitem0List.splice(index, 1);
}, },
dataList() { dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm)) var _data = JSON.parse(JSON.stringify(this.dataForm));
for (let i = 0; i < _data.paymentdoc_item0List.length; i++) { for (let i = 0; i < _data.paymentdocitem0List.length; i++) {
var _list = _data.paymentdoc_item0List[i] var _list = _data.paymentdocitem0List[i];
} }
return _data return _data;
}, },
dataInfo(dataAll) { dataInfo(dataAll) {
let _dataAll = dataAll let _dataAll = dataAll
for (let i = 0; i < _dataAll.paymentdoc_item0List.length; i++) { for (let i = 0; i < _dataAll.paymentdocitem0List.length; i++) {
var _list = _dataAll.paymentdoc_item0List[i] var _list = _dataAll.paymentdocitem0List[i];
} }
this.dataForm = _dataAll this.dataForm = _dataAll
} },
} },
} }
</script> </script>

@ -1,22 +1,11 @@
<template> <template>
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-center"> <div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16"> <el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="单据编号"> <el-form-item label="单据编号">
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input> <el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单据状态 ">
<el-select v-model="query.status" placeholder="请选择"
clearable>
<el-option v-for="(item, index) in statusOptions" :key="index"
:label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -30,131 +19,107 @@
<div class="JNPF-common-layout-main JNPF-flex-main"> <div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head"> <div class="JNPF-common-head">
<div> <div>
<!-- <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">
<el-button type="text" icon="el-icon-check" @click="addOrUpdateHandle(scope.row.id)"> </el-button> -->
</el-button>
<!-- <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">-->
<!-- </el-button>-->
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">
</el-button>
<!-- <el-button type="text" icon="el-icon-download" @click="exportData()">-->
<!-- </el-button>-->
<el-button type="text" icon="el-icon-check" @click="3">
</el-button>
<el-button type="text" icon="el-icon-close" @click="3">
</el-button>
<el-button type="text" icon="el-icon-check" size="medium" @click="paymentapply()">
</el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top"> <el-tooltip effect="dark" content="刷新" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" <el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="reset()" />
@click="reset()"/>
</el-tooltip> </el-tooltip>
<screenfull isContainer/> <screenfull isContainer />
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false" <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'>
@selection-change="handleSelectionChange" border> <el-table-column prop="documentNo" label="单据编号" width="200" align="center" sortable="custom" />
<el-table-column type="index" width="50" label="序号" fixed="left" align="center"/> <!-- <el-table-column prop="purchaseId" label="采购订单" width="200" align="center" sortable="custom" />
<el-table-column prop="documentNo" label="单据编号" width="200" align="center" sortable fixed="left" <el-table-column prop="contractId" label="合同" width="150" align="center" sortable="custom" />
/> <el-table-column prop="supplierId" label="供应商" width="200" align="center" sortable="custom" /> -->
<el-table-column prop="businessDate" label="申请时间" width="150" align="center" sortable fixed="left" sortable="custom" <el-table-column label="付款类型" width="150" prop="paymentType" algin="center" sortable="custom">
/>
<el-table-column prop="supplierName" label="供应商名称" width="200" align="center" sortable fixed="left"
/>
<el-table-column label="币别" width="120" sortable prop="currency" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }} {{ scope.row.paymentType | dynamicText(paymentTypeOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="businessDate" label="业务日期" width="150" align="center" sortable="custom" />
<el-table-column prop="ramount" label="申请金额" width="120" align="center" sortable <el-table-column label="币别" width="150" prop="currency" algin="center" sortable="custom">
/>
<el-table-column prop="paymentAmount" label="付款金额" width="120" align="center"sortable
/>
<el-table-column prop="unpaymentAmount" label="未付款金额" width="120" align="center"sortable
/>
<el-table-column prop="dueDate" label="应付日期" width="120" align="center"sortable sortable="custom"
/>
<el-table-column prop="collectionAccount" label="收款账户" width="120" align="center"sortable
/>
<el-table-column prop="colectionBank" label="收款银行" width="120" align="center"sortable
/>
<el-table-column label="付款类型" width="120" sortable prop="paymentType" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.paymentType | dynamicText(paymentTypeOptions) }} {{ scope.row.currency | dynamicText(currencyOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结算类型" width="150" prop="settlementType" algin="center" sortable="custom">
<el-table-column label="结算类型" width="120" sortable prop="settlementType" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.settlementType | dynamicText(settlementTypeOptions) }} {{ scope.row.settlementType | dynamicText(settlementTypeOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="ramount" label="申请金额" width="150" align="center" sortable="custom" />
<el-table-column label="单据状态" width="120" sortable prop="status" align="center" > <el-table-column prop="paymentAmount" label="付款金额" width="150" align="center" sortable="custom" />
<el-table-column prop="unpaymentAmount" label="未付款金额" width="150" align="center" sortable="custom" />
<el-table-column prop="collectionAccount" label="收款账户" width="150" align="center" sortable="custom" />
<el-table-column prop="colectionBank" label="收款银行" width="150" align="center" sortable="custom" />
<el-table-column prop="dueDate" label="应付日期" width="150" align="center" sortable="custom" />
<el-table-column label="是否付款" width="150" prop="isPay" algin="center" sortable="custom">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.status | dynamicText(statusOptions) }} {{ scope.row.isPay | dynamicText(isPayOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="creatorUserName" label="制单人" width="100" align="center"sortable <el-table-column prop="remark" label="备注" width="150" align="center" sortable="custom" />
/> <el-table-column prop="flowState" label="状态" width="100">
<el-table-column label="操作" fixed="right" align="center"
width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)"> <el-tag v-if="scope.row.flowState==1"></el-tag>
</el-button> <el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
<el-button type="text" <el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag>
@click="1">撤回申请 <el-tag type="info" v-else-if="scope.row.flowState==4">流程撤回</el-tag>
</el-button> <el-tag type="info" v-else-if="scope.row.flowState==5">审核终止</el-tag>
<el-button type="text" <el-tag type="warning" v-else></el-tag>
@click="1">审核 </template>
</el-button> </el-table-column>
<el-button type="text" <el-table-column label="操作" fixed="right" width="100">
@click="1">弃审 <template slot-scope="scope">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="addOrUpdateHandle(scope.row.id)">编辑
</el-button> </el-button>
<el-button type="text" <el-button type="text" class="JNPF-table-delBtn" :disabled="!!scope.row.flowState"
@click="1">提交 @click="handleDel(scope.row.id)">删除
</el-button> </el-button>
<!-- <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">--> <el-button size="mini" type="text" :disabled="!scope.row.flowState"
<!-- </el-button>--> @click="addOrUpdateHandle(scope.row.id,scope.row.flowState)">详情</el-button>
<!-- <el-button type="text"--> <el-button size="mini" type="text" :disabled="!scope.row.flowState"
<!-- @click="goDetail(scope.row.id)">详情--> @click="fukuanHandle(scope.row.id,scope.row.flowState)">付款</el-button>
<!-- </el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData"/> @pagination="initData" />
</div> </div>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/> <FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/> <JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/> <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
</div> </div>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' import {
import JNPFForm from './Form' getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import FlowBox from '@/views/workFlow/components/FlowBox'
import JNPFForm from './paymentForm'
import ExportBox from './ExportBox' import ExportBox from './ExportBox'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import {
import Detail from './Detail' getDataInterfaceRes
} from '@/api/systemData/dataInterface'
export default { export default {
components: { JNPFForm, ExportBox, Detail }, components: {
FlowBox,
JNPFForm,
ExportBox
},
data() { data() {
return { return {
detailVisible: false, formVisible: false,
query: { query: {
documentNo: undefined, documentNo: undefined,
status: undefined
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -163,51 +128,159 @@
}, },
list: [], list: [],
listLoading: true, listLoading: true,
multipleSelection: [], total: 0, total: 0,
listQuery: { listQuery: {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: 'desc', sort: "desc",
sidx: '' sidx: "",
}, },
formVisible: false, flowVisible: false,
exportBoxVisible: false, exportBoxVisible: false,
columnList: [ columnList: [{
{ prop: 'documentNo', label: '单据编号' }, prop: 'documentNo',
{ prop: 'businessDate', label: '申请时间' }, label: '单据编号'
{ prop: 'supplierName', label: '供应商名称' }, },
{ prop: 'currency', label: '币别 ' }, {
{ prop: 'ramount', label: '申请金额' }, prop: 'purchaseId',
{ prop: 'paymentAmount', label: '付款金额' }, label: '采购订单'
{ prop: 'unpaymentAmount', label: '未付款金额' }, },
{ prop: 'dueDate', label: '应付日期' }, {
{ prop: 'collectionAccount', label: '收款账户' }, prop: 'contractId',
{ prop: 'colectionBank', label: '收款银行' }, label: '合同'
{ prop: 'paymentType', label: '付款类型' }, },
{ prop: 'settlementType', label: '结算类型' }, {
{ prop: 'status', label: '单据状态 ' }, prop: 'supplierId',
{ prop: 'creatorUserName', label: '制单人' } label: '供应商'
},
{
prop: 'paymentType',
label: '付款类型'
},
{
prop: 'businessDate',
label: '业务日期'
},
{
prop: 'currency',
label: '币别'
},
{
prop: 'settlementType',
label: '结算类型'
},
{
prop: 'ramount',
label: '申请金额'
},
{
prop: 'paymentAmount',
label: '付款金额'
},
{
prop: 'unpaymentAmount',
label: '未付款金额'
},
{
prop: 'collectionAccount',
label: '收款账户'
},
{
prop: 'colectionBank',
label: '收款银行'
},
{
prop: 'dueDate',
label: '应付日期'
},
{
prop: 'isPay',
label: '是否付款'
},
{
prop: 'remark',
label: '备注'
},
], ],
paymentTypeOptions: [{ 'fullName': '贷款', 'id': '0' }, { 'fullName': '物流运费', 'id': '1' }, { paymentTypeOptions: [{
'fullName': '仓储费', "fullName": "货款",
'id': '2' "id": "0"
}, { 'fullName': '委外加工费', 'id': '3' }, { 'fullName': '其他费用', 'id': '4' }], }, {
paymentTypeProps: { 'label': 'fullName', 'value': 'id' }, "fullName": "运费",
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, { "id": "1"
'fullName': '英镑', }, {
'id': '2' "fullName": "仓储",
"id": "2"
}],
paymentTypeProps: {
"label": "fullName",
"value": "id"
},
currencyOptions: [{
"fullName": "人民币",
"id": "0"
}, {
"fullName": "美元",
"id": "1"
}, {
"fullName": "英镑",
"id": "2"
}],
currencyProps: {
"label": "fullName",
"value": "id"
},
settlementTypeOptions: [{
"fullName": "现金",
"id": "0"
}, {
"fullName": "赊购",
"id": "1"
}, {
"fullName": "网银",
"id": "2"
}, {
"fullName": "银企直连",
"id": "3"
}, {
"fullName": "银票",
"id": "4"
}, {
"fullName": "商票",
"id": "5"
}], }],
currencyProps: { 'label': 'fullName', 'value': 'id' }, settlementTypeProps: {
settlementTypeOptions: [{ 'fullName': '现金', 'id': '0' }, { 'fullName': '赊购', 'id': '1' }, { "label": "fullName",
'fullName': '网银', "value": "id"
'id': '2' },
}, { 'fullName': '银企直连', 'id': '3' }, { 'fullName': '银票', 'id': '4' }, { 'fullName': '商票', 'id': '5' }], isPayOptions: [{
settlementTypeProps: { 'label': 'fullName', 'value': 'id' }, "fullName": "否",
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, { "id": "0"
'fullName': '已审批', }, {
'id': '2' "fullName": "是",
}, { 'fullName': '已付款', 'id': '3' }], "id": "1"
statusProps: { 'label': 'fullName', 'value': 'id' } }],
isPayProps: {
"label": "fullName",
"value": "id"
},
statusOptions: [{
"fullName": "已保存",
"id": "0"
}, {
"fullName": "审批中",
"id": "1"
}, {
"fullName": "已审批",
"id": "2"
}, {
"fullName": "已付款",
"id": "3"
}],
statusProps: {
"label": "fullName",
"value": "id"
},
} }
}, },
computed: { computed: {
@ -219,36 +292,30 @@
this.initData() this.initData()
}, },
methods: { methods: {
goDetail(id) { sortChange({
this.detailVisible = true column,
this.$nextTick(() => { prop,
this.$refs.Detail.init(id) order
}) }) {
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc' this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop this.listQuery.sidx = !order ? '' : prop
this.initData() this.initData()
}, },
initData() { initData() {
this.listLoading = true this.listLoading = true;
let _query = { let _query = {
...this.listQuery, ...this.listQuery,
...this.query, ...this.query,
menuId: this.menuId menuId: this.menuId
} };
request({ request({
url: `/api/example/Paymentdoc/getList`, url: `/api/paymentdoc/Paymentdoc/getList`,
method: 'post', method: 'post',
data: _query data: _query
}).then(res => { }).then(res => {
var _list = [] var _list = [];
for (let i = 0; i < res.data.list.length; i++) { for (let i = 0; i < res.data.list.length; i++) {
res.data.list[i].businessDate = res.data.list[i].businessDate ? res.data.list[i].businessDate.substring(0, let _data = res.data.list[i];
10) : '';
res.data.list[i].dueDate = res.data.list[i].dueDate ? res.data.list[i].dueDate
.substring(0, 10) : '';
let _data = res.data.list[i]
_list.push(_data) _list.push(_data)
} }
this.list = _list this.list = _list
@ -262,7 +329,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/example/Paymentdoc/${id}`, url: `/api/paymentdoc/Paymentdoc/${id}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
@ -271,102 +338,43 @@
onClose: () => { onClose: () => {
this.initData() this.initData()
} }
}) });
}) })
}).catch(() => { }).catch(() => {});
})
},
handleSelectionChange(val) {
const res = val.map(item => item.id)
this.multipleSelection = res
}, },
paymentapply() { fukuanHandle(id, flowState){
if (!this.multipleSelection.length) { if(flowState == 2){
this.$message({ this.formVisible = true
type: 'error', this.$nextTick(() => {
message: '请选择一条数据', request({
duration: 1500 url: '/api/paymentdoc/Paymentdoc/' + id,
}) method: 'get'
return }).then(res => {
} this.$refs.JNPFForm.init(res.data)
let ids = this.multipleSelection.join()
if (this.multipleSelection.length === 1) {
let info = {}
info = this.list.find(function(info) {
return info.id == ids
})
if (info.status != 2) {
this.$message({
type: 'error',
message: '审核中,请先通过审核',
duration: 1500
}) })
return
}
let id = this.multipleSelection.join()
let param = {}
param = this.list.find(function(param) {
return param.id == id
}) })
}else{
debugger
this.$router.push({ path: '/paymentdoc' })
request({
url: `/api/example/Paymentdoc/paymentapplylist`,
method: 'post',
data: param
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
})
})
}
if (this.multipleSelection.length > 1) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请选择单条数据', message: '请耐心等待审批结束',
duration: 1500 duration: 1000
}) });
return
} }
}, },
handleBatchRemoveDel() { addOrUpdateHandle(id, flowState) {
if (!this.multipleSelection.length) { let data = {
this.$message({ id: id || '',
type: 'error', enCode: 'paymentdoc',
message: '请选择一条数据', flowId: '398482034802139205',
duration: 1500 formType: 1,
}) opType: flowState ? 0 : '-1',
return status: flowState
} }
const ids = this.multipleSelection.join() this.flowVisible = true
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/Paymentdoc/batchRemove/${ids}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
})
})
}).catch(() => {
})
},
addOrUpdateHandle(id, isDetail) {
this.formVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail) this.$refs.FlowBox.init(data)
}) })
}, },
exportData() { exportData() {
@ -376,9 +384,14 @@
}) })
}, },
download(data) { download(data) {
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId } let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({ request({
url: `/api/example/Paymentdoc/Actions/Export`, url: `/api/paymentdoc/Paymentdoc/Actions/Export`,
method: 'GET', method: 'GET',
data: query data: query
}).then(res => { }).then(res => {
@ -392,11 +405,15 @@
this.listQuery = { this.listQuery = {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: 'desc', sort: "desc",
sidx: '' sidx: "",
} }
this.initData() this.initData()
}, },
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
refresh(isrRefresh) { refresh(isrRefresh) {
this.formVisible = false this.formVisible = false
if (isrRefresh) this.reset() if (isrRefresh) this.reset()
@ -405,7 +422,13 @@
for (let key in this.query) { for (let key in this.query) {
this.query[key] = undefined this.query[key] = undefined
} }
this.search() this.listQuery = {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
}
this.initData()
} }
} }
} }

@ -0,0 +1,502 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
<template v-if="!loading">
<el-col :span="8">
<el-form-item label="单据编号" prop="documentno">
<el-input v-model="dataForm.documentno" placeholder="系统自动生成" readonly>
</el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item label="供应商" required prop="suppliername">
<el-input v-model="dataForm.suppliername" placeholder="请输入付款账户" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col> -->
<el-col :span="8">
<el-form-item label="付款类型" prop="paymenttype">
<el-select v-model="dataForm.paymenttype" placeholder="请选择付款类型" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in paymenttypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="付款账户" prop="paymentaccount">
<el-input v-model="dataForm.paymentaccount" placeholder="请输入付款账户" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="付款银行" prop="paymentbank">
<el-input v-model="dataForm.paymentbank" placeholder="请输入付款银行" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="付款金额" prop="paymentamount">
<el-input v-model="dataForm.paymentamount" placeholder="请输入付款金额" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收款账户" prop="collectionaccount">
<el-input v-model="dataForm.collectionaccount" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收款银行" prop="collectionbank">
<el-input v-model="dataForm.collectionbank" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请金额" prop="requestedamount">
<el-input v-model="dataForm.requestedamount" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="应付日期" prop="duedate">
<el-date-picker v-model="dataForm.duedate" placeholder="请选择" clearable :style='{"width":"100%"}'
type="date" format="yyyy-MM-dd" value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="币别 " prop="currency">
<el-select v-model="dataForm.currency" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="结算类型" required prop="settlementtype">
<el-select v-model="dataForm.settlementtype" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in settlementtypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="来源单号" prop="paymentno">
<el-input v-model="dataForm.paymentno" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单据状态" prop="status">
<el-select v-model="dataForm.status" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activeivpzpd" tab-position="top" class="mb-20">
<el-tab-pane label="申请明细">
<el-col :span="24">
<el-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.payment_item0List" size='mini' show-summary
:summary-method="getSummaries">
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="amount" width="150" label="付款金额" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="requestAmount" width="150" label="申请金额">
<template slot-scope="scope">
<el-input v-model="scope.row.requestAmount" placeholder="请输入" clearable
:style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="allAmount" width="150" label="订单金额">
<template slot-scope="scope">
<el-input v-model="scope.row.allAmount" placeholder="请输入" clearable
:style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="payPrice" width="150" label="已付金额" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.payPrice" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="documentNo" width="150" label="订单编号" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.documentNo" placeholder="请输入" clearable
:style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="contractNo" width="150" label="合同编码" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.contractNo" placeholder="请输入" clearable
:style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="num" width="150" label="结算重量" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.num" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="advanceAmount" width="150" label="垫资金额" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.advanceAmount" placeholder="请输入" clearable
:style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="rate" width="150" label="税额" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.rate" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="notAmount" width="150" label="不含税金额" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.notAmount" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="creatorTime" label="业务日期" align="center" width="160">
<template slot-scope="scope">
<el-date-picker v-model="scope.row.creatorTime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" readonly>
</el-date-picker>
</template>
</el-table-column>
<el-table-column label="操作" width="50" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delpayment_item0List(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addpayment_item0List()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</el-form-item>
</el-col>
</el-tab-pane>
</el-tabs>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
excludeFields: [],
visible: false,
loading: false,
isDetail: false,
dataForm: {
documentno: '',
suppliername: '',
paymenttype: "0",
paymentaccount: '',
paymentbank: '',
paymentamount: '',
collectionaccount: '',
collectionbank: '',
requestedamount: '',
duedate: '',
currency: "0",
settlementtype: "0",
paymentno: '',
remark: '',
status: "0",
payment_item0List: [],
},
activeivpzpd: '0',
rules: {
suppliername: [],
paymentaccount: [],
paymentamount: [{
required: true,
message: '请输入付款金额',
trigger: 'blur'
},
{
pattern: /^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
},
paymenttypeOptions: [{
"fullName": "贷款",
"id": "0"
}, {
"fullName": "运费",
"id": "1"
}, {
"fullName": "仓储",
"id": "2"
}],
currencyOptions: [{
"fullName": "人民币",
"id": "0"
}, {
"fullName": "美元",
"id": "1"
}, {
"fullName": "英镑",
"id": "2"
}],
settlementtypeOptions: [{
"fullName": "现金",
"id": "0"
}, {
"fullName": "赊购",
"id": "1"
}, {
"fullName": "网银",
"id": "2"
}, {
"fullName": "银企直连",
"id": "3"
}, {
"fullName": "银票",
"id": "4"
}, {
"fullName": "商票",
"id": "5"
}],
statusOptions: [{
"fullName": "已保存",
"id": "0"
}, {
"fullName": "审批中",
"id": "1"
}, {
"fullName": "已审批",
"id": "2"
}, {
"fullName": "已付款",
"id": "3"
}],
}
},
computed: {},
watch: {
dataForm: {
deep: true,
handler: function() {
this.popupSelect()
}
}
},
created() {},
mounted() {},
methods: {
getSummaries(param) {
const {
columns,
data
} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value)) && (index === 1 || index === 2 || index === 5 || index === 6 ||
index === 7 || index === 8)) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
} else {
sums[index] = '';
}
});
return sums;
},
popupSelect() {
let amount = 0
for (let i = 0; i < this.dataForm.payment_item0List.length; i++) {
amount = amount + parseFloat(this.dataForm.payment_item0List[i].amount);
}
parseFloat(this.dataForm.paymentamount = amount)
},
payment_item0Exist() {
let isOk = true;
for (let i = 0; i < this.dataForm.payment_item0List.length; i++) {
const e = this.dataForm.payment_item0List[i];
}
return isOk;
},
clearData(data) {
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(paymentdoc) {
this.dataForm.id = '';
this.visible = true;
this.dataForm.paymenttype = paymentdoc.paymentType
this.dataForm.requestedamount = paymentdoc.ramount
this.dataForm.paymentamount = paymentdoc.ramount
this.dataForm.collectionaccount = paymentdoc.collectionAccount
this.dataForm.collectionbank = paymentdoc.colectionBank
this.dataForm.duedate = paymentdoc.dueDate
this.dataForm.currency = paymentdoc.currency
this.dataForm.settlementtype = paymentdoc.settlementType
this.dataForm.paymentno = paymentdoc.documentNo
paymentdoc.paymentdocitem0List.forEach((item, index) => {
item.requestAmount = item.amount;
item.paymentdocitemId = item.id;
item.id = '';
});
this.dataForm.payment_item0List = paymentdoc.paymentdocitem0List
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (!this.payment_item0Exist()) return
this.request()
}
})
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/payment/Payment',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
} else {
request({
url: '/api/payment/Payment/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
addpayment_item0List() {
let item = {
amount: undefined,
creatorUserId: undefined,
creatorUserName: undefined,
lastModifyUserId: undefined,
lastModifyUserName: undefined,
lastModifyTime: undefined,
deleteUserId: undefined,
deleteTime: undefined,
orgnizeId: undefined,
departmentId: undefined,
creatorTime: undefined,
}
this.dataForm.payment_item0List.push(item)
},
delpayment_item0List(index) {
this.dataForm.payment_item0List.splice(index, 1);
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
for (let i = 0; i < _data.payment_item0List.length; i++) {
var _list = _data.payment_item0List[i];
}
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
for (let i = 0; i < _dataAll.payment_item0List.length; i++) {
var _list = _dataAll.payment_item0List[i];
}
this.dataForm = _dataAll
},
},
}
</script>

@ -2,62 +2,77 @@
<el-dialog title="详情" <el-dialog title="详情"
:close-on-click-modal="false" append-to-body :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px"> width="800px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" > <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading"> <template v-if="!loading">
<el-col :span="24" > <el-col :span="12" >
<el-form-item label="磅单上传" <el-form-item label="物料编码"
prop="poundPictures" > prop="materialCode" >
<JNPF-UploadImg v-model="dataForm.poundPictures" <p>{{dataForm.materialCode}}</p>
disabled
detailed :fileSize="500" sizeUnit="MB" :limit="9" >
</JNPF-UploadImg>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="物料名称" <el-form-item label="物料名称"
prop="materialId" > prop="materialName" >
<p>{{dataForm.materialId}}</p> <p>{{dataForm.materialName}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="销售合同"
prop="salesName" >
<p>{{dataForm.salesName}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="客户名称" <el-form-item label="客户名称"
prop="customerId" > prop="customerName" >
<p>{{dataForm.customerId}}</p> <p>{{dataForm.customerName}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="销售合同" <el-form-item label="是否垫资"
prop="salesId" > prop="advance" >
<p>{{dataForm.salesId}}</p> <p>{{ dataForm.advance | dynamicText(advanceOptions) }} </p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="车牌号" <el-form-item label="销售价格"
prop="vehicleId" > prop="salesPrice" >
<p>{{dataForm.vehicleId}}</p> <p>{{dataForm.salesPrice}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="12" >
<el-form-item label="车辆图片" <el-form-item label="运输方式"
prop="vehiclePictures" > prop="transportType" >
<JNPF-UploadImg v-model="dataForm.vehiclePictures" <p>{{ dataForm.transportType | dynamicText(transportTypeOptions) }} </p>
disabled
detailed :fileSize="500" sizeUnit="MB" :limit="9" >
</JNPF-UploadImg>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="磅单日期" <el-form-item label="运费"
prop="poundDate" > prop="departmentId" >
<p>{{jnpf.dateFormat(dataForm.poundDate)}}</p> <p>{{dataForm.departmentId}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="磅单号" <el-form-item label="车号"
prop="poundlistNo" > prop="licenseNo" >
<p>{{dataForm.poundlistNo}}</p> <p>{{dataForm.licenseNo}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="业务员名称"
prop="businessName" >
<p>{{dataForm.businessName}}</p>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="磅单图片"
prop="poundPictures" >
<JNPF-UploadImg v-model="dataForm.poundPictures"
disabled
detailed :fileSize="500" sizeUnit="MB" :limit="9" >
</JNPF-UploadImg>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
@ -84,58 +99,49 @@
<p>{{dataForm.netWeight}}</p> <p>{{dataForm.netWeight}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="24" >
<el-form-item label="单位" <el-form-item label="备注"
prop="unit" > prop="remark" >
<p>{{ dataForm.unit | dynamicText(unitOptions) }} </p> <p>{{dataForm.remark}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="运输类型"
prop="transportType" >
<p>{{ dataForm.transportType | dynamicText(transportTypeOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="是否垫资"
prop="advance" >
<p>{{ dataForm.advance | dynamicText(advanceOptions) }} </p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="24" >
<el-form-item label="运费" <el-form-item label="司机名称"
prop="transportPrice" > prop="driverName" >
<p>{{dataForm.transportPrice}}</p> <p>{{dataForm.driverName}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="24" >
<el-form-item label="销售价格" <el-form-item label="车辆图片"
prop="salesPrice" > prop="vehiclePictures" >
<p>{{dataForm.salesPrice}}</p> <JNPF-UploadImg v-model="dataForm.vehiclePictures"
disabled
detailed :fileSize="500" sizeUnit="MB" :limit="9" >
</JNPF-UploadImg>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="24" >
<el-form-item label="业务员" <el-form-item label="制单人"
prop="businessId" > prop="creatorusername" >
<p>{{dataForm.businessId}}</p> <p>{{dataForm.creatorusername}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="自然人" <el-form-item label="供应商名称"
prop="naturalId" > prop="supplierName" >
<p>{{dataForm.naturalId}}</p> <p>{{dataForm.supplierName}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="采购合同" <el-form-item label="采购合同"
prop="purchaseId" > prop="purchaseName" >
<p>{{dataForm.purchaseId}}</p> <p>{{dataForm.purchaseName}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="供应商名称" <el-form-item label="单位"
prop="supplierName" > prop="unit" >
<p>{{dataForm.supplierName}}</p> <p>{{ dataForm.unit | dynamicText(unitOptions) }} </p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
@ -175,9 +181,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="备注" <el-form-item label="磅单日期"
prop="remark" > prop="poundDate" >
<p>{{dataForm.remark}}</p> <p>{{jnpf.dateFormat(dataForm.poundDate)}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
</template> </template>
@ -203,38 +209,39 @@
printId: '', printId: '',
dataForm: { dataForm: {
id :'', id :'',
materialCode : "",
materialName : '',
salesName : "",
customerName : '',
advance : "",
salesPrice : '',
transportType : "",
departmentId : 11.225,
licenseNo : "",
businessName : '',
poundPictures : [], poundPictures : [],
materialId : "",
customerId : "",
salesId : "",
vehicleId : "",
vehiclePictures : [],
poundDate : '',
poundlistNo : '',
tareWeight : '', tareWeight : '',
grossWeight : '', grossWeight : '',
buckleWeight : '', buckleWeight : '',
netWeight : '', netWeight : '',
unit : "", remark : '',
transportType : "0", driverName : '',
advance : "0", vehiclePictures : [],
transportPrice : '', creatorusername : '',
salesPrice : '',
businessId : "",
naturalId : "",
purchaseId : "",
supplierName : '', supplierName : '',
purchaseName : "",
unit : "",
settlement : '', settlement : '',
purchasePrice : '', purchasePrice : '',
inputDate : '', inputDate : '',
outputDate : '', outputDate : '',
payDate : '', payDate : '',
paymentDate : '', paymentDate : '',
remark : '', poundDate : '',
}, },
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}], advanceOptions:[{"fullName":"是","id":"1"},{"fullName":"否","id":"0"}],
transportTypeOptions:[{"fullName":"汽运","id":"0"},{"fullName":"船运","id":"1"},{"fullName":"火车","id":"2"}], transportTypeOptions:[{"fullName":"汽运","id":"0"},{"fullName":"船运","id":"1"},{"fullName":"火车","id":"2"}],
advanceOptions:[{"fullName":"否","id":"0"},{"fullName":"","id":"1"}], unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
} }
}, },

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save