kaipiao.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <view style="padding-bottom:220rpx;">
  3. <!-- 发票信息 -->
  4. <view class="box flex justify-center">
  5. <view class="box-con flex justify-center">
  6. <view class="box-con-c">
  7. <view class="box-con-c-item flex justify-between align-center">
  8. <view class="box-con-c-item-l flex align-center">
  9. 发票抬头
  10. <text style="color: red;font-size: 32rpx;margin-top: 20rpx;margin-left: 10rpx;">*</text>
  11. </view>
  12. <view class="box-con-c-item-r">
  13. <u-input v-model="taitou" input-align="right" type="text" placeholder="例:西安XXX有限公司" />
  14. </view>
  15. </view>
  16. <view class="box-con-c-item flex justify-between align-center">
  17. <view class="box-con-c-item-l flex align-center">
  18. 纳税人识别号
  19. <text style="color: red;font-size: 32rpx;margin-top: 20rpx;margin-left: 10rpx;">*</text>
  20. </view>
  21. <view class="box-con-c-item-r">
  22. <u-input v-model="shibiehao" input-align="right" type="text" placeholder="请填写纳税人识别号" />
  23. </view>
  24. </view>
  25. <view class="box-con-c-item flex justify-between align-center">
  26. <view class="box-con-c-item-l flex align-center">
  27. 发票类型
  28. </view>
  29. <view class="box-con-c-item-r">
  30. <u-input v-model="types" :disabled="true" input-align="right" type="text"
  31. placeholder="请填写发票类型" />
  32. </view>
  33. </view>
  34. <view class="box-con-c-item flex justify-between align-center">
  35. <view class="box-con-c-item-l flex align-center">
  36. 发票内容
  37. </view>
  38. <view class="box-con-c-item-r">
  39. <u-input v-model="contents" input-align="right" type="text" placeholder="请填写发票内容" />
  40. </view>
  41. </view>
  42. <view class="box-con-c-item flex justify-between align-center">
  43. <view class="box-con-c-item-l flex align-center">
  44. 发票金额
  45. <text style="color: red;font-size: 32rpx;margin-top: 20rpx;margin-left: 10rpx;">*</text>
  46. </view>
  47. <view class="box-con-c-item-r">
  48. <text style="color: #346EF6;">{{price}}元</text>
  49. </view>
  50. </view>
  51. <view class="box-con-c-item flex justify-between align-center">
  52. <view class="box-con-c-item-l flex align-center">
  53. 注册地址
  54. </view>
  55. <view class="box-con-c-item-r">
  56. <u-input v-model="address" input-align="right" type="text" placeholder="请填写注册地址" />
  57. </view>
  58. </view>
  59. <view class="box-con-c-item flex justify-between align-center">
  60. <view class="box-con-c-item-l flex align-center">
  61. 注册电话
  62. </view>
  63. <view class="box-con-c-item-r">
  64. <u-input v-model="zcphone" input-align="right" type="text" placeholder="请填写注册电话" />
  65. </view>
  66. </view>
  67. <view class="box-con-c-item flex justify-between align-center">
  68. <view class="box-con-c-item-l flex align-center">
  69. 开户银行
  70. </view>
  71. <view class="box-con-c-item-r">
  72. <u-input v-model="yh" input-align="right" type="text" placeholder="请填写开户银行" />
  73. </view>
  74. </view>
  75. <view class="box-con-c-item flex justify-between align-center">
  76. <view class="box-con-c-item-l flex align-center">
  77. 银行账号
  78. </view>
  79. <view class="box-con-c-item-r">
  80. <u-input v-model="yhzh" input-align="right" type="text" placeholder="请填写银行账号" />
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <!-- 收件人信息 -->
  87. <view class="info flex justify-center">
  88. <view class="info-box">
  89. 收件人信息
  90. </view>
  91. </view>
  92. <view class="box flex justify-center">
  93. <view class="box-con flex justify-center">
  94. <view class="box-con-c">
  95. <view class="box-con-c-item flex justify-between align-center">
  96. <view class="box-con-c-item-l flex align-center">
  97. 接收电子邮件
  98. <text style="color: red;font-size: 32rpx;margin-top: 20rpx;margin-left: 10rpx;">*</text>
  99. </view>
  100. <view class="box-con-c-item-r">
  101. <u-input v-model="email" input-align="right" type="text" placeholder="用于向你发送电子发票" />
  102. </view>
  103. </view>
  104. <view class="box-con-c-item flex justify-between align-center">
  105. <view class="box-con-c-item-l flex align-center">
  106. 接收手机号
  107. <text style="color: red;font-size: 32rpx;margin-top: 20rpx;margin-left: 10rpx;">*</text>
  108. </view>
  109. <view class="box-con-c-item-r">
  110. <u-input v-model="phone" input-align="right" type="number" maxlength="11"
  111. placeholder="订单记录通过短信发送" />
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <!-- 确认开票 -->
  118. <view class="btn flex justify-center">
  119. <view class="btn-box flex justify-center align-center" @click="submit">
  120. 提交
  121. </view>
  122. </view>
  123. </view>
  124. </template>
  125. <script>
  126. export default {
  127. data() {
  128. return {
  129. zcphone: '',
  130. yh: '',
  131. yhzh: '',
  132. email: '',
  133. phone: '',
  134. address: '',
  135. types: '电子发票',
  136. contents: '',
  137. taitou: '',
  138. shibiehao: '',
  139. indentNumber: '',
  140. type: '',
  141. price: 0,
  142. };
  143. },
  144. onLoad(e) {
  145. this.price = e.price
  146. this.indentNumber = e.indentNumber
  147. },
  148. methods: {
  149. //提交
  150. submit() {
  151. if (this.taitou == '') {
  152. uni.showToast({
  153. title: '请输入发票抬头',
  154. icon: 'none'
  155. })
  156. return
  157. }
  158. if (this.shibiehao == '') {
  159. uni.showToast({
  160. title: '请输入纳税人识别号',
  161. icon: 'none'
  162. })
  163. return
  164. }
  165. if (this.email == '') {
  166. uni.showToast({
  167. title: '请输入接收电子邮件',
  168. icon: 'none'
  169. })
  170. return
  171. }
  172. if (this.phone == '') {
  173. uni.showToast({
  174. title: '请输入接收手机号',
  175. icon: 'none'
  176. })
  177. return
  178. }
  179. // let invoiceContent =
  180. // `<p><em>发票抬头:${this.taitou}</em></p>`+`<p><em>纳税人识别号:${this.shibiehao}</em></p>`+`${this.address!=''?'<p><em>注册地址:'+this.address+'</em></p>':''}`+`${this.zcphone!=''?'<p><em>注册电话:'+this.zcphone+'</em></p>':''}`+`${this.yh!=''?'<p><em>开户银行:'+this.yh+'</em></p>':''}`+`${this.yhzh!=''?'<p><em>银行账号:'+this.yhzh+'</em></p>':''}`
  181. let data = {
  182. indentNumber: this.indentNumber,
  183. userType: 1,
  184. invoiceType: 1,
  185. invoiceTitle: this.contents,
  186. invoiceMoney: this.price,
  187. userEmail: this.email,
  188. userPhone: this.phone,
  189. invoiceHeader:this.taitou,
  190. taxPayerNumber:this.shibiehao,
  191. bankAddress:this.address,
  192. bankPhone:this.zcphone,
  193. bankDeposit:this.yh,
  194. bankNumber:this.yhzh
  195. }
  196. this.$Request.postJson("/app/invoice/applyInvoice", data).then(res => {
  197. if (res.code == 0) {
  198. uni.showToast({
  199. title: '提交成功!'
  200. })
  201. setTimeout(() => {
  202. uni.navigateBack()
  203. }, 1000)
  204. }else{
  205. uni.showToast({
  206. title:res.msg,
  207. icon:'none'
  208. })
  209. }
  210. });
  211. },
  212. }
  213. }
  214. </script>
  215. <style lang="scss" scoped>
  216. .box {
  217. width: 100%;
  218. height: auto;
  219. margin-top: 20rpx;
  220. .box-con {
  221. width: 686rpx;
  222. height: 100%;
  223. background-color: #ffffff;
  224. border-radius: 16rpx;
  225. .box-con-c {
  226. width: 646rpx;
  227. height: 100%;
  228. }
  229. .box-con-c-item {
  230. width: 100%;
  231. height: 100rpx;
  232. border-bottom: 1rpx solid #f2f2f2;
  233. .box-con-c-item-l {
  234. width: 240rpx;
  235. height: 100%;
  236. }
  237. }
  238. }
  239. }
  240. .info {
  241. width: 100%;
  242. height: auto;
  243. margin-top: 20rpx;
  244. .info-box {
  245. width: 686rpx;
  246. color: #999999;
  247. padding-left: 20rpx;
  248. }
  249. }
  250. .btn {
  251. width: 100%;
  252. position: fixed;
  253. bottom: 0rpx;
  254. height: 200rpx;
  255. background-color: #ffffff;
  256. .btn-box {
  257. width: 686rpx;
  258. height: 100rpx;
  259. border-radius: 50rpx;
  260. background-color: #346EF6;
  261. color: #ffffff;
  262. margin-top: 40rpx;
  263. }
  264. }
  265. </style>