index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <view class="page-container">
  3. <!-- 头部筛选 -->
  4. <view class="page-head">
  5. <u-tabs :list="list"
  6. :itemStyle="{
  7. width: '330rpx',
  8. height: '80rpx'
  9. }"
  10. :activeStyle="{
  11. color:'#4573FC'
  12. }"
  13. lineWidth="40"
  14. lineColor="#4573FC"
  15. @click="({index}) => {
  16. current = index
  17. handleQuery()
  18. }"
  19. >
  20. </u-tabs>
  21. <u-row>
  22. <u-col :span="12" style="padding: 16rpx 24rpx;">
  23. <view>
  24. <view class="input-wapper">
  25. <u--input
  26. v-model="params.queryName"
  27. :disabled="false"
  28. :clearable="true"
  29. placeholder="请输入单号或事件标题"
  30. prefixIcon="search"
  31. shape="circle"
  32. prefixIconStyle="font-size: 22px;color: #909399"
  33. inputAlign="center"
  34. fontSize="28rpx"
  35. disabledColor="#F2F2F2"
  36. border="none"
  37. :customStyle="{
  38. height: '62rpx',
  39. padding: '4rpx 28rpx',
  40. background: '#F2F2F2'
  41. }"
  42. @confirm="handleQuery"
  43. >
  44. </u--input>
  45. </view>
  46. </view>
  47. </u-col>
  48. </u-row>
  49. <u--form label-width="auto" ref="uForm" :model="params" labelAlign="right">
  50. <u-cell-group customStyle="margin-top: 2px">
  51. <template>
  52. <u-cell title="状态" :border="true" :isLink="true"
  53. @click="$refs.exStsRef.show()">
  54. <view slot="value">
  55. <u-form-item>
  56. <template v-if="params.flowStatusName">
  57. {{ params.flowStatusName }}
  58. </template>
  59. <template v-else></template>
  60. </u-form-item>
  61. </view>
  62. <view v-if="params.flowStatusName" slot="right-icon"
  63. @click.stop="() => {
  64. params.flowStatus = ''
  65. params.flowStatusName = ''
  66. handleQuery()
  67. }"
  68. >
  69. <u-icon size="16" name="close-circle"></u-icon>
  70. </view>
  71. </u-cell>
  72. <tq-select ref="exStsRef"
  73. :columns = "exStsList"
  74. @confirm="(e) => {
  75. params.flowStatus = e.value
  76. params.flowStatusName = e.label
  77. handleQuery()
  78. }"
  79. >
  80. </tq-select>
  81. </template>
  82. </u-cell-group>
  83. </u--form>
  84. </view>
  85. <!-- 内容 -->
  86. <view class="page-body">
  87. <scroll-view scroll-y style="height: 100%" enable-back-to-top refresher-enabled
  88. refresher-background="#F6F6F6" :refresher-triggered="refresher" @refresherrefresh="handleRefresher"
  89. @scrolltolower="handleScrollLower">
  90. <template v-for="(e,index) in tableList">
  91. <item :item="e" @getList="handleQuery"
  92. :key="index"
  93. :queryType="queryType"
  94. >
  95. </item>
  96. </template>
  97. <view class="nodata-warp" v-if="!tableList.length">
  98. <image :src="$getImages('/assetsMobile/images/no-data.png')" class="nodata-image"></image>
  99. </view>
  100. <u-loadmore :status="loadStatus" height="40" style="margin-top: 0;"/>
  101. <!-- <u-empty mode="data" v-if="tableList.length === 0" marginTop="200"></u-empty> -->
  102. </scroll-view>
  103. </view>
  104. </view>
  105. </template>
  106. <script>
  107. import {eventList} from '@/api/system/event.js'
  108. import listMixin from '@/utils/mixins/list.js'
  109. import item from './module/item'
  110. export default {
  111. mixins: [listMixin],
  112. components: {
  113. item,
  114. },
  115. data() {
  116. return {
  117. params: {
  118. queryName: '',
  119. flowStatus: '',
  120. flowStatusName: '',
  121. },
  122. list: [
  123. /* { name: '我的记录'},
  124. { name: '全部记录'}, */
  125. ],
  126. current: 0,
  127. exStsList: [
  128. {label: '进行中',value: 1},
  129. {label: '已完成',value: 2},
  130. {label: '已撤销',value: 3},
  131. {label: '不通过',value: 4},
  132. ],
  133. }
  134. },
  135. computed: {
  136. queryType() {
  137. if(this.list.length>0) {
  138. if(this.list[this.current].name == '我的记录') {
  139. return 1
  140. } else {
  141. return 2
  142. }
  143. } else {
  144. return ''
  145. }
  146. }
  147. },
  148. onLoad() {
  149. if(this.$hasPermi('mobile:index:eventRecord:list:my')) {
  150. this.list.push({ name: '我的记录'})
  151. }
  152. if(this.$hasPermi('mobile:index:eventRecord:list:all')) {
  153. this.list.push({ name: '全部记录'})
  154. }
  155. this.handleQuery()
  156. },
  157. onShow() {
  158. },
  159. methods: {
  160. async handleTableList() {
  161. if(this.list.length == 0) return
  162. this.loadStatus = 'loading'
  163. let ajaxData = {
  164. ...this.params,
  165. queryType: this.queryType,
  166. pageIndex: this.page,
  167. pageSize: this.pageSize
  168. }
  169. let {code,data,page} = await eventList(ajaxData)
  170. if (code == "0" ) {
  171. data.map((e) => {
  172. this.tableList.push({
  173. ...e,
  174. });
  175. })
  176. this.loadStatus = 'loadmore'
  177. this.total = page.totalCount;
  178. if (this.page * this.pageSize >= this.total) {
  179. this.loadStatus = 'nomore'
  180. }
  181. this.refresher = false;
  182. }
  183. },
  184. }
  185. }
  186. </script>
  187. <style lang="scss" scoped>
  188. .disflex {
  189. display: flex;
  190. justify-content: center;
  191. align-items: center;
  192. }
  193. .input-wapper {
  194. padding: 0 0rpx;
  195. position: relative;
  196. .prefix {
  197. position: absolute;
  198. left: 42rpx;
  199. bottom: 12rpx;
  200. }
  201. .suffix {
  202. position: absolute;
  203. right: 42rpx;
  204. bottom: 12rpx;
  205. }
  206. }
  207. .page-container {
  208. font-size: 28rpx;
  209. min-height: 100%;
  210. height: 100%;
  211. position: relative;
  212. overflow: hidden;
  213. .page-head {
  214. background: #fff;
  215. }
  216. .page-body {
  217. width: 100%;
  218. height: calc(100% - 240rpx - 20rpx);
  219. overflow: hidden;
  220. }
  221. }
  222. .nodata-warp{
  223. display: flex;
  224. justify-content: center;
  225. align-items: center;
  226. padding: 100rpx 0;
  227. .nodata-image{
  228. width: 218rpx;
  229. height: 150rpx;
  230. }
  231. }
  232. ::v-deep {
  233. .u-form-item__body {
  234. padding: 0;
  235. }
  236. }
  237. </style>