storePersonnel.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <!-- 选择门店 -->
  3. <view>
  4. <u-navbar title="选择门店" autoBack placeholder></u-navbar>
  5. <view class="card_search_head">
  6. <u-search v-model="cylinderNumber" shape="square" :showAction="false" placeholder="请输入门店名称"
  7. borderColor="#e4e7ed" bgColor="#fff" @change="quickSearch"></u-search>
  8. </view>
  9. <view v-if="treeData.length > 0">
  10. <tree-item v-for="item in treeData" :key="item.id" :item="item" @confirm="confirm"></tree-item>
  11. </view>
  12. <view style="margin-top: 30%;" v-else>
  13. <u-empty mode="list" text="暂无门店"></u-empty>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import TreeItem from '@/components/TreeItem.vue';
  19. export default {
  20. components: {
  21. TreeItem
  22. },
  23. data() {
  24. return {
  25. cylinderNumber: '',
  26. flowId: '',
  27. treeData: [],
  28. }
  29. },
  30. onLoad(value) {
  31. this.flowId = value.flowId
  32. this.flowName = value.flowName
  33. this.getList()
  34. },
  35. methods: {
  36. getList() {
  37. this.$api.get('/api/store/all2', {
  38. name: this.cylinderNumber,
  39. }).then(res => {
  40. if (res.code == 200) {
  41. if (res.data) {
  42. this.treeData = res.data
  43. }
  44. }
  45. })
  46. },
  47. confirm(value) {
  48. uni.navigateTo({
  49. url: '/pages/information/recipient?shopID=' + value.id + '&shopName=' + value.name +
  50. '&flowId=' + this.flowId +
  51. '&flowName=' + this.flowName
  52. });
  53. },
  54. quickSearch() {
  55. this.treeData = []
  56. this.getList()
  57. },
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. </style>