下拉框改弹出框联动

master
Gitea 2 years ago
parent 894776036e
commit 30b58af536
  1. 76
      ant-design-vue-jeecg/src/views/zygoods/modules/ZyGoodsForm.vue

@ -11,17 +11,49 @@
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId"> <a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId">
<!--<j-dict-select-tag type="list" v-model="model.clothsTypeId" :dictCode="lx" placeholder="请选择类型" @change="getks()"/>--> <!--<j-dict-select-tag type="list" v-model="model.clothsTypeId" :dictCode="lx" placeholder="请选择类型" @change="getks()"/>-->
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择类型" @change="getks()"/> <!--<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type,type_name,id" placeholder="请选择类型" @change="getks()"/>-->
<j-popup
v-model="model.typeName"
field="typeName"
org-fields="id,type_name"
dest-fields="clothsTypeId,typeName"
code="zy_cloths_type"
:multi="multi"
@input="popupCallback"
/>
<a-input v-model="model.clothsTypeId" hidden />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<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">
<j-dict-select-tag type="list" v-model="model.styleId" :dictCode="ks" placeholder="请选择款式" @change="getxh()"/> <!--<j-dict-select-tag type="list" v-model="model.styleId" :dictCode="ks" placeholder="请选择款式" @change="getxh()"/>-->
<j-popup
v-model="model.styleName"
field="styleName"
org-fields="id,style_names"
dest-fields="styleId,styleName"
code="zy_cloths_style"
:multi="multi"
:param = "param"
@input="popupCallback2"
/>
<a-input v-model="model.styleId" hidden />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="服装型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modelId"> <a-form-model-item label="服装型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modelId">
<j-dict-select-tag type="list" v-model="model.modelId" :dictCode="xh" placeholder="请选择型号" @change="getspbh()"/> <!--<j-dict-select-tag type="list" v-model="model.modelId" :dictCode="xh" placeholder="请选择型号" @change="getspbh()"/>-->
<j-popup
v-model="model.modelName"
field="modelName"
org-fields="id,model_number"
dest-fields="modelId,modelName"
code="zy_style_model"
:multi="multi"
:param = "param2"
@input="popupCallback3"
/>
<a-input v-model="model.modelId" hidden />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -129,6 +161,8 @@
lx:'zy_cloths_type ,type_name,id', lx:'zy_cloths_type ,type_name,id',
ks:'zy_cloths_style,style_names,id', ks:'zy_cloths_style,style_names,id',
xh:'zy_style_model,model_number,id', xh:'zy_style_model,model_number,id',
param:{type_id:""},
param2:{style_id:""},
autoplay:true, autoplay:true,
model:{ model:{
customized:0, customized:0,
@ -144,6 +178,7 @@
sm: { span: 16 }, sm: { span: 16 },
}, },
confirmLoading: false, confirmLoading: false,
multi: false,
validatorRules: { validatorRules: {
enterprisesId:[{ enterprisesId:[{
required: true, message: '请选择企业!' required: true, message: '请选择企业!'
@ -206,6 +241,41 @@
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.modelDefault = JSON.parse(JSON.stringify(this.model));
}, },
methods: { methods: {
popupCallback(value,row){
this.model = Object.assign(this.model, row);
this.param.type_id = this.model.clothsTypeId;
},
popupCallback2(value,row){
this.model = Object.assign(this.model, row);
this.param2.style_id = this.model.styleId;
getAction(this.url.zystyle, {ksid:this.model.styleId}).then((res) => {
if (res.success) {
// this.$forceUpdate();
this.$set(this.model,'goodsIntr',res.result.productOverview);
this.$set(this.model,'goodsPicture',res.result.designSketch);
this.$set(this.model,'defaultPicture',res.result.designSketch);
} else {
}
});
},
popupCallback3(value,row){
this.model = Object.assign(this.model, row);
// //-
if(!this.model.id)
{
getAction(this.url.zy, {lxid:this.model.clothsTypeId,xhid:this.model.modelId}).then((res) => {
if (res.success) {
// console.log(res.result.nums)
// this.$forceUpdate();
//
this.$set(this.model,'goodsCode',res.result);
} else {
}
});
}
},
getlx(){ getlx(){
this.lx ="zy_cloths_type ,type_name,id,enterprise_id='" + this.model.enterprisesId + "'"; this.lx ="zy_cloths_type ,type_name,id,enterprise_id='" + this.model.enterprisesId + "'";
}, },

Loading…
Cancel
Save