blankInvoice.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. // pages/ticketGet/ticketGet.js
  2. const utils = require('../../utils/util.js')
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. invoiceType: ['增值税普通纸质发票', '增值税专用纸质发票'],
  9. invoiceTypeIndex: 0,
  10. invoiceStatus: '3',
  11. userInfo: '',
  12. company: '',
  13. invoiceCode: '',
  14. invoiceNumber: ''
  15. },
  16. /**
  17. * 生命周期函数--监听页面加载
  18. */
  19. onLoad: function (options) {
  20. this.getUser()
  21. },
  22. //获取企业信息(当前登录用户的默认企业信息)
  23. getUser() {
  24. this.setData({
  25. userInfo: utils.getInfo(),
  26. company:utils.getCurrEntInfo()
  27. })
  28. },
  29. //空白发票作废
  30. invalidInvoice(type) {
  31. let params = {
  32. entTaxId: this.data.company.entTaxId,
  33. deviceType: this.data.company.defaultDeviceInfo.deviceType,
  34. taxDiscId: this.data.company.defaultDeviceInfo.taxDiscId,
  35. invoiceInvalidType: 2,
  36. invoiceCategory: this.data.invoiceStatus,
  37. invoiceCode: this.data.invoiceCode,
  38. invoiceNumber: this.data.invoiceNumber,
  39. invalidOper: this.data.userInfo.userName,
  40. mobile: this.data.userInfo.mobile,
  41. reqChannel: 5
  42. }
  43. utils.axios({
  44. method: 'post',
  45. url: '/sys/invoiceExt/invalid',
  46. data: params,
  47. sendBefore() {
  48. wx.showLoading({
  49. title: '加载中...'
  50. })
  51. },
  52. complete() {
  53. wx.hideLoading()
  54. wx.stopPullDownRefresh()
  55. },
  56. success: res => {
  57. if (res.code === 0) {
  58. utils.toast(res.data.msg)
  59. }
  60. }
  61. })
  62. },
  63. //取消
  64. toBack() {
  65. wx.navigateBack()
  66. },
  67. //发票类型
  68. setInvoiceType(e) {
  69. let value = Number(e.detail.value)
  70. let status = ''
  71. if (value === 0) {
  72. status = 3
  73. }
  74. if (value === 1) {
  75. status = 4
  76. }
  77. // if (value === 2) {
  78. // status = 1
  79. // }
  80. // if (value === 3) {
  81. // status = 2
  82. // }
  83. this.setData({
  84. invoiceTypeIndex: value,
  85. invoiceStatus: status
  86. })
  87. },
  88. // 获取发票代码
  89. setInvoiceCode(e) {
  90. this.setData({
  91. invoiceCode: e.detail.value
  92. })
  93. },
  94. // 获取发票号码
  95. setInvoiceNumber(e) {
  96. this.setData({
  97. invoiceNumber: e.detail.value
  98. })
  99. },
  100. /**
  101. * 生命周期函数--监听页面初次渲染完成
  102. */
  103. onReady: function () {
  104. },
  105. /**
  106. * 生命周期函数--监听页面显示
  107. */
  108. onShow: function () {
  109. },
  110. /**
  111. * 生命周期函数--监听页面隐藏
  112. */
  113. onHide: function () {
  114. },
  115. /**
  116. * 生命周期函数--监听页面卸载
  117. */
  118. onUnload: function () {
  119. },
  120. /**
  121. * 页面相关事件处理函数--监听用户下拉动作
  122. */
  123. onPullDownRefresh: function () {
  124. },
  125. /**
  126. * 页面上拉触底事件的处理函数
  127. */
  128. onReachBottom: function () {
  129. },
  130. /**
  131. * 用户点击右上角分享
  132. */
  133. onShareAppMessage: function () {
  134. return {
  135. title: '诺信云',
  136. path: '/pages/index/index'
  137. }
  138. }
  139. })