|
|
|
@ -38,7 +38,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item label="商品图片" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="建议尺寸:750*750像素, 最多上传10张, 可拖拽图片调整顺序, 第1张将作为商品首图"> |
|
|
|
|
<SelectImage :defaultList="goods_images" :source='1' multiple :maxNum="10" v-decorator="['imagesIds', { rules: [{ required: true, message: '请至少上传1张商品图片' }] }]" /> |
|
|
|
|
<SelectImage ref="childComponent" :source='1' multiple :maxNum="10" v-decorator="['imagesIds', { rules: [{ required: true, message: '请至少上传1张商品图片' }] }]" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item label="商品来源" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-radio-group v-decorator="['goods_source', { initialValue: 'JD', rules: [{ required: true }] }]"> |
|
|
|
@ -408,7 +408,6 @@ export default { |
|
|
|
|
], |
|
|
|
|
// 城市总数 |
|
|
|
|
citysCount: null, |
|
|
|
|
goods_images: [] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 初始化数据 |
|
|
|
@ -420,6 +419,13 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
generateRandomDigits(length) { |
|
|
|
|
let result = ''; |
|
|
|
|
for (let i = 0; i < length; i++) { |
|
|
|
|
result += Math.floor(Math.random() * 10); // 生成0-9的随机数字 |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
}, |
|
|
|
|
handInfo() { |
|
|
|
|
const { form } = this |
|
|
|
|
const goods_no = form.getFieldValue('goods_no') |
|
|
|
@ -429,7 +435,12 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.isLoading = true |
|
|
|
|
GoodsApi.getCollector(param).then((result) => { |
|
|
|
|
this.goods_images = result.data.goods_images |
|
|
|
|
if (result.data.goods_images.length > 0) { |
|
|
|
|
result.data.goods_images.forEach(item => { |
|
|
|
|
item.id = Number(this.generateRandomDigits(7)) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
this.$refs.childComponent.selectedItems= result.data.goods_images |
|
|
|
|
let obj = { |
|
|
|
|
goods_name: result.data.name, |
|
|
|
|
content: result.data.content, |
|
|
|
|