List.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <view class="container" v-if="isShow">
  3. <view class="headerBox">
  4. <view class="searchBox">
  5. <icon class="icon-small searchIcon" type="search" size="20"></icon>
  6. <input type="text" data-code="code" v-model="CodeTitle" class="fway-form-input searchInput" placeholder="请输入编号或者标题搜索" />
  7. <text class="searchBtn" @tap="onTapSearch">搜索</text>
  8. </view>
  9. <view class="tabBox">
  10. <view class="tabItem" :class="tabIndex == '1' ? 'active' : ''" @tap="onChangeState('1')">全部</view>
  11. <view class="tabItem" :class="tabIndex == '2' ? 'active' : ''" @tap="onChangeState('2')">未回复</view>
  12. <view class="tabItem" :class="tabIndex == '3' ? 'active' : ''" @tap="onChangeState('3')">已回复</view>
  13. <view class="tabItem" :class="tabIndex == '4' ? 'active' : ''" @tap="onChangeState('4')">已评价</view>
  14. </view>
  15. </view>
  16. <view class="contentBox">
  17. <z-paging ref="paging" v-model="listData" @query="onGetOrderList" refresher-update-time-key="list">
  18. <view class="listInfoBox">
  19. <view class="listInfo" v-for="(item, index) in listData" :key="index" @tap="onOrderViewTo(item.id)">
  20. <view class='listCode'>
  21. <view class="codeTextBox">
  22. <!-- <text>编号:</text> -->
  23. <text class="codeText">{{item.orderNo}}</text>
  24. <text class="codeType" v-if="item.industryName">{{item.industryName}}</text>
  25. </view>
  26. <rich-text :nodes="item.statusText" class="codeStatus" :class="item.statusClass"></rich-text>
  27. </view>
  28. <rich-text :nodes="item.title" class="listTitle"></rich-text>
  29. <view class="listDetailBox">
  30. <text class="listArea">{{item.area}}</text>
  31. <text class="listDate">{{item.creationTime}}</text>
  32. </view>
  33. </view>
  34. </view>
  35. </z-paging>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. return {
  43. isShow: false,
  44. tabIndex: '1',
  45. State: '',
  46. CodeTitle: '',
  47. listData: [],
  48. isReLoad: false,
  49. }
  50. },
  51. onLoad(options) {
  52. let that = this;
  53. if (options.tabIndex){
  54. that.tabIndex = options.tabIndex;
  55. }
  56. that.isShow = true;
  57. },
  58. methods: {
  59. onGetOrderList(pageNo, pageSize) {
  60. let that = this;
  61. switch(that.tabIndex) {
  62. case '1':
  63. that.State = 0;
  64. break;
  65. case '2':
  66. that.State = 1;
  67. break;
  68. case '3':
  69. that.State = 2;
  70. break;
  71. case '4':
  72. that.State = 3;
  73. break;
  74. default: break;
  75. }
  76. that.$admin.req({
  77. method: 'GET',
  78. url: '/api/v1/Snapshot/order?KeyWords=' + that.CodeTitle + '&Status=' + that.State + '&QueryIndex=' + (pageNo - 1) + '&QueryCount=' + pageSize,
  79. }).then(res => {
  80. if (res && res.length > 0) {
  81. res.forEach((item, index) => {
  82. item.creationTime = that.$util.formatTime(new Date(item.creationTime));
  83. switch (item.statusText) {
  84. case '办理完成':
  85. item.statusClass = 'greenText';
  86. break;
  87. case '办理中':
  88. item.statusClass = 'redText';
  89. break;
  90. case '待受理':
  91. item.statusClass = 'yellowText';
  92. break;
  93. case '':
  94. item.statusClass = 'grayText';
  95. break;
  96. default:
  97. item.statusClass = 'blueText';
  98. break;
  99. }
  100. })
  101. that.$refs.paging.complete(res);
  102. } else if (res && res.length == 0) {
  103. that.$refs.paging.complete([]);
  104. } else {
  105. that.$util.msg('网络出错!');
  106. that.$refs.paging.complete(false);
  107. }
  108. typeof fun === 'function' && fun();
  109. }, err => {
  110. if (!that.isReLoad) {
  111. that.isReLoad = true;
  112. that.onGetOrderList(pageNo, pageSize);
  113. } else {
  114. that.$util.msg(err);
  115. that.$refs.paging.complete(false);
  116. }
  117. })
  118. },
  119. // 点击查询按钮
  120. onTapSearch() {
  121. let that = this;
  122. that.$refs.paging.reload();
  123. },
  124. // 切换工单状态
  125. onChangeState(tabIndex) {
  126. let that = this;
  127. if (that.tabIndex != tabIndex){
  128. that.tabIndex = tabIndex;
  129. that.$refs.paging.reload();
  130. }
  131. },
  132. onOrderViewTo(id) {
  133. uni.navigateTo({
  134. url: '/pagesCare/Order/View?type=mine&id=' + encodeURIComponent(id)
  135. })
  136. },
  137. }
  138. }
  139. </script>
  140. <style lang="less">
  141. .container {
  142. background-color: #F6F7F8;
  143. }
  144. .headerBox {
  145. line-height: 0;
  146. background-color: #fff;
  147. }
  148. .searchBox {
  149. padding: 20rpx;
  150. position: relative;
  151. }
  152. .searchIcon {
  153. position: absolute;
  154. top: 40rpx;
  155. left: 50rpx;
  156. }
  157. .searchInput {
  158. background-color: #F6F7F8;
  159. border-radius: 30rpx;
  160. padding: 10rpx 110rpx 10rpx 80rpx;
  161. width: calc(100% - 190rpx);
  162. height: 60rpx;
  163. line-height: 60rpx;
  164. font-size: 36rpx;
  165. }
  166. .searchBtn {
  167. position: absolute;
  168. line-height: 60rpx;
  169. top: 26rpx;
  170. right: 26rpx;
  171. background-color: #E5F7FF;
  172. color: #3e6ffd;
  173. font-size: 36rpx;
  174. padding: 4rpx 20rpx;
  175. border-radius: 30rpx;
  176. }
  177. .tabBox {
  178. padding: 0;
  179. line-height: 48rpx;
  180. }
  181. .tabItem {
  182. padding: 20rpx 0 30rpx;
  183. display: inline-block;
  184. width: calc(25%);
  185. text-align: center;
  186. color: #333333;
  187. font-size: 36rpx;
  188. position: relative;
  189. }
  190. .active {
  191. color: #3e6ffd;
  192. }
  193. .active::after {
  194. content: " ";
  195. width: 72rpx;
  196. height: 6rpx;
  197. background-color: #3e6ffd;
  198. position: absolute;
  199. bottom: 0;
  200. left: calc(50% - 36rpx);
  201. }
  202. .contentBox {
  203. position: relative;
  204. height: calc(100% - 200rpx);
  205. }
  206. .listInfo {
  207. margin: 20rpx;
  208. padding: 30rpx 20rpx;
  209. border-radius: 20rpx;
  210. background-color: #fff;
  211. }
  212. .listCode {
  213. padding-bottom: 30rpx;
  214. border-bottom: 2rpx #EEEEEE solid;
  215. }
  216. .codeTextBox {
  217. width: calc(100% - 160rpx);
  218. display: inline-block;
  219. font-size: 36rpx;
  220. color: #666666;
  221. vertical-align: middle;
  222. }
  223. .codeText {
  224. color: #000006;
  225. }
  226. .codeType{
  227. padding: 2rpx 6rpx 4rpx;
  228. margin-left: 20rpx;
  229. border: 2rpx #3e6ffd solid;
  230. border-radius: 10rpx;
  231. color: #3e6ffd;
  232. font-size: 32rpx;
  233. }
  234. .codeStatus {
  235. width: calc(160rpx);
  236. display: inline-block;
  237. color: #3e6ffd;
  238. font-size: 36rpx;
  239. text-align: right;
  240. vertical-align: middle;
  241. }
  242. .listTitle {
  243. color: #000405;
  244. font-size: 40rpx;
  245. line-height: 50rpx;
  246. white-space: pre-line;
  247. overflow: hidden;
  248. text-overflow: ellipsis;
  249. display: -webkit-box;
  250. -webkit-box-orient: vertical;
  251. /*行向垂直排列*/
  252. -webkit-line-clamp: 2;
  253. width: 100%;
  254. padding-top: 20rpx;
  255. }
  256. .listDetailBox {
  257. color: #666666;
  258. font-size: 32rpx;
  259. padding-top: 30rpx;
  260. display: block;
  261. }
  262. .listArea {
  263. font-size: 32rpx;
  264. margin-right: 20rpx;
  265. }
  266. .listDate {
  267. font-size: 32rpx;
  268. }
  269. </style>