jiebang.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view>
  3. <view class="search">
  4. <view class="search-title">
  5. {{$t('dosugar.equipmentClientID')}}
  6. </view>
  7. <view class="search-input">
  8. <input type="text" :placeholder="$t('dosugar.placeholder')" v-model="searchClientId" />
  9. </view>
  10. <view class="search-button">
  11. <button type="primary" class="" @click="search()">
  12. <p class="">{{$t('dosugar.search')}}</P>
  13. </button>
  14. </view>
  15. </view>
  16. <view class="body">
  17. <uni-collapse :accordion="true">
  18. <uni-list>
  19. <view v-for="(equipment,index) in equipmentList" :key="index">
  20. <uni-list-item :title="equipment.name" :note="equipment.clientId" rightText="" clickable
  21. @click="onClick(equipment)" />
  22. </view>
  23. </uni-list>
  24. </uni-collapse>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. mapState,
  31. mapActions,
  32. mapMutations
  33. } from 'vuex';
  34. import uniCollapse from '@/components/uni-collapse/uni-collapse.vue';
  35. import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue';
  36. import uniList from '../../uni_modules/uni-list/components/uni-list/uni-list.vue';
  37. import uniListItem from '../../uni_modules/uni-list/components/uni-list-item/uni-list-item.vue';
  38. import uniIcons from '../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue';
  39. export default {
  40. data() {
  41. return {
  42. equipmentName: null,
  43. equimentType: null,
  44. equipmentId: null,
  45. equipmentList: [],
  46. searchClientId: null
  47. }
  48. },
  49. onShow() {
  50. var token = uni.getStorageSync("token");
  51. this.globalUser = uni.getStorageSync("globalUser");
  52. if (token.length > 1) {
  53. // this.getEquipmentListData();
  54. // this.getParam();
  55. } else {
  56. uni.reLaunch({
  57. url: '../Login/Login',
  58. });
  59. }
  60. },
  61. methods: {
  62. search() {
  63. var token = uni.getStorageSync("token");
  64. var adminId = uni.getStorageSync("globalUser").id;
  65. uni.request({
  66. url: this.serverurl + '/TEquipment/getEquipmentListLikeClientId',
  67. data: {
  68. "clientId": this.searchClientId
  69. },
  70. header: {
  71. 'token': token
  72. },
  73. method: "POST",
  74. success: (res) => {
  75. if (res.data.code) {
  76. this.equipmentList = res.data.data;
  77. }else{
  78. uni.showModal({
  79. title: "提示",
  80. content:res.data.message,
  81. success: (res) => {
  82. }
  83. })
  84. }
  85. },
  86. });
  87. },
  88. onClick(equipment){
  89. uni.navigateTo({
  90. url: 'jiebangDesc?equipment='+ encodeURIComponent(JSON.stringify(equipment)),
  91. });
  92. }
  93. }
  94. }
  95. </script>
  96. <style>
  97. .search {
  98. width: 100%;
  99. padding-top: 30upx;
  100. display: flex;
  101. flex-direction: row;
  102. justify-content: flex-start;
  103. }
  104. .search-title {
  105. width: 28%;
  106. text-align: center;
  107. font-size: 26upx;
  108. font-family: "PingFang-SC-Bold";
  109. }
  110. .search-input {
  111. width: 45%;
  112. text-align: center;
  113. font-size: 26upx;
  114. font-family: "PingFang-SC-Bold";
  115. box-shadow: 0upx 0upx 20upx #D3D3D3;
  116. border-radius: 5upx;
  117. }
  118. .search-button {
  119. width: 20%;
  120. padding-left: 7upx;
  121. text-align: center;
  122. }
  123. </style>