|
|
@ -18,7 +18,7 @@ |
|
|
|
<a-form-item label="商品SKU" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
<a-form-item label="商品SKU" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
<div style=" display: flex;align-items: center;width:100%"> |
|
|
|
<div style=" display: flex;align-items: center;width:100%"> |
|
|
|
<a-input style="width:242px" placeholder="输入商品SKU" v-decorator="['goods_no', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]" /> |
|
|
|
<a-input style="width:242px" placeholder="输入商品SKU" v-decorator="['goods_no', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]" /> |
|
|
|
<div class="action-item"> |
|
|
|
<div class="action-item" style="margin-left:15px"> |
|
|
|
<a-button type="primary" @click="handInfo">一键获取</a-button> |
|
|
|
<a-button type="primary" @click="handInfo">一键获取</a-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -422,13 +422,6 @@ 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') |
|
|
@ -438,16 +431,13 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
this.isLoading = true |
|
|
|
this.isLoading = true |
|
|
|
GoodsApi.getCollector(param).then((result) => { |
|
|
|
GoodsApi.getCollector(param).then((result) => { |
|
|
|
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 |
|
|
|
this.$refs.childComponent.selectedItems = result.data.goods_images |
|
|
|
let obj = { |
|
|
|
let obj = { |
|
|
|
goods_name: result.data.name, |
|
|
|
goods_name: result.data.name, |
|
|
|
content: result.data.content, |
|
|
|
content: result.data.content, |
|
|
|
goods_price: result.data.proxyPrice, |
|
|
|
goods_price: result.data.proxyPrice, |
|
|
|
|
|
|
|
imagesIds: result.data.goods_images, |
|
|
|
|
|
|
|
goods_images: result.data.goods_images, |
|
|
|
} |
|
|
|
} |
|
|
|
this.form.setFieldsValue(obj) |
|
|
|
this.form.setFieldsValue(obj) |
|
|
|
this.isLoading = false |
|
|
|
this.isLoading = false |
|
|
|