|
|
|
@ -18,7 +18,7 @@ |
|
|
|
|
<a-form-item label="商品SKU" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<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个字符' }] }]" /> |
|
|
|
|
<div class="action-item"> |
|
|
|
|
<div class="action-item" style="margin-left:15px"> |
|
|
|
|
<a-button type="primary" @click="handInfo">一键获取</a-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -240,8 +240,8 @@ |
|
|
|
|
</div> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item label="下单须知" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input placeholder="请输入下单须知" v-decorator="['remark']" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-input placeholder="请输入下单须知" v-decorator="['remark']" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item label="初始销量" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="用户端展示的销量 = 初始销量 + 实际销量"> |
|
|
|
|
<a-input-number v-decorator="['sales_initial', { initialValue: 0 }]" /> |
|
|
|
|
</a-form-item> |
|
|
|
@ -423,31 +423,19 @@ 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') |
|
|
|
|
this.formData.goods.goods_no = goods_no |
|
|
|
|
this.formData.goods.goods_no = goods_no |
|
|
|
|
if (goods_no) { |
|
|
|
|
let param = { |
|
|
|
|
sku: goods_no |
|
|
|
|
} |
|
|
|
|
this.isLoading = true |
|
|
|
|
GoodsApi.getCollector(param).then((result) => { |
|
|
|
|
this.formData.goods.goods_images = [] |
|
|
|
|
if (result.data.goods_images.length > 0) { |
|
|
|
|
result.data.goods_images.forEach(item => { |
|
|
|
|
item.id = Number(this.generateRandomDigits(7)) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
this.formData.goods.imagesIds=result.data.goods_images |
|
|
|
|
this.formData.goods.goods_images = result.data.goods_images |
|
|
|
|
this.$refs.childComponent.selectedItems= result.data.goods_images |
|
|
|
|
this.$refs.childComponent.selectedItems = result.data.goods_images |
|
|
|
|
this.formData.goods.goods_name = result.data.name |
|
|
|
|
this.formData.goods.content = result.data.content |
|
|
|
|
this.formData.goods.goods_price = result.data.proxyPrice |
|
|
|
@ -579,7 +567,7 @@ export default { |
|
|
|
|
'delivery_type', |
|
|
|
|
'is_brand', |
|
|
|
|
'is_in_store', |
|
|
|
|
'goods_no' |
|
|
|
|
'goods_no' |
|
|
|
|
], |
|
|
|
|
['spec_type', 'goods_price', 'is_restrict', 'restrict_total', 'restrict_single', 'cost_price'], |
|
|
|
|
['content'], |
|
|
|
|