the_reimbursement.vue 6.7 KB

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