修改列表问题及部分问题

zhc4dev
赵玉瑞 2 years ago
parent 120ac73975
commit de16d80234
  1. 1
      ant-design-vue-jeecg/src/components/jeecg/JVxeTable/jvxeTypes.js
  2. 2
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsComponentForm.vue
  3. 14
      ant-design-vue-jeecg/src/views/process/modules/ZyClothsModularForm.vue
  4. 167
      ant-design-vue-jeecg/src/views/zystylemodel/ZyStyleModelList.vue
  5. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsComponentController.java
  6. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsModularController.java
  7. 2
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/service/impl/ZyClothsModularServiceImpl.java
  8. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/controller/ZyStyleModelController.java
  9. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/IZyStyleModelService.java
  10. 32
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/service/impl/ZyStyleModelServiceImpl.java

@ -17,6 +17,7 @@ export const JVXETypes = {
rowDragSort: 'row-drag-sort', rowDragSort: 'row-drag-sort',
input: 'input', input: 'input',
//数字输入框 只能输入数字 小数也可以 其它类型的无法输入
inputNumber: 'inputNumber', inputNumber: 'inputNumber',
textarea: 'textarea', textarea: 'textarea',
select: 'select', select: 'select',

@ -208,7 +208,7 @@
// this.data.push(res.result) // this.data.push(res.result)
// } // }
//console.log("List "+this.model.nums); console.log("制衣部件 编号: "+this.model.nums);
}, },
// bianHao() { // bianHao() {
// getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => { // getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => {

@ -132,7 +132,9 @@ export default {
}, },
data() { data() {
return { return {
model: {}, model: {
nums: '',
},
labelCol: { labelCol: {
xs: {span: 24}, xs: {span: 24},
sm: {span: 4}, sm: {span: 4},
@ -174,17 +176,17 @@ export default {
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.modelDefault = JSON.parse(JSON.stringify(this.model));
}, },
methods: { methods: {
bianhao() { async bianhao() {
//var n=6 //var n=6
getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => { getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => {
let num = res.result; //let num = res.result;
console.log("+6++++aaa" + num) console.log("+6++++aaa: " + res.result)
//num=num.toString() //num=num.toString()
//while(num.length<n){ //while(num.length<n){
//num="0"+num //num="0"+num
//} //}
console.log(num) //console.log(num)
this.model.nums = num; this.model.nums = res.result;
}) })
}, },
add() { add() {

@ -91,11 +91,11 @@ export default {
// add remove clearSelection // add remove clearSelection
btn: ['add'], btn: ['add'],
}, },
validatorRules: { // validatorRules: {
// styleId: [ // styleId: [
// {required: true, message: '!'}, // {required: true, message: '!'},
// ], // ],
}, // },
// //
loading: false, loading: false,
// //
@ -117,40 +117,140 @@ export default {
columns: [ columns: [
{ {
title: '服装款式', title: '服装款式', width: '100px', fixed: 'left', key: 'styleId',
width: '110px', type: JVXETypes.normal,
fixed: 'left',
key: 'styleId',
type: JVXETypes.select,
placeholder: '请输入${title}', placeholder: '请输入${title}',
//dictCode: 'zy_cloths_style,style_names,id', //dictCode: 'zy_cloths_style,style_names,id',
validateRules: [ // validateRules: [
{required: true, message: '${title}不能为空'}, // {required: true, message: '${title}'},
], // ],
disabled: true, disabled: true,
}, },
{ {
title: '是否默认尺码', title: '是否默认尺码', align: "center", width: '130px', key: 'isdefault',
align: "center",
width: '130px',
key: 'isdefault',
type: JVXETypes.select, type: JVXETypes.select,
dictCode: 'isdefault', dictCode: 'isdefault',
defaultValue: 0, defaultValue: 0,
}, },
{key: 'modelNumber', title: '型号编码', dictCode: 'modenumber', width: '100px', type: JVXETypes.select}, {
{key: 'size', title: '码数', width: '85px', dictCode: 'size', type: JVXETypes.select}, key: 'modelNumber', title: '型号编码', dictCode: 'modenumber', width: '100px',
{key: 'anumbers', title: '型', width: '85px', dictCode: 'hsize', type: JVXETypes.select}, type: JVXETypes.select
{key: 'bnumbers', title: '号', width: '85px', dictCode: 'xsize', type: JVXETypes.select}, },
{key: 'collarLarge', title: '领大', width: '70px', type: JVXETypes.input}, {
{key: 'bust', title: '胸围', width: '80px', type: JVXETypes.input}, key: 'size', title: '码数', width: '85px', dictCode: 'size',
{key: 'sleeveLength', title: '袖长', width: '80px', type: JVXETypes.input}, type: JVXETypes.select
{key: 'shslLength', title: '连肩袖长', width: '100px', type: JVXETypes.input}, },
{
key: 'anumbers', title: '型', width: '85px', dictCode: 'hsize',
type: JVXETypes.select
},
{
key: 'bnumbers', title: '号', width: '85px', dictCode: 'xsize',
type: JVXETypes.select
},
{
key: 'collarLarge',
title: '领大', width: '70px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
],
},
{
key: 'bust', title: '胸围', width: '80px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /\D/g, message: '${title}只能输入数字类型',
},
]
},
{
key: 'sleeveLength', title: '袖长', width: '80px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
]
},
{
key: 'shslLength', title: '连肩袖长', width: '100px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
],
},
{key: 'tsWidth', title: '总肩宽', width: '80px', type: JVXETypes.input}, {
{key: 'cuff', title: '袖口', width: '80px', type: JVXETypes.input}, key: 'tsWidth', title: '总肩宽', width: '80px',
{key: 'waistline', title: '腰围', width: '80px', type: JVXETypes.input}, type: JVXETypes.inputNumber,
{key: 'hem', title: '下摆', width: '80px', type: JVXETypes.input}, validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
],
},
{
key: 'cuff', title: '袖口', width: '80px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
],
},
{
key: 'waistline', title: '腰围', width: '80px',
type: JVXETypes.inputNumber,
validateRules: [
{
required: false, //
message: '${title}只能输入数字类型' //
},
{pattern: /[^\d]/g, message: '${title}只能输入数字类型'},
],
},
{
key: 'hem', title: '下摆', width: '80px',
type: JVXETypes.inputNumber,
validateRules: [
{ required: false, //
message: '${title}只能输入数字类型' //
},
{
pattern: /[^\d]/g, message: '${title}只能输入数字类型',
},
],
},
{key: 'createTime', title: '创建时间', width: '60px', type: JVXETypes.datetime}, {key: 'createTime', title: '创建时间', width: '60px', type: JVXETypes.datetime},
{ {
@ -201,8 +301,6 @@ export default {
console.log("新增触发事件", event) console.log("新增触发事件", event)
let httpUrl = this.url.add; let httpUrl = this.url.add;
let method = 'post'; let method = 'post';
//httpUrl += this.url.add;
//method = 'post';
let that = this; let that = this;
httpAction(httpUrl, event.row, method).then((res) => { httpAction(httpUrl, event.row, method).then((res) => {
if (res.success) { if (res.success) {
@ -216,18 +314,13 @@ export default {
}) })
}, },
// //
handleValueChange(event) { async handleValueChange(event) {
//this.submitForm(event) //this.submitForm(event)
console.log("//数据发生变化时事件", event); console.log("//数据发生变化时事件", event);
//const str = event.row.id; //const str = event.row.id;
let httpUrl = ''; let httpUrl = this.url.edit;
let method = ''; let method = 'put';
await httpAction(httpUrl, event.row, method).then((res) => {
httpUrl += this.url.edit;
method = 'put';
httpAction(httpUrl, event.row, method).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(res.message); this.$message.success(res.message);
this.$emit('ok'); this.$emit('ok');

@ -112,7 +112,7 @@ public class ZyClothsComponentController extends JeecgController<ZyClothsCompone
@ApiOperation(value = "制衣部件详情", notes = "根据制衣部件详情id进行查询") @ApiOperation(value = "制衣部件详情", notes = "根据制衣部件详情id进行查询")
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
public Result<?> detail(@RequestParam(name = "id", required = true) String id) { public Result<?> detail(@RequestParam(name = "id", required = true) String id) {
System.out.println("controller层接受到的id:zy_cloths_component对象 Id: "+id); //System.out.println("controller层接受到的id:zy_cloths_component对象 Id: "+id);
ZyClothsComponentDetail detail = zyClothsComponentService.queryDetail(id); ZyClothsComponentDetail detail = zyClothsComponentService.queryDetail(id);
return Result.OK(detail); return Result.OK(detail);
} }
@ -154,7 +154,7 @@ public class ZyClothsComponentController extends JeecgController<ZyClothsCompone
public Result<?> sort(@RequestParam(name = "id", required = true) String id) { public Result<?> sort(@RequestParam(name = "id", required = true) String id) {
//编码规则:服装类型(10)+序号(8) //编码规则:服装类型(10)+序号(8)
String sort = zyClothsComponentService.sort(id); String sort = zyClothsComponentService.sort(id);
System.err.println(sort+ " 制衣部件 sort"); //System.err.println(sort+ " 制衣部件 sort");
if (StringUtils.isEmpty(sort)) { if (StringUtils.isEmpty(sort)) {
return Result.OK(0); return Result.OK(0);
} }

@ -107,7 +107,7 @@ public class ZyClothsModularController extends JeecgController<ZyClothsModular,
@ApiOperation(value = "制衣模块详情详情", notes = "根据制衣模块详情id进行查询") @ApiOperation(value = "制衣模块详情详情", notes = "根据制衣模块详情id进行查询")
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
public Result<?> detail(@RequestParam(name = "id", required = true) String id) { public Result<?> detail(@RequestParam(name = "id", required = true) String id) {
System.out.println("controller层接受到的id: zy_cloths_modularId: "+id); //System.out.println("controller层接受到的id: zy_cloths_modularId: "+id);
ZyClothsModularDetail detail = zyClothsModularService.queryDetail(id); ZyClothsModularDetail detail = zyClothsModularService.queryDetail(id);
return Result.OK(detail); return Result.OK(detail);
} }

@ -139,7 +139,7 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
listLong.add(Long.valueOf(newNums)); listLong.add(Long.valueOf(newNums));
} }
System.out.println(listLong); //System.out.println(listLong);
return Collections.max(listLong) + 1; return Collections.max(listLong) + 1;
} }

@ -95,7 +95,12 @@ public class ZyStyleModelController extends JeecgController<ZyStyleModel, IZySty
@ApiOperation(value="zy_style_model-编辑", notes="zy_style_model-编辑") @ApiOperation(value="zy_style_model-编辑", notes="zy_style_model-编辑")
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_model:edit") //@RequiresPermissions("org.jeecg.modules.demo:zy_style_model:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ZyStyleModel zyStyleModel) { public Result<?> edit(@RequestBody ZyStyleModel zyStyleModel) {
zyStyleModel.setStyleId(null);
//限制一些类型的数据只能为数字 否则无法保存
if(!zyStyleModelService.dataTypeProblem(zyStyleModel)){
return Result.error("只能输入数字类型");
}
//System.err.println("zyStyleModel edit: "+zyStyleModel+ LocalDateTime.now()); //System.err.println("zyStyleModel edit: "+zyStyleModel+ LocalDateTime.now());
zyStyleModelService.updateById(zyStyleModel); zyStyleModelService.updateById(zyStyleModel);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
@ -141,7 +146,7 @@ public class ZyStyleModelController extends JeecgController<ZyStyleModel, IZySty
List<String> idList = (List<String>) map.get("id"); List<String> idList = (List<String>) map.get("id");
// List<Integer> list = Arrays.asList(ids); // List<Integer> list = Arrays.asList(ids);
zyStyleModelService.removeByIds(idList); zyStyleModelService.removeByIds(idList);
System.out.println(map); //System.out.println(map);
//this.zyStyleModelService.removeByIds(Arrays.asList(map.get("deleteIds").split(","))); //this.zyStyleModelService.removeByIds(Arrays.asList(map.get("deleteIds").split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }

@ -18,4 +18,6 @@ public interface IZyStyleModelService extends IService<ZyStyleModel> {
List<ZyStyleModel> detail(String id); List<ZyStyleModel> detail(String id);
ZyStyleModelDetailsVO queryDetails(String id); ZyStyleModelDetailsVO queryDetails(String id);
boolean dataTypeProblem(ZyStyleModel zyStyleModel);
} }

@ -19,6 +19,7 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.regex.Pattern;
/** /**
@ -115,6 +116,37 @@ public class ZyStyleModelServiceImpl extends ServiceImpl<ZyStyleModelMapper, ZyS
return detailsVO; return detailsVO;
} }
@Override
public boolean dataTypeProblem(ZyStyleModel zyStyleModel) {
// Pattern pattern = Pattern.compile("/[^\\d]/g");
Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?");
//正则表达式判断是否是数字字符串(可判断正数,负数和小数)
if (!ObjectUtils.isEmpty(zyStyleModel.getCollarLarge())){
return pattern.matcher(zyStyleModel.getCollarLarge().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getBust())){
return pattern.matcher(zyStyleModel.getBust().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getSleeveLength())){
return pattern.matcher(zyStyleModel.getSleeveLength().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getShslLength())){
return pattern.matcher(zyStyleModel.getShslLength().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getTsWidth())){
return pattern.matcher(zyStyleModel.getTsWidth().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getCuff())){
return pattern.matcher(zyStyleModel.getCuff().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getWaistline())){
return pattern.matcher(zyStyleModel.getWaistline().toString()).matches();
}
if (!ObjectUtils.isEmpty(zyStyleModel.getHem())){
return pattern.matcher(zyStyleModel.getHem().toString()).matches();
}
return true;
}
@Contract(pure = true) @Contract(pure = true)

Loading…
Cancel
Save