|
|
|
@ -25,6 +25,38 @@ |
|
|
|
<uni-popup-dialog ref="inputClose" mode="input" :title="dialogTit" :value="inputVal" placeholder="请输入名称" |
|
|
|
cancelText="删除" @confirm="dialogInputConfirm" @close="dialogDel"> |
|
|
|
</uni-popup-dialog> |
|
|
|
</uni-popup> |
|
|
|
<!-- 添加分类弹出层 --> |
|
|
|
<uni-popup ref="addTypeDialog" background-color="#fff"> |
|
|
|
<view class="add-popup-content"> |
|
|
|
<view class="add-popup-title"> |
|
|
|
<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> |
|
|
|
<textarea name="" id="" style="width: 100%;border: 1px solid #eee;height: 80rpx;padding: 12px;margin:20rpx 0;" v-model="typeText" |
|
|
|
placeholder="请输入分类名称"></textarea> |
|
|
|
|
|
|
|
<ul> |
|
|
|
<li v-for="(item,index) in defaultList" :key="index"> |
|
|
|
<view class="title-fur"> |
|
|
|
<view class="name">{{item.name}}</view> |
|
|
|
</view> |
|
|
|
<view class="content-fur"> |
|
|
|
<view class="content-low" :class="item1.checked?'checked':''" v-for="(item1,index1) in item.list" :key="index1" |
|
|
|
@tap.stop="addMultipleType(item,item1.type,index1)">{{item1.type}}</view> |
|
|
|
</view> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
<view class="add-popup-bottom"> |
|
|
|
<view class="add-popup-btn" @tap="dialogInputConfirm(typeText)">确认</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<!-- 查看商品库存弹出层 --> |
|
|
|
<uni-popup ref="carPopup" background-color="#fff"> |
|
|
|
@ -79,7 +111,139 @@ |
|
|
|
isOpenId: '', |
|
|
|
delType: '', |
|
|
|
goodsList: [], |
|
|
|
dialogTit: '输入分类名' |
|
|
|
dialogTit: '输入分类名', |
|
|
|
typeText:'', |
|
|
|
defaultList:[{ |
|
|
|
name:'颜色', |
|
|
|
list:[{ |
|
|
|
type:'白色', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'黑色', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'浅蓝', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'蓝色', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'灰色', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'咖色', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'紫色', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'红色', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'米色', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'均色', |
|
|
|
checked:false, |
|
|
|
}] |
|
|
|
},{ |
|
|
|
name:'通用尺码', |
|
|
|
list:[{ |
|
|
|
type:'XS', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'S', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'M', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'L', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'XL', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'XXL', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'XXXL', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'XXXXL', |
|
|
|
checked:false, |
|
|
|
},{ |
|
|
|
type:'均码', |
|
|
|
checked:false, |
|
|
|
}] |
|
|
|
},{ |
|
|
|
name:'尺码', |
|
|
|
list:[{ |
|
|
|
type:'25码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'26码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'27码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'28码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'29码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'30码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'31码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'32码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'33码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'34码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'35码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'36码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'37码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'38码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'39码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'40码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'41码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'42码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'43码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'44码', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
type:'45码', |
|
|
|
checked:false |
|
|
|
}] |
|
|
|
}], |
|
|
|
multipleList:[] |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -124,7 +288,7 @@ |
|
|
|
this.inputVal = ''; |
|
|
|
this.isOpenId = item; |
|
|
|
this.dialogTit = '输入分类名' |
|
|
|
this.$refs.inputDialog.open() |
|
|
|
this.$refs.addTypeDialog.open('bottom') |
|
|
|
} else if (type == 'attrEdit') { |
|
|
|
this.inputVal = item.attributeName; |
|
|
|
this.editItem = item; |
|
|
|
@ -178,13 +342,6 @@ |
|
|
|
dialogInputConfirm(e) { |
|
|
|
switch (this.typeModel) { |
|
|
|
case 'add': |
|
|
|
if (e == "") { |
|
|
|
uni.showToast({ |
|
|
|
title: "不能为空", |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
for (let i = 0; i < this.indexList.length; i++) { |
|
|
|
if (this.indexList[i].categoryName == e) { |
|
|
|
uni.showToast({ |
|
|
|
@ -193,24 +350,33 @@ |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
this.tui.request("/app/productCategory/save", "post", { |
|
|
|
categoryName: e |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.getGategoryList() |
|
|
|
uni.showToast({ |
|
|
|
title: "添加成功", |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
title: "添加失败", |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}).catch((res) => {}) |
|
|
|
} |
|
|
|
if(e != '' && this.multipleList == ''){ |
|
|
|
this.tui.request("/app/productCategory/save", "post", { |
|
|
|
categoryName: e |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.tui.toast("添加成功") |
|
|
|
|
|
|
|
setTimeout(res=> { |
|
|
|
this.getGategoryList() |
|
|
|
this.$refs.addTypeDialog.close() |
|
|
|
},2000) |
|
|
|
} else { |
|
|
|
this.tui.toast("添加失败") |
|
|
|
} |
|
|
|
|
|
|
|
}).catch((res) => {}) |
|
|
|
}else if(e != '' && this.multipleList != ''){ |
|
|
|
this.tui.toast("暂无法使用") |
|
|
|
setTimeout(res=> { |
|
|
|
this.getGategoryList() |
|
|
|
this.$refs.addTypeDialog.close() |
|
|
|
},1000) |
|
|
|
}else{ |
|
|
|
this.tui.toast("请选择分类后进行添加!") |
|
|
|
} |
|
|
|
this.$refs.addTypeDialog.val = '' |
|
|
|
break; |
|
|
|
case 'edit': |
|
|
|
this.tui.request("/app/productCategory/edit", "post", { |
|
|
|
@ -276,7 +442,60 @@ |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/inventory/gategoryLow?id=' + id |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
//选择多个规格保存 |
|
|
|
addMultipleType(item,item1,index){ |
|
|
|
console.log(item); |
|
|
|
console.log(item1); |
|
|
|
item.list[index].checked = !item.list[index].checked |
|
|
|
var list = [] |
|
|
|
if(this.multipleList == ''){ |
|
|
|
console.log("首次"); |
|
|
|
list.push(item1) |
|
|
|
var data = { |
|
|
|
name:item.name, |
|
|
|
list: list |
|
|
|
} |
|
|
|
this.multipleList.push(data) |
|
|
|
}else{ |
|
|
|
for(var i=0;i<this.multipleList.length;i++){ |
|
|
|
if(this.multipleList[i].name == item.name){ //同种分类 |
|
|
|
|
|
|
|
console.log("同分类"); |
|
|
|
for(var m=0;m<this.multipleList[i].list.length;m++){ |
|
|
|
if(this.multipleList[i].list[m] == item1){ //规格相同 |
|
|
|
console.log("同规格"); |
|
|
|
this.multipleList[i].list.splice(m,1) |
|
|
|
console.log(this.multipleList); |
|
|
|
return; |
|
|
|
}else{ //规格不同 |
|
|
|
if(m+1 == this.multipleList[i].list.length){ |
|
|
|
console.log("不同规格"); |
|
|
|
this.multipleList[i].list.push(item1) |
|
|
|
console.log(this.multipleList); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ //不同分类 |
|
|
|
if(this.multipleList.length == i+1){ |
|
|
|
console.log("不同分类"); |
|
|
|
|
|
|
|
list.push(item1) |
|
|
|
var data = { |
|
|
|
name:item.name, |
|
|
|
list: list |
|
|
|
} |
|
|
|
this.multipleList.push(data) |
|
|
|
console.log(this.multipleList); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log(this.multipleList); |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
@ -356,7 +575,10 @@ |
|
|
|
margin: 150rpx auto 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.checked{ |
|
|
|
background: #60F3FF; |
|
|
|
color: #fff; |
|
|
|
} |
|
|
|
.card-list ul {} |
|
|
|
|
|
|
|
.card-list li { |
|
|
|
@ -449,5 +671,69 @@ |
|
|
|
margin: 0 auto; |
|
|
|
background: linear-gradient(90deg, #60F3FF, #088FEB); |
|
|
|
border-radius: 70rpx; |
|
|
|
} |
|
|
|
.add-popup-content { |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
padding: 15px; |
|
|
|
width: 100%; |
|
|
|
height: 1300rpx; |
|
|
|
background-color: #fff; |
|
|
|
} |
|
|
|
|
|
|
|
.add-popup-title { |
|
|
|
font-size: 36rpx; |
|
|
|
font-weight: bold; |
|
|
|
text-align: center; |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
|
|
|
|
.add-popup-container { |
|
|
|
margin-top: 20rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.add-popup-bottom { |
|
|
|
display: flex; |
|
|
|
height: 80rpx; |
|
|
|
color: #fff; |
|
|
|
line-height: 80rpx; |
|
|
|
margin-top: 50rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.add-popup-btn { |
|
|
|
flex: 1; |
|
|
|
text-align: center; |
|
|
|
background: linear-gradient(90deg, #60F3FF, #088FEB); |
|
|
|
} |
|
|
|
.title-fur { |
|
|
|
width: 95%; |
|
|
|
height: 70rpx; |
|
|
|
margin: 0 auto; |
|
|
|
border-bottom: 1px solid #eee; |
|
|
|
.name { |
|
|
|
font-size: 30rpx; |
|
|
|
width: 50%; |
|
|
|
float: left; |
|
|
|
height: 70rpx; |
|
|
|
line-height: 70rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.content-fur { |
|
|
|
padding-bottom: 25rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.content-low { |
|
|
|
width: auto; |
|
|
|
border: 1px solid #eee; |
|
|
|
display: inline-block; |
|
|
|
min-width: 90rpx; |
|
|
|
padding: 5rpx; |
|
|
|
font-size: 35rpx; |
|
|
|
text-align: center; |
|
|
|
color: #777; |
|
|
|
margin: 20rpx 0 0 20rpx; |
|
|
|
} |
|
|
|
</style> |