index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='业务单位' bgColor='transparent'></cus-header>
  4. <image class="topbg" :src="imgBase+'storage/home_bg.png'" mode="widthFix"></image>
  5. <div class="search">
  6. <u--input
  7. placeholder="请输入单位名称"
  8. border="none"
  9. prefixIcon="search"
  10. prefixIconStyle="font-size: 24px;color: #86909C"
  11. v-model="params.merchantName"
  12. ></u--input>
  13. <div class="btn" @tap="search">搜索</div>
  14. </div>
  15. <template v-if="list.length">
  16. <div class="list">
  17. <div class="item" v-for="item in list" :key="item.id">
  18. <div class="name">{{item.merchantName}}</div>
  19. <div class="info">
  20. <div class="iitem">
  21. <div class="pre">
  22. <div class="title">企业类型</div>
  23. <div class="nr">{{merchantTypeCfg[item.merchantType]||''}}</div>
  24. </div>
  25. <div class="pre">
  26. <div class="title">企业编号</div>
  27. <div class="nr">{{item.merchantCode||''}}</div>
  28. </div>
  29. </div>
  30. <div class="iitem">
  31. <div class="pre">
  32. <div class="title">联系人</div>
  33. <div class="nr">{{item.contactPerson||''}}</div>
  34. </div>
  35. <div class="pre">
  36. <div class="title">职称级别</div>
  37. <div class="nr">{{item.merchantLevel||''}}</div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </template>
  44. <template v-else>
  45. <page-empty :height="'calc(100vh - 100px)'"></page-empty>
  46. </template>
  47. </view>
  48. </template>
  49. <script>
  50. import pageEmpty from '@/components/pageEmpty/index.vue'
  51. export default {
  52. components:{ pageEmpty },
  53. data(){
  54. return {
  55. params:{
  56. page:1,
  57. limit:10,
  58. merchantName:''
  59. },
  60. merchantTypeCfg:{},
  61. list:[],
  62. isOver:false
  63. }
  64. },
  65. onLoad() {
  66. this.getMerchantType();
  67. this.getList();
  68. },
  69. onReachBottom() {
  70. if(this.isOver) return;
  71. this.getList();
  72. },
  73. methods:{
  74. async getMerchantType(){
  75. let res = await this.$api.get('/sys/dict/data/getListByType/merchant_type');
  76. if(res.data.code===0){
  77. res.data.data.forEach(d=>{
  78. this.merchantTypeCfg[+d.dictValue] = d.dictLabel;
  79. })
  80. }else this.$showToast(res.data.msg)
  81. },
  82. getList(){
  83. this.$api.get('/wms/merchant/page',this.params).then(res=>{
  84. if(res.data.code===0){
  85. if(this.list.length<res.data.data.total){
  86. this.params.page++;
  87. this.list = [...this.list,...res.data.data.list];
  88. }else this.isOver = true
  89. }else this.$showModal(res.data.msg)
  90. });
  91. },
  92. search(){
  93. this.params.page = 1;
  94. this.isOver = false;
  95. this.list = [];
  96. this.getList();
  97. }
  98. }
  99. }
  100. </script>
  101. <style scoped lang="less">
  102. .page{
  103. padding: 0 24rpx 20rpx;
  104. background: #F4F8FB;
  105. box-sizing: border-box;
  106. .topbg{
  107. width: 100%;
  108. position: fixed;
  109. top: 0;
  110. left: 0;
  111. z-index: 0;
  112. }
  113. .search{
  114. width: 100%;
  115. height: 84rpx;
  116. padding: 6rpx 6rpx 6rpx 30rpx;
  117. box-sizing: border-box;
  118. background: #FFFFFF;
  119. border-radius: 40rpx;
  120. border: 1rpx solid #198CFF;
  121. position: relative;
  122. display: flex;
  123. align-items: center;
  124. justify-content: space-between;
  125. .btn{
  126. width: 118rpx;
  127. height: 68rpx;
  128. background: #198CFF;
  129. border-radius: 40rpx;
  130. border: 1rpx solid #198CFF;
  131. font-family: PingFangSC, PingFang SC;
  132. font-weight: 400;
  133. font-size: 28rpx;
  134. color: #FFFFFF;
  135. line-height: 68rpx;
  136. text-align: center;
  137. letter-spacing: 2rpx;
  138. }
  139. }
  140. .list{
  141. width: 100%;
  142. position: relative;
  143. .item{
  144. width: 100%;
  145. padding: 36rpx 24rpx;
  146. box-sizing: border-box;
  147. margin-top: 20rpx;
  148. background: #FFFFFF;
  149. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECECEC;
  150. border-radius: 16rpx;
  151. .name{
  152. font-family: PingFang-SC, PingFang-SC;
  153. font-weight: bold;
  154. font-size: 30rpx;
  155. color: #1D2129;
  156. line-height: 30rpx;
  157. text-align: left;
  158. overflow: hidden;
  159. text-overflow: ellipsis;
  160. white-space: nowrap;
  161. }
  162. .info{
  163. .iitem{
  164. width: 100%;
  165. display: flex;
  166. .pre{
  167. width: 50%;
  168. margin-top: 28rpx;
  169. display: flex;
  170. align-items: center;
  171. .title{
  172. width: 116rpx;
  173. font-family: PingFangSC, PingFang SC;
  174. font-weight: 400;
  175. font-size: 24rpx;
  176. color: #86909C;
  177. line-height: 24rpx;
  178. text-align: left;
  179. }
  180. .nr{
  181. width: calc(100% - 116rpx);
  182. font-family: PingFang-SC, PingFang-SC;
  183. font-weight: bold;
  184. font-size: 28rpx;
  185. color: #4E5969;
  186. line-height: 30rpx;
  187. text-align: left;
  188. overflow: hidden;
  189. text-overflow: ellipsis;
  190. white-space: nowrap;
  191. }
  192. }
  193. }
  194. }
  195. }
  196. }
  197. }
  198. </style>