diff --git a/packageIntegral/productAddition/index.vue b/packageIntegral/productAddition/index.vue
index 320c023..bab6ca5 100644
--- a/packageIntegral/productAddition/index.vue
+++ b/packageIntegral/productAddition/index.vue
@@ -6,7 +6,7 @@
-
+
{{item.attributeName}}:
-
-
+
+
-
+
批量填充:批量填充填入信息后,可以批量将内容填写到SKU 信息里
- {{item.label}}
+ {{item.label}}
确定
-
+
*
规格:
@@ -163,6 +163,7 @@
currentBoxId: 'chooseType', //当前显示的view的id
isBoxShow: false,
productDate:{
+ productStatus:'1',
images:[]
},
productList:[],
@@ -175,9 +176,9 @@
checked: false
}],
rules:{
- name:{rules:[{required: true,errorMessage: '请选择商品分类'}]},
+ demandRegion:{rules:[{required: true,errorMessage: '请选择商品分类'}]},
productName:{rules:[{required: true,errorMessage: '请输入商品名称'}]},
- brandId:{rules:[{required: true,errorMessage: '请输入商品品牌'}]},
+ brandId:{rules:[{required: true,errorMessage: '请选择商品品牌'}]},
price:{rules:[{required: true,errorMessage: '请输入商品售价'}]},
},
attributesTypeList:[],
@@ -190,7 +191,8 @@
],
radioAttributes:'',
checkboxAttributes:[],
- stockList:[]
+ stockList:[],
+ checkedList:[]
}
},
@@ -205,6 +207,11 @@
this.productDate.categoryOneId = val.split(',')[0]
this.productDate.categoryTwoId = val.split(',')[1]
}
+ },
+ 'productDate.attributesTypeId'(val){
+ if(!val){
+ this.stockList = []
+ }
}
},
methods: {
@@ -257,20 +264,40 @@
},
changeBox(e){
let currentFlag = e.currentTarget.id;
- switch(currentFlag){
- case 'next':
- this.currentBoxId = 'instruction'
- break;
- case 'previous':
- this.currentBoxId = 'chooseType'
- break;
- default:
- this.currentBoxId = 'viewInstruction'
- break;
- }
if(currentFlag == 'next'){
- this.getAttributesType()
+ this.$refs.productForm.validate().then(res=>{
+ console.log('表单数据信息:', res);
+ switch(currentFlag){
+ case 'next':
+ this.currentBoxId = 'instruction'
+ break;
+ case 'previous':
+ this.currentBoxId = 'chooseType'
+ break;
+ default:
+ this.currentBoxId = 'viewInstruction'
+ break;
+ }
+ if(currentFlag == 'next'){
+ this.getAttributesType()
+ }
+ }).catch(err =>{
+ console.log('表单错误信息:', err);
+ })
+ }else{
+ switch(currentFlag){
+ case 'next':
+ this.currentBoxId = 'instruction'
+ break;
+ case 'previous':
+ this.currentBoxId = 'chooseType'
+ break;
+ default:
+ this.currentBoxId = 'viewInstruction'
+ break;
+ }
}
+
},
getAttributesType(){
this.attributesTypeList = []
@@ -304,6 +331,25 @@
}
},
+ changeRadio(item,index){
+ if(JSON.stringify(this.checkedList) == '[]'){
+ this.checkedList.push({attributeId:item.id,checked:item.attributeName})
+ }else{
+ this.checkedList[index].checked = item.attributeName
+ }
+ },
+ changeCheckBox(item,index){
+ if(this.checkedList.length{
+ checked.push(tab)
+ })
+ this.checkedList[index].checked = checked.join(',')
+ this.checkedList.checked
+ }
+ },
deleteCheckAll(i){
if(this.checkboxAttributes.length>1){
this.checkboxAttributes.splice(i,1)
@@ -358,7 +404,6 @@
sourceType: ['album'], //从相册选择
success: function(res) {
console.log(res)
- console.log('进入1')
const JSESSIONID = utils.uuid()
uni.uploadFile({
url: 'http://uat.xingoil.com/adminapi/oil-oss/obejct/uploadFile',
@@ -379,14 +424,11 @@
'token': utils.md5Salt(JSESSIONID)
},
success(e) {
- console.log('进入2')
- console.log(e)
let obj = JSON.parse(e.data),
imageUrl = obj.data.publicUrl
_that.getImage(imageUrl)
},
fail(err) {
- console.log(err)
}
})
},fail() {
@@ -440,9 +482,15 @@
}else{
this.productDate.recommend == '2'
}
+ this.productDate.checkedList = this.checkedList
this.productDate.stockList = this.stockList
serve.saveProduct(this.productDate).then(res=>{
console.log(res)
+ uni.showToast({
+ title: res.msg,
+ icon: 'none'
+ })
+ this.closed()
})
}
}
@@ -524,6 +572,10 @@
line-height: 72rpx;
}
}
+ .content{
+ padding-bottom: 20rpx;
+ border-bottom: 1rpx solid #F6F6F6;
+ }
.tagButton{
display: inline-block;
width: 133rpx;
diff --git a/packageIntegral/productList/index.vue b/packageIntegral/productList/index.vue
index e98ebdb..6a7a5dd 100644
--- a/packageIntegral/productList/index.vue
+++ b/packageIntegral/productList/index.vue
@@ -17,12 +17,12 @@
-
-
+
批量填充:批量填充填入信息后,可以批量将内容填写到SKU 信息里
{{item.label}}
确定
-
+
*
规格:
@@ -131,7 +131,7 @@
-
+