fix: 基础框架修改,去除不要代码

This commit is contained in:
2024-03-25 18:04:26 +08:00
parent 3c3114985b
commit c61a5083c3
29 changed files with 1335 additions and 222 deletions

View File

@@ -228,6 +228,9 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
menu.setPid(resources.getPid());
menu.setMenu_sort(resources.getMenu_sort());
menu.setCache(resources.getCache());
menu.setEn_title(resources.getEn_title());
menu.setZh_title(resources.getZh_title());
menu.setIn_title(resources.getIn_title());
menu.setHidden(resources.getHidden());
menu.setComponent_name(resources.getComponent_name());
menu.setPermission(resources.getPermission());

View File

@@ -32,14 +32,12 @@ public class MdBaseClassstandardController {
@GetMapping
@Log("查询基础分类")
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(mdBaseClassstandardService.queryAll(whereJson,page)),HttpStatus.OK);
}
@PostMapping
@Log("新增基础分类")
public ResponseEntity<Object> create(@Validated @RequestBody MdBaseClassstandard entity){
mdBaseClassstandardService.create(entity);
return new ResponseEntity<>(HttpStatus.CREATED);
@@ -47,14 +45,12 @@ public class MdBaseClassstandardController {
@PutMapping
@Log("修改基础分类")
public ResponseEntity<Object> update(@Validated @RequestBody MdBaseClassstandard entity){
mdBaseClassstandardService.update(entity);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除基础分类")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody List<String> ids) {
mdBaseClassstandardService.deleteAll(ids);
@@ -63,14 +59,12 @@ public class MdBaseClassstandardController {
@GetMapping("/getClassName")
@Log("获取分类名称下拉框")
public ResponseEntity<Object> getClassName() {
return new ResponseEntity<>(mdBaseClassstandardService.getClassName(), HttpStatus.OK);
}
@GetMapping("/loadClass")
@Log("查询基础类型")
public ResponseEntity<Object> query(@RequestParam Map whereJson) {
return new ResponseEntity<>(mdBaseClassstandardService.loadClass(whereJson), HttpStatus.OK);
}

View File

@@ -0,0 +1,59 @@
package org.nl.wms.basedata.master.customer.controller;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.base.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.basedata.master.customer.service.ICustomerbaseService;
import org.nl.wms.basedata.master.customer.service.dao.Customerbase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import java.util.Set;
/**
* @author lyd
* @date 2024-03-25
**/
@Slf4j
@RestController
@RequestMapping("/api/customerbase")
public class CustomerbaseController {
@Autowired
private ICustomerbaseService customerbaseService;
@GetMapping
@Log("查询客户信息管理")
//@SaCheckPermission("@el.check('customerbase:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(customerbaseService.queryAll(whereJson,page)),HttpStatus.OK);
}
@PostMapping
@Log("新增客户信息管理")
//@SaCheckPermission("@el.check('customerbase:add')")
public ResponseEntity<Object> create(@Validated @RequestBody Customerbase entity){
customerbaseService.create(entity);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PutMapping
@Log("修改客户信息管理")
//@SaCheckPermission("@el.check('customerbase:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody Customerbase entity){
customerbaseService.update(entity);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除客户信息管理")
//@SaCheckPermission("@el.check('customerbase:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
customerbaseService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -0,0 +1,43 @@
package org.nl.wms.basedata.master.customer.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.nl.common.domain.query.PageQuery;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.wms.basedata.master.customer.service.dao.Customerbase;
import java.util.Map;
import java.util.Set;
/**
* @description 服务接口
* @author lyd
* @date 2024-03-25
**/
public interface ICustomerbaseService extends IService<Customerbase> {
/**
* 查询数据分页
* @param whereJson 条件
* @param pageable 分页参数
* @return IPage<Customerbase>
*/
IPage<Customerbase> queryAll(Map whereJson, PageQuery pageable);
/**
* 创建
* @param entity /
*/
void create(Customerbase entity);
/**
* 编辑
* @param entity /
*/
void update(Customerbase entity);
/**
* 多选删除
* @param ids /
*/
void deleteAll(Set<String> ids);
}

View File

@@ -0,0 +1,139 @@
package org.nl.wms.basedata.master.customer.service.dao;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* @description /
* @author lyd
* @date 2024-03-25
**/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("md_cs_customerbase")
public class Customerbase implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "cust_id", type = IdType.NONE)
/** 客户标识 */
private String cust_id;
/** 客户编码 */
private String cust_code;
/** 客户名称 */
private String cust_name;
/** 客户简称 */
private String cust_simple_name;
/** 国家 */
private String country;
/** 省份 */
private String state;
/** 城市 */
private String city;
/** 传真 */
private String faxnumber;
/** 邮箱 */
private String webSite;
/** 法人代表 */
private String jurid_name;
/** 税务登记号 */
private String tax_no;
/** 工商注册号 */
private String register_no;
/** 经营许可证号 */
private String manage_lice_no;
/** 营业执照 */
private String busi_char_name;
/** 行政区划 */
private String area_id;
/** 邮政编码 */
private String zip_code;
/** 公司电话 */
private String corp_tele_no;
/** 公司地址 */
private String corp_address;
/** 业务员 */
private String sales_owner;
/** 创建人 */
private String create_id;
/** 创建人姓名 */
private String create_name;
/** 创建时间 */
private String create_time;
/** 修改人 */
private String update_optid;
/** 修改人姓名 */
private String update_optname;
/** 修改时间 */
private String update_time;
/** 启用时间 */
private String is_used_time;
/** 是否启用 */
private String is_used;
/** 是否删除 */
private String is_delete;
/** 外部标识 */
private String ext_id;
/** 备注 */
private String remark;
/** 分类标识 */
private String class_id;
/** 分类编码 */
private String class_code;
/** 分类名称 */
private String class_name;
/** 子卷打印模板号 */
private String zj_print_no;
/** 包装打印模板号 */
private String bz_print_no;
/** 送货单打印模板号 */
private String shd_print_no;
/** 送货单明细数 */
private String shd_dtl_num;
/** is_auto_table */
private String is_auto_table;
}

View File

@@ -0,0 +1,12 @@
package org.nl.wms.basedata.master.customer.service.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.nl.wms.basedata.master.customer.service.dao.Customerbase;
/**
* @author lyd
* @date 2024-03-25
**/
public interface CustomerbaseMapper extends BaseMapper<Customerbase> {
}

View File

@@ -0,0 +1,5 @@
<?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="org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper">
</mapper>

View File

@@ -0,0 +1,130 @@
package org.nl.wms.basedata.master.customer.service.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
/**
* @description /
* @author lyd
* @date 2024-03-25
**/
@Data
public class CustomerbaseDto implements Serializable {
/** 客户标识 */
/** 防止精度丢失 */
@JsonSerialize(using= ToStringSerializer.class)
private String cust_id;
/** 客户编码 */
private String cust_code;
/** 客户名称 */
private String cust_name;
/** 客户简称 */
private String cust_simple_name;
/** 国家 */
private String country;
/** 省份 */
private String state;
/** 城市 */
private String city;
/** 传真 */
private String faxnumber;
/** 邮箱 */
private String webSite;
/** 法人代表 */
private String jurid_name;
/** 税务登记号 */
private String tax_no;
/** 工商注册号 */
private String register_no;
/** 经营许可证号 */
private String manage_lice_no;
/** 营业执照 */
private String busi_char_name;
/** 行政区划 */
private Long area_id;
/** 邮政编码 */
private String zip_code;
/** 公司电话 */
private String corp_tele_no;
/** 公司地址 */
private String corp_address;
/** 业务员 */
private String sales_owner;
/** 创建人 */
private Long create_id;
/** 创建人姓名 */
private String create_name;
/** 创建时间 */
private String create_time;
/** 修改人 */
private Long update_optid;
/** 修改人姓名 */
private String update_optname;
/** 修改时间 */
private String update_time;
/** 启用时间 */
private String is_used_time;
/** 是否启用 */
private String is_used;
/** 是否删除 */
private String is_delete;
/** 外部标识 */
private String ext_id;
/** 备注 */
private String remark;
/** 分类标识 */
private Long class_id;
/** 分类编码 */
private String class_code;
/** 分类名称 */
private String class_name;
/** 子卷打印模板号 */
private String zj_print_no;
/** 包装打印模板号 */
private String bz_print_no;
/** 送货单打印模板号 */
private String shd_print_no;
/** 送货单明细数 */
private String shd_dtl_num;
private String is_auto_table;
}

View File

@@ -0,0 +1,12 @@
package org.nl.wms.basedata.master.customer.service.dto;
import org.nl.common.domain.query.BaseQuery;
import org.nl.wms.basedata.master.customer.service.dao.Customerbase;
/**
* @author lyd
* @date 2024-03-25
**/
public class CustomerbaseQuery extends BaseQuery<Customerbase> {
}

View File

@@ -0,0 +1,87 @@
package org.nl.wms.basedata.master.customer.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.config.language.LangProcess;
import org.nl.wms.basedata.master.customer.service.ICustomerbaseService;
import org.nl.wms.basedata.master.customer.service.dao.Customerbase;
import org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.Set;
/**
* @description 服务实现
* @author lyd
* @date 2024-03-25
**/
@Slf4j
@Service
public class CustomerbaseServiceImpl extends ServiceImpl<CustomerbaseMapper, Customerbase> implements ICustomerbaseService {
@Autowired
private CustomerbaseMapper customerbaseMapper;
@Override
public IPage<Customerbase> queryAll(Map whereJson, PageQuery page){
String o = ObjectUtil.isEmpty(whereJson.get("search")) ? null : (String)whereJson.get("search");
LambdaQueryWrapper<Customerbase> lam = new LambdaQueryWrapper<>();
lam.like(o != null, Customerbase::getCust_code, o)
.or(o != null)
.like(o != null, Customerbase::getCust_name, o);
IPage<Customerbase> pages = new Page<>(page.getPage() + 1, page.getSize());
customerbaseMapper.selectPage(pages, lam);
return pages;
}
@Override
public void create(Customerbase entity) {
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
entity.setCust_id(IdUtil.getSnowflake(1, 1).nextIdStr());
entity.setCreate_id(currentUserId);
entity.setCreate_name(nickName);
entity.setCreate_time(now);
entity.setUpdate_optid(currentUserId);
entity.setUpdate_optname(nickName);
entity.setUpdate_time(now);
customerbaseMapper.insert(entity);
}
@Override
public void update(Customerbase entity) {
Customerbase dto = customerbaseMapper.selectById(entity.getCust_id());
if (dto == null) {
throw new BadRequestException(LangProcess.msg("error_SystemAuthError"));
}
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
entity.setUpdate_optid(currentUserId);
entity.setUpdate_optname(nickName);
entity.setUpdate_time(now);
customerbaseMapper.updateById(entity);
}
@Override
public void deleteAll(Set<String> ids) {
// 真删除
customerbaseMapper.deleteBatchIds(ids);
}
}

View File

@@ -0,0 +1,55 @@
package org.nl.wms.basedata.master.unit.controller;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.base.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.basedata.master.unit.service.IMeasureunitService;
import org.nl.wms.basedata.master.unit.service.dao.Measureunit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import java.util.Set;
/**
* @author lyd
* @date 2024-03-25
**/
@Slf4j
@RestController
@RequestMapping("/api/measureunit")
public class MeasureunitController {
@Autowired
private IMeasureunitService measureunitService;
@GetMapping
@Log("查询计量单位")
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(measureunitService.queryAll(whereJson,page)),HttpStatus.OK);
}
@PostMapping
@Log("新增计量单位")
public ResponseEntity<Object> create(@Validated @RequestBody Measureunit entity){
measureunitService.create(entity);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PutMapping
@Log("修改计量单位")
public ResponseEntity<Object> update(@Validated @RequestBody Measureunit entity){
measureunitService.update(entity);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除计量单位")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
measureunitService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -0,0 +1,43 @@
package org.nl.wms.basedata.master.unit.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.nl.common.domain.query.PageQuery;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.wms.basedata.master.unit.service.dao.Measureunit;
import java.util.Map;
import java.util.Set;
/**
* @description 服务接口
* @author lyd
* @date 2024-03-25
**/
public interface IMeasureunitService extends IService<Measureunit> {
/**
* 查询数据分页
* @param whereJson 条件
* @param pageable 分页参数
* @return IPage<Measureunit>
*/
IPage<Measureunit> queryAll(Map whereJson, PageQuery pageable);
/**
* 创建
* @param entity /
*/
void create(Measureunit entity);
/**
* 编辑
* @param entity /
*/
void update(Measureunit entity);
/**
* 多选删除
* @param ids /
*/
void deleteAll(Set<String> ids);
}

View File

@@ -0,0 +1,65 @@
package org.nl.wms.basedata.master.unit.service.dao;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.io.Serializable;
/**
* @description /
* @author lyd
* @date 2024-03-25
**/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("md_pb_measureunit")
public class Measureunit implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "measure_unit_id", type = IdType.NONE)
/** 计量单位标识 */
private String measure_unit_id;
/** 编码 */
private String unit_code;
/** 名称 */
private String unit_name;
/** 数据精度 */
private BigDecimal qty_precision;
/** 是否启用 */
private String is_used;
/** 创建人 */
private String create_id;
/** 创建人姓名 */
private String create_name;
/** 创建时间 */
private String create_time;
/** 修改人 */
private String update_optid;
/** 修改人姓名 */
private String update_optname;
/** 修改时间 */
private String update_time;
/** 是否删除 */
private String is_delete;
/** 外部标识 */
private String ext_id;
}

View File

@@ -0,0 +1,12 @@
package org.nl.wms.basedata.master.unit.service.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.nl.wms.basedata.master.unit.service.dao.Measureunit;
/**
* @author lyd
* @date 2024-03-25
**/
public interface MeasureunitMapper extends BaseMapper<Measureunit> {
}

View File

@@ -0,0 +1,5 @@
<?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="org.nl.wms.basedata.master.unit.service.dao.mapper.MeasureunitMapper">
</mapper>

View File

@@ -0,0 +1,58 @@
package org.nl.wms.basedata.master.unit.service.dto;
import java.math.BigDecimal;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
/**
* @description /
* @author lyd
* @date 2024-03-25
**/
@Data
public class MeasureunitDto implements Serializable {
/** 计量单位标识 */
/** 防止精度丢失 */
@JsonSerialize(using= ToStringSerializer.class)
private String measure_unit_id;
/** 编码 */
private String unit_code;
/** 名称 */
private String unit_name;
/** 数据精度 */
private BigDecimal qty_precision;
/** 是否启用 */
private String is_used;
/** 创建人 */
private String create_id;
/** 创建人姓名 */
private String create_name;
/** 创建时间 */
private String create_time;
/** 修改人 */
private String update_optid;
/** 修改人姓名 */
private String update_optname;
/** 修改时间 */
private String update_time;
/** 是否删除 */
private String is_delete;
/** 外部标识 */
private String ext_id;
}

View File

@@ -0,0 +1,12 @@
package org.nl.wms.basedata.master.unit.service.dto;
import org.nl.common.domain.query.BaseQuery;
import org.nl.wms.basedata.master.unit.service.dao.Measureunit;
/**
* @author lyd
* @date 2024-03-25
**/
public class MeasureunitQuery extends BaseQuery<Measureunit> {
}

View File

@@ -0,0 +1,85 @@
package org.nl.wms.basedata.master.unit.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.config.language.LangProcess;
import org.nl.wms.basedata.master.unit.service.IMeasureunitService;
import org.nl.wms.basedata.master.unit.service.dao.Measureunit;
import org.nl.wms.basedata.master.unit.service.dao.mapper.MeasureunitMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.Set;
/**
* @description 服务实现
* @author lyd
* @date 2024-03-25
**/
@Slf4j
@Service
public class MeasureunitServiceImpl extends ServiceImpl<MeasureunitMapper, Measureunit> implements IMeasureunitService {
@Autowired
private MeasureunitMapper measureunitMapper;
@Override
public IPage<Measureunit> queryAll(Map whereJson, PageQuery page){
String o = ObjectUtil.isEmpty(whereJson.get("search")) ? null : (String)whereJson.get("search");
LambdaQueryWrapper<Measureunit> lam = new LambdaQueryWrapper<>();
lam.like(o != null, Measureunit::getUnit_code, o)
.or(o != null)
.like(o != null, Measureunit::getUnit_name, o);
IPage<Measureunit> pages = new Page<>(page.getPage() + 1, page.getSize());
measureunitMapper.selectPage(pages, lam);
return pages;
}
@Override
public void create(Measureunit entity) {
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
entity.setMeasure_unit_id(IdUtil.getSnowflake(1, 1).nextIdStr());
entity.setCreate_id(currentUserId);
entity.setCreate_name(nickName);
entity.setCreate_time(now);
entity.setUpdate_optid(currentUserId);
entity.setUpdate_optname(nickName);
entity.setUpdate_time(now);
measureunitMapper.insert(entity);
}
@Override
public void update(Measureunit entity) {
Measureunit dto = measureunitMapper.selectById(entity.getMeasure_unit_id());
if (dto == null) throw new BadRequestException(LangProcess.msg("error_SystemAuthError"));
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
entity.setUpdate_optid(currentUserId);
entity.setUpdate_optname(nickName);
entity.setUpdate_time(now);
measureunitMapper.updateById(entity);
}
@Override
public void deleteAll(Set<String> ids) {
// 真删除
measureunitMapper.deleteBatchIds(ids);
}
}

View File

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.config.language.LangProcess;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;

View File

@@ -0,0 +1,5 @@
export default {
'customer': {
'title': 'Customer information management',
}
}

View File

@@ -0,0 +1,5 @@
export default {
'customer': {
'title': 'Customer information management',
}
}

View File

@@ -0,0 +1,5 @@
export default {
'customer': {
'title': 'Manajemen Informasi Klien',
}
}

View File

@@ -94,7 +94,7 @@ export default {
}
},
created() {
this.setLang(localStorage.getItem('lang'))
this.initLang()
},
computed: {
...mapGetters([
@@ -121,6 +121,15 @@ export default {
}
},
methods: {
initLang() {
// 初始化语言
let item = localStorage.getItem('lang')
if (item === null) {
item = 'zh'
}
localStorage.setItem('lang', item)
this.setLang(item)
},
// 中英文切换
langChange(command) {
this.$i18n.locale = command

View File

@@ -81,7 +81,7 @@ Vue.use(Element, {
Vue.prototype.$langPre = {
computedProp(suffix) {
let item = localStorage.getItem('lang');
let item = localStorage.getItem('lang')
if (item === null) {
item = 'zh'
}

View File

@@ -1,211 +0,0 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0"
:title="crud.status.title"
width="500px"
>
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
<el-form-item label="当前抓取工位">
<el-input v-model="form.get_station" style="width: 370px;" />
</el-form-item>
<el-form-item label="当前放置工位">
<el-input v-model="form.put_station" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否合格">
<el-input v-model="form.is_qualified" style="width: 370px;" />
</el-form-item>
<el-form-item label="激光标刻码">
<el-input v-model="form.laser_marking_code" style="width: 370px;" />
</el-form-item>
<el-form-item label="碾次">
<el-input v-model="form.grinding_number" style="width: 370px;" />
</el-form-item>
<el-form-item label="高度1">
<el-input v-model="form.height1" style="width: 370px;" />
</el-form-item>
<el-form-item label="高度2">
<el-input v-model="form.height2" style="width: 370px;" />
</el-form-item>
<el-form-item label="高度3">
<el-input v-model="form.height3" style="width: 370px;" />
</el-form-item>
<el-form-item label="高度4">
<el-input v-model="form.height4" style="width: 370px;" />
</el-form-item>
<el-form-item label="宽度1">
<el-input v-model="form.width1" style="width: 370px;" />
</el-form-item>
<el-form-item label="宽度2">
<el-input v-model="form.width2" style="width: 370px;" />
</el-form-item>
<el-form-item label="长度">
<el-input v-model="form.len" style="width: 370px;" />
</el-form-item>
<el-form-item label="体积">
<el-input v-model="form.volume" style="width: 370px;" />
</el-form-item>
<el-form-item label="平面度">
<el-input v-model="form.flatness" style="width: 370px;" />
</el-form-item>
<el-form-item label="缺陷个数">
<el-input v-model="form.unqualified_qty" style="width: 370px;" />
</el-form-item>
<el-form-item label="组盘标识">
<el-input v-model="form.group_id" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否组盘">
<el-input v-model="form.is_group" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column
prop="get_station"
label="当前抓取工位"
:min-width="flexWidth('get_station',crud.data,'当前抓取工位')"
/>
<el-table-column
prop="put_station"
label="当前放置工位"
:min-width="flexWidth('put_station',crud.data,'当前放置工位')"
/>
<el-table-column
prop="is_qualified"
label="是否合格"
:min-width="flexWidth('is_qualified',crud.data,'是否合格')"
>
<template slot-scope="scope">
{{ scope.row.is_qualified ? '合格' : '不合格'}}
</template>
</el-table-column>
<el-table-column
prop="laser_marking_code"
label="激光标刻码"
:min-width="flexWidth('laser_marking_code',crud.data,'激光标刻码')"
/>
<el-table-column
prop="grinding_number"
label="碾次"
:min-width="flexWidth('grinding_number',crud.data,'碾次')"
/>
<el-table-column prop="height1" label="高度1" :min-width="flexWidth('height1',crud.data,'高度1')" />
<el-table-column prop="height2" label="高度2" :min-width="flexWidth('height2',crud.data,'高度2')" />
<el-table-column prop="height3" label="高度3" :min-width="flexWidth('height3',crud.data,'高度3')" />
<el-table-column prop="height4" label="高度4" :min-width="flexWidth('height4',crud.data,'高度4')" />
<el-table-column prop="width1" label="宽度1" :min-width="flexWidth('width1',crud.data,'宽度1')" />
<el-table-column prop="width2" label="宽度2" :min-width="flexWidth('width2',crud.data,'宽度2')" />
<el-table-column prop="len" label="长度" :min-width="flexWidth('len',crud.data,'长度')" />
<el-table-column prop="volume" label="体积" :min-width="flexWidth('volume',crud.data,'体积')" />
<el-table-column prop="flatness" label="平面度" :min-width="flexWidth('flatness',crud.data,'平面度')" />
<el-table-column
prop="unqualified_qty"
label="缺陷个数"
:min-width="flexWidth('unqualified_qty',crud.data,'缺陷个数')"
/>
<el-table-column prop="group_id" label="组盘标识" :min-width="flexWidth('group_id',crud.data,'组盘标识')" />
<el-table-column prop="is_group" label="是否组盘" :min-width="flexWidth('is_group',crud.data,'是否组盘')" >
<template slot-scope="scope">
{{ scope.row.is_group ? '已组盘' : '未组盘'}}
</template>
</el-table-column>
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudMdBaseBrickInfo from './mdBaseBrickInfo'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
const defaultForm = {
brick_id: null,
get_station: null,
put_station: null,
is_qualified: null,
laser_marking_code: null,
grinding_number: null,
height1: null,
height2: null,
height3: null,
height4: null,
width1: null,
width2: null,
len: null,
volume: null,
flatness: null,
unqualified_qty: null,
group_id: null,
is_group: null
}
export default {
name: 'BrickInfo',
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '每块砖的信息记录',
url: 'api/mdBaseBrickInfo',
idField: 'brick_id',
sort: 'brick_id,desc',
crudMethod: { ...crudMdBaseBrickInfo },
optShow: {
add: false,
edit: false,
del: false,
download: false
}
})
},
data() {
return {
permission: {},
rules: {}
}
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
}
}
}
</script>
<style scoped>
</style>

View File

@@ -2,7 +2,7 @@ import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/mdBaseBrickInfo',
url: 'api/customerbase',
method: 'post',
data
})
@@ -10,7 +10,7 @@ export function add(data) {
export function del(ids) {
return request({
url: 'api/mdBaseBrickInfo/',
url: 'api/customerbase/',
method: 'delete',
data: ids
})
@@ -18,7 +18,7 @@ export function del(ids) {
export function edit(data) {
return request({
url: 'api/mdBaseBrickInfo',
url: 'api/customerbase',
method: 'put',
data
})

View File

@@ -0,0 +1,325 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="50px"
label-suffix=":"
>
<el-form-item label="客户">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="输入客户编码或客户名称"
prefix-icon="el-icon-search"
/>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0"
:title="crud.status.title"
width="1100px"
>
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="140px">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="客户编码" prop="cust_code">
<el-input v-model="form.cust_code" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称 " prop="cust_name">
<el-input v-model="form.cust_name" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户简称 " prop="cust_simple_name">
<el-input v-model="form.cust_simple_name" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="税务登记号">
<el-input v-model="form.tax_no" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工商注册号">
<el-input v-model="form.register_no" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营许可证号">
<el-input v-model="form.manage_lice_no" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="营业执照">
<el-input v-model="form.busi_char_name" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮政编码">
<el-input v-model="form.zip_code" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="公司电话">
<el-input v-model="form.corp_tele_no" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="公司地址">
<el-input v-model="form.corp_address" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="外部标识">
<el-input v-model="form.ext_id" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否启用" prop="is_used">
<el-radio v-model="form.is_used" label="0">否</el-radio>
<el-radio v-model="form.is_used" label="1">是</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="法人代表">
<el-input v-model="form.jurid_name" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="送货单打印模板路径">
<el-input v-model="form.shd_print_no" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="送货单明细数">
<el-input-number v-model="form.shd_dtl_num" :min="1" :max="100" :precision="0" :controls="false" style="width: 200px;"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="包装打印模板:">
<el-select
v-model="form.bz_print_no"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 210px"
>
<el-option
v-for="item in dict.print_temple"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否自动贴标" prop="is_auto_table">
<el-radio v-model="form.is_auto_table" label="0">否</el-radio>
<el-radio v-model="form.is_auto_table" label="1">是</el-radio>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="业务员" prop="sales_owner">
<el-input v-model="form.sales_owner" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="16">
<el-form-item label="备注">
<el-input v-model="form.remark" style="width: 550px;" type="textarea" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column prop="cust_code" label="客户编码" :min-width="flexWidth('cust_code',crud.data,'客户编码')"/>
<el-table-column prop="cust_name" label="客户名称 " :min-width="flexWidth('cust_name',crud.data,'客户名称 ')"/>
<el-table-column prop="cust_simple_name" label="客户简称" :min-width="flexWidth('cust_simple_name',crud.data,'客户简称')"/>
<el-table-column prop="sales_owner" label="业务员" :min-width="flexWidth('sales_owner',crud.data,'业务员')"/>
<el-table-column prop="create_name" label="创建人姓名" :min-width="flexWidth('create_name',crud.data,'创建人姓名')"/>
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')"/>
<el-table-column prop="update_optname" label="修改人姓名" :min-width="flexWidth('update_optname',crud.data,'修改人姓名')"/>
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')"/>
<el-table-column prop="is_used" label="是否启用" :min-width="flexWidth('is_used',crud.data,'是否启用')">
<template slot-scope="scope">
<el-switch
v-model="scope.row.is_used"
active-color="#409EFF"
inactive-color="#F56C6C"
active-value="1"
inactive-value="0"
@change="changeEnabled(scope.row, scope.row.is_used)"
/>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')"/>
<el-table-column prop="zj_print_no" label="子卷打印模板号" :min-width="flexWidth('zj_print_no',crud.data,'子卷打印模板号')"/>
<el-table-column prop="bz_print_no" label="包装打印模板号" :min-width="flexWidth('bz_print_no',crud.data,'包装打印模板号')"/>
<el-table-column prop="shd_print_no" label="送货单打印模板号" :min-width="flexWidth('shd_print_no',crud.data,'送货单打印模板号')"/>
<el-table-column prop="shd_dtl_num" label="送货单明细数" :min-width="flexWidth('shd_dtl_num',crud.data,'送货单明细数')"/>
<el-table-column prop="is_auto_table" label="是否自动包装" :min-width="flexWidth('is_auto_table',crud.data,'is_auto_table')">
<template slot-scope="scope">
{{scope.row.is_auto_table === '1' ? '是' : '否'}}
</template>
</el-table-column>
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudCustomerbase from './customerbase'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import i18n from "@/i18n";
const defaultForm = {
cust_id: null,
cust_code: null,
cust_name: null,
cust_simple_name: null,
country: null,
state: null,
city: null,
faxnumber: null,
webSite: null,
jurid_name: null,
tax_no: null,
register_no: null,
manage_lice_no: null,
busi_char_name: null,
area_id: null,
zip_code: null,
corp_tele_no: null,
corp_address: null,
sales_owner: null,
create_id: null,
create_name: null,
create_time: null,
update_optid: null,
update_optname: null,
update_time: null,
is_used_time: null,
is_used: '0',
is_delete: null,
ext_id: null,
remark: null,
class_id: null,
class_code: null,
class_name: null,
zj_print_no: null,
bz_print_no: null,
shd_print_no: null,
shd_dtl_num: null,
is_auto_table: '1'
}
export default {
name: 'Customerbase',
dicts: ['is_used', 'print_temple'],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: i18n.t('customer.title'),
url: 'api/customerbase',
idField: 'cust_id',
sort: 'cust_id,desc',
crudMethod: { ...crudCustomerbase }
})
},
data() {
return {
permission: {
},
rules: {
}
}
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
},
// 改变状态
changeEnabled(data, val) {
this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.cust_name + ', 是否继续', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
crudCustomerbase.edit(data).then(res => {
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
if (data.is_used === '0') {
data.is_used = '1'
return
}
if (data.is_used === '1') {
data.is_used = '0'
}
})
}).catch(() => {
if (data.is_used === '0') {
data.is_used = '1'
return
}
if (data.is_used === '1') {
data.is_used = '0'
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,128 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="50px"
label-suffix=":"
>
<el-form-item label="单位">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="输入单位编码或单位名称"
prefix-icon="el-icon-search"
/>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
<el-form-item label="编码">
<el-input v-model="form.unit_code" style="width: 370px;" />
</el-form-item>
<el-form-item label="名称">
<el-input v-model="form.unit_name" style="width: 370px;" />
</el-form-item>
<el-form-item label="数据精度">
<el-input v-model="form.qty_precision" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否启用">
<el-input v-model="form.is_used" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column prop="unit_code" label="编码" :min-width="flexWidth('unit_code',crud.data,'编码')"/>
<el-table-column prop="unit_name" label="名称" :min-width="flexWidth('unit_name',crud.data,'名称')"/>
<el-table-column prop="qty_precision" label="数据精度" :min-width="flexWidth('qty_precision',crud.data,'数据精度')"/>
<el-table-column prop="is_used" label="是否启用" :min-width="flexWidth('is_used',crud.data,'是否启用')"/>
<el-table-column prop="create_name" label="创建人姓名" :min-width="flexWidth('create_name',crud.data,'创建人姓名')"/>
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')"/>
<el-table-column prop="update_optname" label="修改人姓名" :min-width="flexWidth('update_optname',crud.data,'修改人姓名')"/>
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')"/>
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudMeasureunit from './measureunit'
import CRUD, {crud, form, header, presenter} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
const defaultForm = {
measure_unit_id: null,
unit_code: null,
unit_name: null,
qty_precision: null,
is_used: null,
create_id: null,
create_name: null,
create_time: null,
update_optid: null,
update_optname: null,
update_time: null,
is_delete: null,
ext_id: null
}
export default {
name: 'Measureunit',
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '计量单位',
url: 'api/measureunit',
idField: 'measure_unit_id',
sort: 'measure_unit_id,desc',
crudMethod: { ...crudMeasureunit }
})
},
data() {
return {
permission: {
},
rules: {
} }
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/measureunit',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/measureunit/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/measureunit',
method: 'put',
data
})
}
export default { add, edit, del }