creditSeal.vue 39 KB

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