creditSeal.vue 31 KB

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