list.vue 5.9 KB

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