creditSeal.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  1. <template>
  2. <div class="app-container">
  3. <el-form ref="form" :model="form" disabled :rules="rules" :inline="true" style="margin-top: 20px" label-width="auto" >
  4. <el-row>
  5. <el-col :span="8">
  6. <el-form-item label="融信编号" prop="zfiNumber">
  7. <el-input v-model="form.zfiNumber" style="width: 200px"/>
  8. </el-form-item>
  9. </el-col>
  10. <el-col :span="8">
  11. <el-form-item label="创建时间" prop="createTime">
  12. <el-date-picker disabled size="small" style="width: 200px" v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
  13. </el-date-picker>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="8">
  17. <el-form-item label="创建人" prop="createName">
  18. <el-input v-model="form.createName" style="width: 200px"/>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="8">
  22. <el-form-item label="开立方" prop="openName">
  23. <el-input v-model="form.openName" style="width: 200px"/>
  24. </el-form-item>
  25. </el-col>
  26. <el-col :span="8">
  27. <el-form-item label="接收方" prop="receiveName">
  28. <el-input v-model="form.receiveName" style="width: 200px"/>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="8">
  32. <el-form-item label="授信额度" prop="zfpName" >
  33. <el-input v-model="form.zfpName" style="width: 200px"/>
  34. </el-form-item>
  35. </el-col>
  36. </el-row>
  37. <el-row>
  38. <el-col :span="8">
  39. <el-form-item label="签发有效期" prop="zfiEffectiveDate">
  40. <el-date-picker disabled size="small" style="width: 200px" v-model="form.zfiEffectiveDate" type="date" value-format="yyyy-MM-dd">
  41. </el-date-picker>
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="8">
  45. <el-form-item label="承诺还款日" prop="zfiExpireDate" >
  46. <el-date-picker disabled size="small" style="width: 200px" v-model="form.zfiExpireDate" type="date" value-format="yyyy-MM-dd">
  47. </el-date-picker>
  48. </el-form-item>
  49. </el-col>
  50. <!-- <el-col :span="8">
  51. <el-form-item label="收款账号" prop="zfiCollectionAccount" v-if="isShow">
  52. <el-input v-model="form.zfiCollectionAccount" style="width: 200px"/>
  53. </el-form-item>
  54. </el-col> -->
  55. </el-row>
  56. <el-divider content-position="left" >{{tableTitle}}</el-divider>
  57. <el-form-item style="margin-left: 100px">
  58. <el-form-item label="合计金额:">
  59. <span>{{checkTotalAmt}}</span>
  60. </el-form-item>
  61. <el-form-item label="金额大写:">
  62. <span>{{checkTotalBigAmt}}</span>
  63. </el-form-item>
  64. <el-table :data="payList" style="width: 1100px">
  65. <el-table-column label="账款名称" align="center" prop="zbiName" show-overflow-tooltip />
  66. <el-table-column label="应收企业" align="center" prop="receiveName"/>
  67. <el-table-column label="应付企业" align="center" prop="payName" />
  68. <el-table-column label="预计还款期" align="center" prop="zbiPayDate" show-overflow-tooltip />
  69. <el-table-column label="金额" align="center" prop="zbiAmount" />
  70. </el-table>
  71. </el-form-item>
  72. <el-row>
  73. <el-col :span="8">
  74. <el-form-item label="签发金额" prop="zfiAmount">
  75. <el-input v-model="form.zfiAmount" style="width: 200px"/>
  76. </el-form-item>
  77. </el-col>
  78. </el-row>
  79. <el-row>
  80. <el-col :span="8">
  81. <el-form-item label="金额大写" prop="issuedAmount">
  82. {{issuedAmount}}
  83. </el-form-item>
  84. </el-col>
  85. </el-row>
  86. </el-form>
  87. <!-- 发票附件 -->
  88. <el-divider content-position="left">发票附件</el-divider>
  89. <el-table :data="invoiceFileList" style="width: 100%">
  90. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  91. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  92. <template slot-scope="scope">
  93. <el-button
  94. size="mini"
  95. type="text"
  96. icon="el-icon-view"
  97. @click="handleDownload(scope.row)"
  98. >下载</el-button>
  99. <el-button
  100. size="mini"
  101. type="text"
  102. icon="el-icon-view"
  103. @click="handlePreview(scope.row)"
  104. >预览</el-button>
  105. </template>
  106. </el-table-column>
  107. </el-table>
  108. <!-- 合同附件 -->
  109. <el-divider content-position="left">合同附件</el-divider>
  110. <el-table :data="contractFileList" style="width: 100%">
  111. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  112. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  113. <template slot-scope="scope">
  114. <el-button
  115. size="mini"
  116. type="text"
  117. icon="el-icon-view"
  118. @click="handleDownload(scope.row)"
  119. >下载</el-button>
  120. <el-button
  121. size="mini"
  122. type="text"
  123. icon="el-icon-view"
  124. @click="handlePreview(scope.row)"
  125. >预览</el-button>
  126. </template>
  127. </el-table-column>
  128. </el-table>
  129. <!-- 其他附件 -->
  130. <el-divider content-position="left">其他附件</el-divider>
  131. <el-table :data="otherFileList" style="width: 100%">
  132. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  133. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  134. <template slot-scope="scope">
  135. <el-button
  136. size="mini"
  137. type="text"
  138. icon="el-icon-view"
  139. @click="handleDownload(scope.row)"
  140. >下载</el-button>
  141. <el-button
  142. size="mini"
  143. type="text"
  144. icon="el-icon-view"
  145. @click="handlePreview(scope.row)"
  146. >预览</el-button>
  147. </template>
  148. </el-table-column>
  149. </el-table>
  150. <el-divider content-position="left">盖章附件</el-divider>
  151. <el-row>
  152. <img style="width:50px;height:50px;"
  153. :key="dict.pfiFileId"
  154. src="../../../assets/images/pdf.png"
  155. v-for="dict in creditSealList"
  156. @click="handlePreview(dict)"
  157. :title="dict.pfiFileName"
  158. >
  159. </el-row>
  160. <div class="footer" style="float: right;
  161. margin-bottom:2px;">
  162. <el-button type="success" @click="getContractFile">预览文件</el-button>
  163. <el-button type="info" @click="refuse">拒签</el-button>
  164. <el-button type="primary" @click="selectType">盖章</el-button>
  165. <el-button @click="cancel">取消</el-button>
  166. </div>
  167. <el-dialog
  168. title="预览"
  169. :visible.sync="pdfShowDialog"
  170. width="30%">
  171. <pdf-show :pdfFileList="pdfFileList">
  172. </pdf-show>
  173. </el-dialog>
  174. <!--选择签署意愿类型-->
  175. <el-dialog :visible.sync="confirmIsShow" width="600px" append-to-body :before-close = "cancelUpdate" center>
  176. <el-form ref="updateForm" :disabled="false" :model="updateForm" v-if="confirmIsShow" label-width="150px" class="demo-form-inline" :inline="true">
  177. <el-radio-group v-model="updateForm.radio">
  178. <el-radio label="01">人脸</el-radio>
  179. <el-radio label="02">短信</el-radio>
  180. </el-radio-group>
  181. </el-form>
  182. <div slot="footer" class="dialog-footer">
  183. <el-button type="primary" @click="confirmSelect">确 定</el-button>
  184. <el-button @click="cancelUpdate">取 消</el-button>
  185. </div>
  186. </el-dialog>
  187. <!--短信-->
  188. <el-dialog :visible.sync="messageIsShow" width="800px" append-to-body :before-close = "cancelMessage" center>
  189. <el-form ref="messageForm" :disabled="false" :model="messageForm" v-if="messageIsShow" label-width="150px" class="demo-form-inline" :inline="true" @submit.native.prevent>
  190. <el-form-item label="验证码" prop="validCode">
  191. <el-input v-model="messageForm.validCode" style="width: 200px" maxlength="6"/>
  192. </el-form-item>
  193. <el-form-item>
  194. <el-button v-show="messShow" type="success" @click="send">点击获取验证码</el-button>
  195. <el-button v-show="!messShow" type="success" disabled><span>{{timer}}</span>秒后重新获取</el-button>
  196. </el-form-item>
  197. </el-form>
  198. <div slot="footer" class="dialog-footer">
  199. <el-button type="primary" @click="checkCode">确定</el-button>
  200. <el-button @click="cancelMessage">取 消</el-button>
  201. </div>
  202. </el-dialog>
  203. <!--人脸二维码-->
  204. <el-dialog :visible.sync="faceIsShow" width="500px" append-to-body :before-close = "cancelFace" center>
  205. <img :src="'data:image/jpeg;base64,' + this.fileUrl" style="overflow: auto; width: 100%; height: 100%;"/>
  206. </el-dialog>
  207. <!--预览-->
  208. <el-dialog :visible.sync="openFile" width="1000px" append-to-body>
  209. <img :src="wordUrl" v-if="show" width='450px' height='500px'/>
  210. <iframe :src="wordUrl" width='800px' height='600px' frameborder='1' v-if="heid"/>
  211. </el-dialog>
  212. </div>
  213. </template>
  214. <script>
  215. import {getCreditDetail,getFile} from "@/api/service/credit/credit";
  216. import {accAdd} from "@/utils/calculation";
  217. import {getContractFile,sealRefuse,getCreditSealFile} from "@/api/service/credit/creditHandle";
  218. import {sendMessage,checkCode,faceAuth,checkFaceAuth,contractSigning} from "@/api/service/credit/message";
  219. import pdfShow from "./pdfShow";
  220. import {getToken} from "@/utils/auth";
  221. export default {
  222. name: "CreditSeal",
  223. components: {pdfShow},
  224. data() {
  225. return {
  226. // 总条数
  227. total: 0,
  228. // 表单参数
  229. form: {
  230. },
  231. // 表单校验
  232. rules: {
  233. },
  234. // 是否显示弹出层
  235. open: false,
  236. //应付账款
  237. payList:[],
  238. //签发金额大写
  239. issuedAmount:"零元整",
  240. //合计选中的应付账款的金额
  241. checkTotalAmt:"0.00",
  242. //合计选中的应付账款的大写金额
  243. checkTotalBigAmt:"零元整",
  244. //标题
  245. tableTitle:"",
  246. //控制收款账号是否显示
  247. isShow:false,
  248. //获取类型
  249. createType:'',
  250. //合同附件
  251. contractFileList:[],
  252. //发票附件
  253. invoiceFileList:[],
  254. //其他文件
  255. otherFileList:[],
  256. pdfShowDialog : false,
  257. pdfFileList : [],
  258. //展示选择意愿
  259. confirmIsShow:false,
  260. //意愿
  261. updateForm:{},
  262. //意愿类型
  263. zfpAuthTypeInit:'',
  264. zfpAuthType:'',
  265. //短信展示
  266. messageIsShow:false,
  267. //短信
  268. messageForm:{validCode:""},
  269. //人脸二维码
  270. fileUrl:"",
  271. //控制人脸二维码是否展示
  272. faceIsShow:false,
  273. //人脸验证结果
  274. faceResult:"",
  275. //人脸识别结果传参
  276. authForm:{},
  277. //控制短信验证码倒计时是否展示
  278. messShow:true,
  279. timer:60,
  280. openFile:false,
  281. wordUrl: "",
  282. show:false,
  283. heid:false,
  284. auth_timer : null,
  285. //融资方审批状态
  286. zfiSupplierStatus:'',
  287. //核心审批状态
  288. zfiCoreStatus:'',
  289. //平台审批状态
  290. zfiPlatformStatus:'',
  291. //融信状态
  292. zfiStatus:'',
  293. //盖章文件
  294. creditSealList:[]
  295. };
  296. },
  297. activated() {
  298. const zfiId = this.$route.params && this.$route.params.zfiId;
  299. getCreditDetail(zfiId).then((response) => {
  300. if(response.data){
  301. //融信信息
  302. this.form = response.data.financeInf;
  303. //类型
  304. this.createType = response.data.financeInf.zfiCreateType;
  305. //融信状态
  306. this.zfiStatus = response.data.financeInf.zfiStatus;
  307. //融资方审批状态
  308. this.zfiSupplierStatus = response.data.financeInf.zfiSupplierStatus;
  309. //平台审批状态
  310. this.zfiPlatformStatus = response.data.financeInf.zfiPlatformStatus;
  311. //核心审批状态
  312. this.zfiCoreStatus = response.data.financeInf.zfiCoreStatus;
  313. //意愿类型
  314. this.zfpAuthType = response.data.zfpAuthType;
  315. this.zfpAuthTypeInit = response.data.zfpAuthType;
  316. //核心开立
  317. if(response.data.financeInf.zfiCreateType == '1'){
  318. this.tableTitle = "应付账款";
  319. }else{
  320. this.tableTitle = "应收账款";
  321. //融资开立
  322. if(response.data.financeInf.zfiCreateType == '2'){
  323. //收款账号
  324. //非电子
  325. if(response.data.proComRel.zfpcrLoanType != '0'){
  326. this.isShow = true;
  327. }
  328. }
  329. }
  330. //接收方
  331. this.form.receiveName = response.data.receiveName;
  332. //授信额度
  333. this.form.zfpName = response.data.zfpName;
  334. //开立方
  335. this.form.openName = response.data.openName;
  336. //创建人
  337. this.form.createName = response.data.createName;
  338. //签发金额大写
  339. this.issuedAmount = this.smallToBig(this.form.zfiAmount);
  340. }
  341. if(response.data.payList){
  342. this.payList = response.data.payList.records;
  343. this.getReTotal(this.payList);
  344. //附件
  345. this.getFile(this.payList);
  346. }
  347. this.getCreditSealFile();
  348. })
  349. },
  350. methods: {
  351. // 取消按钮
  352. cancel() {
  353. this.$store.dispatch("tagsView/delView", this.$route);
  354. this.$router.go(-1);
  355. },
  356. /* 多选框跨页 */
  357. rowkeyCustomer(row) {
  358. return row.cciId;
  359. },
  360. //重新合计
  361. getReTotal(chooseTicket){
  362. //合计
  363. this.checkTotalAmt = "0.00";
  364. for(var i = 0; i < chooseTicket.length;i++){
  365. this.checkTotalAmt = accAdd(this.checkTotalAmt,chooseTicket[i].zbiAmount,2);
  366. }
  367. this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
  368. this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
  369. },
  370. //获取附件信息
  371. getFile(datas){
  372. var queryParamsFile = {};
  373. queryParamsFile.ticketList = datas;
  374. getFile(queryParamsFile).then((response) => {
  375. if(response.data){
  376. //获取发票文件
  377. this.invoiceFileList = response.data.invoiceFileList;
  378. //获取合同文件
  379. this.contractFileList = response.data.contractFileList;
  380. //获取其他文件
  381. this.otherFileList = response.data.otherFileList;
  382. }
  383. });
  384. },
  385. //格式化金额
  386. amtFormat(cellValue) {
  387. if(cellValue == null || cellValue== undefined || cellValue == ''){
  388. cellValue = '0.00'
  389. }
  390. cellValue += '';
  391.       if (!cellValue.includes('.')) {
  392. cellValue += '.00';
  393. }
  394.       return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
  395.         return $1 + ',';
  396.       }).replace(/\.$/, '');
  397. },
  398. /* // 将数字金额转换为大写金额 */
  399. smallToBig(money) {
  400. // 将数字金额转换为大写金额
  401. var cnNums = new Array(
  402. "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ); //汉字的数字
  403. var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
  404. var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
  405. var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
  406. var cnInteger = "整"; //整数金额时后面跟的字符
  407. var cnIntLast = "元"; //整数完以后的单位
  408. //最大处理的数字
  409. var maxNum = 999999999999999.9999;
  410. var integerNum; //金额整数部分
  411. var decimalNum; //金额小数部分
  412. //输出的中文金额字符串
  413. var chineseStr = "";
  414. var parts; //分离金额后用的数组,预定义
  415. if (money == "" || money == null || money == undefined) {
  416. return "零元零角零分";
  417. }
  418. money = parseFloat(money);
  419. if (money >= maxNum) {
  420. //超出最大处理数字
  421. return "超出最大处理数字";
  422. }
  423. if (money == 0) {
  424. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  425. return chineseStr;
  426. }
  427. //四舍五入保留两位小数,转换为字符串
  428. money = Math.round(money * 100).toString();
  429. integerNum = money.substr(0, money.length - 2);
  430. decimalNum = money.substr(money.length - 2);
  431. //获取整型部分转换
  432. if (parseInt(integerNum, 10) > 0) {
  433. var zeroCount = 0;
  434. var IntLen = integerNum.length;
  435. for (var i = 0; i < IntLen; i++) {
  436. var n = integerNum.substr(i, 1);
  437. var p = IntLen - i - 1;
  438. var q = p / 4;
  439. var m = p % 4;
  440. if (n == "0") {
  441. zeroCount++;
  442. } else {
  443. if (zeroCount > 0) {
  444. chineseStr += cnNums[0];
  445. }
  446. //归零
  447. zeroCount = 0;
  448. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  449. }
  450. if (m == 0 && zeroCount < 4) {
  451. chineseStr += cnIntUnits[q];
  452. }
  453. }
  454. chineseStr += cnIntLast;
  455. }
  456. //小数部分
  457. if (decimalNum != "") {
  458. var decLen = decimalNum.length;
  459. for (var i = 0; i < decLen; i++) {
  460. var n = decimalNum.substr(i, 1);
  461. if (n != "0") {
  462. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  463. }
  464. }
  465. }
  466. if (chineseStr == "") {
  467. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  468. } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
  469. chineseStr += cnInteger;
  470. }
  471. return chineseStr;
  472. },
  473. //取消选择意愿
  474. cancelUpdate(){
  475. this.confirmIsShow = false;
  476. this.resetUpdate();
  477. },
  478. //关闭短信
  479. cancelMessage(){
  480. this.messageIsShow = false;
  481. this.resetMessage();
  482. },
  483. //关闭二维码
  484. cancelFace(){
  485. this.faceIsShow = false;
  486. },
  487. resetUpdate() {
  488. this.updateForm = {
  489. radio:""
  490. };
  491. //意愿类型还原为全部
  492. this.zfpAuthType = this.zfpAuthTypeInit;
  493. this.resetForm("updateForm");
  494. this.messShow = true;
  495. clearInterval(this.auth_timer);
  496. this.timer = 60;
  497. },
  498. resetMessage() {
  499. this.messageForm = {
  500. validCode:""
  501. };
  502. this.resetForm("messageForm");
  503. },
  504. //获取合同文件
  505. getContractFile(){
  506. getContractFile(this.form).then((response) => {
  507. if(response.data.list){
  508. this.pdfFileList = response.data.list;
  509. }
  510. //文件存在
  511. if(this.pdfFileList.length > 0 ){
  512. this.pdfShowDialog = true;
  513. }
  514. });
  515. },
  516. //选择类型
  517. selectType(){
  518. this.resetUpdate();
  519. /**
  520. * 申请确权:融资审批通过+核心通过+平台通过+融信待确权||
  521. * 核心开立:核心审批通过+其余状态为空
  522. * 融资开立:融资通过+平台通过+其余状态为空
  523. *
  524. */
  525. //调用人脸
  526. if( (this.zfiSupplierStatus == '01' && this.zfiCoreStatus == '01' && this.zfiPlatformStatus == '01' && this.zfiStatus == '00') ||
  527. (this.zfiCoreStatus == '01' && (this.zfiSupplierStatus == '' || this.zfiSupplierStatus == null || this.zfiSupplierStatus == 'null') && (this.zfiPlatformStatus == '' || this.zfiPlatformStatus == null || this.zfiPlatformStatus == 'null') && (this.zfiStatus == '' || this.zfiStatus == null || this.zfiStatus == 'null'))||
  528. (this.zfiSupplierStatus == '01' && this.zfiPlatformStatus == '01' && (this.zfiCoreStatus == '' || this.zfiCoreStatus == null || this.zfiCoreStatus == 'null') && (this.zfiStatus == '' || this.zfiStatus == null || this.zfiStatus == 'null'))){
  529. //选择签署意愿
  530. if(this.zfpAuthType == "00"){
  531. this.confirmIsShow = true;
  532. }else{
  533. this.checking();
  534. }
  535. }else{
  536. //直接盖章
  537. this.contractSigning();
  538. }
  539. },
  540. //文件下载
  541. handleDownload(row){
  542. const pfiUrl = row.pfiUrl;
  543. if(pfiUrl != null && pfiUrl != ''){
  544. window.open(pfiUrl +"/"+ getToken());
  545. }else{
  546. this.$message({
  547. message: '该附件不存在!',
  548. type: 'warning'
  549. });
  550. return;
  551. }
  552. },
  553. //确认选择
  554. confirmSelect(){
  555. if(!this.updateForm.radio){
  556. this.$message({
  557. message: '请选择签署意愿类型',
  558. type: 'warning'
  559. });
  560. return;
  561. }
  562. this.confirmIsShow = false;
  563. this.zfpAuthType = this.updateForm.radio;
  564. //调用人脸识别或者短信验证
  565. this.checking();
  566. },
  567. //去签署
  568. checking(){
  569. //人脸
  570. if(this.zfpAuthType == '01'){
  571. //调用人脸识别生成二维码
  572. faceAuth().then((response) => {
  573. if(response.data){
  574. //获取二维码
  575. this.fileUrl = response.data.fileUrl;
  576. //获取源流水号
  577. var originalTxSN = response.data.originalTxSN;
  578. this.faceIsShow = true;
  579. //每5秒查证人脸识别结果
  580. var timeInterval = window.setInterval(() => {
  581. setTimeout(() => {
  582. //源流水不为空并且结果为空
  583. if(originalTxSN && !this.faceResult){
  584. this.authForm.originalTxSN = originalTxSN;
  585. //调用查证方法
  586. checkFaceAuth(this.authForm).then((res) => {
  587. //认证结果
  588. this.faceResult = res.data.Verification;
  589. //成功
  590. if(this.faceResult == '20'){
  591. this.msgSuccess("验证成功");
  592. //关闭验证码
  593. this.faceIsShow = false;
  594. //关闭定时
  595. window.clearInterval(timeInterval);
  596. //调用盖章
  597. this.contractSigning();
  598. }else if(this.faceResult == '30'){
  599. this.$message({
  600. message: "验证失败",
  601. type: 'warning'
  602. });
  603. //关闭验证码
  604. this.faceIsShow = false;
  605. window.clearInterval(timeInterval);
  606. }
  607. });
  608. }
  609. }, 0)
  610. },10000)
  611. }
  612. });
  613. }else if(this.zfpAuthType == '02'){//短信
  614. this.messageIsShow = true;
  615. }
  616. },
  617. //发送短信验证码
  618. send(){
  619. //发送
  620. sendMessage().then((response) => {
  621. if(response.data){
  622. //手机号
  623. var newIphone = response.data.newIphone;
  624. //结果
  625. var result = response.data.result;
  626. this.messShow = false;
  627. this.auth_timer = window.setInterval(() => {
  628. this.messShow = false;
  629. setTimeout(() => {
  630. this.timer--;
  631. if(this.timer <= 0 ){
  632. this.messShow = true;
  633. clearInterval(this.auth_timer);
  634. }
  635. }, 0)
  636. },1000)
  637. //成功
  638. if("20" == result){
  639. this.$message({
  640. message: "已向经办人手机号为"+newIphone+"发送短信验证码,请注意查收",
  641. type: 'warning'
  642. });
  643. }else if("10" == result){//失败
  644. this.$message({
  645. message: "短信发送失败",
  646. type: 'warning'
  647. });
  648. }
  649. }
  650. });
  651. },
  652. //校验验证码是否正确
  653. checkCode(){
  654. if(!this.messageForm.validCode){
  655. this.$message({
  656. message: "请输入验证码",
  657. type: 'warning'
  658. });
  659. return;
  660. }
  661. //校验验证码
  662. checkCode(this.messageForm).then((response) => {
  663. if(response.data){
  664. //结果
  665. var verification = response.data.verification;
  666. //匹配
  667. if("20" == verification){
  668. //进行下一步-- 盖章
  669. this.contractSigning();
  670. }else if("30" == verification){//不匹配
  671. this.$message({
  672. message: "验证有误,请重新输入",
  673. type: 'warning'
  674. });
  675. }
  676. }
  677. });
  678. },
  679. //盖章
  680. contractSigning(){
  681. const loading = this.$loading({
  682. lock: true,
  683. text: 'Loading',
  684. background: 'rgba(0, 0, 0,0)'
  685. });
  686. contractSigning(this.form).then((response) => {
  687. loading.close();
  688. this.msgSuccess("盖章成功");
  689. if(this.zfpAuthType == '02'){
  690. //关闭短信验证
  691. this.messageIsShow = false;
  692. }else if(this.zfpAuthType == '01'){
  693. //关闭人脸二维码
  694. this.faceIsShow = false;
  695. }
  696. this.$store.dispatch(
  697. "tagsView/delView",
  698. this.$route
  699. );
  700. this.$router.go(-1);
  701. }).catch((response) => {
  702. loading.close();
  703. });
  704. },
  705. //预览
  706. handlePreview(row) {
  707. const pfiUrl = row.pfiUrl;
  708. const pfiFileName = row.pfiFileName;
  709. if (row.pfiUrl) {
  710. console.log(pfiFileName.substr(-3));
  711. if (pfiFileName.substr(-3) == "pdf") {
  712. this.wordUrl = pfiUrl + "/" + getToken();
  713. this.show=false;
  714. this.heid=true;
  715. } else if (
  716. pfiFileName.substr(-3) == "jpg" ||
  717. pfiFileName.substr(-3) == "png" ||
  718. pfiFileName.substr(-3) == "JPG" ||
  719. pfiFileName.substr(-3) == "PNG" ||
  720. pfiFileName.substr(-4) == "jpeg" ||
  721. pfiFileName.substr(-3) == "JPEG"
  722. ) {
  723. this.wordUrl =
  724. pfiUrl +
  725. "/" +
  726. getToken();
  727. this.show=true;
  728. this.heid=false;
  729. console.log("====>",this.wordUrl);
  730. } else if (
  731. pfiFileName.substr(-3) == "doc" ||
  732. pfiFileName.substr(-3) == "DOC"||
  733. pfiFileName.substr(-4) == "docx" ||
  734. pfiFileName.substr(-3) == "DOCX"
  735. ) {
  736. this.wordUrl =
  737. "https://view.officeapps.live.com/op/view.aspx?src=" +
  738. pfiUrl +
  739. "/" +
  740. getToken() +
  741. "/" +
  742. pfiFileName;
  743. this.show=false;
  744. this.heid=true;
  745. console.log("====>",this.wordUrl);
  746. } else {
  747. this.$message({
  748. message: "暂不支持该类型文件预览",
  749. type: "warning",
  750. });
  751. return;
  752. }
  753. }
  754. this.openFile = true;
  755. },
  756. //盖章拒签
  757. refuse(){
  758. this.$refs["form"].validate(valid => {
  759. if (valid) {
  760. const loading = this.$loading({
  761. lock: true,
  762. text: 'Loading',
  763. background: 'rgba(0, 0, 0,0)'
  764. });
  765. sealRefuse(this.form).then(response => {
  766. loading.close();
  767. this.msgSuccess("拒签成功");
  768. this.$store.dispatch("tagsView/delView", this.$route);
  769. this.$router.go(-1);
  770. }).catch((response)=>{
  771. loading.close();
  772. });
  773. }
  774. });
  775. },
  776. //获取盖章文件
  777. getCreditSealFile(){
  778. getCreditSealFile(this.form).then((response) => {
  779. if(response.data.list){
  780. this.creditSealList = response.data.list;
  781. }
  782. });
  783. },
  784. }
  785. };
  786. </script>
  787. <style lang="scss">
  788. .uoloadfj .el-upload--picture-card{
  789. width:110px;
  790. height:110px;
  791. line-height:110px;
  792. }
  793. .fjUoloadSty .el-upload--picture-card{
  794. display:none;
  795. }
  796. table th.star div::before {
  797. content: '*';
  798. color: red;
  799. }
  800. </style>