diff --git a/ant-design-vue-jeecg/src/views/erp/fabric/ZyFabricList.vue b/ant-design-vue-jeecg/src/views/erp/fabric/ZyFabricList.vue
index ef848fc6..7dbf9367 100644
--- a/ant-design-vue-jeecg/src/views/erp/fabric/ZyFabricList.vue
+++ b/ant-design-vue-jeecg/src/views/erp/fabric/ZyFabricList.vue
@@ -11,7 +11,7 @@
-
+
@@ -31,12 +31,12 @@
-
+
-
+
@@ -58,9 +58,9 @@
新增
导出
-
- 导入
-
+
+
+
@@ -114,21 +114,17 @@
编辑
+
+
+ 复制
+
+
+ 详情
-
- 更多
-
-
- 详情
-
-
- handleDelete(record.id)">
- 删除
-
-
-
-
+ handleDelete(record.id)">
+ 删除
+
@@ -171,7 +167,7 @@ import ZyFabricFormDetail from './modules/ZyFabricFormDetail'
{
title:'类型',
align:"center",
- dataIndex: 'typeId'
+ dataIndex: 'typeId_dictText'
},
{
title:'编号',
@@ -218,11 +214,13 @@ import ZyFabricFormDetail from './modules/ZyFabricFormDetail'
align:"center",
dataIndex: 'brandId_dictText'
},
+
{
title:'计量单位',
align:"center",
dataIndex: 'unit_dictText'
},
+
{
title:'密度',
align:"center",
@@ -251,7 +249,7 @@ import ZyFabricFormDetail from './modules/ZyFabricFormDetail'
},
{
- title:'供货商',
+ title:'供货商信息',
align:"center",
dataIndex: 'supplierInfo_dictText'
},
@@ -274,14 +272,15 @@ import ZyFabricFormDetail from './modules/ZyFabricFormDetail'
delete: "/fabric/zyFabric/delete",
deleteBatch: "/fabric/zyFabric/deleteBatch",
exportXlsUrl: "/fabric/zyFabric/exportXls",
- importExcelUrl: "fabric/zyFabric/importExcel",
+ importExcelUrl: "/fabric/zyFabric/importExcel",
+
},
dictOptions:{},
superFieldList:[],
}
},
created() {
- this.getSuperFieldList();
+ this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
@@ -294,33 +293,29 @@ import ZyFabricFormDetail from './modules/ZyFabricFormDetail'
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'color',text:'颜色',dictCode:''})
- fieldList.push({type:'sel_search',value:'pattern',text:'花样',dictTable:'', dictText:'', dictCode:''})
- fieldList.push({type:'sel_search',value:'material',text:'材质',dictTable:'', dictText:'', dictCode:''})
- fieldList.push({type:'sel_search',value:'ply',text:'厚度',dictTable:'', dictText:'', dictCode:''})
+ fieldList.push({type:'sel_search',value:'pattern',text:'花样',dictTable:'', dictText:'', dictCode:'pattern'})
+ fieldList.push({type:'sel_search',value:'material',text:'材质',dictTable:'', dictText:'', dictCode:'material'})
+ fieldList.push({type:'sel_search',value:'ply',text:'厚度',dictTable:'ply', dictText:'', dictCode:''})
fieldList.push({type:'int',value:'money',text:'单价',dictCode:''})
fieldList.push({type:'string',value:'imageUrl',text:'图片地址',dictCode:''})
fieldList.push({type:'popup',value:'typeId',text:'面料类型id', popup:{code:'zy_fabric_type',field:'id',orgFields:'id',destFields:'content'}})
- fieldList.push({type:'sel_search',value:'brandId',text:'材料品牌id',dictTable:'', dictText:'', dictCode:''})
+ fieldList.push({type:'sel_search',value:'brandId',text:'材料品牌id',dictTable:'brand', dictText:'', dictCode:''})
fieldList.push({type:'string',value:'fabricNumber',text:'材料编号',dictCode:''})
- fieldList.push({type:'int',value:'unit',text:'1、为m。2:kg,等',dictCode:''})
+ fieldList.push({type:'int',value:'unit',text:'1、为m。2:kg,等',dictCode:'unit1,,'})
fieldList.push({type:'int',value:'retailPrice',text:'零售价',dictCode:''})
- fieldList.push({type:'sel_search',value:'density',text:'密度',dictTable:'', dictText:'', dictCode:''})
- fieldList.push({type:'string',value:'clothW',text:'幅宽',dictCode:''})
+ fieldList.push({type:'sel_search',value:'density',text:'密度',dictTable:'density', dictText:'', dictCode:''})
+ fieldList.push({type:'string',value:'clothW',text:'幅宽',dictCode:'clothW,,'})
fieldList.push({type:'string',value:'location',text:'所在地区',dictCode:''})
- fieldList.push({type:'int',value:'status',text:'状态 o 为下架 1为上架 ',dictCode:''})
+ fieldList.push({type:'int',value:'status',text:'状态 o 为下架 1为上架 ',dictCode:'fabric_status,,'})
fieldList.push({type:'string',value:'qRcode',text:'二维码',dictCode:''})
fieldList.push({type:'string',value:'name',text:'名称',dictCode:''})
fieldList.push({type:'sel_depart',value:'supplierInfo',text:'供货商信息'})
fieldList.push({type:'string',value:'createTime',text:'创建时间',dictCode:''})
this.superFieldList = fieldList
- },
- openDetail(id){
- this.$refs.ZyFabricFormDetail.showModal(id)
- // this.$children[0].showModal(id)
}
}
}
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/erp/fabric/modules/ZyFabricForm.vue b/ant-design-vue-jeecg/src/views/erp/fabric/modules/ZyFabricForm.vue
index aa868e9a..1de2c8ac 100644
--- a/ant-design-vue-jeecg/src/views/erp/fabric/modules/ZyFabricForm.vue
+++ b/ant-design-vue-jeecg/src/views/erp/fabric/modules/ZyFabricForm.vue
@@ -4,14 +4,14 @@
-
+
@@ -48,7 +48,7 @@
-
+
@@ -63,22 +63,22 @@
-
+
-
+
-
+
-
+
@@ -88,7 +88,7 @@
-
+
@@ -117,61 +117,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -214,6 +159,9 @@
},
confirmLoading: false,
validatorRules: {
+ typeId: [
+ { required: true, message: '请选择类型!'},
+ ],
color: [
{ required: true, message: '请输入颜色!'},
],
@@ -226,6 +174,18 @@
name: [
{ required: true, message: '请输入名称!'},
],
+ money: [
+ { required: false},
+ { pattern: /^\d{0,11}$/, message: '长度不能超过11位数字'},
+ ],
+ retailPrice: [
+ { required: false},
+ { pattern: /^\d{0,11}$/, message: '长度不能超过11位数字'},
+ ],
+ location: [
+ { required: false},
+ { pattern: /^.{0,30}$/, message: '长度不能超过30位字符'},
+ ],
},
url: {
add: "/fabric/zyFabric/add",
diff --git a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/controller/ZyFabricController.java b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/controller/ZyFabricController.java
index 6d8105d2..1fa101a6 100644
--- a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/controller/ZyFabricController.java
+++ b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/controller/ZyFabricController.java
@@ -1,12 +1,10 @@
package org.jeecg.modules.demo.fabric.controller;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.demo.fabric.entity.ZyFabric;
import org.jeecg.modules.demo.fabric.entity.ZyFabricStock;
import org.jeecg.modules.demo.fabric.service.IZyFabricService;
@@ -66,9 +64,9 @@ public class ZyFabricController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(zyFabric, req.getParameterMap());
- QueryWrapper queryWrapper = new QueryWrapper();
- Page page = new Page(pageNo, pageSize);
+ QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyFabric, req.getParameterMap());
+// QueryWrapper queryWrapper = new QueryWrapper();
+ Page page = new Page<>(pageNo, pageSize);
IPage pageList = zyFabricService.page(page, queryWrapper);
return Result.OK(pageList);
}
@@ -201,6 +199,13 @@ public class ZyFabricController extends JeecgController add(@RequestBody ZyFabric zyFabric) {
+ zyFabric.setCreateTime(new Date().toLocaleString());
+ List list = zyFabricService.list();
+ for (ZyFabric zy : list){
+ if (zy.getName().equals(zyFabric.getName())){
+ return Result.error("名称重复,请重新输入");
+ }
+ }
zyFabricService.save(zyFabric);
return Result.OK("添加成功!");
}
@@ -215,6 +220,15 @@ public class ZyFabricController extends JeecgController edit(@RequestBody ZyFabric zyFabric) {
+ zyFabric.setUpdateTime(new Date().toLocaleString());
+ List list = zyFabricService.list();
+ ZyFabric zyFabric1 = zyFabricService.getById(zyFabric.getId());
+ list.remove(zyFabric1);
+ for (ZyFabric zy : list){
+ if (zy.getName().equals(zyFabric.getName())){
+ return Result.error("名称重复,请重新输入");
+ }
+ }
zyFabricService.updateById(zyFabric);
return Result.OK("编辑成功!");
}
diff --git a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/controller/ZyFabricTypeController.java b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/controller/ZyFabricTypeController.java
index 199d1de1..c6763439 100644
--- a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/controller/ZyFabricTypeController.java
+++ b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/controller/ZyFabricTypeController.java
@@ -109,6 +109,8 @@ public class ZyFabricTypeController extends JeecgController edit(@RequestBody ZyFabricType zyFabricType) {
List list = zyFabricTypeService.list();
+ ZyFabricType zyFabricType1 = zyFabricTypeService.getById(zyFabricType.getId());
+ list.remove(zyFabricType1); //移除被编辑行的数据,防止校验重复
for (ZyFabricType zy : list){
if (zy.getNums().equals(zyFabricType.getNums())){
return Result.error("编号重复,请重新输入");
diff --git a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/entity/ZyFabric.java b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/entity/ZyFabric.java
index 53c61aac..ec020f90 100644
--- a/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/entity/ZyFabric.java
+++ b/jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/fabric/entity/ZyFabric.java
@@ -4,9 +4,8 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
@@ -31,121 +30,125 @@ import lombok.experimental.Accessors;
public class ZyFabric implements Serializable {
private static final long serialVersionUID = 1L;
- /** 材料表*/
- @TableId(type = IdType.ASSIGN_ID)
+ /** 材料表*/
+ @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = " 材料表")
- private String id;
-
- /**创建人*/
- @ApiModelProperty(value = "创建人")
- private java.lang.String createBy;
- /**创建日期*/
- @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
- @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
- @ApiModelProperty(value = "创建日期")
- private java.util.Date createTime;
- /**更新人*/
- @ApiModelProperty(value = "更新人")
- private java.lang.String updateBy;
- /**更新日期*/
- @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
- @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
- @ApiModelProperty(value = "更新日期")
- private java.util.Date updateTime;
- /**所属部门*/
- @ApiModelProperty(value = "所属部门")
- private java.lang.String sysOrgCode;
-
- /**颜色*/
- @Excel(name = "颜色", width = 15)
+ private java.lang.String id;
+ /**颜色*/
+ @Excel(name = "颜色", width = 15)
@ApiModelProperty(value = "颜色")
- private String color;
- /**花样*/
- @Excel(name = "花样", width = 15)
+ private java.lang.String color;
+ /**花样*/
+ @Excel(name = "花样", width = 15, dictTable = "", dicText = "", dicCode = "pattern")
+ @Dict(dictTable = "", dicText = "", dicCode = "pattern")
@ApiModelProperty(value = "花样")
- private String pattern;
- /**材质*/
- @Excel(name = "材质", width = 15)
+ private java.lang.String pattern;
+ /**材质*/
+ @Excel(name = "材质", width = 15, dictTable = "", dicText = "", dicCode = "material")
+ @Dict(dictTable = "", dicText = "", dicCode = "material")
@ApiModelProperty(value = "材质")
- private String material;
- /**描述*/
- @Excel(name = "描述", width = 15)
+ private java.lang.String material;
+ /**描述*/
+
@ApiModelProperty(value = "描述")
- private String description;
- /**厚度*/
- @Excel(name = "厚度", width = 15)
+ private java.lang.String description;
+ /**厚度*/
+ @Excel(name = "厚度", width = 15, dictTable = "", dicText = "", dicCode = "ply")
+ @Dict(dictTable = "", dicText = "", dicCode = "ply")
@ApiModelProperty(value = "厚度")
- private String ply;
- /**金额*/
- @Excel(name = "金额", width = 15)
- @ApiModelProperty(value = "金额")
- private Integer money;
-
+ private java.lang.String ply;
+ /**单价*/
+ @Excel(name = "单价", width = 15)
+ @ApiModelProperty(value = "单价")
+ private java.lang.Integer money;
+ /**图片地址*/
+// @Excel(name = "图片地址", width = 15)
@ApiModelProperty(value = "图片地址")
- private String imageUrl;
-
+ private java.lang.String imageUrl;
/**面料类型id*/
- @ApiModelProperty(value = "面料类型id")
- private String typeId;
-
+ @Excel(name = "类型", width = 15 , dictTable = "zy_fabric_type", dicText = "content", dicCode = "id")
+ @Dict(dictTable = "zy_fabric_type", dicText = "content", dicCode = "id")
+ @ApiModelProperty(value = "类型")
+ private java.lang.String typeId;
+ /**图片地址*/
@ApiModelProperty(value = "图片地址")
- private String pictureUrl;
-
- /**材料品牌id*/
- @Excel(name = "面料品牌id", width = 15)
+ private java.lang.String pictureUrl;
+ /**材料品牌id*/
+ @Excel(name = "品牌", width = 15, dictTable = "", dicText = "", dicCode = "brand")
+ @Dict(dictTable = "", dicText = "", dicCode = "brand")
@ApiModelProperty(value = "材料品牌id")
- private String brandId;
- /**材料编号*/
- @Excel(name = "面料编号", width = 15)
- @ApiModelProperty(value = "面料编号")
- private String fabricNumber;
- /**1、为m。2:kg,等*/
- @Excel(name = "1、为m。2:kg,等", width = 15)
+ private java.lang.String brandId;
+ /**材料编号*/
+ @Excel(name = "材料编号", width = 15)
+ @ApiModelProperty(value = "材料编号")
+ private java.lang.String fabricNumber;
+ /**单位 1、为m。2:kg,等*/
+ @Excel(name = "计量单位", width = 15, dictTable = "", dicText = "", dicCode = "unit1")
+ @Dict(dictTable = "", dicText = "", dicCode = "unit1")
@ApiModelProperty(value = "1、为m。2:kg,等")
- private Integer unit;
- /**零售价*/
- @Excel(name = "零售价", width = 15)
+ private java.lang.Integer unit;
+ /**零售价*/
+ @Excel(name = "零售价", width = 15)
@ApiModelProperty(value = "零售价")
- private Integer retailPrice;
- /**密度*/
- @Excel(name = "密度", width = 15)
+ private java.lang.Integer retailPrice;
+ /**密度*/
+ @Excel(name = "密度", width = 15, dictTable = "", dicText = "", dicCode = "density")
+ @Dict(dictTable = "", dicText = "", dicCode = "density")
@ApiModelProperty(value = "密度")
- private String density;
- /**幅宽*/
- @Excel(name = "幅宽", width = 15)
+ private java.lang.String density;
+ /**幅宽*/
+ @Excel(name = "幅宽", width = 15)
@ApiModelProperty(value = "幅宽")
- private String clothW;
- /**所在地区*/
- @Excel(name = "所在地区", width = 15)
+ private java.lang.String clothW;
+ /**所在地区*/
+ @Excel(name = "所在地区", width = 15)
@ApiModelProperty(value = "所在地区")
- private String location;
- /**状态 o 为下架 1为上架 */
- @Excel(name = "状态 o 为下架 1为上架 ", width = 15)
+ private java.lang.String location;
+ /**状态 o 为下架 1为上架 */
+ @Excel(name = "状态", width = 15, dictTable = "", dicText = "", dicCode = "fabric_status")
+ @Dict(dictTable = "", dicText = "", dicCode = "fabric_status")
@ApiModelProperty(value = "状态 o 为下架 1为上架 ")
- private Integer status;
- /**二维码*/
- @Excel(name = "二维码", width = 15)
+ private java.lang.Integer status;
+ /**二维码*/
+ @Excel(name = "二维码", width = 15)
@ApiModelProperty(value = "二维码")
- private String qRcode;
- /**名称*/
- @Excel(name = "名称", width = 15)
+ private java.lang.String qRcode;
+ /**名称*/
+ @Excel(name = "名称", width = 15)
@ApiModelProperty(value = "名称")
- private String name;
- /**克重*/
- @Excel(name = "克重", width = 15)
+ private java.lang.String name;
+ /**克重*/
+
@ApiModelProperty(value = "克重")
- private String gramW;
- /**面料打理方式*/
- @Excel(name = "面料打理方式", width = 15)
+ private java.lang.String gramW;
+ /**面料打理方式*/
+
@ApiModelProperty(value = "面料打理方式")
- private String fabricCare;
- /**供货商信息*/
- @Excel(name = "供货商信息", width = 15)
+ private java.lang.String fabricCare;
+ /**供货商信息*/
+ @Excel(name = "供货商", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
+ @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@ApiModelProperty(value = "供货商信息")
- private String supplierInfo;
-
- /**二维码*/
-
- @ApiModelProperty(value = "二维码")
- private java.lang.String img;
+ private java.lang.String supplierInfo;
+ /**创建人*/
+ @ApiModelProperty(value = "创建人")
+ private java.lang.String createBy;
+ /**创建时间*/
+// @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+// @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "创建时间")
+ private java.lang.String createTime;
+ /**更新人*/
+ @ApiModelProperty(value = "更新人")
+ private java.lang.String updateBy;
+ /**更新时间*/
+// @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+// @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value = "更新时间")
+ private java.lang.String updateTime;
+ /**所属部门*/
+ @ApiModelProperty(value = "所属部门")
+ private java.lang.String sysOrgCode;
}