采购订单

product
杨世强 2 years ago
parent 7f0cc8e82d
commit e6d3207a4c

@ -0,0 +1,429 @@
package jnpf.purchaseorder.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException;
import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity;
import jnpf.purchaseorder.model.purchaseorder.*;
import jnpf.purchaseorder.model.purchaseorder.PurchaseorderPagination;
import jnpf.purchaseorder.entity.*;
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
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.Cleanup;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jnpf.purchaseorder.entity.PurchaseorderEntity;
import jnpf.purchaseorder.service.PurchaseorderService;
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
import jnpf.purchaseorder.service.Purchaseorder_item0Service;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import jnpf.util.GeneraterSwapUtil;
import java.util.*;
import jnpf.util.file.UploadUtil;
import jnpf.util.enums.FileTypeEnum;
/**
*
* purchaseorder
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Slf4j
@RestController
@Api(tags = "purchaseorder" , value = "purchaseorder")
@RequestMapping("/api/purchaseorder/Purchaseorder")
public class PurchaseorderController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private ConfigValueUtil configValueUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private PurchaseorderService purchaseorderService;
@Autowired
private Purchaseorder_item0Service purchaseorder_item0Service;
/**
*
*
* @param purchaseorderPagination
* @return
*/
@PostMapping("/getList")
public ActionResult list(@RequestBody PurchaseorderPagination purchaseorderPagination)throws IOException{
List<PurchaseorderEntity> list= purchaseorderService.getList(purchaseorderPagination);
//处理id字段转名称若无需转或者为空可删除
for(PurchaseorderEntity entity:list){
entity.setDepartmentId(generaterSwapUtil.comSelectValues(entity.getDepartmentId()));
}
List<PurchaseorderListVO> listVO=JsonUtil.getJsonToList(list,PurchaseorderListVO.class);
for(PurchaseorderListVO purchaseorderVO:listVO){
}
PageListVO vo=new PageListVO();
vo.setList(listVO);
PaginationVO page=JsonUtil.getJsonToBean(purchaseorderPagination,PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param purchaseorderCrForm
* @return
*/
@PostMapping
@Transactional
public ActionResult create(@RequestBody @Valid PurchaseorderCrForm purchaseorderCrForm) throws DataException {
String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get();
PurchaseorderEntity entity = JsonUtil.getJsonToBean(purchaseorderCrForm, PurchaseorderEntity.class);
entity.setId(mainId);
purchaseorderService.save(entity);
List<Purchaseorder_item0Entity> Purchaseorder_item0List = JsonUtil.getJsonToList(purchaseorderCrForm.getPurchaseorder_item0List(),Purchaseorder_item0Entity.class);
for(Purchaseorder_item0Entity entitys : Purchaseorder_item0List){
entitys.setId(RandomUtil.uuId());
entitys.setPurchaseorderId(entity.getId());
purchaseorder_item0Service.save(entitys);
}
return ActionResult.success("创建成功");
}
/**
*
*
* @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);
}
/**
* Excel
*
* @return
*/
@ApiOperation("导出Excel")
@GetMapping("/Actions/Export")
public ActionResult Export(PurchaseorderPaginationExportModel purchaseorderPaginationExportModel) throws IOException {
if (StringUtil.isEmpty(purchaseorderPaginationExportModel.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
PurchaseorderPagination purchaseorderPagination=JsonUtil.getJsonToBean(purchaseorderPaginationExportModel, PurchaseorderPagination.class);
List<PurchaseorderEntity> list= purchaseorderService.getTypeList(purchaseorderPagination,purchaseorderPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除
for(PurchaseorderEntity entity:list){
entity.setDepartmentId(generaterSwapUtil.comSelectValues(entity.getDepartmentId()));
}
List<PurchaseorderListVO> listVO=JsonUtil.getJsonToList(list,PurchaseorderListVO.class);
for(PurchaseorderListVO purchaseorderVO:listVO){
}
//转换为map输出
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss"));
String[]keys=!StringUtil.isEmpty(purchaseorderPaginationExportModel.getSelectKey())?purchaseorderPaginationExportModel.getSelectKey().split(","):new String[0];
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 "suppliername" :
entitys.add(new ExcelExportEntity("供应商名称" ,"suppliername"));
break;
case "contractname" :
entitys.add(new ExcelExportEntity("合同名称" ,"contractname"));
break;
case "creatorusername" :
entitys.add(new ExcelExportEntity("制单人" ,"creatorusername"));
break;
case "departmentId" :
entitys.add(new ExcelExportEntity("采购部门" ,"departmentId"));
break;
case "contractno" :
entitys.add(new ExcelExportEntity("对方合同号" ,"contractno"));
break;
case "num" :
entitys.add(new ExcelExportEntity("数量" ,"num"));
break;
case "amount" :
entitys.add(new ExcelExportEntity("金额" ,"amount"));
break;
case "notamount" :
entitys.add(new ExcelExportEntity("不含税金额" ,"notamount"));
break;
case "currency" :
entitys.add(new ExcelExportEntity("币别 " ,"currency"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "erpno" :
entitys.add(new ExcelExportEntity("ERP订单号" ,"erpno"));
break;
case "payprice" :
entitys.add(new ExcelExportEntity("已付款金额" ,"payprice"));
break;
case "invoicenum" :
entitys.add(new ExcelExportEntity("发票数量" ,"invoicenum"));
break;
case "invoiceamount" :
entitys.add(new ExcelExportEntity("发票金额" ,"invoiceamount"));
break;
case "advanceamount" :
entitys.add(new ExcelExportEntity("垫资金额" ,"advanceamount"));
break;
case "status" :
entitys.add(new ExcelExportEntity("单据状态" ,"status"));
break;
case "creatortime" :
entitys.add(new ExcelExportEntity("制单时间" ,"creatortime"));
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";
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
* @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}")
public ActionResult<PurchaseorderInfoVO> info(@PathVariable("id") String id){
PurchaseorderEntity entity= purchaseorderService.getInfo(id);
PurchaseorderInfoVO vo=JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class);
//子表
List<Purchaseorder_item0Entity> Purchaseorder_item0List = purchaseorderService.GetPurchaseorder_item0List(id);
for(Purchaseorder_item0Entity purchaseorder_item0Entity : Purchaseorder_item0List){
}
vo.setPurchaseorder_item0List(JsonUtil.getJsonToList(Purchaseorder_item0List,Purchaseorder_item0Model.class ));
//副表
return ActionResult.success(vo);
}
/**
* ()
*
* @param id
* @return
*/
@GetMapping("/detail/{id}")
public ActionResult<PurchaseorderInfoVO> detailInfo(@PathVariable("id") String id){
PurchaseorderEntity entity= purchaseorderService.getInfo(id);
PurchaseorderInfoVO vo=JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class);
//子表数据转换
List<Purchaseorder_item0Entity> jg_purchaseorder_item0List = purchaseorderService.GetPurchaseorder_item0List(id);
List<Purchaseorder_item0Model> jg_purchaseorder_item0ModelList = JsonUtil.getJsonToList(jg_purchaseorder_item0List,Purchaseorder_item0Model.class);
for(Purchaseorder_item0Model jg_purchaseorder_item0Model : jg_purchaseorder_item0ModelList){
}
vo.setPurchaseorder_item0List(jg_purchaseorder_item0ModelList);
//附表数据转换
//添加到详情表单对象中
vo.setDepartmentId(generaterSwapUtil.comSelectValues(vo.getDepartmentId()));
return ActionResult.success(vo);
}
/**
*
*
* @param id
* @return
*/
@PutMapping("/{id}")
@Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid PurchaseorderUpForm purchaseorderUpForm) throws DataException {
UserInfo userInfo=userProvider.get();
PurchaseorderEntity entity= purchaseorderService.getInfo(id);
if(entity!=null){
PurchaseorderEntity subentity=JsonUtil.getJsonToBean(purchaseorderUpForm, PurchaseorderEntity.class);
purchaseorderService.update(id, subentity);
QueryWrapper<Purchaseorder_item0Entity> Purchaseorder_item0queryWrapper = new QueryWrapper<>();
Purchaseorder_item0queryWrapper.lambda().eq(Purchaseorder_item0Entity::getPurchaseorderId, entity.getId());
purchaseorder_item0Service.remove(Purchaseorder_item0queryWrapper);
List<Purchaseorder_item0Entity> Purchaseorder_item0List = JsonUtil.getJsonToList(purchaseorderUpForm.getPurchaseorder_item0List(),Purchaseorder_item0Entity.class);
for(Purchaseorder_item0Entity entitys : Purchaseorder_item0List){
entitys.setId(RandomUtil.uuId());
entitys.setPurchaseorderId(entity.getId());
purchaseorder_item0Service.save(entitys);
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
*
* @param id
* @return
*/
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
PurchaseorderEntity entity= purchaseorderService.getInfo(id);
if(entity!=null){
purchaseorderService.delete(entity);
QueryWrapper<Purchaseorder_item0Entity> queryWrapperPurchaseorder_item0=new QueryWrapper<>();
queryWrapperPurchaseorder_item0.lambda().eq(Purchaseorder_item0Entity::getPurchaseorderId,entity.getId());
purchaseorder_item0Service.remove(queryWrapperPurchaseorder_item0);
}
return ActionResult.success("删除成功");
}
}

@ -0,0 +1,149 @@
package jnpf.purchaseorder.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-05
*/
@Data
@TableName("jg_purchaseorder")
public class PurchaseorderEntity {
@TableId("ID")
private String id;
@TableField("F_CREATORUSERID")
private String creatoruserid;
@TableField("F_CREATORUSERNAME")
private String creatorusername;
@TableField("F_CREATORTIME")
private Date creatortime;
@TableField("F_LASTMODIFYUSERID")
private String lastmodifyuserid;
@TableField("F_LASTMODIFYUSERNAME")
private String lastmodifyusername;
@TableField("F_LASTMODIFYTIME")
private Date lastmodifytime;
@TableField("F_DELETEUSERID")
private String deleteuserid;
@TableField("F_DELETEUSERNAME")
private String deleteusername;
@TableField("F_DELETETIME")
private Date deletetime;
@TableField("F_DELETEMARK")
private String deletemark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("DOCUMENTNO")
private String documentno;
@TableField("ERPNO")
private String erpno;
@TableField("CONTRACTCODE")
private String contractcode;
@TableField("CONTRACTNAME")
private String contractname;
@TableField("CONTRACTNO")
private String contractno;
@TableField("SUPPLIERCODE")
private String suppliercode;
@TableField("SUPPLIERNAME")
private String suppliername;
@TableField("NUM")
private BigDecimal num;
@TableField("AMOUNT")
private BigDecimal amount;
@TableField("NOTAMOUNT")
private BigDecimal notamount;
@TableField("RATE")
private BigDecimal rate;
@TableField("POUNDNUM")
private Integer poundnum;
@TableField("CURRENCY")
private String currency;
@TableField("ADVANCEAMOUNT")
private BigDecimal advanceamount;
@TableField("PAYPRICE")
private BigDecimal payprice;
@TableField("INVOICENUM")
private BigDecimal invoicenum;
@TableField("INVOICEAMOUNT")
private BigDecimal invoiceamount;
@TableField("REFUNDABLENUM")
private BigDecimal refundablenum;
@TableField("REFUNDABLEAMOUNT")
private BigDecimal refundableamount;
@TableField("STATUS")
private String status;
@TableField("SOURCESYSTEM")
private String sourcesystem;
@TableField("ISSETTLE")
private String issettle;
@TableField("ISSUE")
private String issue;
@TableField("ISTRANSFER")
private String istransfer;
@TableField("REMARK")
private String remark;
}

@ -0,0 +1,129 @@
package jnpf.purchaseorder.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 com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
@TableName("jg_purchaseorder_item0")
public class Purchaseorder_item0Entity {
@TableId("ID")
private String id;
@TableField("F_CREATORUSERID")
private String creatoruserid;
@TableField("F_CREATORUSERNAME")
private String creatorusername;
@TableField("F_CREATORTIME")
private Date creatortime;
@TableField("F_LASTMODIFYUSERID")
private String lastmodifyuserid;
@TableField("F_LASTMODIFYUSERNAME")
private String lastmodifyusername;
@TableField("F_LASTMODIFYTIME")
private Date lastmodifytime;
@TableField("F_DELETEUSERID")
private String deleteuserid;
@TableField("F_DELETEUSERNAME")
private String deleteusername;
@TableField("F_DELETETIME")
private Date deletetime;
@TableField("F_DELETEMARK")
private String deletemark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("PURCHASEORDER_ID")
private String purchaseorderId;
@TableField("POUNDLIST_ID")
private String poundlistId;
@TableField("LICENSENUM")
private String licensenum;
@TableField("MATERIALCODE")
private String materialcode;
@TableField("MATERIALNAME")
private String materialname;
@TableField("SUPPLIERNAME")
private String suppliername;
@TableField("POUNTDATE")
private Date pountdate;
@TableField("POUNTUSER")
private String pountuser;
@TableField("POUNTTYPE")
private String pounttype;
@TableField("ADVANCE")
private String advance;
@TableField("NETWEIGHT")
private BigDecimal netweight;
@TableField("PRICE")
private BigDecimal price;
@TableField("SETTLEMENT")
private BigDecimal settlement;
@TableField("RATE")
private String rate;
@TableField("UNIT")
private String unit;
@TableField("AMOUNT")
private BigDecimal amount;
@TableField("NOTAMOUNT")
private BigDecimal notamount;
@TableField("POUNDPICTURES")
private String poundpictures;
@TableField("VEHICLEPICTURES")
private String vehiclepictures;
@TableField("REMARK")
private String remark;
}

@ -0,0 +1,17 @@
package jnpf.purchaseorder.mapper;
import jnpf.purchaseorder.entity.PurchaseorderEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
*
* purchaseorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
public interface PurchaseorderMapper extends BaseMapper<PurchaseorderEntity> {
}

@ -0,0 +1,17 @@
package jnpf.purchaseorder.mapper;
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
*
* jg_purchaseorder_item0
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
public interface Purchaseorder_item0Mapper extends BaseMapper<Purchaseorder_item0Entity> {
}

@ -0,0 +1,100 @@
package jnpf.purchaseorder.model.purchaseorder;
import jnpf.purchaseorder.model.purchaseorder.Purchaseorder_item0Model;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class PurchaseorderCrForm {
/** 单据编号 **/
@JsonProperty("documentno")
private String documentno;
/** 供应商名称 **/
@JsonProperty("suppliername")
private String suppliername;
/** 合同名称 **/
@JsonProperty("contractname")
private String contractname;
/** 制单人 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 采购部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 对方合同号 **/
@JsonProperty("contractno")
private String contractno;
/** 数量 **/
@JsonProperty("num")
private Integer num;
/** 金额 **/
@JsonProperty("amount")
private String amount;
/** 不含税金额 **/
@JsonProperty("notamount")
private String notamount;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** ERP订单号 **/
@JsonProperty("erpno")
private String erpno;
/** 已付款金额 **/
@JsonProperty("payprice")
private String payprice;
/** 发票数量 **/
@JsonProperty("invoicenum")
private String invoicenum;
/** 发票金额 **/
@JsonProperty("invoiceamount")
private String invoiceamount;
/** 垫资金额 **/
@JsonProperty("advanceamount")
private String advanceamount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 制单时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 子表数据 **/
@JsonProperty("purchaseorder_item0List")
private List<Purchaseorder_item0Model> purchaseorder_item0List;
}

@ -0,0 +1,102 @@
package jnpf.purchaseorder.model.purchaseorder;
import jnpf.purchaseorder.model.purchaseorder.Purchaseorder_item0Model;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class PurchaseorderInfoVO{
/** 主键 **/
@JsonProperty("id")
private String id;
/** 单据编号 **/
@JsonProperty("documentno")
private String documentno;
/** 供应商名称 **/
@JsonProperty("suppliername")
private String suppliername;
/** 合同名称 **/
@JsonProperty("contractname")
private String contractname;
/** 制单人 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 采购部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 对方合同号 **/
@JsonProperty("contractno")
private String contractno;
/** 数量 **/
@JsonProperty("num")
private Integer num;
/** 金额 **/
@JsonProperty("amount")
private String amount;
/** 不含税金额 **/
@JsonProperty("notamount")
private String notamount;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** ERP订单号 **/
@JsonProperty("erpno")
private String erpno;
/** 已付款金额 **/
@JsonProperty("payprice")
private String payprice;
/** 发票数量 **/
@JsonProperty("invoicenum")
private String invoicenum;
/** 发票金额 **/
@JsonProperty("invoiceamount")
private String invoiceamount;
/** 垫资金额 **/
@JsonProperty("advanceamount")
private String advanceamount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 制单时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 子表数据 **/
@JsonProperty("purchaseorder_item0List")
private List<Purchaseorder_item0Model> purchaseorder_item0List;
}

@ -0,0 +1,24 @@
package jnpf.purchaseorder.model.purchaseorder;
import lombok.Data;
import java.util.Date;
import jnpf.base.Pagination;
import java.util.List;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class PurchaseorderListQuery extends Pagination {
/** 单据编号 */
private String documentno;
/**
* id
*/
private String menuId;
}

@ -0,0 +1,117 @@
package jnpf.purchaseorder.model.purchaseorder;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class PurchaseorderListVO{
/** 主键 */
private String id;
/** 单据编号 **/
@JsonProperty("documentno")
private String documentno;
/** 供应商名称 **/
@JsonProperty("suppliername")
private String suppliername;
/** 合同名称 **/
@JsonProperty("contractname")
private String contractname;
/** 制单人 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 采购部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 对方合同号 **/
@JsonProperty("contractno")
private String contractno;
/** 数量 **/
@JsonProperty("num")
private Integer num;
/** 金额 **/
@JsonProperty("amount")
private String amount;
/** 不含税金额 **/
@JsonProperty("notamount")
private String notamount;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** ERP订单号 **/
@JsonProperty("erpno")
private String erpno;
/** 已付款金额 **/
@JsonProperty("payprice")
private String payprice;
/** 发票数量 **/
@JsonProperty("invoicenum")
private String invoicenum;
/** 发票金额 **/
@JsonProperty("invoiceamount")
private String invoiceamount;
/** 垫资金额 **/
@JsonProperty("advanceamount")
private String advanceamount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 制单时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatortime")
private Date creatortime;
}

@ -0,0 +1,25 @@
package jnpf.purchaseorder.model.purchaseorder;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class PurchaseorderPagination extends Pagination {
/** 单据编号 */
private String documentno;
/**
* id
*/
private String menuId;
}

@ -0,0 +1,26 @@
package jnpf.purchaseorder.model.purchaseorder;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.*;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class PurchaseorderPaginationExportModel extends Pagination {
private String selectKey;
private String json;
private String dataType;
/** 单据编号 */
private String documentno;
}

@ -0,0 +1,120 @@
package jnpf.purchaseorder.model.purchaseorder;
import jnpf.purchaseorder.model.purchaseorder.Purchaseorder_item0Model;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
public class PurchaseorderUpForm{
/** 主键 */
private String id;
/** 单据编号 **/
@JsonProperty("documentno")
private String documentno;
/** 供应商名称 **/
@JsonProperty("suppliername")
private String suppliername;
/** 合同名称 **/
@JsonProperty("contractname")
private String contractname;
/** 制单人 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 采购部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 对方合同号 **/
@JsonProperty("contractno")
private String contractno;
/** 数量 **/
@JsonProperty("num")
private Integer num;
/** 金额 **/
@JsonProperty("amount")
private String amount;
/** 不含税金额 **/
@JsonProperty("notamount")
private String notamount;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** ERP订单号 **/
@JsonProperty("erpno")
private String erpno;
/** 已付款金额 **/
@JsonProperty("payprice")
private String payprice;
/** 发票数量 **/
@JsonProperty("invoicenum")
private String invoicenum;
/** 发票金额 **/
@JsonProperty("invoiceamount")
private String invoiceamount;
/** 垫资金额 **/
@JsonProperty("advanceamount")
private String advanceamount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 制单时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 子表数据 **/
@JsonProperty("purchaseorder_item0List")
private List<Purchaseorder_item0Model> purchaseorder_item0List;
}

@ -0,0 +1,70 @@
package jnpf.purchaseorder.model.purchaseorder;
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-01-05
*/
@Data
public class Purchaseorder_item0Model {
/** 车牌号 **/
@JsonProperty("licensenum")
private String licensenum;
/** 物料名称 **/
@JsonProperty("materialname")
private String materialname;
/** 类型 **/
@JsonProperty("pounttype")
private String pounttype;
/** 净重 **/
@JsonProperty("netweight")
private String netweight;
/** 单位 **/
@JsonProperty("unit")
private String unit;
/** 是否垫资 **/
@JsonProperty("advance")
private String advance;
/** 单价 **/
@JsonProperty("price")
private String price;
/** 结算重量 **/
@JsonProperty("settlement")
private String settlement;
/** 税率 **/
@JsonProperty("rate")
private String rate;
/** 金额 **/
@JsonProperty("amount")
private String amount;
/** 不含税金额 **/
@JsonProperty("notamount")
private String notamount;
/** 备注 **/
@JsonProperty("remark")
private String remark;
}

@ -0,0 +1,37 @@
package jnpf.purchaseorder.service;
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
import jnpf.purchaseorder.service.Purchaseorder_item0Service;
import jnpf.purchaseorder.entity.PurchaseorderEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.purchaseorder.model.purchaseorder.PurchaseorderPagination;
import java.util.*;
/**
*
* purchaseorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
public interface PurchaseorderService extends IService<PurchaseorderEntity> {
List<PurchaseorderEntity> getList(PurchaseorderPagination purchaseorderPagination);
List<PurchaseorderEntity> getTypeList(PurchaseorderPagination purchaseorderPagination,String dataType);
PurchaseorderEntity getInfo(String id);
void delete(PurchaseorderEntity entity);
void create(PurchaseorderEntity entity);
boolean update( String id, PurchaseorderEntity entity);
// 子表方法
List<Purchaseorder_item0Entity> GetPurchaseorder_item0List(String id);
//列表子表数据方法
}

@ -0,0 +1,15 @@
package jnpf.purchaseorder.service;
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
import com.baomidou.mybatisplus.extension.service.IService;
/**
*
* jg_purchaseorder_item0
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
public interface Purchaseorder_item0Service extends IService<Purchaseorder_item0Entity> {
}

@ -0,0 +1,267 @@
package jnpf.purchaseorder.service.impl;
import jnpf.purchaseorder.entity.*;
import jnpf.purchaseorder.mapper.PurchaseorderMapper;
import jnpf.purchaseorder.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 jnpf.purchaseorder.model.purchaseorder.PurchaseorderPagination;
import jnpf.permission.service.AuthorizeService;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.stream.Collectors;
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.*;
/**
*
* purchaseorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
@Service
public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, PurchaseorderEntity> implements PurchaseorderService{
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Autowired
private Purchaseorder_item0Service purchaseorder_item0Service;
@Override
public List<PurchaseorderEntity> getList(PurchaseorderPagination purchaseorderPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int purchaseorderNum =0;
QueryWrapper<PurchaseorderEntity> purchaseorderQueryWrapper=new QueryWrapper<>();
int purchaseorder_item0Num =0;
QueryWrapper<Purchaseorder_item0Entity> purchaseorder_item0QueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object purchaseorderObj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorderQueryWrapper,purchaseorderPagination.getMenuId(),"purchaseorder"));
if (ObjectUtil.isEmpty(purchaseorderObj)){
return new ArrayList<>();
} else {
purchaseorderQueryWrapper = (QueryWrapper<PurchaseorderEntity>)purchaseorderObj;
purchaseorderNum++;
}
Object purchaseorder_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorder_item0QueryWrapper,purchaseorderPagination.getMenuId(),"purchaseorder_item0"));
if (ObjectUtil.isEmpty(purchaseorder_item0Obj)){
return new ArrayList<>();
} else {
purchaseorder_item0QueryWrapper = (QueryWrapper<Purchaseorder_item0Entity>)purchaseorder_item0Obj;
purchaseorder_item0Num++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object purchaseorderObj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorderQueryWrapper,purchaseorderPagination.getMenuId(),"purchaseorder"));
if (ObjectUtil.isEmpty(purchaseorderObj)){
return new ArrayList<>();
} else {
purchaseorderQueryWrapper = (QueryWrapper<PurchaseorderEntity>)purchaseorderObj;
purchaseorderNum++;
}
Object purchaseorder_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorder_item0QueryWrapper,purchaseorderPagination.getMenuId(),"purchaseorder_item0"));
if (ObjectUtil.isEmpty(purchaseorder_item0Obj)){
return new ArrayList<>();
} else {
purchaseorder_item0QueryWrapper = (QueryWrapper<Purchaseorder_item0Entity>)purchaseorder_item0Obj;
purchaseorder_item0Num++;
}
}
}
if(StringUtil.isNotEmpty(purchaseorderPagination.getDocumentno())){
purchaseorderNum++;
purchaseorderQueryWrapper.lambda().like(PurchaseorderEntity::getDocumentno,purchaseorderPagination.getDocumentno());
}
if(AllIdList.size()>0){
purchaseorderQueryWrapper.lambda().in(PurchaseorderEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(purchaseorderPagination.getSidx())){
purchaseorderQueryWrapper.lambda().orderByDesc(PurchaseorderEntity::getId);
}else{
try {
String sidx = purchaseorderPagination.getSidx();
PurchaseorderEntity purchaseorderEntity = new PurchaseorderEntity();
Field declaredField = purchaseorderEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
purchaseorderQueryWrapper="asc".equals(purchaseorderPagination.getSort().toLowerCase())?purchaseorderQueryWrapper.orderByAsc(value):purchaseorderQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<PurchaseorderEntity> page=new Page<>(purchaseorderPagination.getCurrentPage(), purchaseorderPagination.getPageSize());
IPage<PurchaseorderEntity> userIPage=this.page(page, purchaseorderQueryWrapper);
return purchaseorderPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<PurchaseorderEntity> list = new ArrayList();
return purchaseorderPagination.setData(list, list.size());
}
}
@Override
public List<PurchaseorderEntity> getTypeList(PurchaseorderPagination purchaseorderPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int purchaseorderNum =0;
QueryWrapper<PurchaseorderEntity> purchaseorderQueryWrapper=new QueryWrapper<>();
int purchaseorder_item0Num =0;
QueryWrapper<Purchaseorder_item0Entity> purchaseorder_item0QueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object purchaseorderObj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorderQueryWrapper,purchaseorderPagination.getMenuId(),"purchaseorder"));
if (ObjectUtil.isEmpty(purchaseorderObj)){
return new ArrayList<>();
} else {
purchaseorderQueryWrapper = (QueryWrapper<PurchaseorderEntity>)purchaseorderObj;
purchaseorderNum++;
}
Object purchaseorder_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorder_item0QueryWrapper,purchaseorderPagination.getMenuId(),"purchaseorder_item0"));
if (ObjectUtil.isEmpty(purchaseorder_item0Obj)){
return new ArrayList<>();
} else {
purchaseorder_item0QueryWrapper = (QueryWrapper<Purchaseorder_item0Entity>)purchaseorder_item0Obj;
purchaseorder_item0Num++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object purchaseorderObj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorderQueryWrapper,purchaseorderPagination.getMenuId(),"purchaseorder"));
if (ObjectUtil.isEmpty(purchaseorderObj)){
return new ArrayList<>();
} else {
purchaseorderQueryWrapper = (QueryWrapper<PurchaseorderEntity>)purchaseorderObj;
purchaseorderNum++;
}
Object purchaseorder_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(purchaseorder_item0QueryWrapper,purchaseorderPagination.getMenuId(),"purchaseorder_item0"));
if (ObjectUtil.isEmpty(purchaseorder_item0Obj)){
return new ArrayList<>();
} else {
purchaseorder_item0QueryWrapper = (QueryWrapper<Purchaseorder_item0Entity>)purchaseorder_item0Obj;
purchaseorder_item0Num++;
}
}
}
if(StringUtil.isNotEmpty(purchaseorderPagination.getDocumentno())){
purchaseorderNum++;
purchaseorderQueryWrapper.lambda().like(PurchaseorderEntity::getDocumentno,purchaseorderPagination.getDocumentno());
}
if(AllIdList.size()>0){
purchaseorderQueryWrapper.lambda().in(PurchaseorderEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(purchaseorderPagination.getSidx())){
purchaseorderQueryWrapper.lambda().orderByDesc(PurchaseorderEntity::getId);
}else{
try {
String sidx = purchaseorderPagination.getSidx();
PurchaseorderEntity purchaseorderEntity = new PurchaseorderEntity();
Field declaredField = purchaseorderEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
purchaseorderQueryWrapper="asc".equals(purchaseorderPagination.getSort().toLowerCase())?purchaseorderQueryWrapper.orderByAsc(value):purchaseorderQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<PurchaseorderEntity> page=new Page<>(purchaseorderPagination.getCurrentPage(), purchaseorderPagination.getPageSize());
IPage<PurchaseorderEntity> userIPage=this.page(page, purchaseorderQueryWrapper);
return purchaseorderPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<PurchaseorderEntity> list = new ArrayList();
return purchaseorderPagination.setData(list, list.size());
}
}else{
return this.list(purchaseorderQueryWrapper);
}
}
@Override
public PurchaseorderEntity getInfo(String id){
QueryWrapper<PurchaseorderEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(PurchaseorderEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(PurchaseorderEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, PurchaseorderEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(PurchaseorderEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
@Override
public List<Purchaseorder_item0Entity> GetPurchaseorder_item0List(String id){
QueryWrapper<Purchaseorder_item0Entity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(Purchaseorder_item0Entity::getPurchaseorderId, id);
return purchaseorder_item0Service.list(queryWrapper);
}
//列表子表数据方法
}

@ -0,0 +1,41 @@
package jnpf.purchaseorder.service.impl;
import jnpf.purchaseorder.entity.*;
import jnpf.purchaseorder.mapper.Purchaseorder_item0Mapper;
import jnpf.purchaseorder.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_item0
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
@Service
public class Purchaseorder_item0ServiceImpl extends ServiceImpl<Purchaseorder_item0Mapper, Purchaseorder_item0Entity> implements Purchaseorder_item0Service{
}

@ -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.mapper.PurchaseorderMapper">
</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.mapper.Purchaseorder_item0Mapper">
</mapper>

@ -0,0 +1,281 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<el-form-item label="单据编号"
prop="documentno" >
<p>{{dataForm.documentno}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="供应商名称"
prop="suppliername" >
<p>{{dataForm.suppliername}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="合同名称"
prop="contractname" >
<p>{{dataForm.contractname}}</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-form-item label="采购部门"
prop="departmentId" >
<p>{{dataForm.departmentId}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="对方合同号"
prop="contractno" >
<p>{{dataForm.contractno}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="数量"
prop="num" >
<p>{{dataForm.num}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="金额"
prop="amount" >
<p>{{dataForm.amount}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="不含税金额"
prop="notamount" >
<p>{{dataForm.notamount}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="币别 "
prop="currency" >
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="16" >
<el-form-item label="备注"
prop="remark" >
<p>{{dataForm.remark}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="ERP订单号"
prop="erpno" >
<p>{{dataForm.erpno}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="已付款金额"
prop="payprice" >
<p>{{dataForm.payprice}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="发票数量"
prop="invoicenum" >
<p>{{dataForm.invoicenum}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="发票金额"
prop="invoiceamount" >
<p>{{dataForm.invoiceamount}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="垫资金额"
prop="advanceamount" >
<p>{{dataForm.advanceamount}}</p>
</el-form-item>
</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="10" >
<el-form-item label="制单时间"
prop="creatortime" >
<p>{{jnpf.dateFormat(dataForm.creatortime)}}</p>
</el-form-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activebgsnko" 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.purchaseorder_item0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="licensenum" label="车牌号">
<template slot-scope="scope">
<p>{{scope.row.licensenum}}</p>
</template>
</el-table-column>
<el-table-column prop="materialname" label="物料名称">
<template slot-scope="scope">
<p>{{scope.row.materialname}}</p>
</template>
</el-table-column>
<el-table-column prop="pounttype" label="类型 ">
<template slot-scope="scope">
<p>{{ scope.row.pounttype | dynamicText(pounttypeOptions) }}</p>
</template>
</el-table-column>
<el-table-column prop="netweight" label="净重">
<template slot-scope="scope">
<p>{{scope.row.netweight}}</p>
</template>
</el-table-column>
<el-table-column prop="unit" label="单位">
<template slot-scope="scope">
<p>{{ scope.row.unit | dynamicText(unitOptions) }}</p>
</template>
</el-table-column>
<el-table-column prop="advance" label="是否垫资">
<template slot-scope="scope">
<p>{{ scope.row.advance | dynamicText(advanceOptions) }}</p>
</template>
</el-table-column>
<el-table-column prop="price" label="单价">
<template slot-scope="scope">
<p>{{scope.row.price}}</p>
</template>
</el-table-column>
<el-table-column prop="settlement" label="结算重量">
<template slot-scope="scope">
<p>{{scope.row.settlement}}</p>
</template>
</el-table-column>
<el-table-column prop="rate" label="税率 ">
<template slot-scope="scope">
<p>{{ scope.row.rate | dynamicText(rateOptions) }}</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="notamount" label="不含税金额">
<template slot-scope="scope">
<p>{{scope.row.notamount}}</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-tabs>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import PrintBrowse from '@/components/PrintBrowse'
import jnpf from '@/utils/jnpf'
export default {
components: {PrintBrowse},
props: [],
data() {
return {
visible: false,
loading: false,
printBrowseVisible: false,
printId: '',
dataForm: {
id :'',
documentno : '',
suppliername : '',
contractname : '',
creatorusername : '',
departmentId : '',
contractno : '',
num : '',
amount : '',
notamount : '',
currency : "",
remark : '',
erpno : '',
payprice : '',
invoicenum : '',
invoiceamount : '',
advanceamount : '',
status : "",
creatortime : '',
purchaseorder_item0List:[],
},
activebgsnko:'0',
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"开票中","id":"1"},{"fullName":"付款申请","id":"2"},{"fullName":"待付款","id":"3"},{"fullName":"付款中","id":"4"},{"fullName":"归档","id":"5"}],
pounttypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"其他","id":"1"}],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
advanceOptions:[{"fullName":"是","id":"1"},{"fullName":"否","id":"0"}],
rateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}],
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
dataInfo(dataAll){
let _dataAll =dataAll
for(let i=0;i<_dataAll.purchaseorder_item0List.length;i++){
var _list = _dataAll.purchaseorder_item0List[i];
}
this.dataForm = _dataAll
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/purchaseorder/Purchaseorder/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

@ -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,467 @@
<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="1000px">
<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="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="供应商名称"
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="contractname" >
<el-input v-model="dataForm.contractname"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="制单人"
prop="creatorusername" >
<el-input v-model="dataForm.creatorusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="采购部门"
prop="departmentId" >
<dep-select v-model="dataForm.departmentId"
placeholder="请选择" clearable >
</dep-select>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="对方合同号"
prop="contractno" >
<el-input v-model="dataForm.contractno"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="数量"
prop="num" >
<el-input-number v-model="dataForm.num"
placeholder="数字文本" :step="1" controls-position='right' >
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="金额"
prop="amount" >
<el-input v-model="dataForm.amount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="不含税金额"
prop="notamount" >
<el-input v-model="dataForm.notamount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</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="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="ERP订单号"
prop="erpno" >
<el-input v-model="dataForm.erpno"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="已付款金额"
prop="payprice" >
<el-input v-model="dataForm.payprice"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="发票数量"
prop="invoicenum" >
<el-input v-model="dataForm.invoicenum"
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%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="垫资金额"
prop="advanceamount" >
<el-input v-model="dataForm.advanceamount"
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="10" >
<el-form-item label="制单时间"
prop="creatortime" >
<el-date-picker v-model="dataForm.creatortime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activebgsnko" 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.purchaseorder_item0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="licensenum" label="车牌号">
<template slot-scope="scope">
<el-input v-model="scope.row.licensenum"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<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="pounttype" label="类型 ">
<template slot-scope="scope">
<el-select v-model="scope.row.pounttype"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in pounttypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="netweight" label="净重">
<template slot-scope="scope">
<el-input v-model="scope.row.netweight"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="unit" label="单位">
<template slot-scope="scope">
<el-select v-model="scope.row.unit"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="advance" label="是否垫资">
<template slot-scope="scope">
<el-select v-model="scope.row.advance"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in advanceOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="price" label="单价">
<template slot-scope="scope">
<el-input v-model="scope.row.price"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="settlement" label="结算重量">
<template slot-scope="scope">
<el-input v-model="scope.row.settlement"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="rate" label="税率 ">
<template slot-scope="scope">
<el-select v-model="scope.row.rate"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in rateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</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%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="notamount" label="不含税金额">
<template slot-scope="scope">
<el-input v-model="scope.row.notamount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</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%"}'>
</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="delpurchaseorder_item0List(scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addpurchaseorder_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 {
visible: false,
loading: false,
isDetail: false,
dataForm: {
documentno : '',
suppliername : '',
contractname : '',
creatorusername : '',
departmentId : '',
contractno : '',
num : '',
amount : '',
notamount : '',
currency : "",
remark : '',
erpno : '',
payprice : '',
invoicenum : '',
invoiceamount : '',
advanceamount : '',
status : "",
creatortime : '',
purchaseorder_item0List:[],
},
activebgsnko:'0',
rules:
{
},
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"开票中","id":"1"},{"fullName":"付款申请","id":"2"},{"fullName":"待付款","id":"3"},{"fullName":"付款中","id":"4"},{"fullName":"归档","id":"5"}],
pounttypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"其他","id":"1"}],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
advanceOptions:[{"fullName":"是","id":"1"},{"fullName":"否","id":"0"}],
rateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}],
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
purchaseorder_item0Exist() {
let isOk = true;
for(let i=0;i<this.dataForm.purchaseorder_item0List.length;i++){
const e = this.dataForm.purchaseorder_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(id, isDetail) {
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if(this.dataForm.id){
this.loading = true
request({
url: '/api/purchaseorder/Purchaseorder/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
}else{
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (!this.purchaseorder_item0Exist()) return
this.request()
}
})
},
request() {
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/purchaseorder/Purchaseorder',
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/purchaseorder/Purchaseorder/'+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)
}
})
})
}
},
addpurchaseorder_item0List(){
let item = {
licensenum:undefined,
materialname:undefined,
pounttype:undefined,
netweight:undefined,
unit:undefined,
advance:undefined,
price:undefined,
settlement:undefined,
rate:undefined,
amount:undefined,
notamount:undefined,
remark:undefined,
}
this.dataForm.purchaseorder_item0List.push(item)
},
delpurchaseorder_item0List(index) {
this.dataForm.purchaseorder_item0List.splice(index, 1);
},
dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm));
for(let i=0;i<_data.purchaseorder_item0List.length;i++){
var _list = _data.purchaseorder_item0List[i];
}
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
for(let i=0;i<_dataAll.purchaseorder_item0List.length;i++){
var _list = _dataAll.purchaseorder_item0List[i];
}
this.dataForm = _dataAll
},
},
}
</script>

@ -0,0 +1,289 @@
<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>
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
</el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
</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' has-c @selection-change="handleSelectionChange">
<el-table-column prop="documentno" label="单据编号" width="0" align="left"
/>
<el-table-column prop="erpno" label="ERP订单号" width="0" align="left"
/>
<el-table-column prop="contractname" label="合同名称" width="0" align="left"
/>
<el-table-column prop="suppliername" label="供应商名称" width="0" align="left"
/>
<el-table-column prop="amount" label="金额" width="0" align="left"
/>
<el-table-column prop="num" label="数量" width="0" align="left"
/>
<el-table-column label="币别 " width="0" prop="currency" algin="left"
>
<template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }}
</template>
</el-table-column>
<el-table-column prop="payprice" label="已付款金额" width="0" align="left"
/>
<el-table-column prop="invoicenum" label="发票数量" width="0" align="left"
/>
<el-table-column prop="invoiceamount" label="发票金额" width="0" align="left"
/>
<el-table-column prop="advanceamount" label="垫资金额" width="0" align="left"
/>
<el-table-column prop="creatortime" label="制单时间" width="0" align="left"
/>
<el-table-column label="单据状态" width="0" prop="status" algin="left"
>
<template slot-scope="scope">
{{ scope.row.status | dynamicText(statusOptions) }}
</template>
</el-table-column>
<el-table-column prop="creatorusername" label="制单人" width="0" align="left"
/>
<el-table-column label="操作" fixed="right"
width="100" >
<template slot-scope="scope">
<el-button type="text"
@click="addOrUpdateHandle(scope.row.id)" >编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
</div>
</template>
<script>
import request from '@/utils/request'
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import JNPFForm from './Form'
import ExportBox from './ExportBox'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import Detail from './Detail'
export default {
components: {JNPFForm, ExportBox,Detail},
data() {
return {
detailVisible: false,
query: {
documentno:undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id'
},
list: [],
listLoading: true,
multipleSelection: [], total: 0,
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
exportBoxVisible: false,
columnList: [
{prop: 'documentno', label: '单据编号'},
{prop: 'erpno', label: 'ERP订单号'},
{prop: 'contractname', label: '合同名称'},
{prop: 'suppliername', label: '供应商名称'},
{prop: 'amount', label: '金额'},
{prop: 'num', label: '数量'},
{prop: 'currency', label: '币别 '},
{prop: 'payprice', label: '已付款金额'},
{prop: 'invoicenum', label: '发票数量'},
{prop: 'invoiceamount', label: '发票金额'},
{prop: 'advanceamount', label: '垫资金额'},
{prop: 'creatortime', label: '制单时间'},
{prop: 'status', label: '单据状态'},
{prop: 'creatorusername', label: '制单人'},
],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
currencyProps:{"label":"fullName","value":"id"},
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"开票中","id":"1"},{"fullName":"付款申请","id":"2"},{"fullName":"待付款","id":"3"},{"fullName":"付款中","id":"4"},{"fullName":"归档","id":"5"}],
statusProps:{"label":"fullName","value":"id"},
}
},
computed: {
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.initData()
},
methods: {
goDetail(id){
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
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/purchaseorder/Purchaseorder/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/purchaseorder/Purchaseorder/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
handleSelectionChange(val) {
const res = val.map(item => item.id)
this.multipleSelection = res
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
const ids = this.multipleSelection.join()
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/purchaseorder/Purchaseorder/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.$refs.JNPFForm.init(id, isDetail)
})
},
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/purchaseorder/Purchaseorder/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()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined
}
this.search()
}
}
}
</script>
Loading…
Cancel
Save