the_reimbursement.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  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=='已驳回'">删除</view>
  45. <view class="wenzi1 audit" @click="requestFunds(3,item)"
  46. v-if="item.status=='已驳回'">编辑</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. that.$api.doRequest('post', '/newWorkflow/api/stopInstance', {
  125. businessKey: val.id,
  126. workflowId: val.workflowId,
  127. }).then(res => {
  128. if (res.data.code == 200) {
  129. that.$api.msg('撤回成功')
  130. that.getList()
  131. } else {
  132. that.$api.msg('撤回成功')
  133. }
  134. })
  135. }
  136. }
  137. })
  138. },
  139. gofujian(val){
  140. uni.navigateTo({
  141. url: '/pages/reimbursement/addaccessory?id=' + val.id + "&expensesType=" + val
  142. .expensesType
  143. })
  144. },
  145. getList() {
  146. uni.showLoading({
  147. title: '加载中',
  148. mask: true
  149. })
  150. this.$api.doRequest('get', '/expenseInfo/selectInfo', {
  151. pageSize: this.pageSize,
  152. currentPage: this.currentPage,
  153. compId: uni.getStorageSync('pcUserInfo').compId,
  154. createUserId : uni.getStorageSync('userInfo').id
  155. }).then(res => {
  156. if (res.data.code == 200) {
  157. uni.hideLoading()
  158. if (res.data.data.records.length > 0) {
  159. this.isLoadMore = false
  160. this.loadStatus = 'loading'
  161. } else {
  162. this.isLoadMore = true
  163. this.loadStatus = 'nomore'
  164. }
  165. if (this.currentPage == 1) {
  166. this.tableData = res.data.data.records
  167. } else {
  168. this.tableData = this.tableData.concat(res.data.data.records)
  169. }
  170. }
  171. })
  172. },
  173. deleExpense(val) {
  174. var title
  175. var that = this
  176. if (that.expensesType == '1') {
  177. title = "确定删除收款信息?"
  178. } else {
  179. title = "确定删除请款信息?"
  180. }
  181. uni.showModal({
  182. content: title,
  183. showCancel: true,
  184. confirmText: '确定',
  185. success: function(res) {
  186. if (res.confirm) {
  187. that.$api.doRequest('post', '/expenseInfo/deleteInfo', {
  188. id: val.id,
  189. }).then(res => {
  190. if (res.data.code == 200) {
  191. that.$api.msg('删除成功')
  192. that.getList()
  193. } else {
  194. that.$api.msg('删除失败')
  195. }
  196. })
  197. }
  198. }
  199. })
  200. },
  201. requestFunds(e, val) {
  202. if (val) {
  203. uni.navigateTo({
  204. url: '/pages/reimbursement/request_funds?id=' + val.id + "&expensesType=" + val
  205. .expensesType
  206. })
  207. } else {
  208. uni.navigateTo({
  209. url: '/pages/reimbursement/request_funds?reType=' + e
  210. })
  211. }
  212. },
  213. getRequestFunds(e, val) {
  214. uni.navigateTo({
  215. url: '/pages/reimbursement/get_request_funds?id=' + val.id
  216. })
  217. },
  218. }
  219. }
  220. </script>
  221. <style lang='scss' scoped>
  222. page {
  223. background: #F5F6FA;
  224. }
  225. .wrap {
  226. padding-top: 30rpx;
  227. padding-bottom: 50rpx;
  228. font-size: 28rpx;
  229. background: #fff;
  230. margin: 20rpx;
  231. border-radius: 20rpx;
  232. input {
  233. font-size: 14px;
  234. }
  235. >.title {
  236. padding: 10px 16px;
  237. }
  238. >.title1 {
  239. padding: 10px 16px;
  240. }
  241. }
  242. .wenzi {
  243. border-radius: 10rpx;
  244. height: 42rpx;
  245. text-align: right;
  246. margin-right: 30rpx;
  247. }
  248. .audit1 {
  249. color: #ff5500;
  250. }
  251. .audit2 {
  252. color: #00df00;
  253. }
  254. .audit3 {
  255. color: red;
  256. }
  257. .wenzi1 {
  258. margin:10rpx 40rpx 10rpx 0;
  259. /* margin-top: 10rpx; */
  260. /* height: 50rpx;
  261. width: 100rpx; */
  262. border-radius: 50rpx;
  263. background-color: #ffffff;
  264. /* text-align: center; */
  265. border: 2rpx solid #AFB3BF;
  266. display: flex;
  267. justify-content: center;
  268. align-content: center;
  269. padding: 10rpx 20rpx;
  270. }
  271. .audit {
  272. color: #000000;
  273. text-align: center;
  274. }
  275. .c-row {
  276. display: flex;
  277. -webkit-box-align: center;
  278. align-items: center;
  279. padding: 5rpx 30rpx;
  280. position: relative;
  281. }
  282. .c-row1 {
  283. display: flex;
  284. -webkit-box-align: center;
  285. align-items: center;
  286. position: relative;
  287. padding: 0rpx 30rpx;
  288. justify-content: flex-end;
  289. margin-top: -21px;
  290. font-size: 18px;
  291. }
  292. .submit {
  293. width: 40%;
  294. background: #2c8ac5;
  295. border-radius: 10rpx;
  296. }
  297. .bottom-btn {
  298. padding: 30rpx;
  299. background: #FFFFFF;
  300. width: 100%;
  301. position: fixed;
  302. bottom: 0rpx;
  303. display: flex;
  304. z-index: 9999;
  305. }
  306. .top_type_right,
  307. .top_type_left {
  308. width: 50%;
  309. }
  310. .bottom-btn {
  311. display: flex;
  312. justify-content: space-between;
  313. .btn {
  314. border-radius: 50rpx;
  315. padding: 20rpx 120rpx;
  316. background: #22C572;
  317. color: #fff;
  318. font-size: 32rpx;
  319. box-sizing: border-box;
  320. }
  321. }
  322. .slot-content{
  323. text-align: center;
  324. }
  325. </style>