|
|
|
|
@ -1,45 +1,73 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div style="padding: 0 40px;">
|
|
|
|
|
<div class="selectClass">
|
|
|
|
|
<Radio v-model="allSelect">全选</Radio>
|
|
|
|
|
<Checkbox v-model="allSelect" @on-change="isSelectAllCompany">全选</Checkbox>
|
|
|
|
|
<i-input icon="search" placeholder="请输入零售公司名称或编码" style="width: 250px"></i-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="companyTable">
|
|
|
|
|
<div class="companyListClass">
|
|
|
|
|
<div :class="companyColorIndex == index ? 'tagColorClass' : ''" class="tagClass" @click="selectTag(index)" v-for="(item, index) in companyList" :key="index" >{{item.name}}</div>
|
|
|
|
|
<div :class="isSelect[index] == true ? 'tagColorClass' : ''" class="tagClass" @click="selectTag(item,index)" v-for="(item, index) in companyList" :key="index" >{{item.label}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import ActivityManager from "../../services/ActivityManager/ActivityManager"
|
|
|
|
|
export default {
|
|
|
|
|
name: "useActivityStepTwo",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
allSelect: false,
|
|
|
|
|
companyList: [{
|
|
|
|
|
name: '111'
|
|
|
|
|
},{
|
|
|
|
|
name: '111'
|
|
|
|
|
},{
|
|
|
|
|
name: '111'
|
|
|
|
|
},{
|
|
|
|
|
name: '111'
|
|
|
|
|
},{
|
|
|
|
|
name: '111'
|
|
|
|
|
},{
|
|
|
|
|
name: '111'
|
|
|
|
|
},{
|
|
|
|
|
name: '111'
|
|
|
|
|
}],
|
|
|
|
|
companyColorIndex: -1
|
|
|
|
|
companyList: [],
|
|
|
|
|
isSelect:[],
|
|
|
|
|
selectValue: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.getCompanyInfo()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
selectTag(val) {
|
|
|
|
|
this.companyColorIndex = val
|
|
|
|
|
getCompanyInfo() {
|
|
|
|
|
let that = this
|
|
|
|
|
let data = {
|
|
|
|
|
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
|
|
|
|
|
}
|
|
|
|
|
ActivityManager.getCompany(data, function (data) {
|
|
|
|
|
that.companyList = []
|
|
|
|
|
data.data.results.forEach(element => {
|
|
|
|
|
that.isSelect.push('')
|
|
|
|
|
that.selectValue.push('')
|
|
|
|
|
that.companyList.push({
|
|
|
|
|
label: element.name,
|
|
|
|
|
value: element.id
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
isSelectAllCompany() {
|
|
|
|
|
if(this.allSelect === true) {
|
|
|
|
|
this.isSelect.forEach((element,index) => {
|
|
|
|
|
this.isSelect.splice(index,1,true)
|
|
|
|
|
})
|
|
|
|
|
this.companyList.forEach((element,index) => {
|
|
|
|
|
this.selectValue.splice(index,1,element.id)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.isSelect.forEach((element,index) => {
|
|
|
|
|
this.isSelect.splice(index,1,'')
|
|
|
|
|
})
|
|
|
|
|
this.companyList.forEach((element,index) => {
|
|
|
|
|
this.selectValue.splice(index,1,'')
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
selectTag(value, index) {
|
|
|
|
|
this.isSelect.splice(index,1,!this.isSelect[index])
|
|
|
|
|
if(this.isSelect[index] === true) {
|
|
|
|
|
this.selectValue.splice(index, 1, value.id)
|
|
|
|
|
} else if(this.isSelect[index] === false) {
|
|
|
|
|
this.selectValue.splice(index, 1, '')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|