product
杨世强 2 years ago
parent ea0fdb1b21
commit 6d8060d6d8

@ -56,7 +56,7 @@ import jnpf.util.enums.FileTypeEnum;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Slf4j
@RestController
@ -363,6 +363,8 @@ public class PurchasebackController {
List<Purchaseback_item0Entity> jg_purchaseback_item0List = purchasebackService.GetPurchaseback_item0List(id);
List<Purchaseback_item0Model> jg_purchaseback_item0ModelList = JsonUtil.getJsonToList(jg_purchaseback_item0List,Purchaseback_item0Model.class);
for(Purchaseback_item0Model jg_purchaseback_item0Model : jg_purchaseback_item0ModelList){
Map<String,Object> licenseNumMap = new HashMap<>();
jg_purchaseback_item0Model.setLicenseNum(generaterSwapUtil.getPopupSelectValue("383214061812227333","license_num","license_num",jg_purchaseback_item0Model.getLicenseNum(),licenseNumMap));
}
vo.setPurchaseback_item0List(jg_purchaseback_item0ModelList);

@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Data
@TableName("jg_purchaseback")

@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Data
@TableName("jg_purchaseback_item0")

@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Data
@TableName("jg_purchaseorder")

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-12
* 2023-01-13
*/
public interface PurchasebackMapper extends BaseMapper<PurchasebackEntity> {

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-12
* 2023-01-13
*/
public interface Purchaseback_item0Mapper extends BaseMapper<Purchaseback_item0Entity> {

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-12
* 2023-01-13
*/
public interface PurchaseorderMapper extends BaseMapper<PurchaseorderEntity> {

@ -15,7 +15,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Data
public class PurchasebackCrForm {

@ -16,7 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Data
public class PurchasebackInfoVO{

@ -10,7 +10,7 @@ import java.util.List;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Data
public class PurchasebackListQuery extends Pagination {

@ -15,7 +15,7 @@ import java.math.BigDecimal;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Data
public class PurchasebackListVO{

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Data
public class PurchasebackPagination extends Pagination {

@ -9,7 +9,7 @@ import java.util.*;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Data
public class PurchasebackPaginationExportModel extends Pagination {

@ -16,7 +16,7 @@ import lombok.Data;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Data
public class PurchasebackUpForm{

@ -13,7 +13,7 @@ import com.alibaba.fastjson.annotation.JSONField;
* V3.2.0
* : LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-12
* 2023-01-13
*/
@Data
public class Purchaseback_item0Model {

@ -15,7 +15,7 @@ import java.math.BigDecimal;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-12
* @ 2023-01-13
*/
@Data
public class PurchaseorderListVO{

@ -13,7 +13,7 @@ import com.alibaba.fastjson.annotation.JSONField;
* V3.2.0
* : LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-12
* 2023-01-13
*/
@Data
public class PurchaseorderModel {

@ -13,7 +13,7 @@ import java.util.*;
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-12
* 2023-01-13
*/
public interface PurchasebackService extends IService<PurchasebackEntity> {

@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-12
* 2023-01-13
*/
public interface Purchaseback_item0Service extends IService<Purchaseback_item0Entity> {

@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-12
* 2023-01-13
*/
public interface PurchaseorderService extends IService<PurchaseorderEntity> {

@ -38,7 +38,7 @@ import java.util.*;
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-12
* 2023-01-13
*/
@Service
public class PurchasebackServiceImpl extends ServiceImpl<PurchasebackMapper, PurchasebackEntity> implements PurchasebackService{

@ -32,7 +32,7 @@ import java.util.*;
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-12
* 2023-01-13
*/
@Service
public class Purchaseback_item0ServiceImpl extends ServiceImpl<Purchaseback_item0Mapper, Purchaseback_item0Entity> implements Purchaseback_item0Service{

@ -32,7 +32,7 @@ import java.util.*;
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-12
* 2023-01-13
*/
@Service
public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, PurchaseorderEntity> implements PurchaseorderService{

@ -0,0 +1,482 @@
package jnpf.saleback.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.saleback.model.saleback.*;
import jnpf.saleback.model.saleback.SalebackPagination;
import jnpf.saleback.entity.*;
import jnpf.saleback.entity.Saleback_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.saleback.entity.SalebackEntity;
import jnpf.saleback.service.SalebackService;
import jnpf.saleback.entity.Saleback_item0Entity;
import jnpf.saleback.service.Saleback_item0Service;
import jnpf.saleback.service.SaleorderService;
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;
/**
*
* saleback
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-13
*/
@Slf4j
@RestController
@Api(tags = "saleback" , value = "saleback")
@RequestMapping("/api/saleback/Saleback")
public class SalebackController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private ConfigValueUtil configValueUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private SalebackService salebackService;
@Autowired
private Saleback_item0Service saleback_item0Service;
@Autowired
private SaleorderService saleorderService;
/**
*
*
* @param salebackPagination
* @return
*/
@PostMapping("/getList")
public ActionResult list(@RequestBody SalebackPagination salebackPagination)throws IOException{
List<SalebackEntity> list= salebackService.getList(salebackPagination);
//处理id字段转名称若无需转或者为空可删除
for(SalebackEntity entity:list){
Map<String,Object> salesOrderIdMap = new HashMap<>();
entity.setSalesOrderId(generaterSwapUtil.getPopupSelectValue("383568951197606085","id","document_no",entity.getSalesOrderId(),salesOrderIdMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
}
List<SalebackListVO> listVO=JsonUtil.getJsonToList(list,SalebackListVO.class);
for(SalebackListVO salebackVO:listVO){
SaleorderEntity saleorderEntity = salebackService.getSaleorder(salebackVO.getSalesOrderId());
if(ObjectUtil.isNotEmpty(saleorderEntity)){
salebackVO.setJg_salesorder(JsonUtil.getJsonToBean(saleorderEntity,SaleorderListVO.class));
}
}
PageListVO vo=new PageListVO();
vo.setList(listVO);
PaginationVO page=JsonUtil.getJsonToBean(salebackPagination,PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param salebackCrForm
* @return
*/
@PostMapping
@Transactional
public ActionResult create(@RequestBody @Valid SalebackCrForm salebackCrForm) throws DataException {
String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get();
salebackCrForm.setCreatorTime(DateUtil.getNow());
salebackCrForm.setCreatorUserName(userInfo.getUserId());
SalebackEntity entity = JsonUtil.getJsonToBean(salebackCrForm, SalebackEntity.class);
entity.setId(mainId);
salebackService.save(entity);
List<Saleback_item0Entity> Saleback_item0List = JsonUtil.getJsonToList(salebackCrForm.getSaleback_item0List(),Saleback_item0Entity.class);
for(Saleback_item0Entity entitys : Saleback_item0List){
entitys.setId(RandomUtil.uuId());
entitys.setSalesBackId(entity.getId());
saleback_item0Service.save(entitys);
}
//子表数据
if(ObjectUtil.isNotEmpty(salebackCrForm.getJg_salesorder())){
SaleorderEntity jg_salesorderentity = JsonUtil.getJsonToBean(salebackCrForm.getJg_salesorder(), SaleorderEntity.class);
jg_salesorderentity.setId(entity.getSalesOrderId());
//自动生成的字段
jg_salesorderentity.setId(mainId);
saleorderService.save(jg_salesorderentity);
}
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(SalebackPaginationExportModel salebackPaginationExportModel) throws IOException {
if (StringUtil.isEmpty(salebackPaginationExportModel.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
SalebackPagination salebackPagination=JsonUtil.getJsonToBean(salebackPaginationExportModel, SalebackPagination.class);
List<SalebackEntity> list= salebackService.getTypeList(salebackPagination,salebackPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除
for(SalebackEntity entity:list){
Map<String,Object> salesOrderIdMap = new HashMap<>();
entity.setSalesOrderId(generaterSwapUtil.getPopupSelectValue("383568951197606085","id","document_no",entity.getSalesOrderId(),salesOrderIdMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
}
List<SalebackListVO> listVO=JsonUtil.getJsonToList(list,SalebackListVO.class);
for(SalebackListVO salebackVO:listVO){
SaleorderEntity saleorderEntity = salebackService.getSaleorder(salebackVO.getSalesOrderId());
if(ObjectUtil.isNotEmpty(saleorderEntity)){
salebackVO.setJg_salesorder(JsonUtil.getJsonToBean(saleorderEntity,SaleorderListVO.class));
}
}
//转换为map输出
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss"));
mapList.stream().forEach(map -> {
Map<String,Object> map2 =new HashMap<>();
Map<String, Object> map1 = JsonUtil.entityToMap(map.get("saleorder"));
for (Map.Entry entry : map1.entrySet()){
String key = "saleorder." +entry.getKey();
map2.put(key,entry.getValue());
}
map.putAll(map2);
});
String[]keys=!StringUtil.isEmpty(salebackPaginationExportModel.getSelectKey())?salebackPaginationExportModel.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 "jg_salesorder.contractName" :
entitys.add(new ExcelExportEntity("合同名称" ,"jg_salesorder.contractName"));
break;
case "jg_salesorder.costomerName" :
entitys.add(new ExcelExportEntity("客户名称" ,"jg_salesorder.costomerName"));
break;
case "documentNo" :
entitys.add(new ExcelExportEntity("单据编号" ,"documentNo"));
break;
case "salesOrderId" :
entitys.add(new ExcelExportEntity("销售订单" ,"salesOrderId"));
break;
case "currency" :
entitys.add(new ExcelExportEntity("币别" ,"currency"));
break;
case "refundAmount" :
entitys.add(new ExcelExportEntity("退款金额" ,"refundAmount"));
break;
case "refundNum" :
entitys.add(new ExcelExportEntity("退货数量" ,"refundNum"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "actualAmount" :
entitys.add(new ExcelExportEntity("实退金额" ,"actualAmount"));
break;
case "status" :
entitys.add(new ExcelExportEntity("单据状态 " ,"status"));
break;
case "creatorTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime"));
break;
case "creatorUserName" :
entitys.add(new ExcelExportEntity("创建人" ,"creatorUserName"));
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<SalebackInfoVO> info(@PathVariable("id") String id){
SalebackEntity entity= salebackService.getInfo(id);
SalebackInfoVO vo=JsonUtil.getJsonToBean(entity, SalebackInfoVO.class);
if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime());
}
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
//子表
List<Saleback_item0Entity> Saleback_item0List = salebackService.GetSaleback_item0List(id);
for(Saleback_item0Entity saleback_item0Entity : Saleback_item0List){
}
vo.setSaleback_item0List(JsonUtil.getJsonToList(Saleback_item0List,Saleback_item0Model.class ));
//副表
QueryWrapper<SaleorderEntity> queryWrapperSaleorder = new QueryWrapper<>();
queryWrapperSaleorder.lambda().eq(SaleorderEntity::getId,entity.getSalesOrderId());
SaleorderEntity jg_salesorderEntity = saleorderService.getOne(queryWrapperSaleorder);
vo.setJg_salesorder(JsonUtil.getJsonToBean(jg_salesorderEntity, SaleorderModel.class));
return ActionResult.success(vo);
}
/**
* ()
*
* @param id
* @return
*/
@GetMapping("/detail/{id}")
public ActionResult<SalebackInfoVO> detailInfo(@PathVariable("id") String id){
SalebackEntity entity= salebackService.getInfo(id);
SalebackInfoVO vo=JsonUtil.getJsonToBean(entity, SalebackInfoVO.class);
//子表数据转换
List<Saleback_item0Entity> jg_salesback_item0List = salebackService.GetSaleback_item0List(id);
List<Saleback_item0Model> jg_salesback_item0ModelList = JsonUtil.getJsonToList(jg_salesback_item0List,Saleback_item0Model.class);
for(Saleback_item0Model jg_salesback_item0Model : jg_salesback_item0ModelList){
Map<String,Object> licenseNumMap = new HashMap<>();
jg_salesback_item0Model.setLicenseNum(generaterSwapUtil.getPopupSelectValue("383568082196537541","license_num","license_num",jg_salesback_item0Model.getLicenseNum(),licenseNumMap));
}
vo.setSaleback_item0List(jg_salesback_item0ModelList);
//附表数据转换
QueryWrapper<SaleorderEntity> queryWrapperSaleorder = new QueryWrapper<>();
queryWrapperSaleorder.lambda().eq(SaleorderEntity::getId,entity.getSalesOrderId());
SaleorderEntity jg_salesorderEntity = saleorderService.getOne(queryWrapperSaleorder);
if(ObjectUtil.isEmpty(jg_salesorderEntity)){
jg_salesorderEntity = new SaleorderEntity();
}
vo.setJg_salesorder(JsonUtil.getJsonToBean(jg_salesorderEntity, SaleorderModel.class));
//添加到详情表单对象中
Map<String,Object> salesOrderIdMap = new HashMap<>();
vo.setSalesOrderId(generaterSwapUtil.getPopupSelectValue("383568951197606085","id","document_no",vo.getSalesOrderId(),salesOrderIdMap));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
return ActionResult.success(vo);
}
/**
*
*
* @param id
* @return
*/
@PutMapping("/{id}")
@Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid SalebackUpForm salebackUpForm) throws DataException {
UserInfo userInfo=userProvider.get();
SalebackEntity entity= salebackService.getInfo(id);
if(entity!=null){
SalebackEntity subentity=JsonUtil.getJsonToBean(salebackUpForm, SalebackEntity.class);
subentity.setCreatorTime(entity.getCreatorTime());
subentity.setCreatorUserName(entity.getCreatorUserName());
salebackService.update(id, subentity);
QueryWrapper<Saleback_item0Entity> Saleback_item0queryWrapper = new QueryWrapper<>();
Saleback_item0queryWrapper.lambda().eq(Saleback_item0Entity::getSalesBackId, entity.getId());
saleback_item0Service.remove(Saleback_item0queryWrapper);
List<Saleback_item0Entity> Saleback_item0List = JsonUtil.getJsonToList(salebackUpForm.getSaleback_item0List(),Saleback_item0Entity.class);
for(Saleback_item0Entity entitys : Saleback_item0List){
entitys.setId(RandomUtil.uuId());
entitys.setSalesBackId(entity.getId());
saleback_item0Service.save(entitys);
}
//子表数据
if(ObjectUtil.isNotEmpty(salebackUpForm.getJg_salesorder())){
QueryWrapper<SaleorderEntity> queryWrapperSaleorder =new QueryWrapper<>();
queryWrapperSaleorder.lambda().eq(SaleorderEntity::getId,entity.getSalesOrderId());
SaleorderEntity jg_salesorderOneEntity= saleorderService.getOne(queryWrapperSaleorder);
SaleorderEntity jg_salesorderentity=JsonUtil.getJsonToBean(salebackUpForm.getJg_salesorder(), SaleorderEntity.class);
jg_salesorderentity.setId(jg_salesorderOneEntity.getId());
jg_salesorderentity.setId(entity.getSalesOrderId());
saleorderService.updateById(jg_salesorderentity);
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
*
* @param id
* @return
*/
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
SalebackEntity entity= salebackService.getInfo(id);
if(entity!=null){
salebackService.delete(entity);
QueryWrapper<Saleback_item0Entity> queryWrapperSaleback_item0=new QueryWrapper<>();
queryWrapperSaleback_item0.lambda().eq(Saleback_item0Entity::getSalesBackId,entity.getId());
saleback_item0Service.remove(queryWrapperSaleback_item0);
//子表数据
QueryWrapper<SaleorderEntity> queryWrapperSaleorder=new QueryWrapper<>();
queryWrapperSaleorder.lambda().eq(SaleorderEntity::getId,entity.getSalesOrderId());
saleorderService.remove(queryWrapperSaleorder);
}
return ActionResult.success("删除成功");
}
}

@ -0,0 +1,90 @@
package jnpf.saleback.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-13
*/
@Data
@TableName("jg_salesback")
public class SalebackEntity {
@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("SALES_ORDER_ID")
private String salesOrderId;
@TableField("CURRENCY")
private String currency;
@TableField("REFUND_NUM")
private BigDecimal refundNum;
@TableField("REFUND_AMOUNT")
private BigDecimal refundAmount;
@TableField("REMARK")
private String remark;
@TableField("ACTUAL_AMOUNT")
private String actualAmount;
@TableField("STATUS")
private String status;
}

@ -0,0 +1,107 @@
package jnpf.saleback.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 com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* 退
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-13
*/
@Data
@TableName("jg_salesback_item0")
public class Saleback_item0Entity {
@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("POUNDLIST_ID")
private String poundlistId;
@TableField("SALESORDER_ITEM0_ID")
private String salesorderItem0Id;
@TableField("SALES_BACK_ID")
private String salesBackId;
@TableField("LICENSE_NUM")
private String licenseNum;
@TableField("MATERIAL_NAME")
private String materialName;
@TableField("POUNT_USER")
private String pountUser;
@TableField("POUNT_TYPE")
private String pountType;
@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("NOT_AMOUNT")
private BigDecimal notAmount;
}

@ -0,0 +1,156 @@
package jnpf.saleback.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 java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-13
*/
@Data
@TableName("jg_salesorder")
public class SaleorderEntity {
@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("SOURCE_PO_NO")
private String sourcePoNo;
@TableField("CONTRACT_CODE")
private String contractCode;
@TableField("CONTRACT_NAME")
private String contractName;
@TableField("CONTRACT_NO")
private String contractNo;
@TableField("COSTOMER_CODE")
private String costomerCode;
@TableField("COSTOMER_NAME")
private String costomerName;
@TableField("NUM")
private BigDecimal num;
@TableField("PRICE")
private BigDecimal price;
@TableField("NOT_PRICE")
private BigDecimal notPrice;
@TableField("RATE")
private BigDecimal rate;
@TableField("POUND_NUM")
private Integer poundNum;
@TableField("CURRENCY")
private String currency;
@TableField("ADVANCE_AMOUNT")
private BigDecimal advanceAmount;
@TableField("AMOUNT_COLLECTED")
private BigDecimal amountCollected;
@TableField("INVOICE_NUM")
private BigDecimal invoiceNum;
@TableField("INVOICE_AMOUNT")
private BigDecimal invoiceAmount;
@TableField("RETURN_QUANTITY")
private BigDecimal returnQuantity;
@TableField("REF_AMOUNT")
private BigDecimal reamount;
@TableField("STATUS")
private String status;
@TableField("SOURCE_SYSTEM")
private String sourceSystem;
@TableField("IS_SETTLE")
private String isSettle;
@TableField("ISSUE")
private String issue;
@TableField("REMARK")
private String remark;
@TableField("CLOSING_DATE")
private Date closingDate;
@TableField("OVERDUE_INTEREST")
private BigDecimal overdueInterest;
}

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

@ -0,0 +1,17 @@
package jnpf.saleback.mapper;
import jnpf.saleback.entity.Saleback_item0Entity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
*
* jg_salesback_item0
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-13
*/
public interface Saleback_item0Mapper extends BaseMapper<Saleback_item0Entity> {
}

@ -0,0 +1,17 @@
package jnpf.saleback.mapper;
import jnpf.saleback.entity.SaleorderEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
*
* jg_salesorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-13
*/
public interface SaleorderMapper extends BaseMapper<SaleorderEntity> {
}

@ -0,0 +1,71 @@
package jnpf.saleback.model.saleback;
import jnpf.saleback.model.saleback.Saleback_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-13
*/
@Data
public class SalebackCrForm {
/** 单据编号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 销售订单 **/
@JsonProperty("salesOrderId")
private String salesOrderId;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 退款金额 **/
@JsonProperty("refundAmount")
private String refundAmount;
/** 退货数量 **/
@JsonProperty("refundNum")
private String refundNum;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 实退金额 **/
@JsonProperty("actualAmount")
private String actualAmount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 创建人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 子表数据 **/
@JsonProperty("saleback_item0List")
private List<Saleback_item0Model> saleback_item0List;
/** 列表子表数据 **/
@JsonProperty("jg_salesorder")
private SaleorderModel jg_salesorder;
}

@ -0,0 +1,74 @@
package jnpf.saleback.model.saleback;
import jnpf.saleback.model.saleback.Saleback_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-13
*/
@Data
public class SalebackInfoVO{
/** 主键 **/
@JsonProperty("id")
private String id;
/** 单据编号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 销售订单 **/
@JsonProperty("salesOrderId")
private String salesOrderId;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 退款金额 **/
@JsonProperty("refundAmount")
private String refundAmount;
/** 退货数量 **/
@JsonProperty("refundNum")
private String refundNum;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 实退金额 **/
@JsonProperty("actualAmount")
private String actualAmount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
/** 创建人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 子表数据 **/
@JsonProperty("saleback_item0List")
private List<Saleback_item0Model> saleback_item0List;
/** 列表子表数据 **/
@JsonProperty("jg_salesorder")
private SaleorderModel jg_salesorder;
}

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

@ -0,0 +1,81 @@
package jnpf.saleback.model.saleback;
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-13
*/
@Data
public class SalebackListVO{
/** 主键 */
private String id;
/** 单据编号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 销售订单 **/
@JsonProperty("salesOrderId")
private String salesOrderId;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 退款金额 **/
@JsonProperty("refundAmount")
private String refundAmount;
/** 退货数量 **/
@JsonProperty("refundNum")
private String refundNum;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 实退金额 **/
@JsonProperty("actualAmount")
private String actualAmount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
/** 创建人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/**列表子表数据 */
@JsonProperty("jg_salesorder")
private SaleorderListVO jg_salesorder;
}

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

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

@ -0,0 +1,83 @@
package jnpf.saleback.model.saleback;
import jnpf.saleback.model.saleback.Saleback_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-13
*/
@Data
public class SalebackUpForm{
/** 主键 */
private String id;
/** 单据编号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 销售订单 **/
@JsonProperty("salesOrderId")
private String salesOrderId;
/** 币别 **/
@JsonProperty("currency")
private String currency;
/** 退款金额 **/
@JsonProperty("refundAmount")
private String refundAmount;
/** 退货数量 **/
@JsonProperty("refundNum")
private String refundNum;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 实退金额 **/
@JsonProperty("actualAmount")
private String actualAmount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 创建人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 子表数据 **/
@JsonProperty("saleback_item0List")
private List<Saleback_item0Model> saleback_item0List;
/** 列表子表数据 **/
@JsonProperty("jg_salesorder")
private SaleorderModel jg_salesorder;
}

@ -0,0 +1,62 @@
package jnpf.saleback.model.saleback;
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-13
*/
@Data
public class Saleback_item0Model {
/** 车牌号 **/
@JsonProperty("licenseNum")
private String licenseNum;
/** 物料名称 **/
@JsonProperty("materialName")
private String materialName;
/** 结算重量 **/
@JsonProperty("settlement")
private String settlement;
/** 计量单位 **/
@JsonProperty("unit")
private String unit;
/** 采购单价 **/
@JsonProperty("price")
private String price;
/** 税率 **/
@JsonProperty("rate")
private String rate;
/** 应退金额 **/
@JsonProperty("amount")
private String amount;
/** 税额 **/
@JsonProperty("notAmount")
private String notAmount;
/** 业务员 **/
@JsonProperty("pountUser")
private String pountUser;
/** 磅单类型 **/
@JsonProperty("pountType")
private String pountType;
}

@ -0,0 +1,28 @@
package jnpf.saleback.model.saleback;
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-13
*/
@Data
public class SaleorderListVO{
/** 合同名称 **/
@JsonProperty("contractName")
private String contractName;
/** 客户名称 **/
@JsonProperty("costomerName")
private String costomerName;
}

@ -0,0 +1,30 @@
package jnpf.saleback.model.saleback;
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-13
*/
@Data
public class SaleorderModel {
/** 合同名称 **/
@JsonProperty("contractName")
private String contractName;
/** 客户名称 **/
@JsonProperty("costomerName")
private String costomerName;
}

@ -0,0 +1,40 @@
package jnpf.saleback.service;
import jnpf.saleback.entity.Saleback_item0Entity;
import jnpf.saleback.service.Saleback_item0Service;
import jnpf.saleback.entity.SalebackEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.saleback.entity.SaleorderEntity;
import jnpf.saleback.model.saleback.SalebackPagination;
import java.util.*;
/**
*
* saleback
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-13
*/
public interface SalebackService extends IService<SalebackEntity> {
List<SalebackEntity> getList(SalebackPagination salebackPagination);
List<SalebackEntity> getTypeList(SalebackPagination salebackPagination,String dataType);
SalebackEntity getInfo(String id);
void delete(SalebackEntity entity);
void create(SalebackEntity entity);
boolean update( String id, SalebackEntity entity);
// 子表方法
List<Saleback_item0Entity> GetSaleback_item0List(String id);
//列表子表数据方法
SaleorderEntity getSaleorder(String id);
}

@ -0,0 +1,15 @@
package jnpf.saleback.service;
import jnpf.saleback.entity.Saleback_item0Entity;
import com.baomidou.mybatisplus.extension.service.IService;
/**
*
* jg_salesback_item0
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-13
*/
public interface Saleback_item0Service extends IService<Saleback_item0Entity> {
}

@ -0,0 +1,15 @@
package jnpf.saleback.service;
import jnpf.saleback.entity.SaleorderEntity;
import com.baomidou.mybatisplus.extension.service.IService;
/**
*
* jg_salesorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-13
*/
public interface SaleorderService extends IService<SaleorderEntity> {
}

@ -0,0 +1,311 @@
package jnpf.saleback.service.impl;
import jnpf.saleback.entity.*;
import jnpf.saleback.mapper.SalebackMapper;
import jnpf.saleback.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.saleback.model.saleback.SalebackPagination;
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.*;
/**
*
* saleback
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-13
*/
@Service
public class SalebackServiceImpl extends ServiceImpl<SalebackMapper, SalebackEntity> implements SalebackService{
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Autowired
private SaleorderService saleorderService;
@Autowired
private Saleback_item0Service saleback_item0Service;
@Override
public List<SalebackEntity> getList(SalebackPagination salebackPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int salebackNum =0;
QueryWrapper<SalebackEntity> salebackQueryWrapper=new QueryWrapper<>();
int saleback_item0Num =0;
QueryWrapper<Saleback_item0Entity> saleback_item0QueryWrapper=new QueryWrapper<>();
int saleorderNum =0;
QueryWrapper<SaleorderEntity> saleorderQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object salebackObj=authorizeService.getCondition(new AuthorizeConditionModel(salebackQueryWrapper,salebackPagination.getMenuId(),"saleback"));
if (ObjectUtil.isEmpty(salebackObj)){
return new ArrayList<>();
} else {
salebackQueryWrapper = (QueryWrapper<SalebackEntity>)salebackObj;
salebackNum++;
}
Object saleback_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(saleback_item0QueryWrapper,salebackPagination.getMenuId(),"saleback_item0"));
if (ObjectUtil.isEmpty(saleback_item0Obj)){
return new ArrayList<>();
} else {
saleback_item0QueryWrapper = (QueryWrapper<Saleback_item0Entity>)saleback_item0Obj;
saleback_item0Num++;
}
Object saleorderObj=authorizeService.getCondition(new AuthorizeConditionModel(saleorderQueryWrapper,salebackPagination.getMenuId(),"saleorder"));
if (ObjectUtil.isEmpty(saleorderObj)){
return new ArrayList<>();
} else {
saleorderQueryWrapper = (QueryWrapper<SaleorderEntity>)saleorderObj;
saleorderNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object salebackObj=authorizeService.getCondition(new AuthorizeConditionModel(salebackQueryWrapper,salebackPagination.getMenuId(),"saleback"));
if (ObjectUtil.isEmpty(salebackObj)){
return new ArrayList<>();
} else {
salebackQueryWrapper = (QueryWrapper<SalebackEntity>)salebackObj;
salebackNum++;
}
Object saleback_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(saleback_item0QueryWrapper,salebackPagination.getMenuId(),"saleback_item0"));
if (ObjectUtil.isEmpty(saleback_item0Obj)){
return new ArrayList<>();
} else {
saleback_item0QueryWrapper = (QueryWrapper<Saleback_item0Entity>)saleback_item0Obj;
saleback_item0Num++;
}
Object saleorderObj=authorizeService.getCondition(new AuthorizeConditionModel(saleorderQueryWrapper,salebackPagination.getMenuId(),"saleorder"));
if (ObjectUtil.isEmpty(saleorderObj)){
return new ArrayList<>();
} else {
saleorderQueryWrapper = (QueryWrapper<SaleorderEntity>)saleorderObj;
saleorderNum++;
}
}
}
if(StringUtil.isNotEmpty(salebackPagination.getDocumentNo())){
salebackNum++;
salebackQueryWrapper.lambda().like(SalebackEntity::getDocumentNo,salebackPagination.getDocumentNo());
}
if(AllIdList.size()>0){
salebackQueryWrapper.lambda().in(SalebackEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(salebackPagination.getSidx())){
salebackQueryWrapper.lambda().orderByDesc(SalebackEntity::getId);
}else{
try {
String sidx = salebackPagination.getSidx();
SalebackEntity salebackEntity = new SalebackEntity();
Field declaredField = salebackEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
salebackQueryWrapper="asc".equals(salebackPagination.getSort().toLowerCase())?salebackQueryWrapper.orderByAsc(value):salebackQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<SalebackEntity> page=new Page<>(salebackPagination.getCurrentPage(), salebackPagination.getPageSize());
IPage<SalebackEntity> userIPage=this.page(page, salebackQueryWrapper);
return salebackPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<SalebackEntity> list = new ArrayList();
return salebackPagination.setData(list, list.size());
}
}
@Override
public List<SalebackEntity> getTypeList(SalebackPagination salebackPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int salebackNum =0;
QueryWrapper<SalebackEntity> salebackQueryWrapper=new QueryWrapper<>();
int saleback_item0Num =0;
QueryWrapper<Saleback_item0Entity> saleback_item0QueryWrapper=new QueryWrapper<>();
int saleorderNum =0;
QueryWrapper<SaleorderEntity> saleorderQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object salebackObj=authorizeService.getCondition(new AuthorizeConditionModel(salebackQueryWrapper,salebackPagination.getMenuId(),"saleback"));
if (ObjectUtil.isEmpty(salebackObj)){
return new ArrayList<>();
} else {
salebackQueryWrapper = (QueryWrapper<SalebackEntity>)salebackObj;
salebackNum++;
}
Object saleback_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(saleback_item0QueryWrapper,salebackPagination.getMenuId(),"saleback_item0"));
if (ObjectUtil.isEmpty(saleback_item0Obj)){
return new ArrayList<>();
} else {
saleback_item0QueryWrapper = (QueryWrapper<Saleback_item0Entity>)saleback_item0Obj;
saleback_item0Num++;
}
Object saleorderObj=authorizeService.getCondition(new AuthorizeConditionModel(saleorderQueryWrapper,salebackPagination.getMenuId(),"saleorder"));
if (ObjectUtil.isEmpty(saleorderObj)){
return new ArrayList<>();
} else {
saleorderQueryWrapper = (QueryWrapper<SaleorderEntity>)saleorderObj;
saleorderNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object salebackObj=authorizeService.getCondition(new AuthorizeConditionModel(salebackQueryWrapper,salebackPagination.getMenuId(),"saleback"));
if (ObjectUtil.isEmpty(salebackObj)){
return new ArrayList<>();
} else {
salebackQueryWrapper = (QueryWrapper<SalebackEntity>)salebackObj;
salebackNum++;
}
Object saleback_item0Obj=authorizeService.getCondition(new AuthorizeConditionModel(saleback_item0QueryWrapper,salebackPagination.getMenuId(),"saleback_item0"));
if (ObjectUtil.isEmpty(saleback_item0Obj)){
return new ArrayList<>();
} else {
saleback_item0QueryWrapper = (QueryWrapper<Saleback_item0Entity>)saleback_item0Obj;
saleback_item0Num++;
}
Object saleorderObj=authorizeService.getCondition(new AuthorizeConditionModel(saleorderQueryWrapper,salebackPagination.getMenuId(),"saleorder"));
if (ObjectUtil.isEmpty(saleorderObj)){
return new ArrayList<>();
} else {
saleorderQueryWrapper = (QueryWrapper<SaleorderEntity>)saleorderObj;
saleorderNum++;
}
}
}
if(StringUtil.isNotEmpty(salebackPagination.getDocumentNo())){
salebackNum++;
salebackQueryWrapper.lambda().like(SalebackEntity::getDocumentNo,salebackPagination.getDocumentNo());
}
if(AllIdList.size()>0){
salebackQueryWrapper.lambda().in(SalebackEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(salebackPagination.getSidx())){
salebackQueryWrapper.lambda().orderByDesc(SalebackEntity::getId);
}else{
try {
String sidx = salebackPagination.getSidx();
SalebackEntity salebackEntity = new SalebackEntity();
Field declaredField = salebackEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
salebackQueryWrapper="asc".equals(salebackPagination.getSort().toLowerCase())?salebackQueryWrapper.orderByAsc(value):salebackQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<SalebackEntity> page=new Page<>(salebackPagination.getCurrentPage(), salebackPagination.getPageSize());
IPage<SalebackEntity> userIPage=this.page(page, salebackQueryWrapper);
return salebackPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<SalebackEntity> list = new ArrayList();
return salebackPagination.setData(list, list.size());
}
}else{
return this.list(salebackQueryWrapper);
}
}
@Override
public SalebackEntity getInfo(String id){
QueryWrapper<SalebackEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(SalebackEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(SalebackEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, SalebackEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(SalebackEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
@Override
public List<Saleback_item0Entity> GetSaleback_item0List(String id){
QueryWrapper<Saleback_item0Entity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(Saleback_item0Entity::getSalesBackId, id);
return saleback_item0Service.list(queryWrapper);
}
//列表子表数据方法
@Override
public SaleorderEntity getSaleorder(String id){
QueryWrapper<SaleorderEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SaleorderEntity::getId, id);
return saleorderService.getOne(queryWrapper);
}
}

@ -0,0 +1,41 @@
package jnpf.saleback.service.impl;
import jnpf.saleback.entity.*;
import jnpf.saleback.mapper.Saleback_item0Mapper;
import jnpf.saleback.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_salesback_item0
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-13
*/
@Service
public class Saleback_item0ServiceImpl extends ServiceImpl<Saleback_item0Mapper, Saleback_item0Entity> implements Saleback_item0Service{
}

@ -0,0 +1,41 @@
package jnpf.saleback.service.impl;
import jnpf.saleback.entity.*;
import jnpf.saleback.mapper.SaleorderMapper;
import jnpf.saleback.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_salesorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-13
*/
@Service
public class SaleorderServiceImpl extends ServiceImpl<SaleorderMapper, SaleorderEntity> implements SaleorderService{
}

@ -87,11 +87,11 @@ public class TradeuploadController {
//处理id字段转名称若无需转或者为空可删除
for(TradeuploadEntity entity:list){
Map<String,Object> materialCodeMap = new HashMap<>();
entity.setMaterialCode(generaterSwapUtil.getPopupSelectValue("381037852907038533","id","item_code",entity.getMaterialCode(),materialCodeMap));
entity.setMaterialCode(generaterSwapUtil.getPopupSelectValue("381037852907038533","item_code","item_code",entity.getMaterialCode(),materialCodeMap));
Map<String,Object> salesNameMap = new HashMap<>();
entity.setSalesName(generaterSwapUtil.getPopupSelectValue("381038993740949317","id","contract_name",entity.getSalesName(),salesNameMap));
entity.setSalesName(generaterSwapUtil.getPopupSelectValue("381038993740949317","contract_name","contract_name",entity.getSalesName(),salesNameMap));
Map<String,Object> licenseNoMap = new HashMap<>();
entity.setLicenseNo(generaterSwapUtil.getPopupSelectValue("381432451370615173","id","ticketno",entity.getLicenseNo(),licenseNoMap));
entity.setLicenseNo(generaterSwapUtil.getPopupSelectValue("381432451370615173","ticketno","ticketno",entity.getLicenseNo(),licenseNoMap));
entity.setPoundPictures(generaterSwapUtil.getFileNameInJson(entity.getPoundPictures()));
entity.setVehiclePictures(generaterSwapUtil.getFileNameInJson(entity.getVehiclePictures()));
}

@ -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.purchaseback.mapper.Purchaseorder_item0Mapper">
</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.saleback.mapper.SalebackMapper">
</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.saleback.mapper.Saleback_item0Mapper">
</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.saleback.mapper.SaleorderMapper">
</mapper>

@ -22,4 +22,6 @@ public class DataInterfacePage extends Pagination {
//数据id
private String id;
private String bissId;
}

@ -32,6 +32,7 @@ import jnpf.util.jscript.JScriptUtil;
import jnpf.util.jwt.JwtUtil;
import jnpf.util.wxutil.HttpUtil;
import lombok.Cleanup;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.StringSubstitutor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -184,7 +185,14 @@ public class DataInterfaceServiceImpl extends ServiceImpl<DataInterfaceMapper, D
total = jdbcPageMod.getTotalRecord();
}
} else {
ActionResult result = infoToId(id, null, null);
ActionResult result;
if (StringUtils.isNotEmpty(page.getBissId())){
Map map = new HashMap();
map.put("id",page.getBissId());
result = infoToId(id, null, map);
}else{
result = infoToId(id, null, null);
}
DataInterfaceActionVo actionVo = (DataInterfaceActionVo) result.getData();
if (actionVo.getData() instanceof List) {
dataList = (List<Map<String, Object>>) actionVo.getData();
@ -203,7 +211,14 @@ public class DataInterfaceServiceImpl extends ServiceImpl<DataInterfaceMapper, D
@Override
public Map<String, Object> infoToInfo(String id, DataInterfacePage page) {
Map<String, Object> dataMap = new HashMap<>();
ActionResult result = infoToId(id, null, null);
ActionResult result;
if (StringUtils.isNotEmpty(page.getBissId())){
Map map = new HashMap();
map.put("id",page.getBissId());
result = infoToId(id, null, map);
}else{
result = infoToId(id, null, null);
}
DataInterfaceActionVo actionVo = (DataInterfaceActionVo) result.getData();
List<Map<String, Object>> dataList = new ArrayList<>();
if (actionVo.getData() instanceof List) {

@ -126,6 +126,10 @@ export default {
type: String,
default: ''
},
bissId: {
type: String,
default: ''
},
placeholder: {
type: String,
default: '请选择'
@ -233,6 +237,7 @@ export default {
let query = {
...this.listQuery,
interfaceId: this.interfaceId,
bissId: this.bissId,
propsValue: this.propsValue,
relationField: this.relationField,
}
@ -291,6 +296,7 @@ export default {
let query = {
id: this.value,
interfaceId: this.interfaceId,
bissId: this.bissId,
propsValue: this.propsValue,
relationField: this.relationField,
}

@ -79,7 +79,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activezqsmwf" tab-position="top" class="mb-20">
<el-tabs v-model="activeyrmekt" tab-position="top" class="mb-20">
<el-tab-pane label="磅单明细">
<el-col :span="24" >
<el-form-item label-width="0">
@ -168,7 +168,7 @@
dataForm: {
id :'',
documentNo : '',
purchaseOrderId : "380716763022647941",
purchaseOrderId : "",
currency : "0",
refundAmount : '',
refundNum : '',
@ -186,7 +186,7 @@
jnpf_jg_purchaseorder_jnpf_contractName:'',
jnpf_jg_purchaseorder_jnpf_supplierName:'',
},
activezqsmwf:'0',
activeyrmekt:'0',
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],

@ -117,7 +117,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activezqsmwf" tab-position="top" class="mb-20">
<el-tabs v-model="activeyrmekt" tab-position="top" class="mb-20">
<el-tab-pane label="磅单明细">
<el-col :span="24" >
<el-form-item label-width="0">
@ -128,9 +128,11 @@
<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>
<popupSelect v-model="scope.row.licenseNum"
placeholder="请选择" clearable :field="'licenseNum'+scope.$index" interfaceId="383214061812227333" :bissId="dataForm.purchaseOrderId" :columnOptions="purchaseback_item0licenseNumcolumnOptions" propsValue="license_num" relationField="license_num" popupType="dialog"
popupWidth="800px"
>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="materialName" label="物料名称">
@ -231,12 +233,13 @@
props: [],
data() {
return {
bissId: '380716763022647941',
visible: false,
loading: false,
isDetail: false,
dataForm: {
documentNo : '',
purchaseOrderId : "380716763022647941",
purchaseOrderId : "",
currency : "0",
refundAmount : '',
refundNum : '',
@ -254,14 +257,15 @@
jnpf_jg_purchaseorder_jnpf_contractName:'',
jnpf_jg_purchaseorder_jnpf_supplierName:'',
},
activezqsmwf:'0',
activeyrmekt:'0',
rules:
{
},
purchaseOrderIdcolumnOptions:[ {"label":"ID","value":"id"}, {"label":"采购订单号","value":"document_no"}, {"label":"合同名称","value":"contract_name"}, {"label":"供应商名称","value":"supplier_name"}, {"label":"币别","value":"currency"}, {"label":"status","value":"状态"},],
purchaseOrderIdcolumnOptions:[ {"label":"ID","value":"id"}, {"label":"采购订单号","value":"document_no"}, {"label":"合同名称","value":"contract_name"}, {"label":"供应商名称","value":"supplier_name"}, {"label":"币别","value":"currency"}, {"label":"状态","value":"status"},],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
purchaseback_item0licenseNumcolumnOptions:[ {"label":"车牌号","value":"license_num"}, {"label":"物料名称","value":"material_name"}, {"label":"结算重量","value":"settlement"}, {"label":"计量单位","value":"unit"}, {"label":"采购单价","value":"price"}, {"label":"税率","value":"rate"}, {"label":"应退金额","value":"amount"}, {"label":"税额","value":"not_amount"}, {"label":"业务员","value":"pount_user"}, {"label":"磅单类型","value":"pount_type"},],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
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"}],
pountTypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"其他","id":"1"}],

@ -0,0 +1,235 @@
<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="salesOrderId" >
<p>{{dataForm.salesOrderId}}</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="8" >
<el-form-item label="退款金额"
prop="refundAmount" >
<p>{{dataForm.refundAmount}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="退货数量"
prop="refundNum" >
<p>{{dataForm.refundNum}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="备注"
prop="remark" >
<p>{{dataForm.remark}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="合同名称"
prop="jnpf_jg_salesorder_jnpf_contractName" >
<p>{{dataForm.jnpf_jg_salesorder_jnpf_contractName}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="客户名称"
prop="jnpf_jg_salesorder_jnpf_costomerName" >
<p>{{dataForm.jnpf_jg_salesorder_jnpf_costomerName}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="实退金额"
prop="actualAmount" >
<p>{{dataForm.actualAmount}}</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="8" >
<el-form-item label="创建时间"
prop="creatorTime" >
<p>{{dataForm.creatorTime}}</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="24">
<el-tabs v-model="activeqkzogz" 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.saleback_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="settlement" label="结算重量 ">
<template slot-scope="scope">
<p>{{scope.row.settlement}}</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="price" label="采购单价">
<template slot-scope="scope">
<p>{{scope.row.price}}</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="pountUser" label="业务员">
<template slot-scope="scope">
<p>{{scope.row.pountUser}}</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>
</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 : '',
salesOrderId : "",
currency : "0",
refundAmount : '',
refundNum : '',
remark : '',
actualAmount : '',
status : "0",
creatorTime : "",
creatorUserName : "",
saleback_item0List:[],
jg_salesorder:
{
contractName:'',
costomerName:'',
},
jnpf_jg_salesorder_jnpf_contractName:'',
jnpf_jg_salesorder_jnpf_costomerName:'',
},
activeqkzogz:'0',
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
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"}],
pountTypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"其他","id":"1"}],
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName
_dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName
for(let i=0;i<_dataAll.saleback_item0List.length;i++){
var _list = _dataAll.saleback_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/saleback/Saleback/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,402 @@
<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="salesOrderId" >
<popupSelect v-model="dataForm.salesOrderId"
placeholder="请选择" clearable field="salesOrderId" interfaceId="383568951197606085" :columnOptions="salesOrderIdcolumnOptions" propsValue="id" relationField="document_no" popupType="dialog"
popupTitle="选择数据" popupWidth="800px"
>
</popupSelect>
</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="退款金额"
prop="refundAmount" >
<el-input v-model="dataForm.refundAmount"
readonly clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="退货数量"
prop="refundNum" >
<el-input v-model="dataForm.refundNum"
readonly clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<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="jnpf_jg_salesorder_jnpf_contractName" >
<el-input v-model=" dataForm.jnpf_jg_salesorder_jnpf_contractName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="客户名称"
prop="jnpf_jg_salesorder_jnpf_costomerName" >
<el-input v-model=" dataForm.jnpf_jg_salesorder_jnpf_costomerName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="实退金额"
prop="actualAmount" >
<el-input v-model="dataForm.actualAmount"
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="8" >
<el-form-item label="创建时间"
prop="creatorTime" >
<el-input v-model="dataForm.creatorTime"
placeholder="系统自动生成" readonly >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="创建人"
prop="creatorUserName" >
<el-input v-model="dataForm.creatorUserName"
placeholder="系统自动生成" readonly >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activeqkzogz" 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.saleback_item0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="licenseNum" label="车牌号">
<template slot-scope="scope">
<popupSelect v-model="scope.row.licenseNum"
placeholder="请选择" clearable :field="'licenseNum'+scope.$index" interfaceId="383568082196537541" :bissId="dataForm.salesOrderId" :columnOptions="saleback_item0licenseNumcolumnOptions" propsValue="license_num" relationField="license_num" popupType="dialog"
popupWidth="800px"
>
</popupSelect>
</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="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="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="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="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="pountUser" label="业务员">
<template slot-scope="scope">
<el-input v-model="scope.row.pountUser"
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 label="操作" width="50" >
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delsaleback_item0List(scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addsaleback_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 : '',
salesOrderId : "",
currency : "0",
refundAmount : '',
refundNum : '',
remark : '',
actualAmount : '',
status : "0",
creatorTime : "",
creatorUserName : "",
saleback_item0List:[],
jg_salesorder:
{
contractName:'',
costomerName:'',
},
jnpf_jg_salesorder_jnpf_contractName:'',
jnpf_jg_salesorder_jnpf_costomerName:'',
},
activeqkzogz:'0',
rules:
{
},
salesOrderIdcolumnOptions:[ {"label":"ID","value":"id"}, {"label":"销售订单号","value":"document_no"}, {"label":"合同名称","value":"contract_name"}, {"label":"客户名称","value":"costomer_name"}, {"label":"币别","value":"currency"}, {"label":"状态","value":"status"},],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
saleback_item0licenseNumcolumnOptions:[ {"label":"车牌号","value":"license_num"}, {"label":"物料名称","value":"material_name"}, {"label":"结算重量","value":"settlement"}, {"label":"计量单位","value":"unit"}, {"label":"采购单价","value":"unit_price"}, {"label":"税率","value":"rate"}, {"label":"应退金额","value":"price"}, {"label":"税额","value":"no_price"}, {"label":"业务员","value":"pound_user"}, {"label":"磅单类型","value":"pound_type"},],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
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"}],
pountTypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"其他","id":"1"}],
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
saleback_item0Exist() {
let isOk = true;
for(let i=0;i<this.dataForm.saleback_item0List.length;i++){
const e = this.dataForm.saleback_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/saleback/Saleback/'+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.saleback_item0Exist()) return
this.request()
}
})
},
request() {
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/saleback/Saleback',
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/saleback/Saleback/'+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)
}
})
})
}
},
addsaleback_item0List(){
let item = {
licenseNum:undefined,
materialName:undefined,
settlement:undefined,
unit:undefined,
price:undefined,
rate:undefined,
amount:undefined,
notAmount:undefined,
pountUser:undefined,
pountType:undefined,
}
this.dataForm.saleback_item0List.push(item)
},
delsaleback_item0List(index) {
this.dataForm.saleback_item0List.splice(index, 1);
},
dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.jg_salesorder.contractName = _data.jnpf_jg_salesorder_jnpf_contractName
_data.jg_salesorder.costomerName = _data.jnpf_jg_salesorder_jnpf_costomerName
for(let i=0;i<_data.saleback_item0List.length;i++){
var _list = _data.saleback_item0List[i];
}
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName
_dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName
for(let i=0;i<_dataAll.saleback_item0List.length;i++){
var _list = _dataAll.saleback_item0List[i];
}
this.dataForm = _dataAll
},
},
}
</script>

@ -0,0 +1,286 @@
<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="salesOrderId" label="销售订单" width="0" align="left"
/>
<el-table-column prop="jg_salesorder.contractName" label="合同名称" width="0" align="left"
/>
<el-table-column prop="jg_salesorder.costomerName" label="客户名称" width="0" align="left"
/>
<el-table-column prop="refundAmount" label="退款金额" width="0" align="left"
/>
<el-table-column prop="actualAmount" 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="refundNum" 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="creatorTime" label="创建时间" width="0" align="left"
/>
<el-table-column prop="creatorUserName" label="创建人" width="0" align="left"
/>
<el-table-column prop="remark" label="备注" width="0" align="left"
/>
<el-table-column label="操作" fixed="right"
width="150" >
<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>
<el-button type="text"
@click="goDetail(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: 'salesOrderId', label: '销售订单'},
{prop: 'jg_salesorder.contractName', label: '合同名称'},
{prop: 'jg_salesorder.costomerName', label: '客户名称'},
{prop: 'refundAmount', label: '退款金额'},
{prop: 'actualAmount', label: '实退金额'},
{prop: 'currency', label: '币别'},
{prop: 'refundNum', label: '退货数量'},
{prop: 'status', label: '单据状态 '},
{prop: 'creatorTime', label: '创建时间'},
{prop: 'creatorUserName', label: '创建人'},
{prop: 'remark', 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"}],
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/saleback/Saleback/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/saleback/Saleback/${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/saleback/Saleback/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/saleback/Saleback/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>

@ -9,7 +9,7 @@
<el-form-item label="物料编码"
prop="materialCode" >
<popupSelect v-model="dataForm.materialCode"
placeholder="请选择" clearable field="materialCode" interfaceId="381037852907038533" :columnOptions="materialCodecolumnOptions" propsValue="id" relationField="item_code" popupType="dialog"
placeholder="请选择" clearable field="materialCode" interfaceId="381037852907038533" :columnOptions="materialCodecolumnOptions" propsValue="item_code" relationField="item_code" popupType="dialog"
popupTitle="选择数据" popupWidth="800px">
</popupSelect>
@ -36,7 +36,7 @@
<el-col :span="12">
<el-form-item label="销售合同" prop="salesName">
<popupSelect v-model="dataForm.salesName" placeholder="请选择" clearable field="salesName"
interfaceId="381038993740949317" :columnOptions="salesNamecolumnOptions" propsValue="id" relationField="contract_name" popupType="dialog"
interfaceId="383242092673015365" :bissId="bissId" :columnOptions="salesNamecolumnOptions" propsValue="contract_name" relationField="contract_name" popupType="dialog"
popupTitle="选择数据" popupWidth="800px">
</popupSelect>
</el-form-item>
@ -85,7 +85,7 @@
<el-col :span="12">
<el-form-item label="车号" prop="licenseNo">
<popupSelect v-model="dataForm.licenseNo" placeholder="请选择" clearable field="licenseNo"
interfaceId="381432451370615173" :columnOptions="licenseNocolumnOptions" propsValue="id" relationField="ticketno" popupType="dialog"
interfaceId="381432451370615173" :columnOptions="licenseNocolumnOptions" propsValue="ticketno" relationField="ticketno" popupType="dialog"
popupTitle="选择数据" popupWidth="800px">
</popupSelect>
@ -186,6 +186,7 @@
props: [],
data() {
return {
bissId: '1',
visible: false,
loading: false,
isDetail: false,

Loading…
Cancel
Save