|
@@ -14,9 +14,8 @@ var supporting = new Vue({
|
|
supportingList:[],
|
|
supportingList:[],
|
|
isAllChecked:false,
|
|
isAllChecked:false,
|
|
isProductChecked:false,
|
|
isProductChecked:false,
|
|
- checkedNum:0,
|
|
|
|
- totalPrice:0
|
|
|
|
-
|
|
|
|
|
|
+ totalPrice:0,
|
|
|
|
+ totalNumber:0,
|
|
},
|
|
},
|
|
filters: {
|
|
filters: {
|
|
NumFormat:function(value) {
|
|
NumFormat:function(value) {
|
|
@@ -36,11 +35,9 @@ var supporting = new Vue({
|
|
return el;
|
|
return el;
|
|
});
|
|
});
|
|
_self.supportingList = list;
|
|
_self.supportingList = list;
|
|
- _self.defaultSupportingList = _self.supportingList.slice(0,5);
|
|
|
|
if(_self.supportingList.length > 0 ){
|
|
if(_self.supportingList.length > 0 ){
|
|
_self.isShowMoreButton = true;
|
|
_self.isShowMoreButton = true;
|
|
}
|
|
}
|
|
- console.log('defaultSupportingList',_self.defaultSupportingList)
|
|
|
|
}else{
|
|
}else{
|
|
_self.supportingList = [];
|
|
_self.supportingList = [];
|
|
}
|
|
}
|
|
@@ -93,42 +90,57 @@ var supporting = new Vue({
|
|
calculatetTtalPrice: function () {
|
|
calculatetTtalPrice: function () {
|
|
var _self = this;
|
|
var _self = this;
|
|
var totalPrice = 0;
|
|
var totalPrice = 0;
|
|
|
|
+ var totalNumber = 0;
|
|
_self.supportingList.forEach(function (pros) {
|
|
_self.supportingList.forEach(function (pros) {
|
|
if(pros.isChecked){
|
|
if(pros.isChecked){
|
|
pros.totalPrice = pros.number*pros.price;
|
|
pros.totalPrice = pros.number*pros.price;
|
|
|
|
+ totalNumber+= pros.number
|
|
|
|
+ totalPrice += pros.totalPrice;
|
|
}else{
|
|
}else{
|
|
pros.totalPrice = 0;
|
|
pros.totalPrice = 0;
|
|
}
|
|
}
|
|
- totalPrice += pros.totalPrice;
|
|
|
|
})
|
|
})
|
|
_self.totalPrice = totalPrice;
|
|
_self.totalPrice = totalPrice;
|
|
|
|
+ _self.totalNumber = totalNumber;
|
|
|
|
+ },
|
|
|
|
+ disabledChecked(pros){
|
|
|
|
+ if(pros.priceFlag ==1){// 为公开价格返回 true 禁用按钮
|
|
|
|
+ return true
|
|
|
|
+ }else{
|
|
|
|
+ if(GLOBAL_USER_IDENTITY == 4 && pros.priceFlag ==2){// 普通机构且商品价格仅会员可见 禁用按钮
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
isCheckedAll(){//全选
|
|
isCheckedAll(){//全选
|
|
var _self = this;
|
|
var _self = this;
|
|
|
|
+ var list = [];
|
|
_self.isAllChecked = !_self.isAllChecked;
|
|
_self.isAllChecked = !_self.isAllChecked;
|
|
- _self.supportingList.forEach((el)=>{
|
|
|
|
- el.isChecked = _self.isAllChecked;
|
|
|
|
|
|
+ _self.supportingList.forEach((pros)=>{
|
|
|
|
+ if(!_self.disabledChecked(pros)){
|
|
|
|
+ pros.isChecked = _self.isAllChecked;
|
|
|
|
+ list.push(pros);
|
|
|
|
+ }
|
|
})
|
|
})
|
|
if(_self.isAllChecked){
|
|
if(_self.isAllChecked){
|
|
_self.isProductChecked = true;
|
|
_self.isProductChecked = true;
|
|
- _self.checkedNum = _self.supportingList.length;
|
|
|
|
}else{
|
|
}else{
|
|
_self.isProductChecked = false;
|
|
_self.isProductChecked = false;
|
|
- _self.checkedNum = 0;
|
|
|
|
}
|
|
}
|
|
_self.calculatetTtalPrice();
|
|
_self.calculatetTtalPrice();
|
|
},
|
|
},
|
|
checkedSoperv:function (pros) {// 勾选
|
|
checkedSoperv:function (pros) {// 勾选
|
|
- console.log(pros)
|
|
|
|
var _self = this;
|
|
var _self = this;
|
|
var goodsCheckedLength = 0;
|
|
var goodsCheckedLength = 0;
|
|
|
|
+ if(_self.disabledChecked(pros)){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
pros.isChecked = !pros.isChecked
|
|
pros.isChecked = !pros.isChecked
|
|
_self.supportingList.forEach(el => {
|
|
_self.supportingList.forEach(el => {
|
|
if(el.isChecked) {
|
|
if(el.isChecked) {
|
|
goodsCheckedLength++;
|
|
goodsCheckedLength++;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- _self.checkedNum = goodsCheckedLength;
|
|
|
|
_self.isAllChecked = goodsCheckedLength === _self.supportingList.length;
|
|
_self.isAllChecked = goodsCheckedLength === _self.supportingList.length;
|
|
if(goodsCheckedLength>0){
|
|
if(goodsCheckedLength>0){
|
|
_self.isProductChecked = true
|
|
_self.isProductChecked = true
|
|
@@ -236,6 +248,7 @@ var supporting = new Vue({
|
|
},
|
|
},
|
|
created: function () {
|
|
created: function () {
|
|
this.userId = this.listQuery.userId = GLOBAL_USER_ID;
|
|
this.userId = this.listQuery.userId = GLOBAL_USER_ID;
|
|
|
|
+ console.log('GLOBAL_USER_ID',GLOBAL_USER_ID)
|
|
// identity: 0个人,1协销,2会员机构,3供应商,4普通机构
|
|
// identity: 0个人,1协销,2会员机构,3供应商,4普通机构
|
|
},
|
|
},
|
|
mounted: function () {
|
|
mounted: function () {
|