list.vue 5.7 KB

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