|
@@ -133,16 +133,63 @@
|
|
|
</el-table>
|
|
|
<div class="footer" style="float: right;
|
|
|
margin-bottom:2px;">
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
+ <el-button type="success" @click="getContractFile">预览文件</el-button>
|
|
|
+ <el-button type="primary" @click="selectType">确定</el-button>
|
|
|
+ <el-button @click="cancel">取消</el-button>
|
|
|
</div>
|
|
|
+ <el-dialog
|
|
|
+ title="预览"
|
|
|
+ :visible.sync="pdfShowDialog"
|
|
|
+ width="30%">
|
|
|
+ <pdf-show :pdfFileList="pdfFileList">
|
|
|
+ </pdf-show>
|
|
|
+ </el-dialog>
|
|
|
+ <!--选择签署意愿类型-->
|
|
|
+ <el-dialog :visible.sync="confirmIsShow" width="600px" append-to-body :before-close = "cancelUpdate" center>
|
|
|
+ <el-form ref="updateForm" :disabled="false" :model="updateForm" v-if="confirmIsShow" label-width="150px" class="demo-form-inline" :inline="true">
|
|
|
+ <el-radio-group v-model="updateForm.radio">
|
|
|
+ <el-radio label="01">人脸</el-radio>
|
|
|
+ <el-radio label="02">短信</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="confirmSelect">确 定</el-button>
|
|
|
+ <el-button @click="cancelUpdate">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!--短信-->
|
|
|
+ <el-dialog :visible.sync="messageIsShow" width="600px" append-to-body :before-close = "cancelMessage" center>
|
|
|
+ <el-form ref="messageForm" :disabled="false" :model="messageForm" v-if="messageIsShow" label-width="150px" class="demo-form-inline" :inline="true">
|
|
|
+ <el-form-item label="验证码" prop="validCode">
|
|
|
+ <el-input v-model="messageForm.validCode" style="width: 200px" maxlength="6"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="success" @click="send">发送验证码</el-button>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="checkCode">确定</el-button>
|
|
|
+ <el-button @click="cancelMessage">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!--人脸二维码-->
|
|
|
+ <el-dialog :visible.sync="faceIsShow" width="500px" append-to-body :before-close = "cancelFace" center>
|
|
|
+ <img :src="'data:image/jpeg;base64,' + this.fileUrl" style="overflow: auto; width: 100%; height: 100%;"/>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import {getCreditDetail,getFile} from "@/api/service/credit/credit";
|
|
|
import {accAdd} from "@/utils/calculation";
|
|
|
+import {getContractFile} from "@/api/service/credit/creditHandle";
|
|
|
+import {sendMessage,checkCode,faceAuth,checkFaceAuth,contractSigning} from "@/api/service/credit/message";
|
|
|
+import pdfShow from "./pdfShow";
|
|
|
export default {
|
|
|
name: "addCredit",
|
|
|
- components: {},
|
|
|
+ components: {pdfShow},
|
|
|
data() {
|
|
|
return {
|
|
|
// 总条数
|
|
@@ -170,12 +217,36 @@ export default {
|
|
|
isShow:false,
|
|
|
//获取类型
|
|
|
createType:'',
|
|
|
+ //获取融信的类型
|
|
|
+ zfiStatus:'',
|
|
|
+ //融资方审批状态
|
|
|
+ zfiSupplierStatus:'',
|
|
|
//合同附件
|
|
|
contractFileList:[],
|
|
|
//发票附件
|
|
|
invoiceFileList:[],
|
|
|
//其他文件
|
|
|
- otherFileList:[]
|
|
|
+ otherFileList:[],
|
|
|
+ pdfShowDialog : false,
|
|
|
+ pdfFileList : [],
|
|
|
+ //展示选择意愿
|
|
|
+ confirmIsShow:false,
|
|
|
+ //意愿
|
|
|
+ updateForm:{},
|
|
|
+ //意愿类型
|
|
|
+ zfpAuthType:'',
|
|
|
+ //短信展示
|
|
|
+ messageIsShow:false,
|
|
|
+ //短信
|
|
|
+ messageForm:{validCode:""},
|
|
|
+ //人脸二维码
|
|
|
+ fileUrl:"",
|
|
|
+ //控制人脸二维码是否展示
|
|
|
+ faceIsShow:false,
|
|
|
+ //人脸验证结果
|
|
|
+ faceResult:"",
|
|
|
+ //人脸识别结果传参
|
|
|
+ authForm:{}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -184,7 +255,14 @@ export default {
|
|
|
if(response.data){
|
|
|
//融信信息
|
|
|
this.form = response.data.financeInf;
|
|
|
+ //类型
|
|
|
this.createType = response.data.financeInf.zfiCreateType;
|
|
|
+ //融信状态
|
|
|
+ this.zfiStatus = response.data.financeInf.zfiStatus;
|
|
|
+ //融资方审批状态
|
|
|
+ this.zfiSupplierStatus = response.data.financeInf.zfiSupplierStatus;
|
|
|
+ //意愿类型
|
|
|
+ this.zfpAuthType = response.data.zfpAuthType;
|
|
|
//核心开立
|
|
|
if(response.data.financeInf.zfiCreateType == '1'){
|
|
|
this.tableTitle = "应付账款";
|
|
@@ -343,7 +421,207 @@ export default {
|
|
|
chineseStr += cnInteger;
|
|
|
}
|
|
|
return chineseStr;
|
|
|
+ },
|
|
|
+ //取消选择意愿
|
|
|
+ cancelUpdate(){
|
|
|
+ this.confirmIsShow = false;
|
|
|
+ this.resetUpdate();
|
|
|
+ },
|
|
|
+ //关闭短信
|
|
|
+ cancelMessage(){
|
|
|
+ this.messageIsShow = false;
|
|
|
+ this.resetMessage();
|
|
|
+ },
|
|
|
+ //关闭二维码
|
|
|
+ cancelFace(){
|
|
|
+ this.faceIsShow = false;
|
|
|
+ },
|
|
|
+ resetUpdate() {
|
|
|
+ this.updateForm = {
|
|
|
+ radio:""
|
|
|
+ };
|
|
|
+ //意愿类型还原为全部
|
|
|
+ this.zfpAuthType ="00";
|
|
|
+ this.resetForm("updateForm");
|
|
|
+ },
|
|
|
+ resetMessage() {
|
|
|
+ this.messageForm = {
|
|
|
+ validCode:""
|
|
|
+ };
|
|
|
+ this.resetForm("messageForm");
|
|
|
+ },
|
|
|
+ //获取合同文件
|
|
|
+ getContractFile(){
|
|
|
+ getContractFile(this.form).then((response) => {
|
|
|
+ if(response.data.list){
|
|
|
+ this.pdfFileList = response.data.list;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //文件存在
|
|
|
+ if(this.pdfFileList.length > 0 ){
|
|
|
+ this.pdfShowDialog = true;
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //选择类型
|
|
|
+ selectType(){
|
|
|
+ //可以直接盖章的
|
|
|
+ if( (this.zfiCreateType =='0' && this.zfiStatus =='01' && this.zfiSupplierStatus =='01')
|
|
|
+ || (this.zfiCreateType =='1' && this.zfiStatus =='01' && this.zfiSupplierStatus =='01')){
|
|
|
+ //直接盖章
|
|
|
+ this.contractSigning();
|
|
|
+ }else{
|
|
|
+ //选择签署意愿
|
|
|
+ if(this.zfpAuthType == "00"){
|
|
|
+ this.confirmIsShow = true;
|
|
|
+ }else{
|
|
|
+ this.checking();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ //确认选择
|
|
|
+ confirmSelect(){
|
|
|
+ if(!this.updateForm.radio){
|
|
|
+ this.$message({
|
|
|
+ message: '请选择签署意愿类型',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.confirmIsShow = false;
|
|
|
+ this.zfpAuthType = this.updateForm.radio;
|
|
|
+ //调用人脸识别或者短信验证
|
|
|
+ this.checking();
|
|
|
+ },
|
|
|
+ //去签署
|
|
|
+ checking(){
|
|
|
+ //人脸
|
|
|
+ if(this.zfpAuthType == '01'){
|
|
|
+ //调用人脸识别生成二维码
|
|
|
+ faceAuth().then((response) => {
|
|
|
+ if(response.data){
|
|
|
+ //获取二维码
|
|
|
+ this.fileUrl = response.data.fileUrl;
|
|
|
+ //获取源流水号
|
|
|
+ var originalTxSN = response.data.originalTxSN;
|
|
|
+ this.faceIsShow = true;
|
|
|
+ //每5秒查证人脸识别结果
|
|
|
+ var timeInterval = window.setInterval(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ //源流水不为空并且结果为空
|
|
|
+ if(originalTxSN && !this.faceResult){
|
|
|
+ this.authForm.originalTxSN = originalTxSN;
|
|
|
+ //调用查证方法
|
|
|
+ checkFaceAuth(this.authForm).then((res) => {
|
|
|
+ //认证结果
|
|
|
+ this.faceResult = res.data.Verification;
|
|
|
+ //成功
|
|
|
+ if(this.faceResult == '20'){
|
|
|
+ this.msgSuccess("验证成功");
|
|
|
+ //关闭验证码
|
|
|
+ this.faceIsShow = false;
|
|
|
+ //关闭定时
|
|
|
+ window.clearInterval(timeInterval);
|
|
|
+ //调用盖章
|
|
|
+ this.contractSigning();
|
|
|
+ }else if(this.faceResult == '30'){
|
|
|
+ this.$message({
|
|
|
+ message: "验证失败",
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ //关闭验证码
|
|
|
+ this.faceIsShow = false;
|
|
|
+ window.clearInterval(timeInterval);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ },10000)
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }else if(this.zfpAuthType == '02'){//短信
|
|
|
+ this.messageIsShow = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ //发送短信验证码
|
|
|
+ send(){
|
|
|
+ //发送
|
|
|
+ sendMessage().then((response) => {
|
|
|
+ if(response.data){
|
|
|
+ //手机号
|
|
|
+ var newIphone = response.data.newIphone;
|
|
|
+ //结果
|
|
|
+ var result = response.data.result;
|
|
|
+ //成功
|
|
|
+ if("20" == result){
|
|
|
+ this.$message({
|
|
|
+ message: "已向经办人手机号为"+newIphone+"发送短信验证码,请注意查收",
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }else if("10" == result){//失败
|
|
|
+ this.$message({
|
|
|
+ message: "短信发送失败",
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ //校验验证码是否正确
|
|
|
+ checkCode(){
|
|
|
+ if(!this.messageForm.validCode){
|
|
|
+ this.$message({
|
|
|
+ message: "请输入验证码",
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //校验验证码
|
|
|
+ checkCode(this.messageForm).then((response) => {
|
|
|
+ if(response.data){
|
|
|
+ //结果
|
|
|
+ var verification = response.data.verification;
|
|
|
+ //匹配
|
|
|
+ if("20" == verification){
|
|
|
+ //进行下一步-- 盖章
|
|
|
+ this.contractSigning();
|
|
|
+ }else if("30" == verification){//不匹配
|
|
|
+ this.$message({
|
|
|
+ message: "验证有误,请重新输入",
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //盖章
|
|
|
+ contractSigning(){
|
|
|
+ contractSigning(this.form).then((response) => {
|
|
|
+ this.msgSuccess("盖章成功");
|
|
|
+ if(this.zfpAuthType == '02'){
|
|
|
+ //关闭短信验证
|
|
|
+ this.messageIsShow = false;
|
|
|
+ }else if(this.zfpAuthType == '01'){
|
|
|
+ //关闭人脸二维码
|
|
|
+ this.faceIsShow = false;
|
|
|
+ }
|
|
|
+ this.$store.dispatch(
|
|
|
+ "tagsView/delView",
|
|
|
+ this.$route
|
|
|
+ );
|
|
|
+ this.$router.go(-1);
|
|
|
+ }).catch((response) => {
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
};
|