issueInvoice.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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. uni.showToast({
  172. icon: "none",
  173. title: error
  174. })
  175. })
  176. },
  177. openInvoiceByRecordIds(){
  178. uni.showLoading({
  179. mask:true,title:'加载中...'
  180. })
  181. API.openInvoiceByRecordIds({
  182. recordIds:this.ids
  183. }).then((response) => {
  184. uni.hideLoading();
  185. //this.list=response.data.data;
  186. this.invoiceType=response.data.invoiceType;
  187. this.totalPrice=response.data.totalPrice;
  188. }).catch(error => {
  189. uni.hideLoading();
  190. uni.showToast({
  191. icon: "none",
  192. title: error
  193. })
  194. })
  195. },
  196. }
  197. }
  198. </script>
  199. <style lang="scss" scoped>
  200. .cover {
  201. margin: 24rpx 32rpx;
  202. padding: 58rpx 32rpx;
  203. border-radius: 8px;
  204. position: relative;
  205. background: linear-gradient(90deg, rgba(49, 110, 207, 1) 2%, rgba(20, 73, 159, 1) 100%);
  206. .title {
  207. color: rgba(255, 255, 255, 1);
  208. font-size: 48rpx;
  209. font-weight: bold;
  210. }
  211. .image {
  212. width: 176rpx;
  213. height: 176rpx;
  214. position: absolute;
  215. right: 0;
  216. top: 0;
  217. .img {
  218. width: 100%;
  219. height: 100%;
  220. }
  221. }
  222. }
  223. // 详细信息
  224. .invoice-infos {
  225. background-color: #fff;
  226. border-radius: 8px;
  227. margin: 36rpx 32rpx;
  228. .item {
  229. display: flex;
  230. align-items: center;
  231. padding: 28rpx 32rpx;
  232. .title {
  233. color: rgba(119, 119, 119, 1);
  234. font-size: 32rpx;
  235. }
  236. .value {
  237. flex: 1;
  238. display: flex;
  239. justify-content: space-between;
  240. align-items: center;
  241. margin-left: 40rpx;
  242. /deep/.uni-radio-input {
  243. width: 32rpx;
  244. height: 32rpx;
  245. }
  246. /deep/.uni-input-placeholder {
  247. //color: rgba(16, 16, 16, 1);
  248. font-size: 32rpx;
  249. }
  250. .radio {
  251. margin-right: 16rpx;
  252. }
  253. .invoiceTypeClass{
  254. font-size: 32rpx;
  255. .invoiceTypeClassTextNo{
  256. color: rgba(119, 119, 119, 1);
  257. }
  258. }
  259. }
  260. .value2 {
  261. /deep/.uni-input-placeholder {
  262. //color: rgba(172, 172, 172, 1);
  263. font-size: 32rpx;
  264. }
  265. }
  266. .money {
  267. color: rgba(255, 61, 0, 1);
  268. }
  269. }
  270. }
  271. // 底部
  272. .bottom {
  273. position: fixed;
  274. bottom: 0;
  275. left: 0;
  276. right: 0;
  277. background-color: #fff;
  278. padding: 24rpx 32rpx;
  279. .btn {
  280. line-height: 80rpx;
  281. border-radius: 50px;
  282. background: linear-gradient(-88.46deg, rgba(34, 109, 198, 1) 2.59%, rgba(9, 158, 237, 1) 97.02%);
  283. color: rgba(255, 255, 255, 1);
  284. font-size: 36rpx;
  285. }
  286. }
  287. // 弹窗
  288. .modal {
  289. .headline {
  290. text-align: center;
  291. background: linear-gradient(90deg, rgba(49, 110, 207, 1) 2%, rgba(20, 73, 159, 1) 100%);
  292. color: #fff;
  293. padding: 32rpx 0;
  294. }
  295. .infos {
  296. padding: 40rpx 48rpx 26rpx;
  297. .item {
  298. display: flex;
  299. justify-content: space-between;
  300. margin-bottom: 24rpx;
  301. .title {
  302. color: rgba(119, 119, 119, 1);
  303. font-size: 32rpx;
  304. }
  305. .value {
  306. color: rgba(51, 51, 51, 1);
  307. font-size: 32rpx;
  308. }
  309. }
  310. }
  311. .hint{
  312. color: rgba(238,49,56,1);
  313. font-size: 28rpx
  314. }
  315. }
  316. </style>