the_reimbursement.vue 6.9 KB

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