|
|
|
@ -6,25 +6,25 @@ |
|
|
|
<uni-icons type="left" size="28"></uni-icons> |
|
|
|
</view> |
|
|
|
<view class="title-name" :style="{'padding-top': menuButtonInfo.top +'px'}"> |
|
|
|
规格管理 |
|
|
|
属性管理 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="width: 100%;position: fixed;bottom: 10px;background: #fff;z-index: 99;"> |
|
|
|
<button size="default" type="default" @tap="inputDialogToggle('add')" hover-class="is-hover">添加规格</button> |
|
|
|
<button size="default" type="default" @tap="inputDialogToggle('add')" hover-class="is-hover">添加属性</button> |
|
|
|
</view> |
|
|
|
<view class="card-list"> |
|
|
|
<ul> |
|
|
|
<li v-for="(item, index) in indexList" :key="index" @tap="clickList(item)"> |
|
|
|
<view class="name"> |
|
|
|
<text>{{item.attributeName}}</text> |
|
|
|
<u-icon name="edit-pen-fill" size="22" v-if="item.attributeName != '默认规格'" @tap.stop="inputDialogToggle('edit', item)"></u-icon> |
|
|
|
<u-icon name="edit-pen-fill" size="22" v-if="item.attributeName != '默认属性'" @tap.stop="inputDialogToggle('edit', item)"></u-icon> |
|
|
|
</view> |
|
|
|
<button class="bj-btn" @tap.stop="goGategoryLow(item)">管理属性</button> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</view> |
|
|
|
<u-modal :show="show" :title="'删除'" :content="'是否确认删除此规格?'" showCancelButton="true" @cancel="show = false" |
|
|
|
<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="请输入名称" |
|
|
|
@ -35,17 +35,17 @@ |
|
|
|
<uni-popup ref="delDialog" background-color="#fff"> |
|
|
|
<view class="add-popup-content"> |
|
|
|
<view class="add-popup-title"> |
|
|
|
<text>编辑规格</text> |
|
|
|
<text>编辑属性</text> |
|
|
|
<uni-icons @tap='close' type="closeempty" color='red' size="16" |
|
|
|
style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons> |
|
|
|
</view> |
|
|
|
<view class="add-popup-container"> |
|
|
|
<view style="width: 90%;margin: 40rpx auto 0;"> |
|
|
|
规格名称: |
|
|
|
<uni-easyinput type="text" v-model="inputVal" @blur="handleBlur" placeholder="请输入规格值" /> |
|
|
|
属性名称: |
|
|
|
<uni-easyinput type="text" v-model="inputVal" @blur="handleBlur" placeholder="请输入属性值" /> |
|
|
|
</view> |
|
|
|
<view style="width: 100%;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 0;color: #fff;display: flex;position: absolute;bottom: 0;"> |
|
|
|
<view style="flex: 1;background: linear-gradient(90deg, #60F3FF, #088FEB);" v-if="inputVal != '默认规格'" @tap="dialogDel">删除</view> |
|
|
|
<view style="flex: 1;background: linear-gradient(90deg, #60F3FF, #088FEB);" v-if="inputVal != '默认属性'" @tap="dialogDel">删除</view> |
|
|
|
<view style="flex: 1;background: linear-gradient(90deg, #FF9797, #FFC1E0);" @tap="dialogInputConfirm">确认</view> |
|
|
|
</view> |
|
|
|
<!-- <ul> |
|
|
|
@ -64,20 +64,18 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<!-- 添加规格弹出层 --> |
|
|
|
<!-- 添加属性弹出层 --> |
|
|
|
<uni-popup ref="addTypeDialog" background-color="#fff"> |
|
|
|
<view class="add-popup-content"> |
|
|
|
<view class="add-popup-title"> |
|
|
|
<text>新增规格</text> |
|
|
|
<text>新增属性</text> |
|
|
|
<uni-icons @tap='close' type="closeempty" color='red' size="16" |
|
|
|
style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons> |
|
|
|
</view> |
|
|
|
<view class="add-popup-container"> |
|
|
|
<view> |
|
|
|
<text style="color:red;font-size:22rpx;">*您可以点击默认项快捷添加规格,如没有想要的快捷项,可以手动输入</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<input type="text" v-model="typeText" style="width: 100%;border: 1px solid #eee;height: 80rpx;padding-left: 20rpx;margin:20rpx 0;font-size: 25rpx;line-height: 80rpx;" |
|
|
|
placeholder="请输入规格名称"> |
|
|
|
placeholder="请输入属性名称"> |
|
|
|
<!-- <ul> |
|
|
|
<li v-for="(item,index) in defaultList" :key="index"> |
|
|
|
<view class="title-fur"> |
|
|
|
@ -99,7 +97,7 @@ |
|
|
|
</uni-popup> |
|
|
|
|
|
|
|
<uni-popup ref="attrValueDialog" background-color="#fff"> |
|
|
|
<view class="add-popup-content"> |
|
|
|
<view class="add-popup-content" style="width: 640rpx;max-height: 600px;overflow: scroll;"> |
|
|
|
<view class="add-popup-title"> |
|
|
|
<text>管理属性</text> |
|
|
|
<uni-icons @tap='close' type="closeempty" color='red' size="16" |
|
|
|
@ -107,16 +105,20 @@ |
|
|
|
</view> |
|
|
|
<view class="add-popup-container"> |
|
|
|
<view> |
|
|
|
<text style="color:red;font-size:22rpx;">*您可以点击默认项快捷添加属性,如没有想要的快捷项,可以手动输入</text> |
|
|
|
<text style="color:red;font-size:22rpx;">*点击“+”号可新增专属自己店铺的属性值</text> |
|
|
|
</view> |
|
|
|
<view style="display: flex;font-weight: 700;font-size: 16px;height: 50px;line-height: 50px;padding-right: 10px;"> |
|
|
|
<view style="flex: 1;"> |
|
|
|
属性列表 |
|
|
|
</view> |
|
|
|
<uni-icons type="plusempty" @tap="toggle()" color="#5fd9ee" size="20"></uni-icons> |
|
|
|
</view> |
|
|
|
<u-icon size="20" name="plus" color="#5fd9ee" |
|
|
|
@tap="toggle() "></u-icon> |
|
|
|
<ul> |
|
|
|
<li v-for="(item,index) in defaultList" :key="index"> |
|
|
|
<view class="title-fur"> |
|
|
|
<view class="name">{{item.value}}</view> |
|
|
|
<view style="flex: 1;background: linear-gradient(90deg, #60F3FF, #088FEB);" v-if="inputVal != '默认规格'" @tap="editValue(item)">修改</view> |
|
|
|
<view style="flex: 1;background: linear-gradient(90deg, #60F3FF, #088FEB);" v-if="inputVal != '默认规格'" @tap="delValue(item)">删除</view> |
|
|
|
<view class="btn" v-if="inputVal != '默认属性'" @tap="editValue(item)">修改</view> |
|
|
|
<view class="btn" v-if="inputVal != '默认属性'" @tap="delValue(item)">删除</view> |
|
|
|
</view> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
@ -130,11 +132,11 @@ |
|
|
|
<view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view> |
|
|
|
<view v-if="goodsList !=''" |
|
|
|
style="width:100%;font-weight:bold;text-align: center;font-size: 28rpx;margin: 20rpx 0;"> |
|
|
|
“{{goodsList[0].productName}}”规格下有以下库存,确认继续删除吗? |
|
|
|
“{{goodsList[0].productName}}”属性下有以下库存,确认继续删除吗? |
|
|
|
</view> |
|
|
|
<view class="tui-order-item boxbg"> |
|
|
|
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;"> |
|
|
|
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;">商品规格</view> |
|
|
|
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;">商品属性</view> |
|
|
|
<view style="width: 29%;text-align: center;">数量</view> |
|
|
|
</view> |
|
|
|
<view class="shop-box" v-for="(item,index) in goodsList" :key="index" style="position: relative;"> |
|
|
|
@ -191,7 +193,7 @@ |
|
|
|
isOpenId: '', |
|
|
|
delType: '', |
|
|
|
goodsList: [], |
|
|
|
dialogTit: '输入规格名', |
|
|
|
dialogTit: '输入属性名', |
|
|
|
typeText:'', |
|
|
|
sortText:'', |
|
|
|
sortTextEdit:'', |
|
|
|
@ -369,7 +371,7 @@ |
|
|
|
|
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
//初始化获取规格列表 |
|
|
|
//初始化获取属性列表 |
|
|
|
getGategoryList() { |
|
|
|
this.tui.request("/app/productAttribute/selectByCategoryId", "post", {categoryId:this.attrId}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
@ -389,13 +391,13 @@ |
|
|
|
} else if (type == 'add') { |
|
|
|
this.inputVal = ''; |
|
|
|
this.isOpenId = item; |
|
|
|
this.dialogTit = '输入规格名' |
|
|
|
this.dialogTit = '输入属性名' |
|
|
|
this.$refs.addTypeDialog.open('bottom') |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
close(){ |
|
|
|
this.$refs.addTypeDialog.close() |
|
|
|
this.$refs.attrValueDialog.close() |
|
|
|
}, |
|
|
|
handleBlur(e){ |
|
|
|
this.inputVal = e.detail.value |
|
|
|
@ -403,7 +405,7 @@ |
|
|
|
handleBlurSort(e){ |
|
|
|
this.sortTextEdit = e.detail.value |
|
|
|
}, |
|
|
|
//查询规格下有没有库存 |
|
|
|
//查询属性下有没有库存 |
|
|
|
getTypeToNum(id) { |
|
|
|
let that = this; |
|
|
|
this.tui.request("/app/stock/getlistByAttributeList", "post", { |
|
|
|
@ -421,7 +423,7 @@ |
|
|
|
if (res1.result.length > 0) { |
|
|
|
uni.showModal({ |
|
|
|
title: "提示", |
|
|
|
content: "此规格已经维护了子规格,确定继续删除吗?", |
|
|
|
content: "此属性已经维护了子属性,确定继续删除吗?", |
|
|
|
success: function(res2) { |
|
|
|
if (res2.confirm) { |
|
|
|
that.delItemModal() |
|
|
|
@ -486,7 +488,7 @@ |
|
|
|
}).catch((res) => {}) |
|
|
|
} |
|
|
|
}, |
|
|
|
//规格编辑(新增,修改) |
|
|
|
//属性编辑(新增,修改) |
|
|
|
dialogInputConfirm(e) { |
|
|
|
let that = this; |
|
|
|
switch (that.typeModel) { |
|
|
|
@ -501,7 +503,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
if(e == ''){ |
|
|
|
that.tui.toast("请输入规格名") |
|
|
|
that.tui.toast("请输入属性名") |
|
|
|
return |
|
|
|
} |
|
|
|
that.tui.request("/app/productAttribute/save", "post", { |
|
|
|
@ -610,7 +612,7 @@ |
|
|
|
this.delItems = item; |
|
|
|
this.getTypeToNum(this.delItems.id) |
|
|
|
}, |
|
|
|
//跳转子规格页 |
|
|
|
//跳转子属性页 |
|
|
|
goGategoryLow(item) { |
|
|
|
this.editItem = item |
|
|
|
this.tui.request("/app/productAttributeValue/selectByAttributeId", "get", { |
|
|
|
@ -628,7 +630,7 @@ |
|
|
|
}).catch((res) => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
//选择多个规格保存 |
|
|
|
//选择多个属性保存 |
|
|
|
addMultipleType(item,item1,index){ |
|
|
|
|
|
|
|
|
|
|
|
@ -644,16 +646,16 @@ |
|
|
|
this.multipleList.push(data) |
|
|
|
}else{ |
|
|
|
for(var i=0;i<this.multipleList.length;i++){ |
|
|
|
if(this.multipleList[i].attributeName == item.name){ //同种规格 |
|
|
|
if(this.multipleList[i].attributeName == item.name){ //同种属性 |
|
|
|
|
|
|
|
|
|
|
|
for(var m=0;m<this.multipleList[i].productAttributeValueVoList.length;m++){ |
|
|
|
if(this.multipleList[i].productAttributeValueVoList[m].value == item.list[index].value){ //规格相同 |
|
|
|
if(this.multipleList[i].productAttributeValueVoList[m].value == item.list[index].value){ //属性相同 |
|
|
|
|
|
|
|
this.multipleList[i].productAttributeValueVoList.splice(m,1) |
|
|
|
|
|
|
|
return; |
|
|
|
}else{ //规格不同 |
|
|
|
}else{ //属性不同 |
|
|
|
if(m+1 == this.multipleList[i].productAttributeValueVoList.length){ |
|
|
|
|
|
|
|
this.multipleList[i].productAttributeValueVoList.push(item.list[index]) |
|
|
|
@ -662,7 +664,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ //不同规格 |
|
|
|
}else{ //不同属性 |
|
|
|
if(this.multipleList.length == i+1){ |
|
|
|
|
|
|
|
|
|
|
|
@ -760,7 +762,7 @@ |
|
|
|
border-radius: 10upx; |
|
|
|
background: #fff; |
|
|
|
height: auto; |
|
|
|
margin: 150rpx auto 0; |
|
|
|
margin: -200rpx auto 0; |
|
|
|
|
|
|
|
} |
|
|
|
.checked{ |
|
|
|
@ -847,6 +849,15 @@ |
|
|
|
bottom: 0; |
|
|
|
left: 20rpx; |
|
|
|
} |
|
|
|
.btn{ |
|
|
|
flex: 1; |
|
|
|
line-height: 25px; |
|
|
|
text-align: center; |
|
|
|
height: 25px; |
|
|
|
color: #1E90FF; |
|
|
|
border-radius: 7px; |
|
|
|
margin: 5px 0 0 10px; |
|
|
|
} |
|
|
|
|
|
|
|
.title-search { |
|
|
|
margin-top: 110rpx; |
|
|
|
@ -901,7 +912,7 @@ |
|
|
|
justify-content: center; |
|
|
|
padding: 30rpx; |
|
|
|
width: 100%; |
|
|
|
height: 400rpx; |
|
|
|
height: 325rpx; |
|
|
|
background-color: #fff; |
|
|
|
overflow: scroll; |
|
|
|
} |
|
|
|
@ -941,10 +952,10 @@ |
|
|
|
height: 70rpx; |
|
|
|
margin: 0 auto; |
|
|
|
border-bottom: 1px solid #eee; |
|
|
|
display: flex; |
|
|
|
.name { |
|
|
|
font-size: 30rpx; |
|
|
|
width: 90%; |
|
|
|
float: left; |
|
|
|
width: 65%; |
|
|
|
height: 70rpx; |
|
|
|
line-height: 70rpx; |
|
|
|
} |
|
|
|
|