index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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. export default {
  51. data(){
  52. return {
  53. params:{
  54. page:1,
  55. limit:10,
  56. merchantName:''
  57. },
  58. merchantTypeCfg:{},
  59. list:[],
  60. isOver:false
  61. }
  62. },
  63. onLoad() {
  64. this.getMerchantType();
  65. this.getList();
  66. },
  67. onReachBottom() {
  68. if(this.isOver) return;
  69. this.getList();
  70. },
  71. methods:{
  72. async getMerchantType(){
  73. let res = await this.$api.get('/sys/dict/data/getListByType/merchant_type');
  74. if(res.data.code===0){
  75. res.data.data.forEach(d=>{
  76. this.merchantTypeCfg[+d.dictValue] = d.dictLabel;
  77. })
  78. }else this.$showToast(res.data.msg)
  79. },
  80. getList(){
  81. this.$api.get('/wms/merchant/page',this.params).then(res=>{
  82. if(res.data.code===0){
  83. if(this.list.length<res.data.data.total){
  84. this.params.page++;
  85. this.list = [...this.list,...res.data.data.list];
  86. }else this.isOver = true
  87. }else this.$showModal(res.data.msg)
  88. });
  89. },
  90. search(){
  91. this.params.page = 1;
  92. this.isOver = false;
  93. this.list = [];
  94. this.getList();
  95. }
  96. }
  97. }
  98. </script>
  99. <style scoped lang="less">
  100. .page{
  101. padding: 0 24rpx 20rpx;
  102. background: #F4F8FB;
  103. box-sizing: border-box;
  104. .topbg{
  105. width: 100%;
  106. position: fixed;
  107. top: 0;
  108. left: 0;
  109. z-index: 0;
  110. }
  111. .search{
  112. width: 100%;
  113. height: 84rpx;
  114. padding: 6rpx 6rpx 6rpx 30rpx;
  115. box-sizing: border-box;
  116. background: #FFFFFF;
  117. border-radius: 40rpx;
  118. border: 1rpx solid #198CFF;
  119. position: relative;
  120. display: flex;
  121. align-items: center;
  122. justify-content: space-between;
  123. .btn{
  124. width: 118rpx;
  125. height: 68rpx;
  126. background: #198CFF;
  127. border-radius: 40rpx;
  128. border: 1rpx solid #198CFF;
  129. font-family: PingFangSC, PingFang SC;
  130. font-weight: 400;
  131. font-size: 28rpx;
  132. color: #FFFFFF;
  133. line-height: 68rpx;
  134. text-align: center;
  135. letter-spacing: 2rpx;
  136. }
  137. }
  138. .list{
  139. width: 100%;
  140. position: relative;
  141. .item{
  142. width: 100%;
  143. padding: 36rpx 24rpx;
  144. box-sizing: border-box;
  145. margin-top: 20rpx;
  146. background: #FFFFFF;
  147. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECECEC;
  148. border-radius: 16rpx;
  149. .name{
  150. font-family: PingFang-SC, PingFang-SC;
  151. font-weight: bold;
  152. font-size: 30rpx;
  153. color: #1D2129;
  154. line-height: 30rpx;
  155. text-align: left;
  156. overflow: hidden;
  157. text-overflow: ellipsis;
  158. white-space: nowrap;
  159. }
  160. .info{
  161. .iitem{
  162. width: 100%;
  163. display: flex;
  164. .pre{
  165. width: 50%;
  166. margin-top: 28rpx;
  167. display: flex;
  168. align-items: center;
  169. .title{
  170. width: 116rpx;
  171. font-family: PingFangSC, PingFang SC;
  172. font-weight: 400;
  173. font-size: 24rpx;
  174. color: #86909C;
  175. line-height: 24rpx;
  176. text-align: left;
  177. }
  178. .nr{
  179. width: calc(100% - 116rpx);
  180. font-family: PingFang-SC, PingFang-SC;
  181. font-weight: bold;
  182. font-size: 28rpx;
  183. color: #4E5969;
  184. line-height: 30rpx;
  185. text-align: left;
  186. overflow: hidden;
  187. text-overflow: ellipsis;
  188. white-space: nowrap;
  189. }
  190. }
  191. }
  192. }
  193. }
  194. }
  195. }
  196. </style>