pdfShow.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. <template>
  2. <div>
  3. <!-- <el-button type="text" @click="dialogVisible = true">点击打开 Dialog</el-button> -->
  4. <!-- <el-dialog :visible.sync="dialogVisible" width="80%" height="1080px;" :before-close="handleClose" append-to-body > -->
  5. <el-tabs v-model="activeName" type="card">
  6. <el-tab-pane v-for="item in pdfFileList" :key="item.value" label="合同信息" name="first" style="height:780px;">
  7. <embed :src="'data:application/pdf;base64,' + item.base64" type="application/pdf" title="Embedded PDF" style="overflow: auto; width: 100%; height: 100%;"/>
  8. </el-tab-pane>
  9. <!-- <el-tab-pane label="申请协议" name="first" style="height:780px;">
  10. 招采融信申请协议
  11. 编号:ZCRXKL-20210712001
  12. 本《供应链金融服务平台融信转让协议》(以下简称为“本协议”、“《融信转让
  13. 协议》”)由融信转让人、融信受让人于本协议约定的时间在北京市东城区签署:
  14. 融信转让人:B 供应商 2_TSCF 培训专用
  15. 住所:成都市高新区新园南二路一号
  16. 法定代表人:张健
  17. 融信受让人:B 供应商 1_TSCF 培训专用
  18. 住所:成都市高新区新园南二路一号
  19. 法定代表人:张健 鉴于:
  20. (A) 融信反向保理平台由中粮资本科技有限责任公司建设并运营,向用户提供
  21. 应收账款管理、转让、融资等服务。
  22. (B) 融信转让人与融信受让人(以下简称为“双方”)均为融信反向保理平台的
  23. 用户。
  24. (C) 融信转让人现持有融信,享有融信项下的应收账款债权。
  25. (D) 双方均同意使用融信反向保理平台的服务,现融信转让人拟将融信项下应
  26. 收账款债权全部或部分通过融信反向保理平台转让给融信受让人,融信受
  27. 因此,经双方协商一致,签订本协议,约定如下:
  28. </el-tab-pane>
  29. <el-tab-pane label="配置管理" name="second" style="height:780px;">
  30. 住所:成都市高新区新园南二路一号
  31. 法定代表人:张健
  32. 融信受让人:B 供应商 1_TSCF 培训专用
  33. 住所:成都市高新区新园南二路一号
  34. 法定代表人:张健 鉴于:
  35. (A) 融信反向保理平台由中粮资本科技有限责任公司建设并运营,向用户提供
  36. 应收账款管理、转让、融资等服务。
  37. (B) 融信转让人与融信受让人(以下简称为“双方”)均为融信反向保理平台的
  38. 用户。
  39. (C) 融信转让人现持有融信,享有融信项下的应收账款债权。
  40. (D) 双方均同意使用融信反向保理平台的服务,现融信转让人拟将融信项下应
  41. 收账款债权全部或部分通过融信反向保理平台转让给融信受让人,融信受
  42. 因此,经双方协商一致,签订本协议,约定如下:</el-tab-pane> -->
  43. </el-tabs>
  44. <span slot="footer" class="dialog-footer" style="float: right;">
  45. <el-button type="primary" @click="selectType" size="mini">签署</el-button>
  46. <el-button @click="closePdfShow" size="mini">取 消</el-button>
  47. </span>
  48. <!-- <span slot="footer" class="dialog-footer">
  49. <el-button @click="dialogVisible = false">取 消</el-button>
  50. </span> -->
  51. <!-- </el-dialog> -->
  52. <div>
  53. <!--选择签署意愿类型-->
  54. <el-dialog :visible.sync="confirmIsShow" width="600px" append-to-body :before-close = "cancelUpdate" center>
  55. <el-form ref="updateForm" :disabled="false" :model="updateForm" v-if="confirmIsShow" label-width="150px" class="demo-form-inline" :inline="true">
  56. <el-radio-group v-model="updateForm.radio">
  57. <el-radio label="01">人脸</el-radio>
  58. <el-radio label="02">短信</el-radio>
  59. </el-radio-group>
  60. </el-form>
  61. <div slot="footer" class="dialog-footer">
  62. <el-button type="primary" @click="confirmSelect">确 定</el-button>
  63. <el-button @click="cancelUpdate">取 消</el-button>
  64. </div>
  65. </el-dialog>
  66. <!--短信-->
  67. <el-dialog :visible.sync="messageIsShow" width="800px" append-to-body :before-close = "cancelMessage" center>
  68. <el-form ref="messageForm" :disabled="false" :model="messageForm" v-if="messageIsShow" label-width="150px" class="demo-form-inline" :inline="true" @submit.native.prevent>
  69. <el-form-item label="验证码" prop="validCode">
  70. <el-input v-model="messageForm.validCode" style="width: 200px" maxlength="6" oninput="value=value.replace(/[^\d]/g,'')"/>
  71. </el-form-item>
  72. <el-form-item>
  73. <el-button v-show="messShow" type="success" @click="send">点击获取验证码</el-button>
  74. <el-button v-show="!messShow" type="success" disabled><span>{{timer}}</span>秒后重新获取</el-button>
  75. </el-form-item>
  76. </el-form>
  77. <div slot="footer" class="dialog-footer">
  78. <el-button type="primary" @click="checkCode">确定</el-button>
  79. <el-button @click="cancelMessage">取 消</el-button>
  80. </div>
  81. </el-dialog>
  82. <!--授权编号的短信框-->
  83. <el-dialog :title="授权短信验证" :visible.sync="projectIsShow" width="800px" append-to-body :before-close = "cancelProject" center>
  84. <el-form ref="projectForm" :disabled="false" :model="projectForm" v-if="projectIsShow" label-width="150px" class="demo-form-inline" :inline="true">
  85. <el-form-item label="验证码" prop="code">
  86. <el-input v-model="projectForm.code" style="width: 200px" maxlength="6" oninput="value=value.replace(/[^\d]/g,'')"/>
  87. </el-form-item>
  88. <el-form-item>
  89. <el-button v-show="proShow" type="success" @click="proSend">点击获取验证码</el-button>
  90. <el-button v-show="!proShow" type="success" disabled><span>{{proTimer}}</span>秒后重新获取</el-button>
  91. </el-form-item>
  92. </el-form>
  93. <div slot="footer" class="dialog-footer">
  94. <el-button type="primary" @click="checkProCode">确定</el-button>
  95. <el-button @click="cancelProject">取 消</el-button>
  96. </div>
  97. </el-dialog>
  98. <!--人脸二维码-->
  99. <el-dialog :visible.sync="faceIsShow" width="500px" append-to-body :before-close = "cancelFace" center>
  100. <img :src="'data:image/jpeg;base64,' + this.fileUrl" style="overflow: auto; width: 100%; height: 100%;"/>
  101. </el-dialog>
  102. </div>
  103. </div>
  104. </template>
  105. <script>
  106. import {sendMessage,checkCode,faceAuth,checkFaceAuth,contractSigning} from "@/api/service/credit/message";
  107. import {cfcaProjectNo,projectSendMessage,checkProCode} from "@/api/service/credit/cfcaProject";
  108. import {getCreditDetail} from "@/api/service/credit/credit";
  109. export default {
  110. props : ['pdfFileList','zfiId', 'parent'],
  111. data() {
  112. return {
  113. activeName: "first",
  114. dialogVisible: false,
  115. dialogTableVisible: false,
  116. dialogFormVisible: false,
  117. form: {
  118. name: "",
  119. region: "",
  120. date1: "",
  121. date2: "",
  122. delivery: false,
  123. type: [],
  124. resource: "",
  125. desc: "",
  126. },
  127. formLabelWidth: "120px",
  128. //展示选择意愿
  129. confirmIsShow:false,
  130. //意愿
  131. updateForm:{},
  132. //意愿类型
  133. zfpAuthTypeInit:'',
  134. zfpAuthType:'',
  135. //短信展示
  136. messageIsShow:false,
  137. //短信
  138. messageForm:{validCode:""},
  139. //人脸二维码
  140. fileUrl:"",
  141. //控制人脸二维码是否展示
  142. faceIsShow:false,
  143. //人脸验证结果
  144. faceResult:"",
  145. //人脸识别结果传参
  146. authForm:{},
  147. //控制短信验证码倒计时是否展示
  148. messShow:true,
  149. timer:60,
  150. openFile:false,
  151. wordUrl: "",
  152. show:false,
  153. heid:false,
  154. auth_timer : null,
  155. //融资方审批状态
  156. zfiSupplierStatus:'',
  157. //核心审批状态
  158. zfiCoreStatus:'',
  159. //平台审批状态
  160. zfiPlatformStatus:'',
  161. //融信状态
  162. zfiStatus:'',
  163. //盖章文件
  164. creditSealList:[],
  165. //生成授权编号的短信框
  166. projectIsShow:false,
  167. //短信
  168. projectForm:{code:""},
  169. //控制倒计时是否展示
  170. proShow:true,
  171. //时间
  172. proTimer:60,
  173. //项目编号
  174. projectCode:"",
  175. //融信信息
  176. financeData:{},
  177. //接收方
  178. receiveName:"",
  179. //开立方
  180. openName:""
  181. };
  182. },
  183. created() {
  184. getCreditDetail(this.zfiId).then((response) => {
  185. if(response.data){
  186. //融信状态
  187. this.zfiStatus = response.data.financeInf.zfiStatus;
  188. //融资方审批状态
  189. this.zfiSupplierStatus = response.data.financeInf.zfiSupplierStatus;
  190. //平台审批状态
  191. this.zfiPlatformStatus = response.data.financeInf.zfiPlatformStatus;
  192. //核心审批状态
  193. this.zfiCoreStatus = response.data.financeInf.zfiCoreStatus;
  194. //意愿类型
  195. this.zfpAuthType = response.data.zfpAuthType;
  196. this.zfpAuthTypeInit = response.data.zfpAuthType;
  197. //融信信息
  198. this.financeData = response.data.financeInf;
  199. //接收方
  200. this.receiveName = response.data.receiveName;
  201. //开立方
  202. this.openName = response.data.openName;
  203. }
  204. })
  205. this.dialogVisible = true;
  206. for(var i = 0 ; i < this.pdfFileList.length; i++){
  207. var base64 = this.pdfFileList[i].base64;
  208. <embed src="data:application/pdf;base64," type="application/pdf" title="Embedded PDF" style="overflow: auto; width: 100%; height: 100%;"/>
  209. }
  210. },
  211. methods: {
  212. handleClose(done) {
  213. this.$confirm("确认关闭?")
  214. .then((_) => {
  215. done();
  216. })
  217. .catch((_) => {});
  218. },
  219. selectChildType(){
  220. this.$parent.selectType();
  221. },
  222. //取消选择意愿
  223. cancelUpdate(){
  224. this.confirmIsShow = false;
  225. this.resetUpdate();
  226. },
  227. //关闭短信
  228. cancelMessage(){
  229. this.messageIsShow = false;
  230. this.resetMessage();
  231. },
  232. //关闭短信
  233. cancelProject(){
  234. this.projectIsShow = false;
  235. this.resetProject();
  236. },
  237. //关闭二维码
  238. cancelFace(){
  239. this.faceIsShow = false;
  240. },
  241. resetUpdate() {
  242. this.updateForm = {
  243. radio:""
  244. };
  245. //意愿类型还原为全部
  246. this.zfpAuthType = this.zfpAuthTypeInit;
  247. this.resetForm("updateForm");
  248. this.messShow = true;
  249. clearInterval(this.auth_timer);
  250. this.timer = 60;
  251. this.proShow = true;
  252. clearInterval(this.auth_pro_timer);
  253. this.proTimer = 60;
  254. },
  255. resetMessage() {
  256. this.messageForm = {
  257. validCode:""
  258. };
  259. this.resetForm("messageForm");
  260. },
  261. resetProject(){
  262. this.projectForm = {
  263. code:""
  264. };
  265. this.resetForm("projectForm");
  266. },
  267. //选择类型
  268. selectType(){
  269. //查询当前企业是否存在企业授权编号
  270. cfcaProjectNo().then((response) => {
  271. //存在授权编号
  272. if(response.data.scyCfcaAuthNumber){
  273. /**
  274. * 申请确权:融资审批通过+核心通过+平台通过+融信待确权||
  275. * 核心开立:核心审批通过+其余状态为空
  276. * 融资开立:融资通过+平台通过+其余状态为空
  277. *
  278. */
  279. this.resetUpdate();
  280. //调用人脸
  281. if( (this.zfiSupplierStatus == '01' && this.zfiCoreStatus == '01' && this.zfiPlatformStatus == '01' && this.zfiStatus == '00') ||
  282. (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'))||
  283. (this.zfiSupplierStatus == '01' && this.zfiPlatformStatus == '01' && (this.zfiCoreStatus == '' || this.zfiCoreStatus == null || this.zfiCoreStatus == 'null') && (this.zfiStatus == '' || this.zfiStatus == null || this.zfiStatus == 'null'))){
  284. //选择签署意愿
  285. if(this.zfpAuthType == "00"){
  286. this.confirmIsShow = true;
  287. }else{
  288. this.checking();
  289. }
  290. }else{
  291. //直接盖章
  292. this.contractSigning();
  293. }
  294. }else{
  295. //不存在授权编号
  296. //发送短信验证码认证
  297. this.projectIsShow = true;
  298. }
  299. });
  300. },
  301. //确认选择
  302. confirmSelect(){
  303. if(!this.updateForm.radio){
  304. this.$message({
  305. message: '请选择签署意愿类型',
  306. type: 'warning'
  307. });
  308. return;
  309. }
  310. this.confirmIsShow = false;
  311. this.zfpAuthType = this.updateForm.radio;
  312. //调用人脸识别或者短信验证
  313. this.checking();
  314. },
  315. //去签署
  316. checking(){
  317. //人脸
  318. if(this.zfpAuthType == '01'){
  319. //调用人脸识别生成二维码
  320. faceAuth().then((response) => {
  321. if(response.data){
  322. //获取二维码
  323. this.fileUrl = response.data.fileUrl;
  324. //获取源流水号
  325. var originalTxSN = response.data.originalTxSN;
  326. this.faceIsShow = true;
  327. //每10秒查证人脸识别结果
  328. var timeInterval = window.setInterval(() => {
  329. setTimeout(() => {
  330. //源流水不为空并且结果为空
  331. if(originalTxSN && !this.faceResult){
  332. this.authForm.originalTxSN = originalTxSN;
  333. //调用查证方法
  334. checkFaceAuth(this.authForm).then((res) => {
  335. //认证结果
  336. this.faceResult = res.data.Verification;
  337. //成功
  338. if(this.faceResult == '20'){
  339. this.msgSuccess("验证成功");
  340. //关闭验证码
  341. this.faceIsShow = false;
  342. //关闭定时
  343. window.clearInterval(timeInterval);
  344. //调用盖章
  345. this.contractSigning();
  346. }else if(this.faceResult == '30'){
  347. this.$message({
  348. message: "验证失败",
  349. type: 'warning'
  350. });
  351. //关闭验证码
  352. this.faceIsShow = false;
  353. window.clearInterval(timeInterval);
  354. }
  355. });
  356. }
  357. }, 0)
  358. },10000)
  359. }
  360. });
  361. }else if(this.zfpAuthType == '02'){//短信
  362. this.messageIsShow = true;
  363. }
  364. },
  365. //发送短信验证码
  366. send(){
  367. //发送
  368. sendMessage().then((response) => {
  369. if(response.data){
  370. //手机号
  371. var newIphone = response.data.newIphone;
  372. //结果
  373. var result = response.data.result;
  374. this.messShow = false;
  375. this.auth_timer = window.setInterval(() => {
  376. this.messShow = false;
  377. setTimeout(() => {
  378. this.timer--;
  379. if(this.timer <= 0 ){
  380. this.messShow = true;
  381. clearInterval(this.auth_timer);
  382. }
  383. }, 0)
  384. },1000)
  385. //成功
  386. if("20" == result){
  387. this.$message({
  388. message: "已向经办人手机号为"+newIphone+"发送短信验证码,请注意查收",
  389. type: 'warning'
  390. });
  391. }else if("10" == result){//失败
  392. this.$message({
  393. message: "短信发送失败",
  394. type: 'warning'
  395. });
  396. }
  397. }
  398. });
  399. },
  400. //生成项目授权编号发送短信
  401. proSend(){
  402. //发送
  403. projectSendMessage().then((response) => {
  404. if(response.data){
  405. //手机号
  406. var newIphone = response.data.newIphone;
  407. //结果
  408. var result = response.data.result;
  409. //项目编号
  410. this.projectCode = response.data.projectCode;
  411. this.proShow = false;
  412. this.auth_pro_timer = window.setInterval(() => {
  413. this.proShow = false;
  414. setTimeout(() => {
  415. this.timer--;
  416. if(this.timer <= 0 ){
  417. this.proShow = true;
  418. clearInterval(this.auth_pro_timer);
  419. }
  420. }, 0)
  421. },1000)
  422. //成功
  423. if("60000000" == result){
  424. this.$message({
  425. message: "已向经办人手机号为"+newIphone+"发送短信验证码,请注意查收",
  426. type: 'warning'
  427. });
  428. }else{//失败
  429. this.$message({
  430. message: "短信发送失败",
  431. type: 'warning'
  432. });
  433. }
  434. }
  435. });
  436. },
  437. //校验验证码是否正确
  438. checkCode(){
  439. if(!this.messageForm.validCode){
  440. this.$message({
  441. message: "请输入验证码",
  442. type: 'warning'
  443. });
  444. return;
  445. }
  446. //校验验证码
  447. checkCode(this.messageForm).then((response) => {
  448. if(response.data){
  449. //结果
  450. var verification = response.data.verification;
  451. //匹配
  452. if("20" == verification){
  453. //进行下一步-- 盖章
  454. this.contractSigning();
  455. }else if("30" == verification){//不匹配
  456. this.$message({
  457. message: "验证有误,请重新输入",
  458. type: 'warning'
  459. });
  460. }
  461. }
  462. });
  463. },
  464. //盖章
  465. contractSigning(){
  466. const loading = this.$loading({
  467. lock: true,
  468. text: 'Loading',
  469. background: 'rgba(0, 0, 0,0)'
  470. });
  471. contractSigning(this.financeData).then((response) => {
  472. loading.close();
  473. //确权:状态为待确权
  474. if(this.zfiStatus == '00'){
  475. this.msgSuccess("确权成功,融信已提交,"+this.receiveName+"签收");
  476. }else if(this.zfiStatus == '01' && this.zfiCreateType == '0'){//签收
  477. this.msgSuccess("恭喜您成功签收一笔融信");
  478. }else if(this.zfiCreateType == '1' && this.zfiCoreStatus == '01' && !this.zfiStatus){//核心开立
  479. this.msgSuccess("开立成功,融信已提交"+this.receiveName+"签收");
  480. }else if(this.zfiCreateType == '2' && this.zfiPlatformStatus == '01' && this.zfiSupplierStatus == '01' && !this.zfiStatus){
  481. //融资开立盖章
  482. this.msgSuccess("开立成功,待:"+this.openName+"确权;确权结果请留意待办事项与站内消息");
  483. }
  484. if(this.zfpAuthType == '02'){
  485. //关闭短信验证
  486. this.messageIsShow = false;
  487. }else if(this.zfpAuthType == '01'){
  488. //关闭人脸二维码
  489. this.faceIsShow = false;
  490. }
  491. this.$store.dispatch(
  492. "tagsView/delView",
  493. this.$route
  494. );
  495. this.$router.go(-1);
  496. }).catch((response) => {
  497. loading.close();
  498. });
  499. },
  500. //校验授权编号验证码
  501. checkProCode(){
  502. if(!this.projectForm.code){
  503. this.$message({
  504. message: "请输入验证码",
  505. type: 'warning'
  506. });
  507. return;
  508. }
  509. //项目编号
  510. this.projectForm.projectCode = this.projectCode;
  511. //校验验证码
  512. checkProCode(this.projectForm).then((response) => {
  513. if(response.data){
  514. //结果
  515. var verification = response.data.verification;
  516. //匹配
  517. if("60000000" == verification){
  518. /**
  519. * 申请确权:融资审批通过+核心通过+平台通过+融信待确权||
  520. * 核心开立:核心审批通过+其余状态为空
  521. * 融资开立:融资通过+平台通过+其余状态为空
  522. *
  523. */
  524. this.resetUpdate();
  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. }else {//不匹配
  540. this.$message({
  541. message: "验证有误,请重新输入",
  542. type: 'warning'
  543. });
  544. }
  545. }
  546. });
  547. },
  548. closePdfShow(){
  549. this.parent.closePdfShow();
  550. }
  551. },
  552. };
  553. </script>