123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- <template>
- <view>
- <ujp-navbar title="开具发票">
- <text class="explain" @click="gotoUrl('pages/article/details?code=KPSM')">开票说明</text>
- </ujp-navbar>
- <view class="invioice-info">
- <p class="title">发票信息</p>
- <u-cell-group>
- <u-cell-item title="发票金额" :arrow="false"> <text style="color:#ff3d00;">{{obj.totalPrice.toFixed(2)}}元</text></u-cell-item>
- <u-cell-item title="抬头类型" :arrow="false">
- <view v-if="!selectObj.title">请选择发票</view>
- <view v-else-if="selectObj.headerType==1">企业单位</view>
- <view v-else-if="selectObj.headerType==2">个人/非企业单位</view>
- </u-cell-item>
- <u-cell-item title="发票抬头" @click="gotoUrl('pages/MyInvoice/invoiceTitleManagement?invoice=1&uuid='+uuid)" :value="selectObj.title?selectObj.title:'请选择发票抬头'"></u-cell-item>
- <u-cell-item title="公司税号" :value="selectObj.title?(selectObj.companyTaxNo?selectObj.companyTaxNo:'--'):'自动读取对应抬头的公司税号'" :arrow="false"></u-cell-item>
- </u-cell-group>
- </view>
- <!-- 弹窗 -->
- <view class="modal">
- <u-modal v-model="show" :show-title="false" @confirm="confirm"
- :show-cancel-button="true" confirm-text="确认开具" cancel-text="返回修改">
- <view class="title">
- 发票开具成功后不可撤销
- 请您仔细核对开票信息
- </view>
- <view class="infos">
- <view class="item">
- <view class="name">
- 发票项目
- </view>
- <view class="content">
- 充电费发票
- </view>
- </view>
- <view class="item">
- <view class="name">
- 发票抬头
- </view>
- <view class="content">
- {{selectObj.title}}
- </view>
- </view>
- <view class="item">
- <view class="name">
- 公司税号
- </view>
- <view class="content">
- {{selectObj.companyTaxNo}}
- </view>
- </view>
- <view class="item">
- <view class="name">
- 发票金额
- </view>
- <view class="content">
- {{obj.totalPrice.toFixed(2)}}元
- </view>
- </view>
- <view class="hint">
- 发票开具后,可开票额度将按照实际开票金额相应扣减
- </view>
- </view>
- </u-modal>
-
- </view>
- <u-button class="submit" type="success" @click="open" shape="circle">提交</u-button>
- </view>
- </template>
- <script>
- import * as API from '@/apis/invoiceApi.js'
-
- export default {
- data() {
- return {
- ids:"",
- uuid:"",
- list: [{
- name: '企业单位',
- disabled: false
- },
- {
- name: '个人/非企业单位',
- disabled: false
- },
- ],
- value: '企业单位',
- show: false,
- selectObj:{},
- obj:{},
-
- };
- },
- onShow() {
- this.getInfo()
-
- },
- onLoad(op) {
-
- if(op.ids){
- this.ids=op.ids;
- //this.getInfo()
- }
- },
-
- methods: {
- confirm(){
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- API.saveInvoice({
- recordIds:this.ids,
- invoiceTypeId:this.selectObj.id
- }).then((res) => {
-
-
-
- uni.hideLoading()
- uni.redirectTo({
- url:"/pages/MyInvoice/invioceResult"
- })
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- getInfo(){
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- API.invoiceTypeDefalut({
- recordIds:this.ids
- }).then((res) => {
- uni.hideLoading()
- this.selectObj=res.data.invoiceType
- if(!res.data.invoiceType){
- this.selectObj={}
- this.uuid=new Date().getTime();
- }else{
-
- var obj=this.carhelp.get("issueInvoice");
- if(obj){
- if(obj.uuid==this.uuid){
- if(obj.selectObj.id){
- this.selectObj=obj.selectObj;
- }
-
- }
- }
- }
- this.selectObj.totalPrice=res.data.totalPrice;
- this.obj=res.data
-
-
- this.uuid=new Date().getTime();
- this.carhelp.set("issueInvoice",{
- uuid:this.uuid,
- selectObj:this.selectObj
- })
-
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- // 选中某个单选框时,由radio时触发
- radioChange(e) {
- // console.log(e);
- },
- // 选中任一radio时,由radio-group触发
- radioGroupChange(e) {
- // console.log(e);
- },
- open() {
-
- if(this.selectObj.id){
- this.show = true;
- }
- else{
- uni.showToast({
- title:"请选择发票"
- })
- }
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- background-color: #fff;
- }
- .explain {
- position: absolute;
- right: 16px;
- color: rgba(51, 51, 51, 100);
- font-size: 12px
- }
- .invioice-info {
- padding: 20px 16px;
- .title {
- font-size: 16px;
- color: #101010;
- margin-bottom: 16px;
- }
- }
- ::v-deep.u-cell__value {
- text-align: left;
- margin-left: 41px;
- font-size: 16px
- }
- ::v-deep.u-cell {
- padding: 16px 0;
- }
- .submit {
- width: 91.4%;
- margin: 12px auto;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- }
- // 弹窗
- .modal {
- background-color: #101010;
- .title {
- line-height: 20px;
- padding: 18px 52px;
- background-image: linear-gradient(rgb(0, 217, 115), #00A457);
- color: #fff;
- text-align: center;
- }
- .infos {
- padding: 20px 14px;
- .item {
- line-height: 28px;
- display: flex;
- justify-content: space-between;
- color: #666666;
- font-size: 16px
- }
- .hint {
- color: rgba(238, 49, 56, 100);
- margin-top: 16px;
- font-size: 14px
- }
- }
- }
- </style>
|