|
|
@ -38,7 +38,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
<a-form-item label="商品图片" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="建议尺寸:750*750像素, 最多上传10张, 可拖拽图片调整顺序, 第1张将作为商品首图"> |
|
|
|
<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> |
|
|
|
<a-form-item label="商品来源" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
<a-form-item label="商品来源" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
<a-radio-group v-decorator="['goods_source', { initialValue: 'JD', rules: [{ required: true }] }]"> |
|
|
|
<a-radio-group v-decorator="['goods_source', { initialValue: 'JD', rules: [{ required: true }] }]"> |
|
|
@ -408,7 +408,6 @@ export default { |
|
|
|
], |
|
|
|
], |
|
|
|
// 城市总数 |
|
|
|
// 城市总数 |
|
|
|
citysCount: null, |
|
|
|
citysCount: null, |
|
|
|
goods_images: [] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 初始化数据 |
|
|
|
// 初始化数据 |
|
|
@ -420,29 +419,41 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
generateRandomDigits(length) { |
|
|
|
|
|
|
|
let result = ''; |
|
|
|
|
|
|
|
for (let i = 0; i < length; i++) { |
|
|
|
|
|
|
|
result += Math.floor(Math.random() * 10); // 生成0-9的随机数字 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
}, |
|
|
|
handInfo() { |
|
|
|
handInfo() { |
|
|
|
const { form } = this |
|
|
|
const { form } = this |
|
|
|
const goods_no = form.getFieldValue('goods_no') |
|
|
|
const goods_no = form.getFieldValue('goods_no') |
|
|
|
if(goods_no){ |
|
|
|
if (goods_no) { |
|
|
|
let param = { |
|
|
|
let param = { |
|
|
|
sku: goods_no |
|
|
|
sku: goods_no |
|
|
|
} |
|
|
|
|
|
|
|
this.isLoading = true |
|
|
|
|
|
|
|
GoodsApi.getCollector(param).then((result) => { |
|
|
|
|
|
|
|
this.goods_images = result.data.goods_images |
|
|
|
|
|
|
|
let obj = { |
|
|
|
|
|
|
|
goods_name: result.data.name, |
|
|
|
|
|
|
|
content: result.data.content, |
|
|
|
|
|
|
|
goods_price: result.data.proxyPrice, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
this.form.setFieldsValue(obj) |
|
|
|
this.isLoading = true |
|
|
|
this.isLoading = false |
|
|
|
GoodsApi.getCollector(param).then((result) => { |
|
|
|
}) |
|
|
|
if (result.data.goods_images.length > 0) { |
|
|
|
.catch(() => { |
|
|
|
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, |
|
|
|
|
|
|
|
goods_price: result.data.proxyPrice, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.form.setFieldsValue(obj) |
|
|
|
this.isLoading = false |
|
|
|
this.isLoading = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
.finally(() => (this.isLoading = false)) |
|
|
|
.catch(() => { |
|
|
|
}else{ |
|
|
|
this.isLoading = false |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.finally(() => (this.isLoading = false)) |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.warning('请输入商品SKU', 1.5) |
|
|
|
this.$message.warning('请输入商品SKU', 1.5) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|