修改列表问题及部分问题

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. 207
      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',
input: 'input',
//数字输入框 只能输入数字 小数也可以 其它类型的无法输入
inputNumber: 'inputNumber',
textarea: 'textarea',
select: 'select',

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

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

@ -3,20 +3,20 @@
<a-card :bordered="false">
<p style="font-size: 30px;color:#333;padding-left: 40%">{{biaoTi}}</p>
<!-- 查询区域 -->
<!-- <div class="table-page-search-wrapper">-->
<!-- <a-form layout="inline" @keyup.enter.native="searchQuery">-->
<!-- <a-row :gutter="24">-->
<!-- <a-col>-->
<!-- <div class="table-page-search-wrapper">-->
<!-- <a-form layout="inline" @keyup.enter.native="searchQuery">-->
<!-- <a-row :gutter="24">-->
<!-- <a-col>-->
<!-- <a-button type="primary">{{biaoTi}}</a-button>-->
<!-- </a-col>-->
<!-- </a-row>-->
<!-- </a-form>-->
<!-- </div>-->
<!-- </a-col>-->
<!-- </a-row>-->
<!-- </a-form>-->
<!-- </div>-->
<!-- 查询区域-END -->
<!-- <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>-->
<!-- <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>-->
<!-- table区域-begin -->
<div >
<div>
<j-vxe-table
toolbar
:toolbarConfig="toolbarConfig"
@ -37,19 +37,19 @@
>
<template v-slot:toolbarSuffix>
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>
<!-- <a-tooltip placement="top" title="获取值,忽略表单验证" :autoAdjustOverflow="true">-->
<!-- <a-button @click="handleTableGet">获取值</a-button>-->
<!-- </a-tooltip>-->
<!-- <a-tooltip placement="top" title="模拟加载1000条数据" :autoAdjustOverflow="true">-->
<!-- <a-button @click="handleTableSet">设置值</a-button>-->
<!-- </a-tooltip>-->
<!-- <a-tooltip placement="top" title="获取值,忽略表单验证" :autoAdjustOverflow="true">-->
<!-- <a-button @click="handleTableGet">获取值</a-button>-->
<!-- </a-tooltip>-->
<!-- <a-tooltip placement="top" title="模拟加载1000条数据" :autoAdjustOverflow="true">-->
<!-- <a-button @click="handleTableSet">设置值</a-button>-->
<!-- </a-tooltip>-->
</template>
<template v-slot:action="props">
<!-- <a @click="submitForm(props)">保存</a>-->
<!-- <a-divider type="vertical"/>-->
<!-- <a @click="submitForm(props)">保存</a>-->
<!-- <a-divider type="vertical"/>-->
<a @click="viewDetail(props.rowId)">详情</a>
<a-divider type="vertical" />
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="handleDelete(props.rowId)">
<a>删除</a>
</a-popconfirm>
@ -91,11 +91,11 @@ export default {
// add remove clearSelection
btn: ['add'],
},
validatorRules: {
// validatorRules: {
// styleId: [
// {required: true, message: '!'},
// ],
},
// },
//
loading: false,
//
@ -117,40 +117,140 @@ export default {
columns: [
{
title: '服装款式',
width: '110px',
fixed: 'left',
key: 'styleId',
type: JVXETypes.select,
title: '服装款式', width: '100px', fixed: 'left', key: 'styleId',
type: JVXETypes.normal,
placeholder: '请输入${title}',
//dictCode: 'zy_cloths_style,style_names,id',
validateRules: [
{required: true, message: '${title}不能为空'},
],
// validateRules: [
// {required: true, message: '${title}'},
// ],
disabled: true,
},
{
title: '是否默认尺码',
align: "center",
width: '130px',
key: 'isdefault',
title: '是否默认尺码', align: "center", width: '130px', key: 'isdefault',
type: JVXETypes.select,
dictCode: 'isdefault',
defaultValue: 0,
},
{key: 'modelNumber', title: '型号编码', dictCode: 'modenumber', width: '100px', type: JVXETypes.select},
{key: 'size', title: '码数', width: '85px', dictCode: 'size', type: JVXETypes.select},
{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.input},
{key: 'bust', title: '胸围', width: '80px', type: JVXETypes.input},
{key: 'sleeveLength', title: '袖长', width: '80px', type: JVXETypes.input},
{key: 'shslLength', title: '连肩袖长', width: '100px', type: JVXETypes.input},
{
key: 'modelNumber', title: '型号编码', dictCode: 'modenumber', width: '100px',
type: JVXETypes.select
},
{
key: 'size', title: '码数', width: '85px', dictCode: 'size',
type: JVXETypes.select
},
{
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: 'waistline', title: '腰围', width: '80px', type: JVXETypes.input},
{key: 'hem', title: '下摆', width: '80px', type: JVXETypes.input},
{
key: 'tsWidth', title: '总肩宽', width: '80px',
type: JVXETypes.inputNumber,
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},
{
@ -195,14 +295,12 @@ export default {
methods: {
//
added(event){
added(event) {
//this.styleId = this.$route.query.id;
event.row.styleId = this.$route.query.id;
console.log("新增触发事件", event)
let httpUrl = this.url.add;
let method = 'post';
//httpUrl += this.url.add;
//method = 'post';
let that = this;
httpAction(httpUrl, event.row, method).then((res) => {
if (res.success) {
@ -216,18 +314,13 @@ export default {
})
},
//
handleValueChange(event) {
async handleValueChange(event) {
//this.submitForm(event)
console.log("//数据发生变化时事件", event);
//const str = event.row.id;
let httpUrl = '';
let method = '';
httpUrl += this.url.edit;
method = 'put';
httpAction(httpUrl, event.row, method).then((res) => {
let httpUrl = this.url.edit;
let method = 'put';
await httpAction(httpUrl, event.row, method).then((res) => {
if (res.success) {
this.$message.success(res.message);
this.$emit('ok');

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

@ -107,7 +107,7 @@ public class ZyClothsModularController extends JeecgController<ZyClothsModular,
@ApiOperation(value = "制衣模块详情详情", notes = "根据制衣模块详情id进行查询")
@GetMapping(value = "/detail")
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);
return Result.OK(detail);
}

@ -139,7 +139,7 @@ public class ZyClothsModularServiceImpl extends ServiceImpl<ZyClothsModularMappe
listLong.add(Long.valueOf(newNums));
}
System.out.println(listLong);
//System.out.println(listLong);
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-编辑")
//@RequiresPermissions("org.jeecg.modules.demo:zy_style_model:edit")
@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());
zyStyleModelService.updateById(zyStyleModel);
return Result.OK("编辑成功!");
@ -141,7 +146,7 @@ public class ZyStyleModelController extends JeecgController<ZyStyleModel, IZySty
List<String> idList = (List<String>) map.get("id");
// List<Integer> list = Arrays.asList(ids);
zyStyleModelService.removeByIds(idList);
System.out.println(map);
//System.out.println(map);
//this.zyStyleModelService.removeByIds(Arrays.asList(map.get("deleteIds").split(",")));
return Result.OK("批量删除成功!");
}

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

@ -19,6 +19,7 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.List;
import java.util.regex.Pattern;
/**
@ -115,6 +116,37 @@ public class ZyStyleModelServiceImpl extends ServiceImpl<ZyStyleModelMapper, ZyS
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)

Loading…
Cancel
Save