addBill.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="pages">
  3. <u-subsection :list="list" mode="subsection" :current="current" @change="sectionChange"></u-subsection>
  4. <div v-if="current==0" class="form-input">
  5. <u-input :customStyle="{height:'30px'}" v-model="ordinaryInvoice.name" placeholder="请输入公司名称" />
  6. <u-input :customStyle="{height:'30px'}" v-model="ordinaryInvoice.number" placeholder="请输入纳税人识别号" />
  7. </div>
  8. <div v-if="current==1" class="form-input">
  9. <u-input :customStyle="{height:'30px'}" placeholder="请输入公司名称" />
  10. <u-input :customStyle="{height:'30px'}" placeholder="请输入纳税人识别号" />
  11. <u-input :customStyle="{height:'30px'}" placeholder="请输入开户银行" />
  12. <u-input :customStyle="{height:'30px'}" placeholder="请输入银行账户" />
  13. <u-input :customStyle="{height:'30px'}" placeholder="请输入公司地址" />
  14. <u-input :customStyle="{height:'30px'}" placeholder="请输入公司电话" />
  15. </div>
  16. <div class="bottom-btn">
  17. <u-button type="primary" @click="save">保存</u-button>
  18. </div>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. list: ['公司普票', '公司专票'],
  26. current: 0,
  27. ordinaryInvoice: {
  28. name: null,
  29. number: null
  30. },
  31. specialInvoice: {
  32. name: null,
  33. number: null,
  34. bank: null,
  35. account: null,
  36. address: null,
  37. phone: null
  38. }
  39. }
  40. },
  41. methods: {
  42. save() {
  43. if (this.current == 0) {
  44. if (this.ordinaryInvoice.name == null) {
  45. this.$u.toast('请输入公司名称')
  46. return
  47. }
  48. if (this.ordinaryInvoice.number == null) {
  49. this.$u.toast('请输入纳税人识别号')
  50. return
  51. }
  52. uni.navigateBack(1)
  53. }
  54. if (this.current == 1) {
  55. uni.navigateBack(1)
  56. }
  57. },
  58. sectionChange(e) {
  59. console.log(e);
  60. this.current = e
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .pages {
  67. width: 100%;
  68. height: 100vh;
  69. background: #f5f5f5;
  70. }
  71. .form-input {
  72. background: #fff;
  73. padding: 10px;
  74. }
  75. .bottom-btn{
  76. position: fixed;
  77. bottom: 0;
  78. width: 100%;
  79. padding: 20px;
  80. background: #fff;
  81. box-sizing: border-box;
  82. }
  83. </style>