|
|
@@ -680,26 +680,33 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // 请求后端接口,获取限购花材信息
|
|
|
- // let newList = list.map(item => {
|
|
|
- // return {
|
|
|
- // id: item.id,
|
|
|
- // bigCount: item.bigCount,
|
|
|
- // //smallCount: item.smallCount
|
|
|
- // }
|
|
|
- // })
|
|
|
- // getLimitBuyInfo({ghsId: this.options.id, list: newList}).then(res => {
|
|
|
- // const limitBuyInfo = Array.isArray(res.data) ? res.data : []
|
|
|
- // const warnList = limitBuyInfo.filter(item => item.specialPrice === false && item.reachLimitBuyNum === true)
|
|
|
- // if(warnList.length > 0){
|
|
|
- // this.limitBuyWarnList = warnList
|
|
|
- // this.cartItemShow = true
|
|
|
- // this.$msg("有花材超出限购")
|
|
|
- // return
|
|
|
- // }
|
|
|
- // this.limitBuyWarnList = []
|
|
|
- // this.setLimitBuyInfoByType({ type: this.pageType, info: limitBuyInfo });
|
|
|
- // })
|
|
|
+ // 请求后端接口,获取限购花材信息(仅 limitBuy > 0 的项参与校验)
|
|
|
+ let newList = list
|
|
|
+ .filter(item => Number(item.limitBuy) > 0)
|
|
|
+ .map(item => {
|
|
|
+ return {
|
|
|
+ id: item.id,
|
|
|
+ bigCount: item.bigCount,
|
|
|
+ //smallCount: item.smallCount
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (newList.length > 0) {
|
|
|
+ getLimitBuyInfo({ghsId: this.options.id, list: newList}).then(res => {
|
|
|
+ const limitBuyInfo = Array.isArray(res.data) ? res.data : []
|
|
|
+ const warnList = limitBuyInfo.filter(item => item.specialPrice === false && item.reachLimitBuyNum === true)
|
|
|
+ if(warnList.length > 0){
|
|
|
+ this.limitBuyWarnList = warnList
|
|
|
+ this.cartItemShow = true
|
|
|
+ this.$msg("有花材超出限购")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.limitBuyWarnList = []
|
|
|
+ this.setLimitBuyInfoByType({ type: this.pageType, info: limitBuyInfo });
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.limitBuyWarnList = []
|
|
|
+ this.setLimitBuyInfoByType({ type: this.pageType, info: [] });
|
|
|
+ }
|
|
|
this.setSelectInfoByType({ type: this.pageType, info: list });
|
|
|
this.pageTo({url: '/admin/billing/affirmGhs?id='+this.options.id,type: 2})
|
|
|
} else {
|