This commit is contained in:
@@ -58,7 +58,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="modal-body">
|
<view class="modal-body">
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">分类</text>
|
<text class="label"><text class="required">*</text>分类</text>
|
||||||
<picker :range="categories" range-key="name" @change="onCategoryChange">
|
<picker :range="categories" range-key="name" @change="onCategoryChange">
|
||||||
<view class="picker">
|
<view class="picker">
|
||||||
{{ form.categoryId ? getCategoryName(form.categoryId) : '请选择分类' }}
|
{{ form.categoryId ? getCategoryName(form.categoryId) : '请选择分类' }}
|
||||||
@@ -218,6 +218,10 @@ export default {
|
|||||||
return cat ? cat.name : ''
|
return cat ? cat.name : ''
|
||||||
},
|
},
|
||||||
async saveProduct() {
|
async saveProduct() {
|
||||||
|
if (!this.form.categoryId) {
|
||||||
|
uni.showToast({ title: '请选择分类', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!this.form.name) {
|
if (!this.form.name) {
|
||||||
uni.showToast({ title: '请输入商品名称', icon: 'none' })
|
uni.showToast({ title: '请输入商品名称', icon: 'none' })
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user