search-staff.vue
1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<template>
<Page name="search-staff">
<template #header>
<search-bar v-model="searchForm.name" placeholder="请输入姓名" auto @confirm="onSearch" />
</template>
<template #content>
<List ref="list" v-model="list" :api="searchAPI">
<template v-for="(item, index) in list">
<zui-cell :key="index" @click="onSelect(item)">
<template #title>
<text>{{ item.name }}</text>
</template>
</zui-cell>
</template>
</List>
</template>
</Page>
</template>
<script>
export default {
data() {
return {
list: [],
searchForm: {
name: '',
},
};
},
methods: {
searchAPI(params) {
return uni.$u.api.filter.pricingEmployee({ ...params, ...this.searchForm });
},
onSelect(item) {
uni.$emit('select-staff', item);
uni.navigateBack();
},
},
};
</script>
<style lang="scss">
.page-search-staff {
&__header {
padding: 15rpx 22rpx !important;
}
}
</style>