the_reimbursement.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <view>
  3. <view class="" style="padding-bottom: 150rpx;">
  4. <view class='wrap' v-for="(item, index) in tableData" :key="index">
  5. <view class="" style="display: flex;">
  6. <view class="c-row top_type_left">
  7. <view class="title">{{item.purpose}}—{{item.expensesType=='1'?'收款':'请款'}}
  8. <!-- <view @click="requestFunds(1)" v-if="item.expensesType == '1'">收款</view>
  9. <view @click="requestFunds(2)" v-else-if="item.expensesType == '2'">请款
  10. </view> -->
  11. </view>
  12. </view>
  13. <view class="top_type_right">
  14. <view class="wenzi audit1" v-if="item.approveStatus != null && item.status != '已驳回' ">
  15. {{item.approveStatus}}
  16. </view>
  17. <view class="wenzi audit2" v-else-if="item.approveStatus == null ">{{item.status}}</view>
  18. <view class="wenzi audit3" v-else="item.status == '已驳回' ">{{item.status}}</view>
  19. </view>
  20. </view>
  21. <view class="c-row" style="color: #777e7d;">
  22. <view class="title">
  23. <view class="title1" v-if="item.expensesPurpose == '1'">{{item.contractNo}}</view>
  24. <view class="title1" v-else-if="item.expensesPurpose == '3'">{{item.warehouseName}}
  25. </view>
  26. <view class="title1" v-else-if="item.expensesPurpose == '5'">{{ }}</view>
  27. </view>
  28. </view>
  29. <view class="c-row" style="font-size: 35rpx;font-weight:550; padding-top:30rpx">
  30. <view class="title"> {{item.expenseName}}</view>
  31. </view>
  32. <view class="c-row" style="padding-top:10rpx">
  33. <view class="title" style="color:#777e7d;">{{item.createDate}}</view>
  34. </view>
  35. <view class="c-row1">
  36. <view class="title1"> {{item.amountMoney}} 元</view>
  37. </view>
  38. <view style="display: flex;justify-content: flex-end;margin-top: 30rpx;">
  39. <!-- v-if="item.status == '已驳回'" -->
  40. <!-- v-if="item.status == '已驳回'" -->
  41. <view class="wenzi1 audit" @click="deleExpense(item)">删除</view>
  42. <view class="wenzi1 audit" @click="requestFunds(3,item)">编辑</view>
  43. <view class="wenzi1 audit" @click="getRequestFunds(1,item)">查看</view>
  44. </view>
  45. </view>
  46. <view v-show="isLoadMore">
  47. <uni-load-more :status="loadStatus"></uni-load-more>
  48. </view>
  49. </view>
  50. <u-toast ref="uToast" />
  51. <view class="bottom-btn">
  52. <view class="btn" @click="requestFunds(1)">收款</view>
  53. <view class="btn" @click="requestFunds(2)">请款</view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. pageSize: 10,
  62. currentPage: 1,
  63. tableData: [],
  64. reType: '',
  65. flag: '',
  66. isLoadMore: false, //是否加载中
  67. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  68. }
  69. },
  70. onShow() {
  71. this.getList()
  72. },
  73. //下拉刷新
  74. onPullDownRefresh() {
  75. this.currentPage = 1
  76. this.isLoadMore = false
  77. this.loadStatus = 'loading'
  78. this.getList()
  79. setTimeout(function() {
  80. uni.stopPullDownRefresh();
  81. }, 1000);
  82. },
  83. onReachBottom() { //上拉触底函数
  84. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  85. this.isLoadMore = true
  86. this.currentPage += 1
  87. this.getList()
  88. }
  89. },
  90. methods: {
  91. getList() {
  92. uni.showLoading({
  93. title: '加载中',
  94. mask: true
  95. })
  96. this.$api.doRequest('get', '/expenseInfo/selectInfo', {
  97. pageSize: this.pageSize,
  98. currentPage: this.currentPage,
  99. compId: uni.getStorageSync('pcUserInfo').compId,
  100. }).then(res => {
  101. if (res.data.code == 200) {
  102. uni.hideLoading()
  103. if (res.data.data.records.length > 0) {
  104. this.isLoadMore = false
  105. this.loadStatus = 'loading'
  106. } else {
  107. this.isLoadMore = true
  108. this.loadStatus = 'nomore'
  109. }
  110. if (this.currentPage == 1) {
  111. this.tableData = res.data.data.records
  112. } else {
  113. this.tableData = this.tableData.concat(res.data.data.records)
  114. }
  115. }
  116. })
  117. },
  118. deleExpense(val) {
  119. var title
  120. var that = this
  121. if (that.expensesType == '1') {
  122. title = "确定删除收款信息?"
  123. } else {
  124. title = "确定删除请款信息?"
  125. }
  126. uni.showModal({
  127. content: title,
  128. showCancel: true,
  129. confirmText: '确定',
  130. success: function(res) {
  131. if (res.confirm) {
  132. that.$api.doRequest('post', '/expenseInfo/deleteInfo', {
  133. id: val.id,
  134. }).then(res => {
  135. if (res.data.code == 200) {
  136. that.$api.msg('删除成功')
  137. that.getList()
  138. } else {
  139. that.$api.msg('删除失败')
  140. }
  141. })
  142. }
  143. }
  144. })
  145. },
  146. requestFunds(e, val) {
  147. if (val) {
  148. uni.navigateTo({
  149. url: '/pages/reimbursement/request_funds?id=' + val.id + "&expensesType=" + val
  150. .expensesType
  151. })
  152. } else {
  153. uni.navigateTo({
  154. url: '/pages/reimbursement/request_funds?reType=' + e
  155. })
  156. }
  157. },
  158. getRequestFunds(e, val) {
  159. uni.navigateTo({
  160. url: '/pages/reimbursement/get_request_funds?id=' + val.id
  161. })
  162. },
  163. }
  164. }
  165. </script>
  166. <style lang='scss' scoped>
  167. page {
  168. background: #F5F6FA;
  169. }
  170. .wrap {
  171. padding-top: 30rpx;
  172. padding-bottom: 50rpx;
  173. font-size: 28rpx;
  174. background: #fff;
  175. margin: 20rpx;
  176. border-radius: 20rpx;
  177. input {
  178. font-size: 14px;
  179. }
  180. >.title {
  181. padding: 10px 16px;
  182. }
  183. >.title1 {
  184. padding: 10px 16px;
  185. }
  186. }
  187. .wenzi {
  188. border-radius: 10rpx;
  189. height: 42rpx;
  190. text-align: right;
  191. margin-right: 30rpx;
  192. }
  193. .audit1 {
  194. color: #ff5500;
  195. }
  196. .audit2 {
  197. color: #00df00;
  198. }
  199. .audit3 {
  200. color: red;
  201. }
  202. .wenzi1 {
  203. margin-right: 40rpx;
  204. /* margin-top: 10rpx; */
  205. /* height: 50rpx;
  206. width: 100rpx; */
  207. border-radius: 50rpx;
  208. background-color: #ffffff;
  209. /* text-align: center; */
  210. border: 2rpx solid #AFB3BF;
  211. display: flex;
  212. justify-content: center;
  213. align-content: center;
  214. padding: 10rpx 20rpx;
  215. }
  216. .audit {
  217. color: #000000;
  218. text-align: center;
  219. }
  220. .c-row {
  221. display: flex;
  222. -webkit-box-align: center;
  223. align-items: center;
  224. padding: 5rpx 30rpx;
  225. position: relative;
  226. }
  227. .c-row1 {
  228. display: flex;
  229. -webkit-box-align: center;
  230. align-items: center;
  231. position: relative;
  232. padding: 0rpx 30rpx;
  233. justify-content: flex-end;
  234. margin-top: -21px;
  235. font-size: 18px;
  236. }
  237. .submit {
  238. width: 40%;
  239. background: #2c8ac5;
  240. border-radius: 10rpx;
  241. }
  242. .bottom-btn {
  243. padding: 30rpx;
  244. background: #FFFFFF;
  245. width: 100%;
  246. position: fixed;
  247. bottom: 0rpx;
  248. display: flex;
  249. z-index: 9999;
  250. }
  251. .top_type_right,
  252. .top_type_left {
  253. width: 50%;
  254. }
  255. .bottom-btn {
  256. display: flex;
  257. justify-content: space-between;
  258. .btn {
  259. border-radius: 50rpx;
  260. padding: 20rpx 120rpx;
  261. background: #22C572;
  262. color: #fff;
  263. font-size: 32rpx;
  264. box-sizing: border-box;
  265. }
  266. }
  267. </style>