my-fapiao.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <template>
  2. <view class="my-fapiao">
  3. <view class="ad-header u-flex">
  4. <view class="header-item u-flex-1 u-flex u-row-center">
  5. <view class="item-box u-flex-col u-col-bottom" :class="{'item-box1':current == 1}" @click="changetabs(1)">
  6. <text>我的发票</text>
  7. <text></text>
  8. </view>
  9. </view>
  10. <view class="header-item u-flex-1 u-flex u-row-center">
  11. <view class="item-box u-flex-col u-col-bottom" :class="{'item-box1':current == 2}" @click="changetabs(2)">
  12. <text>发票抬头</text>
  13. <text></text>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="fapiao-list1" v-if="current == 1">
  18. <view class="list1-item" v-for="(item,index) in list" :key="index" @click="toinfo(item)">
  19. <view class="list1-top u-flex u-row-between">
  20. <text>订单编号 {{item.order_no}}</text>
  21. <text style="color: #F2413A;" v-if="item.status == 1">待开票</text>
  22. <text style="color: #FF8635;" v-if="item.status == 2">待发送</text>
  23. <text style="color: #61BF60;" v-if="item.status == 3">待签收</text>
  24. <text style="color: #61BF60;" v-if="item.status == 4">已签收</text>
  25. </view>
  26. <view class="list1-user u-flex">
  27. <text>{{item.order_resume_name.resume_name.name}}</text>
  28. <text>/{{item.order_job_name.job_name.job_name}}</text>
  29. </view>
  30. <view class="list1-body u-flex u-col-bottom u-row-between">
  31. <view class="u-flex-col">
  32. <text class="text1">{{item.invoice_format == 1 ? '纸质发票' : '电子发票'}}-{{item.taitou_type == 1 ? '个人' : '公司'}}</text>
  33. <text class="text2">抬头名称 {{item.name}}</text>
  34. <text class="text3">申请时间 {{item.createtime}}</text>
  35. </view>
  36. <text class="price">¥{{item.money}}</text>
  37. </view>
  38. <view class="list1-down u-flex u-row-right">
  39. <text v-if="item.status == 3" @click.stop="shoudao(item)">确认收到</text>
  40. <text v-else style="border: 2rpx solid #A3A3A3;color: #222222;">查看详情</text>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="fapiao-list2" v-if="current == 2">
  45. <view class="list2-item" v-for="(item,index) in list" :key="index">
  46. <view class="list2-top">
  47. 普通发票-{{item.taitou_type == 1 ? '个人' : '公司'}}抬头
  48. </view>
  49. <view class="list2-down u-flex u-row-between">
  50. <text>{{item.name}}</text>
  51. <image src="static/fapiao-edit.png" @click="toedit(item)" mode=""></image>
  52. </view>
  53. </view>
  54. <view style="height: 130rpx;"></view>
  55. <view class="safe-area-inset-bottom"></view>
  56. </view>
  57. <view style="height: 70vh;" v-if="list.length == 0">
  58. <u-empty text="暂无数据" mode="list"></u-empty>
  59. </view>
  60. <view class="list-down-btn" v-if="current == 2">
  61. <view class="down-btn u-flex u-row-center">
  62. <text @click="toadd">添加发票抬头</text>
  63. </view>
  64. <view class="safe-area-inset-bottom"></view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. current: 1,
  73. page: 1,
  74. list: [],
  75. total: 0,
  76. }
  77. },
  78. onShow() {
  79. this.page = 1
  80. this.list = []
  81. this.getlist()
  82. },
  83. onReachBottom() {
  84. if (this.current == 1 && (this.total != this.list.length)) {
  85. this.page++
  86. this.getlist()
  87. }
  88. },
  89. methods: {
  90. shoudao(item) {
  91. uni.showModal({
  92. title: "提示",
  93. content: "确认收到吗?",
  94. success: (e) => {
  95. if (e.confirm) {
  96. uni.showLoading({
  97. mask: true,
  98. title: "请稍后"
  99. })
  100. this.$u.post('/api/hr.invoice/invoice_receipt', {
  101. id: item.id
  102. }).then(res => {
  103. this.$u.toast(res.msg)
  104. if (res.code == 1) {
  105. setTimeout(() => {
  106. this.page = 1
  107. this.list = []
  108. this.getlist()
  109. }, 800)
  110. }
  111. })
  112. }
  113. }
  114. })
  115. },
  116. changetabs(type) {
  117. this.current = type
  118. this.page = 1
  119. this.list = []
  120. this.getlist()
  121. },
  122. getlist() {
  123. if (this.current == 1) {
  124. this.$u.post('/api/hr.invoice/my_invoice', {
  125. page: this.page
  126. }).then(res => {
  127. this.total = res.data.total
  128. this.list = this.list.concat(res.data.data)
  129. })
  130. } else {
  131. this.$u.post('/api/hr.invoice/invoice_info').then(res => {
  132. this.list = res.data
  133. })
  134. }
  135. },
  136. toadd() {
  137. uni.navigateTo({
  138. url: "/pagesD/add-fapiao"
  139. })
  140. },
  141. toinfo(item) {
  142. uni.navigateTo({
  143. url: "/pagesD/fapiao-info?id=" + item.id
  144. })
  145. },
  146. toedit(item) {
  147. uni.navigateTo({
  148. url: "/pagesD/add-fapiao?id=" + item.id
  149. })
  150. }
  151. }
  152. }
  153. </script>
  154. <style lang="scss">
  155. .my-fapiao {
  156. .list-down-btn {
  157. position: fixed;
  158. bottom: 0;
  159. left: 0;
  160. width: 750rpx;
  161. z-index: 99;
  162. background-color: #fff;
  163. .down-btn {
  164. padding: 12rpx 0;
  165. text {
  166. width: 686rpx;
  167. line-height: 92rpx;
  168. background: #0C66C2;
  169. border-radius: 12rpx;
  170. text-align: center;
  171. font-size: 36rpx;
  172. font-family: PingFangSC-Medium, PingFang SC;
  173. font-weight: 500;
  174. color: #FFFFFF;
  175. }
  176. }
  177. }
  178. .fapiao-list2 {
  179. .list2-item {
  180. width: 702rpx;
  181. background: #FFFFFF;
  182. border-radius: 16rpx;
  183. margin: 20rpx auto;
  184. padding: 0 20rpx;
  185. .list2-down {
  186. height: 98rpx;
  187. text {
  188. font-size: 32rpx;
  189. font-family: PingFangSC-Regular, PingFang SC;
  190. font-weight: 400;
  191. color: #222222;
  192. }
  193. image {
  194. width: 36rpx;
  195. height: 36rpx;
  196. }
  197. }
  198. .list2-top {
  199. line-height: 72rpx;
  200. border-bottom: 2rpx solid #F3F3F3;
  201. font-size: 22rpx;
  202. font-family: PingFangSC-Regular, PingFang SC;
  203. font-weight: 400;
  204. color: #777777;
  205. }
  206. }
  207. }
  208. .fapiao-list1 {
  209. .list1-item {
  210. width: 686rpx;
  211. background: #FFFFFF;
  212. border-radius: 20rpx;
  213. margin: 20rpx auto;
  214. padding: 0 20rpx;
  215. .list1-down {
  216. height: 108rpx;
  217. text {
  218. width: 164rpx;
  219. line-height: 64rpx;
  220. border-radius: 12rpx;
  221. border: 1rpx solid #0C66C2;
  222. text-align: center;
  223. font-size: 26rpx;
  224. font-family: PingFangSC-Regular, PingFang SC;
  225. font-weight: 400;
  226. color: #0C66C2;
  227. }
  228. }
  229. .list1-body {
  230. background: #F3F3F3;
  231. border-radius: 12rpx;
  232. padding: 20rpx;
  233. .price {
  234. font-size: 40rpx;
  235. font-family: JDZhengHT-Regular, JDZhengHT;
  236. font-weight: 500;
  237. color: #222222;
  238. }
  239. .text1 {
  240. font-size: 24rpx;
  241. font-family: PingFangSC-Regular, PingFang SC;
  242. font-weight: 400;
  243. color: #1A1C24;
  244. margin-bottom: 12rpx;
  245. }
  246. .text2 {
  247. font-size: 20rpx;
  248. font-family: PingFangSC-Regular, PingFang SC;
  249. font-weight: 400;
  250. color: #777777;
  251. margin-bottom: 12rpx;
  252. }
  253. .text3 {
  254. font-size: 20rpx;
  255. font-family: SFPro-Regular, SFPro;
  256. font-weight: 400;
  257. color: #777777;
  258. }
  259. }
  260. .list1-user {
  261. height: 78rpx;
  262. text:first-child {
  263. font-size: 28rpx;
  264. font-family: PingFangSC-Medium, PingFang SC;
  265. font-weight: 500;
  266. color: #222222;
  267. margin-right: 12rpx;
  268. }
  269. text:last-child {
  270. font-size: 22rpx;
  271. font-family: PingFangSC-Regular, PingFang SC;
  272. font-weight: 400;
  273. color: #555555;
  274. }
  275. }
  276. .list1-top {
  277. height: 72rpx;
  278. border-bottom: 2rpx solid #F3F3F3;
  279. text:first-child {
  280. font-size: 22rpx;
  281. font-family: SFPro-Regular, SFPro;
  282. font-weight: 400;
  283. color: #777777;
  284. }
  285. text:last-child {
  286. font-size: 24rpx;
  287. font-family: PingFangSC-Medium, PingFang SC;
  288. font-weight: 500;
  289. }
  290. }
  291. }
  292. }
  293. .ad-header {
  294. position: sticky;
  295. top: 0;
  296. left: 0;
  297. z-index: 99;
  298. background-color: #fff;
  299. height: 80rpx;
  300. .header-item {
  301. .item-box {
  302. text:first-child {
  303. font-size: 30rpx;
  304. font-family: PingFangSC-Regular, PingFang SC;
  305. font-weight: 400;
  306. color: #444444;
  307. }
  308. text:last-child {
  309. width: 44rpx;
  310. height: 8rpx;
  311. border-radius: 4rpx;
  312. margin-top: -14rpx;
  313. position: relative;
  314. z-index: -1;
  315. }
  316. }
  317. .item-box1 {
  318. text:first-child {
  319. font-size: 30rpx;
  320. font-family: PingFangSC-Medium, PingFang SC;
  321. font-weight: 500;
  322. color: #141414;
  323. }
  324. text:last-child {
  325. background: linear-gradient(270deg, #0C66C2 0%, #FFFFFF 100%);
  326. }
  327. }
  328. }
  329. }
  330. }
  331. page {
  332. background-color: #F3F3F3;
  333. }
  334. </style>