issueInvoice.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <template>
  2. <view>
  3. <u-navbar title="开具发票" title-color="#101010">
  4. <view class="slot" slot="right" @click="gotoUrl('/pages/invoiceManagement/applyMessage')" >
  5. 开票说明
  6. </view>
  7. </u-navbar>
  8. <view class="cover">
  9. <view class="title">
  10. 发票信息
  11. </view>
  12. <view class="image">
  13. <image class="img" src="@/assets/img/invoice.svg" mode=""></image>
  14. </view>
  15. </view>
  16. <!-- 详细信息 -->
  17. <!-- 企业单位 -->
  18. <!-- 个人/非企业单位 -->
  19. <view class="invoice-infos" >
  20. <view class="item">
  21. <view class="title">
  22. 发票金额
  23. </view>
  24. <view class="value money">
  25. {{totalPrice}}元
  26. </view>
  27. </view>
  28. <view class="item">
  29. <view class="title">
  30. 抬头类型
  31. </view>
  32. <view class="value ">
  33. <view class="invoiceTypeClass">
  34. <view class="invoiceTypeClassText" v-show="invoiceType.id">{{invoiceType.headerType=='1'?'企业单位':''}}{{invoiceType.headerType=='2'?'个人/非企业单位':''}}</view>
  35. <view class="invoiceTypeClassTextNo" v-show="!invoiceType.id" >请选择发票抬头</view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="item" v-if="invoiceType.headerType=='1'">
  40. <view class="title">
  41. 发票类型
  42. </view>
  43. <view class="value ">
  44. <view class="invoiceTypeClass">
  45. <view class="invoiceTypeClassText" v-show="invoiceType.id">{{invoiceType.type=='1'?'增值税专票':''}}{{invoiceType.type=='2'?'增值税普票':''}}</view>
  46. <view class="invoiceTypeClassTextNo" v-show="!invoiceType.id" >请选择发票抬头</view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="item" @click="gotoUrl('/pages/invoiceManagement/selectTitleManagement')" >
  51. <view class="title">
  52. 发票抬头
  53. </view>
  54. <view class="value value2" >
  55. <view class="invoiceTypeClass">
  56. <view class="invoiceTypeClassText" v-show="invoiceType.id">{{invoiceType.title}}</view>
  57. <view class="invoiceTypeClassTextNo" v-show="!invoiceType.id" >请选择发票抬头</view>
  58. </view>
  59. <view class="icon">
  60. <u-icon name="arrow-right" color="#acacac"></u-icon>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="item">
  65. <view class="title">
  66. 联系电话
  67. </view>
  68. <view class="value ">
  69. <view class="invoiceTypeClass">
  70. <view class="invoiceTypeClassText" v-show="invoiceType.id">{{invoiceType.companyTelephone}}</view>
  71. <view class="invoiceTypeClassTextNo" v-show="!invoiceType.id" >请选择发票抬头</view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. <!-- 底部 -->
  77. <view class="bottom">
  78. <button class="btn" @click="show=true">提交申请</button>
  79. </view>
  80. <!-- 弹窗 -->
  81. <view class="modal">
  82. <u-modal v-model="show" :show-title="false" :show-cancel-button="true"
  83. @confirm="submit"
  84. cancel-text="返回修改"
  85. confirm-text="确认开票">
  86. <view class="headline">
  87. <p>发票开具成功后不可撤销</p>
  88. <p>请您仔细核对开票信息!</p>
  89. </view>
  90. <view class="infos">
  91. <view class="item">
  92. <view class="title">
  93. 发票项目
  94. </view>
  95. <view class="value">
  96. 2024年1月扣费发票
  97. </view>
  98. </view>
  99. <view class="item">
  100. <view class="title">
  101. 发票抬头
  102. </view>
  103. <view class="value">
  104. 联通公司
  105. </view>
  106. </view>
  107. <view class="item">
  108. <view class="title">
  109. 发票金额
  110. </view>
  111. <view class="value">
  112. 1000.00元
  113. </view>
  114. </view>
  115. <view class="hint">
  116. 发票开具后,可开票额度将按照实际开票金额相应扣减
  117. </view>
  118. </view>
  119. </u-modal>
  120. </view>
  121. </view>
  122. </template>
  123. <script>
  124. import * as API from '@/apis/pagejs/invoiceApi.js'
  125. export default {
  126. data() {
  127. return {
  128. show: false,
  129. ids:"",
  130. totalPrice:0,
  131. invoiceType:{
  132. }
  133. }
  134. },
  135. onLoad(op ){
  136. this.ids=op.ids
  137. this.carhelp.set('select_invoice_title','')
  138. this.openInvoiceByRecordIds();
  139. },
  140. onShow() {
  141. var item=this.carhelp.get('select_invoice_title')
  142. if(item){
  143. this.invoiceType=item;
  144. this.carhelp.set('select_invoice_title','')
  145. }
  146. },
  147. methods: {
  148. submit(){
  149. if (!(this.invoiceType&&this.invoiceType.id)) {
  150. uni.showToast({
  151. icon: "none",
  152. title: "请选择发票抬头",
  153. })
  154. return;
  155. }
  156. uni.showLoading({
  157. mask:true,title:'加载中...'
  158. })
  159. API.saveInvoiceByRecordIds({
  160. recordIds:this.ids,
  161. invoiceTypeId:this.invoiceType.id
  162. }).then((response) => {
  163. uni.hideLoading();
  164. const eventChannel = this.getOpenerEventChannel();
  165. eventChannel.emit('refreshData');
  166. uni.redirectTo({
  167. url:"/pages/invoiceManagement/applyBilling?id="+response.data.id
  168. })
  169. }).catch(error => {
  170. uni.hideLoading();
  171. })
  172. },
  173. openInvoiceByRecordIds(){
  174. uni.showLoading({
  175. mask:true,title:'加载中...'
  176. })
  177. API.openInvoiceByRecordIds({
  178. recordIds:this.ids
  179. }).then((response) => {
  180. uni.hideLoading();
  181. //this.list=response.data.data;
  182. this.invoiceType=response.data.invoiceType;
  183. this.totalPrice=response.data.totalPrice;
  184. }).catch(error => {
  185. uni.hideLoading();
  186. })
  187. },
  188. }
  189. }
  190. </script>
  191. <style lang="scss" scoped>
  192. .cover {
  193. margin: 24rpx 32rpx;
  194. padding: 58rpx 32rpx;
  195. border-radius: 8px;
  196. position: relative;
  197. background: linear-gradient(90deg, rgba(49, 110, 207, 1) 2%, rgba(20, 73, 159, 1) 100%);
  198. .title {
  199. color: rgba(255, 255, 255, 1);
  200. font-size: 48rpx;
  201. font-weight: bold;
  202. }
  203. .image {
  204. width: 176rpx;
  205. height: 176rpx;
  206. position: absolute;
  207. right: 0;
  208. top: 0;
  209. .img {
  210. width: 100%;
  211. height: 100%;
  212. }
  213. }
  214. }
  215. // 详细信息
  216. .invoice-infos {
  217. background-color: #fff;
  218. border-radius: 8px;
  219. margin: 36rpx 32rpx;
  220. .item {
  221. display: flex;
  222. align-items: center;
  223. padding: 28rpx 32rpx;
  224. .title {
  225. color: rgba(119, 119, 119, 1);
  226. font-size: 32rpx;
  227. }
  228. .value {
  229. flex: 1;
  230. display: flex;
  231. justify-content: space-between;
  232. align-items: center;
  233. margin-left: 40rpx;
  234. /deep/.uni-radio-input {
  235. width: 32rpx;
  236. height: 32rpx;
  237. }
  238. /deep/.uni-input-placeholder {
  239. //color: rgba(16, 16, 16, 1);
  240. font-size: 32rpx;
  241. }
  242. .radio {
  243. margin-right: 16rpx;
  244. }
  245. .invoiceTypeClass{
  246. font-size: 32rpx;
  247. .invoiceTypeClassTextNo{
  248. color: rgba(119, 119, 119, 1);
  249. }
  250. }
  251. }
  252. .value2 {
  253. /deep/.uni-input-placeholder {
  254. //color: rgba(172, 172, 172, 1);
  255. font-size: 32rpx;
  256. }
  257. }
  258. .money {
  259. color: rgba(255, 61, 0, 1);
  260. }
  261. }
  262. }
  263. // 底部
  264. .bottom {
  265. position: fixed;
  266. bottom: 0;
  267. left: 0;
  268. right: 0;
  269. background-color: #fff;
  270. padding: 24rpx 32rpx;
  271. .btn {
  272. line-height: 80rpx;
  273. border-radius: 50px;
  274. background: linear-gradient(-88.46deg, rgba(34, 109, 198, 1) 2.59%, rgba(9, 158, 237, 1) 97.02%);
  275. color: rgba(255, 255, 255, 1);
  276. font-size: 36rpx;
  277. }
  278. }
  279. // 弹窗
  280. .modal {
  281. .headline {
  282. text-align: center;
  283. background: linear-gradient(90deg, rgba(49, 110, 207, 1) 2%, rgba(20, 73, 159, 1) 100%);
  284. color: #fff;
  285. padding: 32rpx 0;
  286. }
  287. .infos {
  288. padding: 40rpx 48rpx 26rpx;
  289. .item {
  290. display: flex;
  291. justify-content: space-between;
  292. margin-bottom: 24rpx;
  293. .title {
  294. color: rgba(119, 119, 119, 1);
  295. font-size: 32rpx;
  296. }
  297. .value {
  298. color: rgba(51, 51, 51, 1);
  299. font-size: 32rpx;
  300. }
  301. }
  302. }
  303. .hint{
  304. color: rgba(238,49,56,1);
  305. font-size: 28rpx
  306. }
  307. }
  308. </style>