|
|
@@ -20,12 +20,12 @@
|
|
|
<div style="font-size: 14px">
|
|
|
<span>产品匹配:</span>
|
|
|
<span v-if="store && store.length > 0">
|
|
|
- <input type="checkbox" v-if="storeExist && UmallExist">
|
|
|
- <span v-if="UmallExist"> 库存寄售</span>
|
|
|
- <input type="checkbox" v-if="storeExist && UmallExist">
|
|
|
+ <input type="checkbox" v-if="storeExist && UmallExist" @click="filterType('umall')">
|
|
|
+ <span v-if="UmallExist"> 库存寄售 </span>
|
|
|
+ <input type="checkbox" v-if="storeExist && UmallExist" @click="filterType('store')">
|
|
|
<span v-if="storeExist"> 店铺自营</span>
|
|
|
</span>
|
|
|
- <span v-if="!store || store.length == 0">暂无可匹配的信息 </span>
|
|
|
+ <span v-if="!storeList.content || storeList.content.length == 0">暂无可匹配的信息 </span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -123,7 +123,18 @@
|
|
|
return {
|
|
|
storeIds: [],
|
|
|
UmallExist: false,
|
|
|
- storeExist: false
|
|
|
+ storeExist: false,
|
|
|
+ params: {
|
|
|
+ count: 10,
|
|
|
+ page: 1,
|
|
|
+ sorting: {'minPriceRMB': 'ASC'},
|
|
|
+ filter: {
|
|
|
+ uuid: this.$route.params.uuid,
|
|
|
+ ignoreUMall: false,
|
|
|
+ ignoreStore: false,
|
|
|
+ storeIds: ''
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
@@ -148,10 +159,12 @@
|
|
|
},
|
|
|
storeList () {
|
|
|
let storeList = this.$store.state.componentInformation.information.data
|
|
|
- if (storeList.storeid && storeList.storeid !== '') {
|
|
|
- this.storeIds = storeList.storeid
|
|
|
+ let _self = this
|
|
|
+ if (storeList.content) {
|
|
|
+ storeList.content.forEach(function (item) {
|
|
|
+ _self.storeIds.push(item.storeid)
|
|
|
+ })
|
|
|
}
|
|
|
- // this.storeId
|
|
|
if (this.storeIds.length > 0) {
|
|
|
if (this.storeIds.indexOf(this.storeId) === -1) {
|
|
|
this.storeExist = true
|
|
|
@@ -179,6 +192,41 @@
|
|
|
this.storeIds.push(storeIn.uuid)
|
|
|
storeIn.isSelected = true
|
|
|
}
|
|
|
+ // 点击请求处理
|
|
|
+ let index = this.params.filter.storeIds.indexOf(storeIn.uuid)
|
|
|
+ if (index === -1) {
|
|
|
+ if (this.params.filter.storeIds === '') {
|
|
|
+ this.params.filter.storeIds += storeIn.uuid
|
|
|
+ } else {
|
|
|
+ this.params.filter.storeIds += ',' + storeIn.uuid
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // console.log(this.params.filter.storeIds.replace(storeIn.uuid, ''))
|
|
|
+ console.log(this.params.filter.storeIds.charAt(index + storeIn.uuid.length))
|
|
|
+ if (this.params.filter.storeIds.charAt(index + storeIn.uuid.length) === '') {
|
|
|
+ if (this.params.filter.storeIds.charAt(index - 1) === ',') {
|
|
|
+ this.params.filter.storeIds = this.params.filter.storeIds.replace(',' + storeIn.uuid, '')
|
|
|
+ }
|
|
|
+ this.params.filter.storeIds = this.params.filter.storeIds.replace(storeIn.uuid, '')
|
|
|
+ } else {
|
|
|
+ this.params.filter.storeIds = this.params.filter.storeIds.replace(storeIn.uuid + ',', '')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$store.dispatch('loadComponentInformation', this.params)
|
|
|
+ .then(response => {
|
|
|
+ this.$store.commit('componentInformation/GET_INFORMATION_SUCCESS', response.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ filterType (type) {
|
|
|
+ if (type === 'umall') {
|
|
|
+ this.params.filter.ignoreUMall = !this.params.filter.ignoreUMall
|
|
|
+ } else if (type === 'store') {
|
|
|
+ this.params.filter.ignoreStore = !this.params.filter.ignoreStore
|
|
|
+ }
|
|
|
+ this.$store.dispatch('loadComponentInformation', this.params)
|
|
|
+ .then(response => {
|
|
|
+ this.$store.commit('componentInformation/GET_INFORMATION_SUCCESS', response.data)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|