2023-1-9sample

zhc4dev
lenovo 2 years ago
parent 9551b2a05b
commit 00ce5ee23e
  1. 55
      ant-design-vue-jeecg/src/views/zyclothsample/modules/ZyClothSampleForm.vue
  2. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/controller/ZyClothSampleController.java
  3. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/entity/ZyClothSample.java
  4. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/mapper/ZyClothSampleMapper.java
  5. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/service/IZyClothSampleService.java
  6. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zyclothsample/service/impl/ZyClothSampleServiceImpl.java
  7. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/zystylemodel/entity/ZyStyleModel.java

@ -3,28 +3,47 @@
<j-form-container :disabled="formDisabled"> <j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24" >
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId"> <a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId" v-if="this.model.id==null">
<j-select-depart v-model="model.enterpriseId" @change="kuanshi" /> <j-select-depart v-model="model.enterpriseId" @change="kuanshi" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId" v-else>
<j-select-depart v-model="model.enterpriseId" @change="kuanshi" disabled />
</a-form-model-item>
</a-col> </a-col>
<!--关联服装款式表 zy_cloths_style 关联列名称 传值id--> <!--关联服装款式表 zy_cloths_style 关联列名称 传值id-->
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="款式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleId"> <a-form-model-item label="款式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleId" v-if="this.model.id==null">
<j-dict-select-tag v-model="model.styleId" placeholder="请输入款式" <j-dict-select-tag v-model="model.styleId" placeholder="请输入款式"
:dict-code="dict" @change="xiugai"></j-dict-select-tag> :dict-code="dict" @change="xiugai"></j-dict-select-tag>
</a-form-model-item>
<a-form-model-item label="款式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleId" v-else>
<j-dict-select-tag v-model="model.styleId" placeholder="请输入款式"
:dict-code="dict" @change="xiugai" disabled></j-dict-select-tag>
</a-form-model-item> </a-form-model-item>
<!-- 编码也是唯一的和id一样 --> <!-- 编码也是唯一的和id一样 -->
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="款式型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stylemodelId"> <a-form-model-item label="款式型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stylemodelId" v-if="this.model.id==null">
<!-- <a-input v-model="model.stylemodelId" placeholder="请输入款式型号" @change="(vaule) => handletypeSelect(value)"></a-input>--> <!-- <a-input v-model="model.stylemodelId" placeholder="请输入款式型号" @change="(vaule) => handletypeSelect(value)"></a-input>-->
<!-- <j-dict-select-tag v-model="model.stylemodelId" placeholder="请输入款式型号"--> <!-- <j-dict-select-tag v-model="model.stylemodelId" placeholder="请输入款式型号"-->
<!-- dict-code="zy_style_model,model_number,model_number"></j-dict-select-tag>--> <!-- dict-code="zy_style_model,model_number,model_number"></j-dict-select-tag>-->
<j-dict-select-tag v-model="model.stylemodelId" placeholder="请选择款式型号" <j-dict-select-tag v-model="model.stylemodelId" placeholder="请选择款式型号"
dictCode="modenumber" @change="gaibian"></j-dict-select-tag> :dictCode="modenumber" @change="gaibian"></j-dict-select-tag>
</a-form-model-item>
<a-form-model-item label="款式型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stylemodelId" v-else>
<!-- <a-input v-model="model.stylemodelId" placeholder="请输入款式型号" @change="(vaule) => handletypeSelect(value)"></a-input>-->
<!-- <j-dict-select-tag v-model="model.stylemodelId" placeholder="请输入款式型号"-->
<!-- dict-code="zy_style_model,model_number,model_number"></j-dict-select-tag>-->
<j-dict-select-tag v-model="model.stylemodelId" placeholder="请选择款式型号"
:dictCode="modenumber" @change="gaibian" disabled></j-dict-select-tag>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -90,7 +109,8 @@ export default {
model: { model: {
nums:'', nums:'',
}, },
dict:"zy_cloths_style,style_names,nums", dict:"zy_cloths_style,style_names,id",
modenumber:'zy_style_model,model_number,id',
labelCol: { labelCol: {
xs: {span: 24}, xs: {span: 24},
sm: {span: 5}, sm: {span: 5},
@ -152,30 +172,34 @@ export default {
}, },
// //
kuanshi(){ kuanshi(){
this.dict="zy_cloths_style,style_names,nums,enterprise_id="+"'"+this.model.enterpriseId+"'"; this.dict="zy_cloths_style,style_names,id,enterprise_id="+"'"+this.model.enterpriseId+"'";
this.model.styleId=null this.model.styleId=null
this.model.nums=null
}, },
xiugai(){ xiugai(){
if(this.model.stylemodelId!=null&&this.model.enterpriseId!=null){ this.modenumber="zy_style_model,model_number,id,style_id="+"'"+this.model.styleId+"'"
this.gaibian() this.model.stylemodelId=null
} this.model.nums=null
// if(this.model.stylemodelId!=null&&this.model.enterpriseId!=null){
// this.gaibian()
// }
}, },
gaibian(){ gaibian(){
var n=3; var n=3;
console.log(this.model) console.log(this.model)
getAction(this.url.sort,this.model).then((res)=>{ getAction(this.url.sort,this.model).then((res)=>{
console.log(res) console.log(res.result[1])
if(this.model.id==null||parseInt(res.result,10)==0){ if(this.model.id==null||parseInt(res.result[1],10)==0){
var num=parseInt(res.result,10)+1 var num=parseInt(res.result[1],10)+1
}else{ }else{
var num=parseInt(res.result,10) var num=parseInt(res.result[1],10)
} }
num=num.toString() num=num.toString()
while(num.length<n){ while(num.length<n){
num="0"+num num="0"+num
} }
this.model.nums=this.model.styleId+this.model.stylemodelId+num; this.model.nums=res.result[2]+res.result[0]+num;
console.log( this.model.nums) console.log( this.model.nums)
})}, })},
// select // select
@ -189,6 +213,7 @@ export default {
edit(record) { edit(record) {
this.model = Object.assign({}, record); this.model = Object.assign({}, record);
this.dict="zy_cloths_style,style_names,nums,enterprise_id="+"'"+this.model.enterpriseId+"'"; this.dict="zy_cloths_style,style_names,nums,enterprise_id="+"'"+this.model.enterpriseId+"'";
this.modenumber="zy_style_model,model_number,id,style_id="+"'"+this.model.styleId+"'"
this.visible = true; this.visible = true;
} }
, ,

@ -1,5 +1,6 @@
package org.jeecg.modules.zyclothsample.controller; package org.jeecg.modules.zyclothsample.controller;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -190,10 +191,18 @@ public class ZyClothSampleController extends JeecgController<ZyClothSample, IZyC
@GetMapping(value = "/sort") @GetMapping(value = "/sort")
public Result<?> sort(ZyClothSample zyClothSample) { public Result<?> sort(ZyClothSample zyClothSample) {
String s=zyClothSampleService.findSort(zyClothSample.getStyleId(),zyClothSample.getStylemodelId()); String s=zyClothSampleService.findSort(zyClothSample.getStyleId(),zyClothSample.getStylemodelId());
String code=zyClothSampleService.findCode(zyClothSample.getStylemodelId());
String styleId=zyClothSampleService.findStyleNums(zyClothSample.getStyleId());
List<String> list=new ArrayList<>();
list.add(code);
if(s==null){ if(s==null){
return Result.OK(0); list.add("0");
}else }else{
return Result.OK(s.substring(21)); list.add(s.substring(21));
}
list.add(styleId);
return Result.OK(list);
} }
} }

@ -64,12 +64,12 @@ public class ZyClothSample implements Serializable {
*/ */
@Excel(name = "款式", width = 15) @Excel(name = "款式", width = 15)
@ApiModelProperty(value = "款式") @ApiModelProperty(value = "款式")
@Dict(dicCode = "nums",dictTable = "zy_cloths_style",dicText = "style_names") @Dict(dicCode = "id",dictTable = "zy_cloths_style",dicText = "style_names")
private String styleId; private String styleId;
/**型号*/ /**型号*/
@Excel(name = "型号", width = 15) @Excel(name = "型号", width = 15)
@ApiModelProperty(value = "型号") @ApiModelProperty(value = "型号")
@Dict(dicCode = "modenumber", dictTable = "", dicText = "") @Dict(dicCode = "id", dictTable = "zy_style_model", dicText = "model_number")
private String stylemodelId; private String stylemodelId;
/**管理模块样板*/ /**管理模块样板*/

@ -18,4 +18,10 @@ public interface ZyClothSampleMapper extends BaseMapper<ZyClothSample> {
@Select("select nums from zy_cloth_sample where style_id=#{styleId} and stylemodel_id=#{stylemodelId} order by nums desc limit 0,1") @Select("select nums from zy_cloth_sample where style_id=#{styleId} and stylemodel_id=#{stylemodelId} order by nums desc limit 0,1")
String findSort(@Param("styleId") String styleId, @Param("stylemodelId") String stylemodelId); String findSort(@Param("styleId") String styleId, @Param("stylemodelId") String stylemodelId);
@Select("select model_code from zy_style_model where id=#{stylemodelId}")
String findCode(String stylemodelId);
@Select("select nums from zy_cloths_style where id=#{styleId}")
String findNums(String styleId);
} }

@ -12,4 +12,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
public interface IZyClothSampleService extends IService<ZyClothSample> { public interface IZyClothSampleService extends IService<ZyClothSample> {
String findSort(String styleId, String stylemodelId); String findSort(String styleId, String stylemodelId);
String findCode(String stylemodelId);
String findStyleNums(String styleId);
} }

@ -23,4 +23,14 @@ public class ZyClothSampleServiceImpl extends ServiceImpl<ZyClothSampleMapper, Z
public String findSort(String styleId, String stylemodelId) { public String findSort(String styleId, String stylemodelId) {
return zyClothSampleMapper.findSort(styleId,stylemodelId); return zyClothSampleMapper.findSort(styleId,stylemodelId);
} }
@Override
public String findCode(String stylemodelId) {
return zyClothSampleMapper.findCode(stylemodelId);
}
@Override
public String findStyleNums(String styleId) {
return zyClothSampleMapper.findNums(styleId);
}
} }

@ -117,6 +117,9 @@ public class ZyStyleModel implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
private java.util.Date updateTime; private java.util.Date updateTime;
@Excel(name = "型号对应的三位数字", width = 15)
@ApiModelProperty(value = "型号对应的三位数字")
private String modelCode;
} }

Loading…
Cancel
Save