creditSeal.vue 40 KB

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