|
|
|
|
@ -13,6 +13,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import ActivityManager from "../../services/ActivityManager/ActivityManager"
|
|
|
|
|
import store from "../../store/index"
|
|
|
|
|
export default {
|
|
|
|
|
name: "useActivityStepTwo",
|
|
|
|
|
data() {
|
|
|
|
|
@ -20,7 +21,8 @@ export default {
|
|
|
|
|
allSelect: false,
|
|
|
|
|
companyList: [],
|
|
|
|
|
isSelect:[],
|
|
|
|
|
selectValue: []
|
|
|
|
|
selectValue: [],
|
|
|
|
|
companyListdata:[]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
@ -34,6 +36,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
ActivityManager.getCompany(data, function (data) {
|
|
|
|
|
that.companyList = []
|
|
|
|
|
that.companyListdata = data.data.results
|
|
|
|
|
data.data.results.forEach(element => {
|
|
|
|
|
that.isSelect.push('')
|
|
|
|
|
that.selectValue.push('')
|
|
|
|
|
@ -64,10 +67,25 @@ export default {
|
|
|
|
|
selectTag(value, index) {
|
|
|
|
|
this.isSelect.splice(index,1,!this.isSelect[index])
|
|
|
|
|
if(this.isSelect[index] === true) {
|
|
|
|
|
this.selectValue.splice(index, 1, value.id)
|
|
|
|
|
this.selectValue.splice(index, 1, value.value)
|
|
|
|
|
} else if(this.isSelect[index] === false) {
|
|
|
|
|
this.selectValue.splice(index, 1, '')
|
|
|
|
|
}
|
|
|
|
|
let selectCompanyValue = []
|
|
|
|
|
this.isSelect.forEach((element,index) => {
|
|
|
|
|
if(element === true) {
|
|
|
|
|
selectCompanyValue.push(this.selectValue[index])
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
let selectCompanyValueObject = []
|
|
|
|
|
for(let j=0; j< selectCompanyValue.length; j++) {
|
|
|
|
|
for(let i = 0; i< this.companyList.length; i++){
|
|
|
|
|
if(this.companyList[i].value === selectCompanyValue[j]) {
|
|
|
|
|
selectCompanyValueObject.push(this.companyListdata[i])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
store.getters.useData.selectCompanyValue = selectCompanyValueObject
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|