|
|
@ -3,9 +3,29 @@ |
|
|
|
<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-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterprisesId"> |
|
|
|
|
|
|
|
<j-select-depart v-model="model.enterprisesId" @change="getlx()"/> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
<a-col :span="24"> |
|
|
|
|
|
|
|
<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()"/> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
<a-col :span="24"> |
|
|
|
|
|
|
|
<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()"/> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
<a-col :span="24"> |
|
|
|
|
|
|
|
<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()"/> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-form-model-item label="商品编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsCode"> |
|
|
|
<a-form-model-item label="商品编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsCode"> |
|
|
|
<a-input v-model="model.goodsCode" placeholder="请输入商品编号" ></a-input> |
|
|
|
<a-input v-model="model.goodsCode" placeholder="请输入商品编号" disabled></a-input> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-col :span="24"> |
|
|
@ -38,21 +58,6 @@ |
|
|
|
<j-upload v-model="model.goodsVideo" ></j-upload> |
|
|
|
<j-upload v-model="model.goodsVideo" ></j-upload> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
<a-col :span="24"> |
|
|
|
|
|
|
|
<a-form-model-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothsTypeId"> |
|
|
|
|
|
|
|
<j-dict-select-tag type="list" v-model="model.clothsTypeId" dictCode="zy_cloths_type ,type_name,id" placeholder="请选择类型id" /> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
<a-col :span="24"> |
|
|
|
|
|
|
|
<a-form-model-item label="型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modelId"> |
|
|
|
|
|
|
|
<j-dict-select-tag type="list" v-model="model.modelId" dictCode="zy_style_model,model_number,id" placeholder="请选择型号id" /> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
<a-col :span="24"> |
|
|
|
|
|
|
|
<a-form-model-item label="款式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleId"> |
|
|
|
|
|
|
|
<j-dict-select-tag type="list" v-model="model.styleId" dictCode="zy_cloths_style,style_names,id" placeholder="请选择款式id" /> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
<a-col :span="24"> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unit"> |
|
|
|
<a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unit"> |
|
|
|
<a-input v-model="model.unit" placeholder="请输入单位" ></a-input> |
|
|
|
<a-input v-model="model.unit" placeholder="请输入单位" ></a-input> |
|
|
@ -64,17 +69,17 @@ |
|
|
|
</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="unitPrice"> |
|
|
|
<a-form-model-item label="单价(元)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unitPrice"> |
|
|
|
<a-input-number v-model="model.unitPrice" placeholder="请输入单价" style="width: 100%" /> |
|
|
|
<a-input-number v-model="model.unitPrice" placeholder="请输入单价" style="width: 100%" /> |
|
|
|
</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="discount"> |
|
|
|
<a-form-model-item label="折扣(元)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="discount"> |
|
|
|
<a-input-number v-model="model.discount" placeholder="请输入折扣" style="width: 100%" /> |
|
|
|
<a-input-number v-model="model.discount" placeholder="请输入折扣" style="width: 100%" /> |
|
|
|
</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="promotionPrice"> |
|
|
|
<a-form-model-item label="促销价(元)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="promotionPrice"> |
|
|
|
<a-input-number v-model="model.promotionPrice" placeholder="请输入促销价" style="width: 100%" /> |
|
|
|
<a-input-number v-model="model.promotionPrice" placeholder="请输入促销价" style="width: 100%" /> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
@ -93,11 +98,7 @@ |
|
|
|
<j-dict-select-tag type="radio" v-model="model.status" dictCode="good_status" placeholder="请选择状态" /> |
|
|
|
<j-dict-select-tag type="radio" v-model="model.status" dictCode="good_status" placeholder="请选择状态" /> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
<a-col :span="24"> |
|
|
|
|
|
|
|
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterprisesId"> |
|
|
|
|
|
|
|
<j-select-depart v-model="model.enterprisesId" multi /> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
</a-row> |
|
|
|
</a-row> |
|
|
|
</a-form-model> |
|
|
|
</a-form-model> |
|
|
|
</j-form-container> |
|
|
|
</j-form-container> |
|
|
@ -123,6 +124,9 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
lx:'zy_cloths_type ,type_name,id', |
|
|
|
|
|
|
|
ks:'zy_cloths_style,style_names,id', |
|
|
|
|
|
|
|
xh:'zy_style_model,model_number,id', |
|
|
|
model:{ |
|
|
|
model:{ |
|
|
|
customized:0, |
|
|
|
customized:0, |
|
|
|
recommend:0, |
|
|
|
recommend:0, |
|
|
@ -138,15 +142,24 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
confirmLoading: false, |
|
|
|
confirmLoading: false, |
|
|
|
validatorRules: { |
|
|
|
validatorRules: { |
|
|
|
|
|
|
|
enterprisesId:[{ |
|
|
|
|
|
|
|
required: true, message: '请选择企业!' |
|
|
|
|
|
|
|
}], |
|
|
|
|
|
|
|
modelId:[{ |
|
|
|
|
|
|
|
required: true, message: '请选择型号!' |
|
|
|
|
|
|
|
}], |
|
|
|
goodsCode: [ |
|
|
|
goodsCode: [ |
|
|
|
{ required: true, message: '请输入商品编号!'}, |
|
|
|
{ required: true, message: '请输入商品编号!'}, |
|
|
|
], |
|
|
|
], |
|
|
|
styleId: [ |
|
|
|
styleId: [ |
|
|
|
{ required: true, message: '请选择款式!'}, |
|
|
|
{ required: true, message: '请选择款式!'}, |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
clothsTypeId:[{ |
|
|
|
|
|
|
|
required: true, message: '请选择类型!' |
|
|
|
|
|
|
|
}], |
|
|
|
number: [ |
|
|
|
number: [ |
|
|
|
{ required: false}, |
|
|
|
{ required: false}, |
|
|
|
{ pattern: /^-?\d+$/, message: '请输入整数!'}, |
|
|
|
{ pattern: /^[+]{0,1}(\d+)$/, message: '包装个数必须大于等于0!'}, |
|
|
|
], |
|
|
|
], |
|
|
|
unitPrice: [ |
|
|
|
unitPrice: [ |
|
|
|
{ required: false}, |
|
|
|
{ required: false}, |
|
|
@ -164,7 +177,8 @@ |
|
|
|
url: { |
|
|
|
url: { |
|
|
|
add: "/zygoods/zyGoods/add", |
|
|
|
add: "/zygoods/zyGoods/add", |
|
|
|
edit: "/zygoods/zyGoods/edit", |
|
|
|
edit: "/zygoods/zyGoods/edit", |
|
|
|
queryById: "/zygoods/zyGoods/queryById" |
|
|
|
queryById: "/zygoods/zyGoods/queryById", |
|
|
|
|
|
|
|
zy:"/zygoods/zyGoods/getspbh" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -178,6 +192,27 @@ |
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
getlx(){ |
|
|
|
|
|
|
|
this.lx ="zy_cloths_type ,type_name,id,enterprise_id='" + this.model.enterprisesId + "'"; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getks(){ |
|
|
|
|
|
|
|
this.ks ="zy_cloths_style,style_names,id,type_id='" + this.model.clothsTypeId + "'"; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getxh(){ |
|
|
|
|
|
|
|
this.xh ="zy_style_model,model_number,id,style_id='" + this.model.styleId + "'"; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getspbh(){ |
|
|
|
|
|
|
|
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 { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
add () { |
|
|
|
add () { |
|
|
|
this.edit(this.modelDefault); |
|
|
|
this.edit(this.modelDefault); |
|
|
|
}, |
|
|
|
}, |
|
|
|