|
|
@ -7,7 +7,7 @@ |
|
|
<uni-easyinput type="text" v-model="formData.productName" placeholder="请输入商品名称" trim="all" /> |
|
|
<uni-easyinput type="text" v-model="formData.productName" placeholder="请输入商品名称" trim="all" /> |
|
|
</uni-forms-item> |
|
|
</uni-forms-item> |
|
|
<uni-forms-item label="商品图片" name="productPicture"> |
|
|
<uni-forms-item label="商品图片" name="productPicture"> |
|
|
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple |
|
|
<u-upload :fileList="formData.productPicture" @afterRead="afterRead" @delete="deletePic" name="1" multiple |
|
|
:maxCount="10"></u-upload> |
|
|
:maxCount="10"></u-upload> |
|
|
</uni-forms-item> |
|
|
</uni-forms-item> |
|
|
<uni-forms-item label="货号" name="productSn" required> |
|
|
<uni-forms-item label="货号" name="productSn" required> |
|
|
@ -24,7 +24,7 @@ |
|
|
<uni-datetime-picker type="date" :clear-icon="false" v-model="formData.salesWeek" /> |
|
|
<uni-datetime-picker type="date" :clear-icon="false" v-model="formData.salesWeek" /> |
|
|
</uni-forms-item> |
|
|
</uni-forms-item> |
|
|
<uni-forms-item label="库存预警" name="tailWarn" required> |
|
|
<uni-forms-item label="库存预警" name="tailWarn" required> |
|
|
<uni-easyinput type="digit" v-model="formData.tailWarn" placeholder="请设置库存预警天数" trim="all" /> |
|
|
<uni-easyinput type="digit" v-model="formData.tailWarn" placeholder="请设置库存预警最低天数" trim="all" /> |
|
|
</uni-forms-item> |
|
|
</uni-forms-item> |
|
|
<uni-forms-item label="分类" name="categoryId" required> |
|
|
<uni-forms-item label="分类" name="categoryId" required> |
|
|
<uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId" |
|
|
<uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId" |
|
|
@ -58,7 +58,7 @@ |
|
|
productSn: '', |
|
|
productSn: '', |
|
|
wholesalePrice: '', |
|
|
wholesalePrice: '', |
|
|
// classification: '', |
|
|
// classification: '', |
|
|
productPicture: '', |
|
|
productPicture: [], |
|
|
productIntro: '', |
|
|
productIntro: '', |
|
|
categoryId: '', |
|
|
categoryId: '', |
|
|
salesWeek: '', |
|
|
salesWeek: '', |
|
|
@ -149,7 +149,7 @@ |
|
|
console.log(event); |
|
|
console.log(event); |
|
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式 |
|
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式 |
|
|
let lists = [].concat(event.file) |
|
|
let lists = [].concat(event.file) |
|
|
if (this.fileList1 == undefined) this.fileList1 = []; |
|
|
if (this.formData.productPicture == undefined) this.formData.productPicture = []; |
|
|
let fileListLen = this[`fileList${event.name}`].length |
|
|
let fileListLen = this[`fileList${event.name}`].length |
|
|
console.log(lists, 'lists'); |
|
|
console.log(lists, 'lists'); |
|
|
lists.map((item) => { |
|
|
lists.map((item) => { |
|
|
@ -159,7 +159,7 @@ |
|
|
message: '上传中' |
|
|
message: '上传中' |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
console.log(this.fileList1); |
|
|
console.log(this.formData.productPicture); |
|
|
for (let i = 0; i < lists.length; i++) { |
|
|
for (let i = 0; i < lists.length; i++) { |
|
|
const result = await this.uploadFilePromise(lists[i].url) |
|
|
const result = await this.uploadFilePromise(lists[i].url) |
|
|
let item = this[`fileList${event.name}`][fileListLen] |
|
|
let item = this[`fileList${event.name}`][fileListLen] |
|
|
|