add:页面
This commit is contained in:
@@ -5,6 +5,7 @@ import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* s
|
||||
@@ -16,11 +17,24 @@ public enum QueryTEnum {
|
||||
//
|
||||
EQ((q, k, v) -> { q.eq(k[0],v); }),
|
||||
IN((q, key, o) -> { if (o instanceof Collection){ q.in(key[0],(Collection) o); } }),
|
||||
LK((q, keys, o) -> { for (String key : keys) { q.like(key,o); } }),
|
||||
LK((queryWrapper, keys, val) -> {
|
||||
queryWrapper.nested((Consumer<QueryWrapper>) query -> {
|
||||
query.like(keys[0], val);
|
||||
for (int i = 1; i < keys.length; i++) {
|
||||
query.or(true).like(keys[i], val);
|
||||
}
|
||||
});
|
||||
}),
|
||||
LE((q, k, v) -> { q.le(k[0],v); }),
|
||||
GE((q, k, v) -> { q.ge(k[0],v); }),
|
||||
BY((q, k, v) -> { q.orderByDesc(k[0],v); }),
|
||||
NO((q, k, v) -> { q.isNull(k[0]); }),
|
||||
LT((q, k, v) -> { q.lt(k[0],v); }),
|
||||
BT((q, k, v) -> { q.between(k[0],((Object[])v)[0],((Object[])v)[1]); }),
|
||||
LASTSQL((q, k, o) -> {
|
||||
q.eq("1","1");
|
||||
q.last(String.valueOf(k[0]));
|
||||
}),
|
||||
OREQ((q, k, v) -> { if (StringUtils.isBlank((String)v)){ q.isNull(k[0]); }else { q.eq(k[0],v); } });
|
||||
|
||||
private LConsumer<QueryWrapper,String[], Object> doP;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.boge.modules.car.service.impl;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -18,11 +19,13 @@ public class CarServiceImpl extends ServiceImpl<CarDao, CarEntity> implements Ca
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
QueryWrapper<CarEntity> query = new QueryWrapper<>();
|
||||
if (params.get("key") != null){
|
||||
query.like("car_name",params.get("key"));
|
||||
}
|
||||
IPage<CarEntity> page = this.page(
|
||||
new Query<CarEntity>().getPage(params),
|
||||
new QueryWrapper<CarEntity>()
|
||||
new Query<CarEntity>().getPage(params),query
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.boge.modules.client.controller;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.modules.client.entity.ClientQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -35,10 +38,9 @@ public class ClientController {
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
//@RequiresPermissions("client:client:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = clientService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
public R list(PageQuery page, ClientQuery query){
|
||||
Page<ClientEntity> result = clientService.page(page.build(), query.build());
|
||||
return R.ok().put("page", new PageUtils(result));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.boge.modules.client.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.boge.common.query.BaseQuery;
|
||||
import com.boge.common.query.QParam;
|
||||
import com.boge.common.query.QueryTEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 公司
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:46:19
|
||||
*/
|
||||
@Data
|
||||
public class ClientQuery extends BaseQuery<ClientEntity> {
|
||||
|
||||
private String key;
|
||||
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("key", QParam.builder().k(new String[]{"client_name"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.boge.modules.contract.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.modules.client.entity.ClientQuery;
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import com.boge.modules.contract.entity.ContractQuery;
|
||||
import com.boge.modules.contract.service.ContractService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -30,10 +34,9 @@ public class ContractController {
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
//@RequiresPermissions("flow:contract:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = contractService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
public R list(PageQuery page, ContractQuery query){
|
||||
Page<ContractEntity> entityPage = contractService.page(page.build(), query.build());
|
||||
return R.ok().put("page", new PageUtils(entityPage));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.boge.modules.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.boge.common.query.BaseQuery;
|
||||
import com.boge.common.query.QParam;
|
||||
import com.boge.common.query.QueryTEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@Data
|
||||
public class ContractQuery extends BaseQuery<ContractEntity> {
|
||||
private Integer isValidity;
|
||||
private Integer isAcceptance;
|
||||
private Integer contractType;
|
||||
private String contractNumber;
|
||||
private String clientName;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("contractNumber", QParam.builder().k(new String[]{"contract_number"}).type(QueryTEnum.LK).build());
|
||||
super.doP.put("clientName", QParam.builder().k(new String[]{"client_name"}).type(QueryTEnum.LK).build());
|
||||
super.doP.put("startTime", QParam.builder().k(new String[]{"acceptance_time"}).type(QueryTEnum.LT).build());
|
||||
super.doP.put("endTime", QParam.builder().k(new String[]{"acceptance_time"}).type(QueryTEnum.LE).build());
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.modules.dict.dao.Dict;
|
||||
import com.boge.modules.dict.dto.DictQuery;
|
||||
import liquibase.pro.packaged.I;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
@@ -85,4 +86,10 @@ public interface ISysDictService extends IService<Dict> {
|
||||
* @return
|
||||
*/
|
||||
List<Dict> queryAll();
|
||||
|
||||
/**
|
||||
* 查询label,value
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> getAllLable();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.boge.common.exception.RRException;
|
||||
import com.boge.common.query.MapOf;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.common.utils.ShiroUtils;
|
||||
import com.boge.modules.dict.dao.Dict;
|
||||
@@ -17,14 +18,12 @@ import com.boge.modules.dict.dao.mapper.SysDictMapper;
|
||||
import com.boge.modules.dict.dto.DictQuery;
|
||||
import com.boge.modules.dict.service.ISysDictService;
|
||||
import com.boge.modules.sys.entity.SysUserEntity;
|
||||
import liquibase.pro.packaged.S;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -202,4 +201,13 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
.groupBy(Dict::getCode, Dict::getName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getAllLable() {
|
||||
List<Dict> dicts = sysDictMapper.selectList(new QueryWrapper<Dict>().select("value", "label"));
|
||||
Map<String, String> result = new HashMap<>();
|
||||
for (Dict dict : dicts) {
|
||||
result.put(dict.getLabel(),dict.getValue());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
package com.boge.modules.material.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.modules.dept.util.PageUtil;
|
||||
import com.boge.modules.material.dao.MaterialQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.boge.modules.material.entity.MaterialEntity;
|
||||
import com.boge.modules.material.service.MaterialService;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
/**
|
||||
@@ -35,13 +43,11 @@ public class MaterialController {
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
//@RequiresPermissions("material:material:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = materialService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
public R list(PageQuery page, MaterialQuery query){
|
||||
Page<MaterialEntity> entityPage = materialService.page(page.build(), query.build());
|
||||
return R.ok().put("page", new PageUtils(entityPage));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@@ -64,6 +70,20 @@ public class MaterialController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/importExcel")
|
||||
//@RequiresPermissions("material:material:save")
|
||||
public R batchSave(@RequestParam("file") MultipartFile file){
|
||||
List<String> list = materialService.importMarial(file);
|
||||
if (!CollectionUtils.isEmpty(list)){
|
||||
return R.error(list.stream().collect(Collectors.joining(",")));
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.boge.modules.material.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.boge.common.base.TableDataInfo;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.common.utils.ShiroUtils;
|
||||
import com.boge.modules.material.dao.MaterialPriceQuery;
|
||||
import com.boge.modules.material.entity.MaterialEntity;
|
||||
import com.boge.modules.material.entity.MaterialPriceEntity;
|
||||
import com.boge.modules.material.service.MaterialPriceService;
|
||||
import com.boge.modules.material.service.MaterialService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 20:06:39
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("materialPrice")
|
||||
public class MaterialPriceController {
|
||||
@Autowired
|
||||
private MaterialService materialService;
|
||||
@Autowired
|
||||
private MaterialPriceService materialPriceService;
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info")
|
||||
//@RequiresPermissions("material:material:info")
|
||||
public R info(PageQuery page, MaterialPriceQuery query){
|
||||
page.setSort("id,desc");
|
||||
Page<MaterialPriceEntity> entityPage = materialPriceService.page(page.build(), query.build());
|
||||
return R.ok().put("data",entityPage.getRecords())
|
||||
.put("page",page.getPage())
|
||||
.put("size",page.getSize()).put("total",entityPage.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
//@RequiresPermissions("material:material:save")
|
||||
public R save(@RequestBody MaterialPriceEntity material){
|
||||
material.setCreateTime(new Date());
|
||||
material.setCreateName(ShiroUtils.getUserEntity().getNickname());
|
||||
materialPriceService.save(material);
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* 价格变动
|
||||
*/
|
||||
@RequestMapping("/use")
|
||||
//@RequiresPermissions("material:material:save")
|
||||
public R use(@RequestBody MaterialPriceEntity price){
|
||||
materialService.update(new UpdateWrapper<MaterialEntity>()
|
||||
.set("cost_price",price.getCostPrice())
|
||||
.set("sale_price",price.getSalePrice())
|
||||
.set("update_time",new Date())
|
||||
.set("update_Name", ShiroUtils.getUserEntity().getNickname())
|
||||
.set("sale_price",price.getSalePrice())
|
||||
.eq("material_code",price.getMaterialCode()));
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* 批量导入
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/importExcel")
|
||||
//@RequiresPermissions("material:material:save")
|
||||
public R batchSave(@RequestParam("file") MultipartFile file){
|
||||
List<String> list = materialService.importMarial(file);
|
||||
if (!CollectionUtils.isEmpty(list)){
|
||||
return R.error(list.stream().collect(Collectors.joining(",")));
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* 修改单价
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
//@RequiresPermissions("material:material:update")
|
||||
public R update(@RequestBody MaterialEntity price){
|
||||
Date date = new Date();
|
||||
MaterialPriceEntity priceEntity = new MaterialPriceEntity();
|
||||
priceEntity.setCostPrice(price.getCostPrice());
|
||||
priceEntity.setSalePrice(price.getSalePrice());
|
||||
priceEntity.setMaterialCode(price.getMaterialCode());
|
||||
priceEntity.setCreateTime(date);
|
||||
priceEntity.setCreateName(ShiroUtils.getUserEntity().getNickname());
|
||||
materialPriceService.save(priceEntity);
|
||||
price.setUpdateTime(date);
|
||||
price.setUpdateName(ShiroUtils.getUserEntity().getNickname());
|
||||
materialService.updateById(price);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
//@RequiresPermissions("material:material:delete")
|
||||
public R delete(@RequestBody Long[] materialIds){
|
||||
materialPriceService.removeByIds(Arrays.asList(materialIds));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.boge.modules.material.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.modules.material.entity.MaterialEntity;
|
||||
import com.boge.modules.material.entity.MaterialPriceEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 20:06:39
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialPriceDao extends BaseMapper<MaterialPriceEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.boge.modules.material.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.common.query.BaseQuery;
|
||||
import com.boge.modules.material.entity.MaterialPriceEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 20:06:39
|
||||
*/
|
||||
@Data
|
||||
public class MaterialPriceQuery extends BaseQuery<MaterialPriceEntity> {
|
||||
private String materialCode;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.boge.modules.material.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.common.query.BaseQuery;
|
||||
import com.boge.common.query.QParam;
|
||||
import com.boge.common.query.QueryTEnum;
|
||||
import com.boge.modules.material.entity.MaterialEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 20:06:39
|
||||
*/
|
||||
@Data
|
||||
public class MaterialQuery extends BaseQuery<MaterialEntity> {
|
||||
private String key;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("key", QParam.builder().k(new String[]{"material_code","material_name"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import liquibase.pro.packaged.S;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -53,6 +53,18 @@ public class MaterialEntity implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String updateName;
|
||||
/**
|
||||
* 成本价
|
||||
*/
|
||||
private BigDecimal costPrice;
|
||||
/**
|
||||
* 销售价
|
||||
*/
|
||||
private BigDecimal salePrice;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.boge.modules.material.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 20:06:39
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_material_price")
|
||||
public class MaterialPriceEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 成本价
|
||||
*/
|
||||
private BigDecimal costPrice;
|
||||
/**
|
||||
* 销售价
|
||||
*/
|
||||
private BigDecimal salePrice;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String createName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.boge.modules.material.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.modules.material.entity.MaterialEntity;
|
||||
import com.boge.modules.material.entity.MaterialPriceEntity;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 20:06:39
|
||||
*/
|
||||
public interface MaterialPriceService extends IService<MaterialPriceEntity> {
|
||||
|
||||
List<String> importMarial(MultipartFile file);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.boge.modules.material.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.modules.material.entity.MaterialEntity;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -16,5 +18,7 @@ import java.util.Map;
|
||||
public interface MaterialService extends IService<MaterialEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<String> importMarial(MultipartFile file);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.boge.modules.material.service.impl;
|
||||
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.boge.common.exception.RRException;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.Query;
|
||||
import com.boge.modules.dict.service.ISysDictService;
|
||||
import com.boge.modules.material.dao.MaterialDao;
|
||||
import com.boge.modules.material.dao.MaterialPriceDao;
|
||||
import com.boge.modules.material.entity.MaterialEntity;
|
||||
import com.boge.modules.material.entity.MaterialPriceEntity;
|
||||
import com.boge.modules.material.service.MaterialPriceService;
|
||||
import com.boge.modules.material.service.MaterialService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service()
|
||||
public class MaterialPriceServiceImpl extends ServiceImpl<MaterialPriceDao, MaterialPriceEntity> implements MaterialPriceService {
|
||||
|
||||
@Override
|
||||
public List<String> importMarial(MultipartFile file){
|
||||
if (file==null){
|
||||
throw new RRException("文件不存在");
|
||||
}
|
||||
List<String> errorInfo = new ArrayList<>();
|
||||
List<MaterialEntity> entitys = new ArrayList<>();
|
||||
Map<String, Integer> codeLine = new HashMap<>();
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
inputStream = file.getInputStream();
|
||||
ExcelReader excelReader = ExcelUtil.getReader(inputStream);
|
||||
List<List<Object>> read = excelReader.read();
|
||||
Date date = new Date();
|
||||
for (int i = 1; i < read.size(); i++) {
|
||||
List<Object> row = read.get(i);
|
||||
}
|
||||
if (CollectionUtils.isEmpty(errorInfo)){
|
||||
|
||||
}
|
||||
}catch (Exception ex){
|
||||
throw new RRException(ex.getMessage());
|
||||
}finally {
|
||||
if (inputStream!=null){
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return errorInfo;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,24 @@
|
||||
package com.boge.modules.material.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.boge.common.exception.RRException;
|
||||
import com.boge.common.utils.ShiroUtils;
|
||||
import com.boge.modules.dict.service.ISysDictService;
|
||||
import lombok.val;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -11,11 +28,16 @@ import com.boge.common.utils.Query;
|
||||
import com.boge.modules.material.dao.MaterialDao;
|
||||
import com.boge.modules.material.entity.MaterialEntity;
|
||||
import com.boge.modules.material.service.MaterialService;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
@Service("materialService")
|
||||
public class MaterialServiceImpl extends ServiceImpl<MaterialDao, MaterialEntity> implements MaterialService {
|
||||
|
||||
@Autowired
|
||||
private ISysDictService iSysDictService;
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<MaterialEntity> page = this.page(
|
||||
@@ -26,4 +48,72 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialDao, MaterialEntity
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> importMarial(MultipartFile file){
|
||||
if (file==null){
|
||||
throw new RRException("文件不存在");
|
||||
}
|
||||
List<String> errorInfo = new ArrayList<>();
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
inputStream = file.getInputStream();
|
||||
ExcelReader excelReader = ExcelUtil.getReader(inputStream);
|
||||
List<List<Object>> read = excelReader.read();
|
||||
|
||||
List<MaterialEntity> entitys = new ArrayList<>();
|
||||
Map<String, Integer> codeLine = new HashMap<>();
|
||||
Map<String, String> allLable = iSysDictService.getAllLable();
|
||||
Date date = new Date();
|
||||
String user = ShiroUtils.getUserEntity().getNickname();
|
||||
for (int i = 1; i < read.size(); i++) {
|
||||
List<Object> row = read.get(i);
|
||||
if (CollectionUtils.isEmpty(row)){
|
||||
continue;
|
||||
}
|
||||
if (row.size()<5){
|
||||
errorInfo.add("当前行"+i+":"+"参数不全");
|
||||
continue;
|
||||
}
|
||||
codeLine.put(String.valueOf( row.get(0)),i);
|
||||
|
||||
String type = allLable.get(String.valueOf(row.get(4)));
|
||||
if (StringUtils.isEmpty(type)){
|
||||
errorInfo.add("当前行"+i+":"+"物料类型不存在");
|
||||
continue;
|
||||
}
|
||||
MaterialEntity entity = new MaterialEntity();
|
||||
entity.setMaterialCode(String.valueOf( row.get(0)));
|
||||
entity.setMaterialName(String.valueOf( row.get(1)));
|
||||
entity.setMaterialSpec(String.valueOf( row.get(2)));
|
||||
entity.setUnitName(String.valueOf( row.get(3)));
|
||||
entity.setUpdateTime(date);
|
||||
entity.setUpdateName(user);
|
||||
entity.setMaterialType(Integer.valueOf(type));
|
||||
entitys.add(entity);
|
||||
}
|
||||
List<String> materialCodes = entitys.stream().map(MaterialEntity::getMaterialCode).collect(Collectors.toList());
|
||||
List<MaterialEntity> has = this.baseMapper.selectList(new QueryWrapper<MaterialEntity>()
|
||||
.in("material_code", materialCodes));
|
||||
if (!CollectionUtils.isEmpty(has)){
|
||||
has.forEach(a->{
|
||||
Integer integer = codeLine.get(a.getMaterialCode());
|
||||
errorInfo.add("当前行"+integer+":"+a.getMaterialCode()+"编码数据已存在");
|
||||
});
|
||||
}
|
||||
if (CollectionUtils.isEmpty(errorInfo)){
|
||||
this.saveBatch(entitys);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
throw new RRException(ex.getMessage());
|
||||
}finally {
|
||||
if (inputStream!=null){
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return errorInfo;
|
||||
}
|
||||
}
|
||||
@@ -38,24 +38,20 @@ public class PriceEntity implements Serializable {
|
||||
*/
|
||||
private String quoter;
|
||||
/**
|
||||
* 接收人
|
||||
* 发货方信息
|
||||
*/
|
||||
private String fattn;
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String fmobile;
|
||||
private String finc;
|
||||
private String fadd;
|
||||
private String ftel;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private Long clientId;
|
||||
/**
|
||||
* 客户接收人
|
||||
* 收货方信息
|
||||
*/
|
||||
private String tattn;
|
||||
/**
|
||||
* 客户接收人联系方法
|
||||
*/
|
||||
private String tmobile;
|
||||
private String tinc;
|
||||
private String tadd;
|
||||
private String ttel;
|
||||
/**
|
||||
* 物料信息
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.boge.modules.project.contract.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import com.boge.modules.contract.entity.ContractQuery;
|
||||
import com.boge.modules.project.contract.entity.ProjectContractEntity;
|
||||
import com.boge.modules.project.contract.entity.ProjectContractQuery;
|
||||
import com.boge.modules.project.contract.service.ProjectContractService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -30,13 +35,11 @@ public class ProjectContractController {
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
//@RequiresPermissions("flow:contract:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = contractService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
public R list(PageQuery page, ProjectContractQuery query) {
|
||||
Page<ProjectContractEntity> entityPage = contractService.page(page.build(), query.build());
|
||||
return R.ok().put("page", new PageUtils(entityPage));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
|
||||
@@ -42,6 +42,10 @@ public class ProjectContractEntity implements Serializable {
|
||||
* 客户id
|
||||
*/
|
||||
private Long clientId;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private String clientName;
|
||||
/**
|
||||
* 物料信息
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.boge.modules.project.contract.entity;
|
||||
|
||||
import com.boge.common.query.BaseQuery;
|
||||
import com.boge.common.query.QParam;
|
||||
import com.boge.common.query.QueryTEnum;
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@Data
|
||||
public class ProjectContractQuery extends BaseQuery<ProjectContractEntity> {
|
||||
private Integer isValidity;
|
||||
private Integer isAcceptance;
|
||||
private Integer contractType;
|
||||
private String contractNumber;
|
||||
private String[] acceptanceTime;
|
||||
private String clientName;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("contractNumber", QParam.builder().k(new String[]{"contract_number"}).type(QueryTEnum.LK).build());
|
||||
super.doP.put("clientName", QParam.builder().k(new String[]{"client_name"}).type(QueryTEnum.LK).build());
|
||||
super.doP.put("startTime", QParam.builder().k(new String[]{"acceptance_time"}).type(QueryTEnum.GE).build());
|
||||
super.doP.put("endTime", QParam.builder().k(new String[]{"acceptance_time"}).type(QueryTEnum.LE).build());
|
||||
super.doP.put("isValidity", QParam.builder().k(new String[]{"AND NOW()"+(Integer.valueOf(1).equals(isValidity)?"<=":">")+" DATE_ADD(acceptance_time, INTERVAL validity DAY)"}).type(QueryTEnum.LASTSQL).build());
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String username = (String)params.get("username");
|
||||
Long createUserId = (Long)params.get("createUserId");
|
||||
IPage<SysUserEntity> page = this.page(
|
||||
new Query<SysUserEntity>().getPage(params),
|
||||
new QueryWrapper<SysUserEntity>()
|
||||
|
||||
@@ -24,7 +24,7 @@ import './style/bpmn-custom-color.css' // 导入自定义的样式文件
|
||||
Vue.prototype.$echarts = echarts;
|
||||
Vue.use(VueCookie)
|
||||
Vue.use(ElementUI)
|
||||
Vue.config.productionTip = false
|
||||
Vue.config.productionTip = true
|
||||
|
||||
// 非生产环境, 适配mockjs模拟数据 // api: https://github.com/nuysoft/Mock
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
|
||||
128
base-vue/src/views/common/UploadDialog.vue
Normal file
128
base-vue/src/views/common/UploadDialog.vue
Normal file
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入Excel文件"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="400px"
|
||||
:show-close="true"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
drag
|
||||
:on-exceed="is_one"
|
||||
:limit="1"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
:show-file-list="true"
|
||||
:on-change="uploadByJsqd"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传Excel文件,且不超过10MB</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="close()">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
mixins: [],
|
||||
components: {},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
},
|
||||
urlApi: ''
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
file1: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
is_one() {
|
||||
this.$message.error('只能上传一个excel文件!')
|
||||
},
|
||||
// 文件校验方法
|
||||
beforeAvatarUpload(file) {
|
||||
// 不能导入大小超过2Mb的文件
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 文件发生改变就会触发的事件
|
||||
uploadByJsqd (file) {
|
||||
this.file1 = file
|
||||
},
|
||||
submit () {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
this.fileList.url = ''
|
||||
var formdata = new FormData()
|
||||
formdata.append('file', this.file1.raw)
|
||||
// excelImport:请求接口 formdata:传递参数
|
||||
debugger
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(this.urlApi),
|
||||
method: 'post',
|
||||
data: formdata
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
this.$emit('event-close', false)
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -227,10 +227,10 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialId"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialCode"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" size="mini" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
<el-input v-model="dataForm.key" placeholder="车辆名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
@@ -24,10 +24,10 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="carId"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="carName"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" size="mini" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
<el-input v-model="dataForm.key" placeholder="客户名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
@@ -24,10 +24,10 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="clientId"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="clientName"
|
||||
|
||||
@@ -227,10 +227,10 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialId"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialCode"
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialId"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialType"
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" size="mini" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
<el-input v-model="dataForm.key" placeholder="物料编码,名称或规格" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('material:material:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button type="primary" @click="uploadShow = true">导入</el-button>
|
||||
<el-button v-if="isAuth('material:material:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -24,10 +25,10 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialId"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialCode"
|
||||
@@ -71,10 +72,16 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
label="操作人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="操作人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
@@ -99,18 +106,22 @@
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :dictData="dictData" @refreshDataList="getDataList"></add-or-update>
|
||||
<UploadDialog :dialog-show.sync="uploadShow" @event-close="closeUpload" urlApi='/material/material/importExcel' />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './material-add-or-update'
|
||||
import { apiUtils } from '@/utils/dict'
|
||||
import UploadDialog from '../../common/UploadDialog'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
uploadShow: false,
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
@@ -124,7 +135,7 @@
|
||||
},
|
||||
mixins: [apiUtils],
|
||||
components: {
|
||||
AddOrUpdate
|
||||
AddOrUpdate, UploadDialog
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
@@ -152,6 +163,10 @@
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
closeUpload () {
|
||||
this.uploadShow = false
|
||||
this.getDataList()
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
|
||||
BIN
base-vue/src/views/modules/material/物料导入模版.xlsx
Normal file
BIN
base-vue/src/views/modules/material/物料导入模版.xlsx
Normal file
Binary file not shown.
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.materialId ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible"
|
||||
width="500px">
|
||||
<el-form :model="dataForm" :rules="dataRule" size="mini" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="物料编码" prop="materialCode">
|
||||
<el-input disabled v-model="dataForm.materialCode" placeholder="物料编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input disabled v-model="dataForm.materialName" placeholder="物料名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料规格" prop="materialSpec">
|
||||
<el-input disabled v-model="dataForm.materialSpec" placeholder="物料名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="成本价" prop="costPrice">
|
||||
<el-input-number precision="2" v-model="dataForm.costPrice" placeholder="成本价"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售价" prop="salePrice">
|
||||
<el-input-number precision="2" v-model="dataForm.salePrice" placeholder="销售价"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" @click="visible = false">取消</el-button>
|
||||
<el-button size="mini" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
materialId: 0,
|
||||
materialCode: '',
|
||||
materialName: '',
|
||||
materialSpec: '',
|
||||
costPrice: '',
|
||||
salePrice: '',
|
||||
unitName: '',
|
||||
materialType: '',
|
||||
isOn: 0
|
||||
},
|
||||
dataRule: {
|
||||
materialCode: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
materialName: [
|
||||
{ required: true, message: '物料名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
materialType: [
|
||||
{ required: true, message: '物料类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
dictData: Array
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.materialId = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.materialId) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/material/material/info/${this.dataForm.materialId}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.materialCode = data.material.materialCode
|
||||
this.dataForm.materialName = data.material.materialName
|
||||
this.dataForm.unitName = data.material.unitName
|
||||
this.dataForm.costPrice = data.material.costPrice
|
||||
this.dataForm.salePrice = data.material.salePrice
|
||||
this.dataForm.materialSpec = data.material.materialSpec
|
||||
this.dataForm.materialType = String(data.material.materialType)
|
||||
this.dataForm.isOn = data.material.isOn
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/materialPrice/${!this.dataForm.materialId ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'materialId': this.dataForm.materialId || undefined,
|
||||
'materialCode': this.dataForm.materialCode,
|
||||
'materialName': this.dataForm.materialName,
|
||||
'materialSpec': this.dataForm.materialSpec,
|
||||
'costPrice': this.dataForm.costPrice,
|
||||
'salePrice': this.dataForm.salePrice,
|
||||
'unitName': this.dataForm.unitName,
|
||||
'materialType': this.dataForm.materialType,
|
||||
'isOn': this.dataForm.isOn
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
224
base-vue/src/views/modules/materialprice/materialprice.vue
Normal file
224
base-vue/src/views/modules/materialprice/materialprice.vue
Normal file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" size="mini" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="物料编码,名称或规格" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<!-- <el-button v-if="isAuth('material:material:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>-->
|
||||
<el-button type="primary" @click="uploadShow = true">导入</el-button>
|
||||
<!-- <el-button v-if="isAuth('material:material:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
size="mini"
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="物料编码">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView( scope.row.materialCode)">{{ scope.row.materialCode }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="物料名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialSpec"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="物料规格">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="costPrice"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="成本价">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="salePrice"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="销售价">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="操作时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="操作人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.materialId)">修改</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :dictData="dictData" @refreshDataList="getDataList"></add-or-update>
|
||||
<UploadDialog :dialog-show.sync="uploadShow" @event-close="closeUpload" urlApi='/material/material/importExcel' />
|
||||
<PriceList ref="priceList" :dialog-show.sync="priceView" @refreshDataList="getDataList"/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './material-add-or-update'
|
||||
import { apiUtils } from '@/utils/dict'
|
||||
import UploadDialog from '../../common/UploadDialog'
|
||||
import PriceList from './price-list'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
uploadShow: false,
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
priceView: false,
|
||||
dictConfigs: [{type: 'dict', code: 'material_type'}],
|
||||
dictData: []
|
||||
}
|
||||
},
|
||||
mixins: [apiUtils],
|
||||
components: {
|
||||
AddOrUpdate, UploadDialog, PriceList
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
toView (materialCode) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.priceList.init(materialCode)
|
||||
})
|
||||
},
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/material/material/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
closeUpload () {
|
||||
this.uploadShow = false
|
||||
this.getDataList()
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.materialId
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/material/material/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
171
base-vue/src/views/modules/materialprice/price-list.vue
Normal file
171
base-vue/src/views/modules/materialprice/price-list.vue
Normal file
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="维护记录"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="priceView">
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
size="mini"
|
||||
max-height="400"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="物料编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="costPrice"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="成本价">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="salePrice"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="销售价">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="usePrice(scope.row)">启用</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" @click="closeView">关闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
priceView: false,
|
||||
materialCode: '',
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
headers: { 'Token': this.$cookie.get('token') }
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (materialCode) {
|
||||
this.dataList = []
|
||||
this.materialCode = materialCode
|
||||
this.priceView = true
|
||||
this.$nextTick(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/materialPrice/info`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'size': this.pageSize,
|
||||
'materialCode': materialCode
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.data
|
||||
this.totalPage = data.total
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
usePrice (price) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/materialPrice/use`),
|
||||
method: 'post',
|
||||
data: price
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.$refs.upload.clearFiles()
|
||||
this.activeName = 'first'
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.init(this.materialCode)
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.init(this.materialCode)
|
||||
},
|
||||
closeView (val) {
|
||||
// eslint-disable-next-line no-unused-expressions,no-sequences
|
||||
this.priceView = false,
|
||||
this.materialCode = '',
|
||||
this.dataList = []
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tab_box_wraper {
|
||||
width: 460px;
|
||||
}
|
||||
.file-item {
|
||||
border: 1px solid #eee;
|
||||
padding: 5px 8px 5px 15px;
|
||||
}
|
||||
.file-item-name {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
.el-pagination {
|
||||
margin-top: 15px;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -150,7 +150,7 @@
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
tempVisible: false,
|
||||
dictConfigs: [{type: 'dict', code: 'contract_type'}, {url: '/client/client/list', type: 'list', value: 'clientId', label: 'clientName'}],
|
||||
dictConfigs: [{type: 'dict', code: 'contract_type'}, {url: '/client/client/list', type: 'list', value: 'clientId', label: 'clientName'}, {url: '/sys/user/list', type: 'list', value: 'userId', label: 'username'}],
|
||||
statusOpt: [{value: '1', label: '未审核'}, {value: '2', label: '审核通过'}, {value: '3', label: '审核驳回'}]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编号" prop="contractNumber">
|
||||
<el-input v-model="dataForm.contractNumber" placeholder="合同编号"></el-input>
|
||||
<el-input disabled v-model="dataForm.contractNumber" placeholder="系统生成"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否是主合同" prop="isMaster">
|
||||
<el-switch
|
||||
@@ -243,10 +243,10 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialId"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialCode"
|
||||
@@ -314,9 +314,6 @@
|
||||
contractType: [
|
||||
{ required: true, message: '合同类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
contractNumber: [
|
||||
{ required: true, message: '合同编号不能为空', trigger: 'blur' }
|
||||
],
|
||||
clientId: [
|
||||
{ required: true, message: '客户不能为空', trigger: 'blur' }
|
||||
]
|
||||
|
||||
@@ -1,8 +1,51 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form size="mini" :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
<el-form-item label="客户名称">
|
||||
<el-input v-model="dataForm.clientName" placeholder="客户名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编号">
|
||||
<el-input v-model="dataForm.contractNumber" placeholder="合同编号" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型">
|
||||
<el-select v-model="dataForm.contractType" placeholder="请选择合同类型" clearable>
|
||||
<el-option
|
||||
v-for="item in dictData[0]"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同日期">
|
||||
<el-date-picker
|
||||
v-model="dataForm.acceptanceTime"
|
||||
type="daterange"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否验收">
|
||||
<el-select v-model="dataForm.isAcceptance" placeholder="是否验收" clearable>
|
||||
<el-option
|
||||
v-for="item in dictData[2]"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否在保">
|
||||
<el-select v-model="dataForm.isValidity" placeholder="是否在保" clearable>
|
||||
<el-option
|
||||
v-for="item in dictData[2]"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
@@ -128,7 +171,12 @@
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
isValidity: null,
|
||||
isAcceptance: null,
|
||||
acceptanceTime: [],
|
||||
contractType: null,
|
||||
contractNumber: null,
|
||||
clientName: null
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
@@ -138,7 +186,7 @@
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
tempVisible: false,
|
||||
dictConfigs: [{type: 'dict', code: 'contract_type'}, {url: '/client/client/list', type: 'list', value: 'clientId', label: 'clientName'}],
|
||||
dictConfigs: [{type: 'dict', code: 'contract_type'}, {url: '/client/client/list', type: 'list', value: 'clientId', label: 'clientName'}, {type: 'dict', code: 'onoff'}],
|
||||
}
|
||||
},
|
||||
mixins: [apiUtils],
|
||||
@@ -153,13 +201,26 @@
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
let startTime = null
|
||||
let endTime = null
|
||||
if (this.dataForm.acceptanceTime != null && this.dataForm.acceptanceTime.length > 1){
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
startTime = this.dataForm.acceptanceTime[0]
|
||||
endTime = this.dataForm.acceptanceTime[1]
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/flow/projectContract/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
'isValidity': this.dataForm.isValidity,
|
||||
'isAcceptance': this.dataForm.isAcceptance,
|
||||
'startTime': startTime,
|
||||
'endTime': endTime,
|
||||
'contractType': this.dataForm.contractType,
|
||||
'contractNumber': this.dataForm.contractNumber,
|
||||
'clientName': this.dataForm.clientName
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialId"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="materialCode"
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="80"
|
||||
label="ID">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="paramKey"
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="id"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="80"
|
||||
label="ID">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="username"
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="roleId"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="80"
|
||||
label="ID">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="roleName"
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="userId"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="80"
|
||||
label="ID">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="username"
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="userId"
|
||||
type="index"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="80"
|
||||
label="ID">
|
||||
label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="username"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.config.productionTip = true
|
||||
|
||||
Reference in New Issue
Block a user