|
|
@ -18,24 +18,16 @@ |
|
|
|
<el-card class="box-card"> |
|
|
|
<div class="item"> |
|
|
|
<span class="item_text">选择菜窖分类:</span> |
|
|
|
<el-select v-model="formobj.brandId" placeholder="请选择菜窖分类" class="item_input" @change="selectBrandChange"> |
|
|
|
<el-option |
|
|
|
v-for="item in brandList" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id" |
|
|
|
/> |
|
|
|
<el-select v-model="formobj.brandId" placeholder="请选择菜窖分类" class="item_input" |
|
|
|
@change="selectBrandChange"> |
|
|
|
<el-option v-for="item in brandList" :key="item.id" :label="item.name" :value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<span class="item_text">选择商品分类:</span> |
|
|
|
<el-select v-model="formobj.categoryId" placeholder="请选择商品分类" class="item_input" @change="selectCateChange"> |
|
|
|
<el-option |
|
|
|
v-for="item in cateList" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id" |
|
|
|
/> |
|
|
|
<el-select v-model="formobj.categoryId" placeholder="请选择商品分类" class="item_input" |
|
|
|
@change="selectCateChange"> |
|
|
|
<el-option v-for="item in cateList" :key="item.id" :label="item.name" :value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
@ -44,46 +36,43 @@ |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<span class="item_text">编码:</span> |
|
|
|
<el-input |
|
|
|
v-model="formobj.code" |
|
|
|
placeholder="" |
|
|
|
class="item_input" |
|
|
|
clearable |
|
|
|
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" |
|
|
|
/> |
|
|
|
<el-input v-model="formobj.code" placeholder="" class="item_input" clearable |
|
|
|
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" /> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<span class="item_text">条码:</span> |
|
|
|
<el-input |
|
|
|
v-model="formobj.barcode" |
|
|
|
placeholder="" |
|
|
|
class="item_input" |
|
|
|
clearable |
|
|
|
oninput="value=value.replace(/[^0-9]/g,'')" |
|
|
|
/> |
|
|
|
<el-input v-model="formobj.barcode" placeholder="" class="item_input" clearable |
|
|
|
oninput="value=value.replace(/[^0-9]/g,'')" /> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<span class="item_text">价格 (元/斤):</span> |
|
|
|
<el-input |
|
|
|
v-model="formobj.price" |
|
|
|
placeholder="" |
|
|
|
class="item_input" |
|
|
|
clearable |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" |
|
|
|
/> |
|
|
|
<el-input v-model="formobj.price" placeholder="" class="item_input" clearable |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<span class="item_text">阶梯重量(斤):</span> |
|
|
|
<el-input v-model="formobj.stepWeight" placeholder="" class="item_input" clearable |
|
|
|
oninput="value=value.replace(/[^0-9]/g,'')"/> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<span class="item_text">阶梯价格 (元/斤):</span> |
|
|
|
<el-input v-model="formobj.stepPrice" placeholder="" class="item_input" clearable |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="item"> |
|
|
|
<span class="item_text">商品单位:</span> |
|
|
|
<el-input v-model="formobj.specificationUnit" placeholder="例如:斤/瓶/袋/箱/盒" class="item_input" clearable /> |
|
|
|
<el-input v-model="formobj.specificationUnit" placeholder="例如:斤/瓶/袋/箱/盒" class="item_input" |
|
|
|
clearable /> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<span class="item_text">规格 (斤/份):</span> |
|
|
|
<el-input v-model="formobj.weight" placeholder="例如:30" class="item_input" clearable oninput="value=value.replace(/[^0-9]/g,'')" /> |
|
|
|
<el-input v-model="formobj.weight" placeholder="例如:30" class="item_input" clearable |
|
|
|
oninput="value=value.replace(/[^0-9]/g,'')" /> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<span class="item_text">规格单位:</span> |
|
|
|
<el-input v-model="formobj.unitName" placeholder="例如:份" :readonly="true" class="item_input" clearable /> |
|
|
|
<el-input v-model="formobj.unitName" placeholder="例如:份" :readonly="true" class="item_input" |
|
|
|
clearable /> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<span class="item_text">规格描述:</span> |
|
|
@ -96,17 +85,9 @@ |
|
|
|
|
|
|
|
<div class="item" style="margin-bottom: 100px;margin-top: 100px;"> |
|
|
|
<span class="item_text">图片:</span> |
|
|
|
<upload |
|
|
|
ref="uploadImg2" |
|
|
|
v-model="imgList" |
|
|
|
style="margin-top: 20px;" |
|
|
|
class="item_input" |
|
|
|
:limit="1" |
|
|
|
bucket="map" |
|
|
|
:class="{ hide: hideUploadBtn }" |
|
|
|
:upload-data="{ type: '0001' }" |
|
|
|
@change="backData" |
|
|
|
/> |
|
|
|
<upload ref="uploadImg2" v-model="imgList" style="margin-top: 20px;" class="item_input" :limit="1" |
|
|
|
bucket="map" :class="{ hide: hideUploadBtn }" :upload-data="{ type: '0001' }" |
|
|
|
@change="backData" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div> |
|
|
@ -144,6 +125,8 @@ |
|
|
|
code: '', |
|
|
|
barcode: '', |
|
|
|
price: '', |
|
|
|
stepWeight: '', |
|
|
|
stepPrice: '', |
|
|
|
unitName: '份', |
|
|
|
specificationUnit: '', |
|
|
|
weight: '', |
|
|
@ -212,6 +195,8 @@ |
|
|
|
code: '', |
|
|
|
barcode: '', |
|
|
|
price: '', |
|
|
|
stepWeight: '', |
|
|
|
stepPrice: '', |
|
|
|
unitName: '份', |
|
|
|
specificationUnit: '', |
|
|
|
weight: '', |
|
|
@ -235,7 +220,7 @@ |
|
|
|
this.imgList.push({ |
|
|
|
url: resp.data.picUrl |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.hideUploadBtn = this.imgList.length != 0 |
|
|
|
console.log('this.hideUploadBtn', this.hideUploadBtn) |
|
|
@ -244,13 +229,13 @@ |
|
|
|
.catch(e => { |
|
|
|
this.formobj = row |
|
|
|
this.imgList = [] |
|
|
|
// if (resp.data.picUrl != '') { |
|
|
|
// this.imgList.push({ |
|
|
|
// url: formobj.picUrl |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// if (resp.data.picUrl != '') { |
|
|
|
// this.imgList.push({ |
|
|
|
// url: formobj.picUrl |
|
|
|
// }) |
|
|
|
// } |
|
|
|
|
|
|
|
// this.hideUploadBtn = this.imgList.length != 0 |
|
|
|
// this.hideUploadBtn = this.imgList.length != 0 |
|
|
|
console.log('this.hideUploadBtn', this.hideUploadBtn) |
|
|
|
}) |
|
|
|
}, |
|
|
|