the_reimbursement.vue 8.5 KB

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