list.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <view>
  3. <u-navbar :titleLong="fieldInfo.title">
  4. </u-navbar>
  5. <view class="list1">
  6. <view class="item" v-for="(item,i) in list" @click="ckInfo(item)" :key="i">
  7. <view class="group" v-for="(tinfo,i) in typeKey" :key="i">
  8. <view class="group1" >
  9. <view class="name">
  10. {{tinfo.name}}:
  11. </view>
  12. <view class="value">
  13. {{item[tinfo.key]}}
  14. </view>
  15. </view>
  16. <view class="group2" v-if="i==0">
  17. <view class="title">
  18. <span :style="{color:recordStatusColor(item.status)}">{{item.statusN}}</span>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="group">
  23. <view class="group1">
  24. <view class="name">
  25. 提交时间:
  26. </view>
  27. <view class="value">
  28. {{item.createTime}}
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <u-divider v-if="formData.recordsTotal==list.length"
  34. :isnone="formData.recordsTotal==0" nonetext="没有找到相关内容"
  35. border-color="#CFD2D5">已经到底了</u-divider>
  36. </view>
  37. <view class="bottom">
  38. <u-button type="primary" @click="addInfo">表单提报</u-button>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import * as API from '@/apis/pagejs/oa.js'
  44. import {
  45. dataJsGetInfo
  46. } from '../data.js'
  47. export default {
  48. data() {
  49. return {
  50. oatype:"",
  51. title:"",
  52. typeKey:[],
  53. formData:{
  54. pageIndex: 1,
  55. pageSize: 20,
  56. recordsTotal: 0,
  57. },
  58. list: [
  59. ],
  60. }
  61. },
  62. onLoad(op){
  63. this.oatype=op.oatype;
  64. this.fieldInfo=dataJsGetInfo(op.oatype)
  65. this.title=this.fieldInfo.title
  66. this.typeKey=this.fieldInfo.typeKey;
  67. },
  68. onReady() {
  69. this.getList();
  70. },
  71. onReachBottom() {
  72. if (this.list.length < this.formData.recordsTotal) {
  73. this.myLoadmore();
  74. }
  75. },
  76. methods: {
  77. init(){
  78. this.formData.pageIndex = 1;
  79. this.getList();
  80. },
  81. addInfo(){
  82. uni.navigateTo({
  83. url:"/pages/oawork/business/add?oatype="+this.oatype,
  84. events: {
  85. refreshData: () => {
  86. this.init()
  87. }
  88. }
  89. })
  90. },
  91. ckInfo(info){
  92. var url=""
  93. if(info.status==-1){
  94. url="/pages/oawork/business/add"
  95. }else{
  96. url="/pages/oawork/business/info"
  97. }
  98. uni.navigateTo({
  99. url:url+"?id="+info.id+"&oatype="+this.oatype,
  100. events: {
  101. refreshData: () => {
  102. this.init()
  103. }
  104. }
  105. })
  106. },
  107. recordStatusColor(val){
  108. var retu = ""
  109. val=val+''
  110. switch (val) {
  111. case '-1':
  112. retu = '#f29a38'
  113. break;
  114. case '0':
  115. retu = '#f29a38'
  116. break;
  117. case '1':
  118. retu = '#52b56b'
  119. break;
  120. case '2':
  121. retu = '#c94031'
  122. break;
  123. case '3':
  124. retu = '#3a3bc2'
  125. break;
  126. case '5':
  127. retu = '#c94031'
  128. break;
  129. case '6':
  130. retu = '#c94031'
  131. case '9':
  132. retu = '#c94031'
  133. break;
  134. default:
  135. retu = '#52b56b'
  136. break;
  137. }
  138. return retu
  139. },
  140. getList(){
  141. uni.showLoading({
  142. title: "加载中",
  143. mask: true,
  144. })
  145. this.formData.formId=this.oatype
  146. API.processList(this.formData).then((res) => {
  147. uni.hideLoading();
  148. if(this.formData.pageIndex==1){
  149. this.list = [
  150. ...res.data.data
  151. ];
  152. }else{
  153. this.list = [
  154. ...this.list,
  155. ...res.data.data
  156. ];
  157. }
  158. this.formData.recordsTotal = res.data.recordsTotal;
  159. }).catch(error => {
  160. uni.showToast({
  161. title: error,
  162. icon: "none"
  163. })
  164. })
  165. },
  166. myLoadmore() {
  167. this.formData.pageIndex += 1;
  168. this.getList();
  169. },
  170. }
  171. }
  172. </script>
  173. <style lang="scss" scoped>
  174. page {
  175. padding-bottom: 100rpx;
  176. }
  177. .head {
  178. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  179. /deep/.u-navbar {
  180. //background: 0!important;
  181. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  182. height: 210rpx;
  183. //padding: 0 32rpx;
  184. }
  185. /deep/.u-border-bottom:after {
  186. height: 0;
  187. }
  188. .tabs {
  189. padding: 0 32rpx
  190. }
  191. }
  192. .tabs {
  193. display: flex;flex-wrap: wrap;
  194. justify-content: space-between;
  195. align-items: center;
  196. /deep/.u-tabs {
  197. background: 0 !important;
  198. width: 250rpx;
  199. }
  200. /deep/.u-tab-bar {
  201. background-color: #2A8EFB !important;
  202. }
  203. .screen {
  204. color: #415058;
  205. position: relative;
  206. font-family: Microsoft Yahei;
  207. /deep/.uicon-arrow-down {
  208. margin-left: 4rpx;
  209. }
  210. }
  211. .options {
  212. width: 120rpx;
  213. height: 60rpx;
  214. line-height: 60rpx;
  215. text-align: center;
  216. background-color: #fff;
  217. color: rgba(65, 80, 88, 1);
  218. font-family: Microsoft Yahei;
  219. position: absolute;
  220. top: 160rpx;
  221. right: 24rpx;
  222. box-shadow: 5px 5px 10px gray;
  223. }
  224. }
  225. .list1,
  226. .list2 {
  227. margin:12px;
  228. padding-bottom: 60px;
  229. .item {
  230. border-radius: 8px;
  231. background-color: rgba(255, 255, 255, 1);
  232. padding: 24rpx;
  233. margin-bottom: 24rpx;
  234. .group {
  235. display: flex;
  236. flex-wrap: wrap;
  237. justify-content: space-between;
  238. color: rgba(119, 119, 119, 1);
  239. // margin-top: 16rpx;
  240. font-weight: bold;
  241. .name{
  242. color:#777777;
  243. }
  244. .value{
  245. color:#333333;
  246. }
  247. .group1{
  248. display: flex;flex-wrap: wrap;
  249. }
  250. .group2{
  251. }
  252. }
  253. }
  254. }
  255. .bottom {
  256. position: fixed;
  257. bottom: 0;
  258. left: 0;
  259. right: 0;
  260. //background-color: #fff;
  261. padding: 16rpx 32rpx;
  262. uni-button {
  263. height: 88rpx;
  264. line-height: 88rpx;
  265. border-radius: 8px;
  266. background: linear-gradient(180deg, rgba(22, 119, 255, 1) 0%, rgba(16, 98, 213, 1) 100%);
  267. color: rgba(255, 255, 255, 1);
  268. font-size: 32rpx;
  269. font-family: Microsoft Yahei;
  270. }
  271. }
  272. </style>