12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
-
- <uni-check-list
- :listData="list"
- checkIconPositon="right"
- :showArrow="false"
- :defValue="value"
- :types="type"
- :noDataText="noDataText"
- backValue="objArr"
- @ok="chooseOk">
- </uni-check-list>
- </template>
- <script>
- import {findStoreList,findAllStore} from '@/api/store'
- export default {
- data() {
- return {
- list: [],
- value: [],
- noDataText: '暂无考评门店',
- type: ''
- }
- },
- onUnload() {
- this.value = []
- this.list = []
- },
- onLoad(opts) {
- this.value = opts.item&&JSON.parse(opts.item)||[]
- this.value.map(item=>{
- item.id = item.storeId || item.id
- })
- this.type = opts.type || 'checkbox'
-
- if(opts.isAll == '1'){
-
- this.findAllStore()
- }else{
-
- this.findStoreList()
- }
- },
- methods: {
-
- findStoreList(){
- findStoreList({}).then(res=>{
- if(res.status == 200){
- this.list = res.data || []
- } else {
- this.noDataText = res.message
- }
- })
- },
-
- findAllStore(){
- findAllStore({}).then(res=>{
- if(res.status == 200){
- this.list = res.data || []
- } else {
- this.noDataText = res.message
- }
- })
- },
-
- chooseOk(item) {
- console.log(item)
- if(item.length){
-
- uni.$emit("selKpStores",item)
- uni.navigateBack()
- }else{
- uni.showToast({
- title:"请选择考评门店"
- })
- }
- },
- }
- }
- </script>
- <style lang="scss">
- page{
- height: 100%;
- }
- </style>
|