addInvoiceTitle.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view>
  3. <u-navbar title="新增发票抬头" title-color="#101010" ></u-navbar>
  4. <!-- 类型 -->
  5. <view class="main">
  6. <u-cell-group>
  7. <u-cell-item title="抬头类型" required :arrow="false" >
  8. <u-radio-group v-model="form.headerType" @change="radioGroupChange">
  9. <u-radio
  10. @change="radioChange"
  11. v-for="(item, index) in list" :key="index"
  12. :name="item.id"
  13. :disabled="item.disabled"
  14. >
  15. {{item.name}}
  16. </u-radio>
  17. </u-radio-group>
  18. </u-cell-item>
  19. <u-cell-item title="发票类型" required :arrow="false" v-show="setparameter('type')" >
  20. <u-radio-group v-model="form.type" @change="radioGroupChange">
  21. <u-radio
  22. @change="radioChange"
  23. v-for="(item, index) in list2" :key="index"
  24. :name="item.id"
  25. :disabled="item.disabled"
  26. >
  27. {{item.name}}
  28. </u-radio>
  29. </u-radio-group>
  30. </u-cell-item>
  31. </u-cell-group>
  32. </view>
  33. <!-- 其他信息 -->
  34. <view class="main">
  35. <u-cell-group>
  36. <u-cell-item title="发票抬头" value="" required :arrow="false" v-show="setparameter('title')" >
  37. <u-input placeholder="请填写发票抬头" ></u-input>
  38. </u-cell-item>
  39. <u-cell-item title="公司税号" value="" required :arrow="false" v-show="setparameter('companyTaxNo')" >
  40. <u-input placeholder="请填写纳税人税号" ></u-input>
  41. </u-cell-item>
  42. <u-cell-item title="开户银行" value="" :required="setparameter('bankName')==2" :arrow="false" v-show="setparameter('bankName')" >
  43. <u-input placeholder="请填写开户银行全称" ></u-input>
  44. </u-cell-item>
  45. <u-cell-item title="银行账户" value="" :required="setparameter('accountNo')==2" :arrow="false" v-show="setparameter('accountNo')" >
  46. <u-input placeholder="请填写银行账户" ></u-input>
  47. </u-cell-item>
  48. <u-cell-item title="公司地址" value="" :required="setparameter('companyAddress')==2" :arrow="false" v-show="setparameter('companyAddress')" >
  49. <u-input placeholder="请填写公司详细地址" ></u-input>
  50. </u-cell-item>
  51. <u-cell-item title="身份证号" value="" required :arrow="false" v-show="setparameter('idCard')" >
  52. <u-input placeholder="请填写身份证号" ></u-input>
  53. </u-cell-item>
  54. </u-cell-group>
  55. </view>
  56. <view class="main">
  57. <u-cell-item title="联系电话" value="" required :arrow="false" v-show="setparameter('companyTelephone')" >
  58. <u-input placeholder="请填写联系电话" ></u-input>
  59. </u-cell-item>
  60. </view>
  61. <!-- 默认 -->
  62. <view class="main ">
  63. <u-cell-item title="设为默认" :arrow="false" >
  64. <u-switch size="40" v-model="checked" active-color="#00e266"></u-switch>
  65. </u-cell-item>
  66. </view>
  67. <button class="save">保存</button>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. checked:true,
  75. list: [
  76. {
  77. id:1,
  78. name: '企业单位',
  79. disabled: false
  80. },
  81. {
  82. id:2,
  83. name: '个人/非企业单位',
  84. disabled: false
  85. }
  86. ],
  87. list2: [
  88. {
  89. id:1,
  90. name: '增值税专票',
  91. disabled: false
  92. },
  93. {
  94. id:2,
  95. name: '增值税普票',
  96. disabled: false
  97. }
  98. ],
  99. value: 'orange',
  100. form:{
  101. headerType:'',//专票必填
  102. type:"",//专票必填
  103. //companyName:"",//专票必填
  104. companyTaxNo:"",//专票必填
  105. bankName:"",
  106. accountNo:"",
  107. companyAddress:"",
  108. companyTelephone:"",
  109. defaultHeader:"",
  110. title:"",//个人
  111. idCard:"",//个人
  112. }
  113. };
  114. },
  115. computed:{
  116. ruleReqlist(){
  117. if(this.form.headerType==2){
  118. return ["title","idCard"]
  119. }else if(this.form.headerType==1&&this.form.type==2){
  120. return ["headerType","type","title","companyTaxNo",
  121. "companyTelephone","defaultHeader"]
  122. }else{
  123. return ["headerType","type","title","companyTaxNo",
  124. "bankName","accountNo","companyAddress",
  125. "companyTelephone","defaultHeader"]
  126. }
  127. },
  128. rulelist(){
  129. if(this.form.headerType==1&&this.form.type==2){
  130. return ["bankName","accountNo","companyAddress"]
  131. }else {
  132. return []
  133. }
  134. }
  135. },
  136. methods: {
  137. setparameter(key){
  138. if(this.ruleReqlist.indexOf(key)!=-1){
  139. //console.log(2,key,this.ruleReqlist)
  140. return 2
  141. }
  142. if(this.rulelist.indexOf(key)!=-1){
  143. //console.log(1,key,this.rulelist)
  144. return 1
  145. }
  146. //console.log(0,key)
  147. return 0
  148. },
  149. // 选中某个单选框时,由radio时触发
  150. radioChange(e) {
  151. // console.log(e);
  152. },
  153. // 选中任一radio时,由radio-group触发
  154. radioGroupChange(e) {
  155. }
  156. }
  157. };
  158. </script>
  159. <style lang="scss" scoped>
  160. .main{
  161. background-color: #fff;
  162. margin-bottom: 24rpx;
  163. }
  164. /deep/.u-cell{
  165. height: 96rpx;
  166. }
  167. /deep/.u-cell__value{
  168. text-align: left;
  169. margin-left: 8%;
  170. font-size: 32rpx;
  171. }
  172. /deep/.u-switch{
  173. margin: auto 0;
  174. float: left;;
  175. }
  176. .save{
  177. margin: 24rpx 32rpx;
  178. line-height: 88rpx;
  179. border-radius: 50px;
  180. background: linear-gradient(-88.46deg, rgba(34,109,198,1) 2.59%,rgba(9,158,237,1) 97.02%);
  181. color: rgba(255,255,255,1);
  182. font-size: 36rpx;
  183. }
  184. </style>