Commit c21f1419 authored by 许珑标's avatar 许珑标

一键开票

parent 548efe1b
......@@ -84,7 +84,6 @@ export function updateInvoiceStatus(data) {
})
}
// 通过外部付款卡号获取销售方开票信息
export function getSellerInvoiceInfo(cardNo) {
return request({
......@@ -92,3 +91,34 @@ export function getSellerInvoiceInfo(cardNo) {
method: 'get',
})
}
// 一键开票
export function onlineInvoicing(data) {
return request({
url: '/business/invoiceApply/onlineGen',
method: 'post',
data: data
})
}
//获取人脸登录二维码
export function getFaceLoginCode(query) {
console.log('获取人脸登录二维码:', query)
return request({
url: '/business/invoiceApply/getFaceLoginQrCode',
method: 'get',
params: query
})
}
// 获取人脸识别登录结果
export function getFaceLoginStatus(query) {
console.log('获取人脸识别登录结果:', query)
return request({
url: '/business/invoiceApply/getFaceLoginStatus',
method: 'get',
params: query
})
}
......@@ -434,17 +434,46 @@
</span>
</el-dialog>
<!-- 一键发票对话框 -->
<el-dialog title="上传发票" :visible.sync="onlineInvoiceForm.panel">
<el-dialog title="自助开票" :visible.sync="onlineInvoiceForm.panel">
<el-form :model="onlineInvoiceForm" ref="onlineInvoiceForm" size="small" label-width="100px">
<el-select v-model="onlineInvoiceForm.taxpayerId" placeholder="请选择开票员" clearable>
<el-option v-for="item in taxpayerList" :key="item.loginUserIdCard" :label="item.loginName" :value="item.id" />
</el-select>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="uploadInvoiceFile">确 定</el-button>
<el-button type="primary" @click="onlineGen">确 定</el-button>
<el-button @click="onlineInvoiceForm.panel = false">取 消</el-button>
</span>
</el-dialog>
<el-dialog title="人脸识别二维码" :visible.sync="faceCodeForm.panel" width="30%">
<el-tabs value="first" @tab-click="codeCheckClick">
<el-tab-pane label="个人所得税App" name="first">
<el-span>请打开个人所得税App扫码进行人脸验证,验证完成后请点按下方按钮。</el-span>
<el-image style="width:100%" :src="faceCodeForm.faceQRCode" fit="fill"/>
<el-row>
<el-col :span="14" style="text-align: right;">
<el-button type="success" round @click="refreshThisPage()">我已完成</el-button>
</el-col>
<el-col :span="10" style="text-align: right;">
<el-button type="primary" icon="el-icon-refresh-right" @click="getFaceLoginCode()" circle></el-button>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="当地电子税局App" name="second">
<el-span>请打开当地电子税局App扫码进行人脸验证,验证完成后请点按下方按钮。</el-span>
<el-image style="width:100%" :src="faceCodeForm.faceQRCode" fit="fill"/>
<el-row>
<el-col :span="14" style="text-align: right;">
<el-button type="success" round @click="refreshThisPage()">我已完成</el-button>
</el-col>
<el-col :span="10" style="text-align: right;">
<el-button type="primary" icon="el-icon-refresh-right" @click="getFaceLoginCode()" circle></el-button>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
</el-dialog>
</div>
</template>
......@@ -455,7 +484,7 @@ import {
delInvoiceApply,
addInvoiceApply,
updateInvoiceApply,
uploadInvoiceFile, updateInvoiceStatus, getInvoiceApplyDetail
uploadInvoiceFile, updateInvoiceStatus, getInvoiceApplyDetail, onlineInvoicing, getFaceLoginCode, getFaceLoginStatus
} from '@/api/business/invoiceApply'
import { listCompanyInfo } from '@/api/business/companyInfo'
import fa from 'element-ui/src/locale/lang/fa'
......@@ -472,11 +501,20 @@ export default {
dicts: ['invoice_status', 'tax_invoice_type'],
data() {
return {
// 人脸识别弹窗表单
faceCodeForm: {
panel: false,
faceQRCode: null,
},
// 一键开票
onlineInvoiceForm: {
panel: false,
taxpayerId: ''
taxpayerId: null,
invoiceApplyId: null,
smsCode: null,
verifyAppType: null
},
verifyAppType: 2,
//上传发票
applyInvoiceId: null,
viewInvoiceFileOpen : false,
......@@ -851,7 +889,100 @@ export default {
this.taxpayerList = resp.data
}
})
this.onlineInvoiceForm.panel = true
this.onlineInvoiceForm = {
panel: true,
taxpayerId: null,
invoiceApplyId: row.id,
smsCode: null,
verifyAppType: null
}
},
onlineGen() {
this.$prompt('请输入返回值', '操作提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({ value }) => {
let testData = {
code: value
}
this.invoicingAfter(testData)
})
// onlineInvoicing(this.onlineInvoiceForm).then(resp => {
// if (200 === resp.code) {
// this.invoicingAfter(resp.data)
// }
// })
},
invoicingAfter(data) {
let code = data.code
if (code == 200) {
this.$modal.msgSuccess('开具成功')
this.getList()
} else if (code == 202) {
this.$modal.msgWarning('本次开票需要进行人脸识别验证。')
this.faceCodeForm = {
faceQRCode: data.base64,
panel: true
}
} else if (code == 201) {
this.$modal.msgWarning('本次开票需要短信验证')
this.$prompt('请输入短信验证码', '操作提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({ value }) => {
// todo 重新发起
this.onlineInvoiceForm.smsCode = value
// this.onlineGen()
this.$message({
type: 'success',
message: '你输入的短信验证码是: ' + value
});
console.log('一键开票请求参数:', this.onlineInvoiceForm)
})
} else if (code == 500) {
this.$modal.msgError(data.msg)
}
},
// 获取新的扫脸二维码
getFaceLoginCode(fn) {
const loading = this.$loading({
lock: true,
text: '正在获取中请稍等...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
let params = {
verifyAppType: this.verifyAppType,
taxpayerId: this.onlineInvoiceForm.taxpayerId
}
getFaceLoginCode(params).then(res => {
if (res.code == 200) {
if (fn && typeof fn === 'function') {
fn()
}
this.faceCodeForm.faceQRCode = res.data;
}
}).finally(() => {
loading.close()
})
},
// 查询人脸识别状态
refreshThisPage() {
getFaceLoginStatus({
taxpayerId: this.onlineInvoiceForm.taxpayerId
}).then(res => {
if (res.data) {
this.faceCodeForm.panel = false;
this.$modal.msgSuccess('验证成功')
} else {
this.$alert('查询人脸识别结果为失败,请刷新二维码后重新操作', '操作提示', {
});
}
})
},
codeCheckClick(tab) {
this.verifyAppType = tab.name === "second" ? 1 : 2 //1:电子税局 App(当地使用的) 2:个人所得税 App
this.getFaceLoginCode();
},
},
};
......
......@@ -70,11 +70,11 @@
<el-table-column label="登录账号" align="center" prop="loginAccount" />
<el-table-column label="身份证号" align="center" prop="loginUserIdCard" />
<el-table-column label="联系方式" align="center" prop="loginUserMobile" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.taxpayer_status" :value="scope.row.status" />
</template>
</el-table-column>
<!-- <el-table-column label="状态" align="center" prop="status">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.taxpayer_status" :value="scope.row.status" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -83,13 +83,13 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-s-check"
@click="doAuth(scope.row)"
v-if="scope.row.status === 'saved'"
>认证</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-s-check"-->
<!-- @click="doAuth(scope.row)"-->
<!-- v-if="scope.row.status === 'saved'"-->
<!-- >认证</el-button>-->
<el-button
size="mini"
type="text"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment