|
|
|
@ -25,10 +25,19 @@ |
|
|
|
</view> |
|
|
|
<u-modal :show="show" :title="'删除'" :content="'是否确认删除此分类?'" showCancelButton="true" @cancel="show = false" |
|
|
|
@confirm="delItemModal"></u-modal> |
|
|
|
<uni-popup ref="inputDialog" type="dialog"> |
|
|
|
<uni-popup-dialog ref="inputClose" mode="input" :title="dialogTit" :value="inputVal" placeholder="请输入名称" |
|
|
|
@confirm="dialogInputConfirm" @close="dialogClose"> |
|
|
|
</uni-popup-dialog> |
|
|
|
<uni-popup ref="inputDialog" type="dialog"> |
|
|
|
<view class="type-popup" style="width:600rpx;margin-bottom: 0;border-radius: 0;height: 400rpx;border-radius: 10px;"> |
|
|
|
<view style="height: 80rpx;font-size: 36rpx;font-weight: bold;line-height: 80rpx;text-align: center;"> |
|
|
|
新增规格 |
|
|
|
</view> |
|
|
|
<view style="width: 90%;margin: 80rpx auto;"> |
|
|
|
<uni-easyinput type="text" v-model="categoryText" @blur="handleBlur" placeholder="请输入规格值" /> |
|
|
|
</view> |
|
|
|
<view style="width: 100%;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 0;background: linear-gradient(90deg, #60F3FF, #088FEB);color: #fff;display: flex;position: absolute;bottom: 0;"> |
|
|
|
<view style="width:50%;" @tap="$refs.inputDialog.close()">取消</view> |
|
|
|
<view style="width:50%;background: linear-gradient(90deg, #FF9797, #FFC1E0);" @tap="dialogInputConfirm">确认</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<!-- 查看商品库存弹出层 --> |
|
|
|
<uni-popup ref="carPopup" background-color="#fff"> |
|
|
|
@ -87,7 +96,8 @@ |
|
|
|
delType: '', |
|
|
|
dialogTit: '输入分类名', |
|
|
|
categoryId: '', |
|
|
|
goodsList: [] |
|
|
|
goodsList: [], |
|
|
|
categoryText:'' |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -183,13 +193,16 @@ |
|
|
|
this.editItem = item; |
|
|
|
} |
|
|
|
this.$refs.inputDialog.open() |
|
|
|
}, |
|
|
|
handleBlur(e){ |
|
|
|
this.categoryText = e.detail.value |
|
|
|
}, |
|
|
|
dialogInputConfirm(e) { |
|
|
|
switch (this.typeModel) { |
|
|
|
case 'add': |
|
|
|
|
|
|
|
this.tui.request("/app/productCategory/save", "post", { |
|
|
|
categoryName: e |
|
|
|
categoryName: this.categoryText |
|
|
|
}, false, true).then((res) => { |
|
|
|
|
|
|
|
if (res.code == 200) { |
|
|
|
@ -209,7 +222,7 @@ |
|
|
|
break; |
|
|
|
case 'edit': |
|
|
|
this.tui.request("/app/productCategory/edit", "post", { |
|
|
|
categoryName: e, |
|
|
|
categoryName: this.categoryText, |
|
|
|
id: this.editItem.id |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
@ -237,7 +250,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
this.tui.request("/app/productAttribute/save", "post", { |
|
|
|
attributeName: e, |
|
|
|
attributeName: this.categoryText, |
|
|
|
categoryId: this.isOpenId |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
@ -263,7 +276,7 @@ |
|
|
|
return |
|
|
|
} |
|
|
|
this.tui.request("/app/productAttributeValue/save", "post", { |
|
|
|
value: e, |
|
|
|
value: this.categoryText, |
|
|
|
attributeId: this.isOpenId |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
@ -271,7 +284,8 @@ |
|
|
|
uni.showToast({ |
|
|
|
title: "添加成功", |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$refs.inputDialog.close() |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
title: res.message, |
|
|
|
@ -282,7 +296,7 @@ |
|
|
|
break; |
|
|
|
case 'attrEdit': |
|
|
|
this.tui.request("/app/productAttribute/edit", "post", { |
|
|
|
attributeName: e, |
|
|
|
attributeName: this.categoryText, |
|
|
|
categoryId: this.editItem.categoryId, |
|
|
|
id: this.editItem.id |
|
|
|
}, false, true).then((res) => { |
|
|
|
@ -549,5 +563,13 @@ |
|
|
|
flex: 1; |
|
|
|
text-align: center; |
|
|
|
background: linear-gradient(90deg, #60F3FF, #088FEB); |
|
|
|
} |
|
|
|
.type-popup{ |
|
|
|
width: 500rpx; |
|
|
|
height: auto; |
|
|
|
background: #fff; |
|
|
|
border-radius: 10px; |
|
|
|
position: relative; |
|
|
|
margin-bottom: 40rpx; |
|
|
|
} |
|
|
|
</style> |