signFor.vue 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407
  1. <template>
  2. <el-tabs type="border-card">
  3. <!-- 资产信息-->
  4. <el-tab-pane label="资产信息">
  5. <!-- <div class="app-container"> -->
  6. <el-form ref="forms" :model="forms" :inline="true" style="margin-top: 20px" label-width="auto" >
  7. <el-row class="zap-form" style="padding-bottom: 0;">
  8. <el-col :span="12">
  9. <el-form-item label="选择融信:" prop="zfrFinanceId" size="large" style="display:none">
  10. <el-select v-model="forms.zfrFinanceId" clearable @clear="clearBoth">
  11. <el-option v-for="(item,index) in financeInfList" :key="index" :label="item.zfiNumber" :value="item.zfiId" @click.native="amount(item)"></el-option>
  12. </el-select>
  13. </el-form-item>
  14. </el-col>
  15. <!-- <el-col :span="12">
  16. <el-form-item label="融资收款账户:" prop="zfrCollectionAccount" size="large" label-width="101px">
  17. <el-input v-model="forms.zfrCollectionAccount" clearable placeholder="请输入融资账户" maxlength="25" :readonly="readonly" />
  18. </el-form-item>
  19. </el-col> -->
  20. </el-row>
  21. <el-row class="zap-form" style="padding-bottom: 0;">
  22. <el-col :span="12">
  23. <el-form-item label="融信金额:" prop="zfiAmount" size="large">
  24. <el-input v-model="forms.zfiAmount" clearable placeholder="请输入融信金额" maxlength="25" readonly >
  25. <template slot="append">元</template>
  26. </el-input>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="12">
  30. <el-form-item label="融资利率:" prop="zfrRate" size="large">
  31. <el-input v-model="forms.zfrRate" clearable placeholder="请输入融资利率" maxlength="25" readonly >
  32. <template slot="append">%</template>
  33. </el-input>
  34. </el-form-item>
  35. </el-col>
  36. <!-- <el-col :span="12">
  37. <el-form-item label="申请融资方:" prop="companyName" size="large">
  38. <el-input v-model="forms.companyName" clearable placeholder="请输入申请融资方" maxlength="25" readonly />
  39. </el-form-item>
  40. </el-col> -->
  41. </el-row>
  42. <el-row class="zap-form" style="padding-bottom: 0;">
  43. <el-col :span="12">
  44. <el-form-item label="承诺还款日期:" prop="zfrRepaymentDate" size="large" label-width="101px">
  45. <el-input v-model="forms.zfrRepaymentDate" clearable placeholder="请输入承诺还款日期" maxlength="25" readonly />
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="12">
  49. <el-form-item label="服务费率:" prop="zfpcrChargeRate" size="large">
  50. <el-input v-model="forms.zfpcrChargeRate" clearable placeholder="请输入服务费率" maxlength="25" readonly >
  51. <template slot="append">%</template>
  52. </el-input>
  53. </el-form-item>
  54. </el-col>
  55. </el-row>
  56. <el-row class="zap-form" style="padding-bottom: 0;">
  57. <el-col :span="12">
  58. <el-form-item label="签发有效期:" prop="zfiEffectiveDate" size="large" label-width="101px">
  59. <el-input v-model="forms.zfiEffectiveDate" clearable placeholder="请输入融资期限" maxlength="25" readonly />
  60. </el-form-item>
  61. <!-- <el-form-item label="融资期限:" prop="termIng" size="large" label-width="101px">
  62. <el-input v-model="forms.termIng" clearable placeholder="请输入融资期限" maxlength="25" readonly />
  63. </el-form-item> -->
  64. </el-col>
  65. <el-col :span="12">
  66. <el-form-item label="融信状态:" prop="zfiStatus" size="large" label-width="101px" >
  67. <el-select v-model="forms.zfiStatus" placeholder="请选择状态" clearable disabled>
  68. <el-option v-for="dict in stateOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
  69. </el-select>
  70. </el-form-item>
  71. </el-col>
  72. </el-row>
  73. </el-form>
  74. <el-form ref="form" :model="form" :rules="rules" :inline="true" style="margin-top: 20px" label-width="auto" >
  75. <el-divider content-position="left">签收</el-divider>
  76. <el-form-item label="融信利率:">
  77. <span>{{this.zfiRate}}</span>%
  78. </el-form-item>
  79. <table class="gridtable" style="width:80%;text-align:center" align="center">
  80. <tr>
  81. <td rowspan="4">开立方</td>
  82. <td>全称</td>
  83. <td>{{openName}}</td>
  84. <td rowspan="4">接收方</td>
  85. <td>全称</td>
  86. <td>{{receiveName}}</td>
  87. </tr>
  88. <tr>
  89. <td>社会统一码</td>
  90. <td>{{openCode}}</td>
  91. <td>社会统一码</td>
  92. <td>{{receiverCode}}</td>
  93. </tr>
  94. <tr>
  95. <td>开户银行</td>
  96. <td>{{openBank}}</td>
  97. <td>开户银行</td>
  98. <td>{{receiverBank}}</td>
  99. </tr>
  100. <tr>
  101. <td>账号</td>
  102. <td>{{openAccount}}</td>
  103. <td>账号</td>
  104. <td>{{receiverAccount}}</td>
  105. </tr>
  106. <tr>
  107. <td colspan="2">粮信金额</td>
  108. <td colspan="4">人民币(大写):{{issuedAmount}}<br>人民币(小写)¥{{form.zfiAmount}}</td>
  109. </tr>
  110. <tr>
  111. <td colspan="2">起止日期</td>
  112. <td colspan="4">{{stopDate}}</td>
  113. </tr>
  114. </table>
  115. <el-form-item style="margin-left: 100px">
  116. <el-button size="mini" type="success" :disabled="isClick" @click="openTicket(form.zfiId)">选择</el-button>
  117. <el-button size="mini" type="primary" :disabled="isClick" @click="addPay">新增应收账款</el-button>
  118. <el-button size="mini" @click="deleteTicekt" :disabled="isClick" >清空全部</el-button>
  119. <el-form-item label="合计金额:">
  120. <span>{{checkTotalAmt}}</span>
  121. </el-form-item>
  122. <el-form-item label="金额大写:">
  123. <span>{{checkTotalBigAmt}}</span>
  124. </el-form-item>
  125. <el-table :data="ticketList" style="width: 1100px">
  126. <el-table-column label="账款名称" align="center" prop="zbiName" show-overflow-tooltip />
  127. <el-table-column label="应收企业" align="center" prop="receiveName"/>
  128. <el-table-column label="应收企业" align="center" prop="payName" />
  129. <el-table-column label="预计还款期" align="center" prop="zbiPayDate" show-overflow-tooltip />
  130. <el-table-column label="金额" align="center" prop="zbiAmount" />
  131. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
  132. <template slot-scope="scope">
  133. <el-button
  134. size="mini"
  135. type="text"
  136. icon="el-icon-delete"
  137. :disabled="isClick"
  138. @click="handleDelete(scope.$index, ticketList)"
  139. >删除</el-button>
  140. <el-button
  141. size="mini"
  142. type="text"
  143. icon="el-icon-view"
  144. @click="handleDetail(scope.$index, ticketList)"
  145. >详情</el-button>
  146. <!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.$index, ticketList)">修改</el-button> -->
  147. </template>
  148. </el-table-column>
  149. </el-table>
  150. </el-form-item>
  151. <el-row>
  152. <el-col :span="8">
  153. <el-form-item label="签发金额" prop="zfiAmount">
  154. <el-input v-model="form.zfiAmount" style="width: 200px" disabled @input="getBigSmall"/>
  155. </el-form-item>
  156. </el-col>
  157. </el-row>
  158. <el-row>
  159. <el-col :span="8">
  160. <el-form-item label="金额大写" prop="issuedAmount">
  161. {{issuedAmount}}
  162. </el-form-item>
  163. </el-col>
  164. </el-row>
  165. <p>请知悉,资产信息仅能接受指定的销售方与购买方的往来账款(含账款基本信息、贸易合同与贸易发票等);如须使用系统尚未维护的往来账款,请点击新增应付账款
  166. </p>
  167. </el-form>
  168. <!-- 发票附件 -->
  169. <!-- <el-divider content-position="left">发票附件</el-divider>
  170. <el-table :data="invoiceFileList" style="width: 100%">
  171. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  172. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  173. <template slot-scope="scope">
  174. <el-button
  175. size="mini"
  176. type="text"
  177. icon="el-icon-view"
  178. @click="handleDownload(scope.row)"
  179. >下载</el-button>
  180. <el-button
  181. size="mini"
  182. type="text"
  183. icon="el-icon-view"
  184. @click="handlePreview(scope.row)"
  185. >预览</el-button>
  186. </template>
  187. </el-table-column>
  188. </el-table> -->
  189. <!-- 合同附件 -->
  190. <!-- <el-divider content-position="left">合同附件</el-divider>
  191. <el-table :data="contractFileList" style="width: 100%">
  192. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  193. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  194. <template slot-scope="scope">
  195. <el-button
  196. size="mini"
  197. type="text"
  198. icon="el-icon-view"
  199. @click="handleDownload(scope.row)"
  200. >下载</el-button>
  201. <el-button
  202. size="mini"
  203. type="text"
  204. icon="el-icon-view"
  205. @click="handlePreview(scope.row)"
  206. >预览</el-button>
  207. </template>
  208. </el-table-column>
  209. </el-table> -->
  210. <!-- 其他附件 -->
  211. <!-- <el-divider content-position="left">其他附件</el-divider>
  212. <el-table :data="otherFileList" style="width: 100%">
  213. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  214. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  215. <template slot-scope="scope">
  216. <el-button
  217. size="mini"
  218. type="text"
  219. icon="el-icon-view"
  220. @click="handleDownload(scope.row)"
  221. >下载</el-button>
  222. <el-button
  223. size="mini"
  224. type="text"
  225. icon="el-icon-view"
  226. @click="handlePreview(scope.row)"
  227. >预览</el-button>
  228. </template>
  229. </el-table-column>
  230. </el-table> -->
  231. <div class="footer" style="float: right;
  232. margin-bottom:2px;">
  233. <el-button type="info" @click="submitForm('01')">拒绝</el-button>
  234. <el-button type="primary" @click="sign()" v-if="!isHas">签收</el-button>
  235. <el-button type="primary" @click="submitForm('00')" v-if="isHas">内部审批</el-button>
  236. <el-button @click="cancel">取 消</el-button>
  237. </div>
  238. <!-- 应收账款信息 -->
  239. <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body destroy-on-close>
  240. <el-form :model="queryParamsPay" ref="formQuery" :inline="true" label-width="68px" style="margin-bottom: -21px">
  241. <el-form-item label="账款名称" prop="zbiName">
  242. <el-input
  243. v-model="queryParamsPay.zbiName"
  244. placeholder="请输入账款名称"
  245. clearable
  246. size="small"
  247. maxlength="11"
  248. @keyup.enter.native="handleQuerys"/>
  249. </el-form-item>
  250. <el-form-item>
  251. <el-button
  252. type="cyan"
  253. icon="el-icon-search"
  254. size="mini"
  255. @click="handleQuerys"
  256. >搜索</el-button>
  257. <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys"
  258. >重置</el-button>
  259. </el-form-item>
  260. </el-form>
  261. <el-table :data="payList"
  262. ref="tablePay"
  263. class="single-select-table"
  264. @selection-change="handleSelectionChange"
  265. :row-key="rowkey">
  266. <el-table-column
  267. type="selection"
  268. :reserve-selection="true"
  269. width="50"
  270. align="center"/>
  271. <el-table-column label="序号" type="index" width="50" align="center">
  272. <template slot-scope="scope">
  273. <span>{{ (queryParamsPay.pageNum - 1) * queryParamsPay.pageSize + scope.$index + 1}}</span>
  274. </template>
  275. </el-table-column>
  276. <el-table-column label="账款名称" align="center" prop="zbiName" show-overflow-tooltip />
  277. <el-table-column label="应收企业" align="center" prop="receiveName"/>
  278. <el-table-column label="应收企业" align="center" prop="payName" />
  279. <el-table-column label="预计还款期" align="center" prop="zbiPayDate" show-overflow-tooltip />
  280. <el-table-column label="金额" align="center" prop="zbiAmount" />
  281. </el-table>
  282. <pagination
  283. v-show="total > 0"
  284. :total="total"
  285. :page.sync="queryParamsPay.pageNum"
  286. :limit.sync="queryParamsPay.pageSize"
  287. @pagination="getAccountsCollection" />
  288. <span slot="footer" class="dialog-footer">
  289. <el-button size="mini" @click="cancelTicket">取消</el-button>
  290. <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
  291. </span>
  292. </el-dialog>
  293. <!-- 新增往来账款 -->
  294. <el-dialog title="新增往来账款" :visible.sync="openAddBill" width="1120px" append-to-body>
  295. <add-bill :companyId="form.zfiCoreId" companyType="01" :payDate="payDate" @addClick="emitAddClick" v-if="openAddBill"></add-bill>
  296. </el-dialog>
  297. <el-dialog title="详情" :visible.sync="openDetailBill" width="1120px" append-to-body>
  298. <detail-bill :zbiId="this.zbiId" v-if="openDetailBill"></detail-bill>
  299. </el-dialog>
  300. <!-- 修改往来账款 -->
  301. <el-dialog title="修改往来账款" :visible.sync="openEditBill" width="1120px" append-to-body>
  302. <edit-bill :zbiId="this.zbiId" @editClick="emitEditClick" v-if="openEditBill"></edit-bill>
  303. </el-dialog>
  304. <!--预览-->
  305. <el-dialog :visible.sync="openFile" width="1000px" append-to-body>
  306. <img :src="wordUrl" v-if="show" width='950px' height='500px'/>
  307. <iframe :src="wordUrl" width='800px' height='600px' frameborder='1' v-if="heid"/>
  308. </el-dialog>
  309. <el-dialog
  310. :visible.sync="pdfShowDialog"
  311. width="70%"
  312. height = "60%"
  313. append-to-body>
  314. <pdf-show :pdfFileList="pdfFileList" :zfiId="this.form.zfiId" :parent="parent" @PDFData="PDFData">
  315. </pdf-show>
  316. </el-dialog>
  317. <el-dialog
  318. :visible.sync="pdfShowDialogs"
  319. width="70%" height = "60%" append-to-body :show-close="false" >
  320. <pdf-shows :pdfFileLists="pdfFileLists" :zfiId="this.form.zfiId" :parents="parents">
  321. </pdf-shows>
  322. </el-dialog>
  323. <!--去融资-->
  324. <el-dialog :visible.sync="goShow" width="300px" append-to-body :before-close = "cancelGo" center>
  325. <!-- <p>恭喜您成功签收一笔融信</p> -->
  326. <p>签收融信成功,融信信息:</p>
  327. <el-form ref="financeSignForm" :model="financeSignForm" label-width="auto" :inline="true">
  328. <el-row>
  329. <el-form-item label="融信编号:">{{financeSignForm.zfiNumber}}</el-form-item>
  330. <el-form-item label="融信金额:">{{handleInput(financeSignForm.zfiAmount) + "元"}}</el-form-item>
  331. <el-form-item label="大写:">{{smallToBig(financeSignForm.zfiAmount)}}</el-form-item>
  332. </el-row>
  333. <el-row>
  334. <el-form-item label="融信利率:">{{financeSignForm.zfiRate + "%"}}</el-form-item>
  335. <el-form-item label="最长融信期限:">{{financeSignForm.intervalTime + "天"}}</el-form-item>
  336. <el-form-item label="融信有效期:">{{financeSignForm.validity}}</el-form-item>
  337. </el-row>
  338. </el-form>
  339. <div slot="footer" class="dialog-footer">
  340. <el-button type="primary" @click="goFinance">去融资</el-button>
  341. <el-button @click="cancelGo">取 消</el-button>
  342. </div>
  343. </el-dialog>
  344. </el-tab-pane>
  345. <el-tab-pane label="签署合同">
  346. <el-table :data="creditSealList" style="width: 100%">
  347. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip>
  348. <template slot-scope="scope">
  349. <img style="width:30px;height:30px;"
  350. src="../../../assets/images/pdf.png"
  351. />
  352. <span>{{scope.row.pfiFileName}}
  353. </span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  357. <template slot-scope="scope">
  358. <el-button
  359. size="mini"
  360. type="text"
  361. icon="el-icon-view"
  362. @click="handleDownload(scope.row)"
  363. >下载</el-button>
  364. <el-button
  365. size="mini"
  366. type="text"
  367. icon="el-icon-view"
  368. @click="handlePreview(scope.row)"
  369. >预览</el-button>
  370. </template>
  371. </el-table-column>
  372. </el-table>
  373. </el-tab-pane>
  374. </el-tabs>
  375. <!-- </div> -->
  376. </template>
  377. <script>
  378. import {getCreditDetail,getAvailableBalance,getAccountsCollection,getFile,getFinanceSign} from "@/api/service/credit/credit";
  379. import {signFor,getCreditSealFile,getContractFile} from "@/api/service/credit/creditHandle";
  380. import {accAdd} from "@/utils/calculation";
  381. import {getToken} from "@/utils/auth";
  382. import { getBill} from "@/api/service/bill/bill";
  383. import AddBill from "@/views/service/bill/addBill";
  384. import EditBill from "@/views/service/bill/editBill";
  385. import {isOpenApproval} from "@/api/service/credit/approvalRelatedCredit";
  386. import pdfShow from "./pdfShow";
  387. import pdfShows from "./showStampedPdf";
  388. import DetailBill from "@/views/service/credit/billDetail";
  389. import {contractSigning} from "@/api/service/credit/message";
  390. import { listFinanceInf } from "@/api/common/financeInf";
  391. import { listCompanyHandler } from "@/api/common/companyHandler";
  392. import { amtformat } from "@/utils/amtCommon";
  393. import Cookies from 'js-cookie';
  394. export default {
  395. name: "addCredit",
  396. components: {AddBill,DetailBill,pdfShow,EditBill,pdfShows},
  397. data() {
  398. return {
  399. //往来账款id
  400. zbiId: '',
  401. // 总条数
  402. total: 0,
  403. // 表单参数read
  404. form: {
  405. },
  406. forms:{},
  407. // 表单校验
  408. rules: {
  409. },
  410. financeSignForm:{},
  411. // 是否显示弹出层
  412. open: false,
  413. openAddBill: false,
  414. openDetailBill: false,
  415. openEditBill: false,
  416. //选择的应收账款
  417. payList:[],
  418. //现有的应收账款
  419. ticketList:[],
  420. //签发金额大写
  421. issuedAmount:"零元整",
  422. //合计选中的应收账款的金额
  423. checkTotalAmt:"0.00",
  424. //合计选中的应收账款的大写金额
  425. checkTotalBigAmt:"零元整",
  426. //接收方
  427. supplierList:[],
  428. supplierForm:{},
  429. queryParamsPay: {
  430. pageNum: 1,
  431. pageSize: 10,
  432. zbiName:null
  433. },
  434. //授信额度
  435. creditLineList:[],
  436. //可用额度
  437. availableAmt:"0.00",
  438. //有效期
  439. validityDate:"",
  440. //有效期类型
  441. zfpcrDateType:"" ,
  442. //产品是否可拆分
  443. zfpSplit:"",
  444. //融资放款方式
  445. zfpcrLoanType:"",
  446. //产品编号
  447. zfpId:"",
  448. //标题
  449. payTitle:"",
  450. //利率
  451. zfiRate:"",
  452. //授信额度
  453. creditParams: {
  454. zfpcrId:null,
  455. type:'1'
  456. },
  457. //合同附件
  458. contractFileList:[],
  459. //发票附件
  460. invoiceFileList:[],
  461. //其他文件
  462. otherFileList:[] ,
  463. //盖章文件
  464. creditSealList:[],
  465. //开立方编号
  466. zfiCoreId:"",
  467. //接收方
  468. zfiSupplierId:"" ,
  469. //融信类型
  470. zfiCreateType:"",
  471. //控制按钮是否可点击
  472. isClick:true,
  473. openFile:false,
  474. wordUrl: "",
  475. show:false,
  476. heid:false,
  477. chooseTicket:[],
  478. payDate:null,
  479. //开立方
  480. openName:"",
  481. //开立社会码
  482. openCode:"",
  483. //开立银行
  484. openBank:"",
  485. //开立账户
  486. openAccount:"",
  487. //接收方
  488. receiveName:"",
  489. //接收方社会统一码
  490. receiverCode:"",
  491. //接收方银行
  492. receiverBank:"",
  493. //接收方账户
  494. receiverAccount:"",
  495. //起止日期
  496. stopDate:"",
  497. //控制签收,内部审批按钮展示
  498. isHas:true,
  499. //融资企业审批状态
  500. zfiSupplierStatus:"",
  501. //融信编号
  502. zfiId:"",
  503. pdfFileList : [],
  504. pdfShowDialog : false,
  505. parent : this,
  506. pdfShowDialogs : false,
  507. pdfFileLists : [],
  508. parents : this,
  509. //显示去融资框
  510. goShow:false,
  511. //状态
  512. stateOptions:[],
  513. };
  514. },
  515. watch:{
  516. 'form.zfiCoreQuotaId':'change'
  517. },
  518. created() {
  519. this.getDicts("zc_finance_state").then(response => {
  520. this.stateOptions = response.data;
  521. });
  522. const zfiId = this.$route.params && this.$route.params.zfiId;
  523. this.zfiId = zfiId;
  524. getCreditDetail(zfiId).then((response) => {
  525. if(response.data){
  526. //签发金额
  527. this.form= response.data.financeInf;
  528. this.forms.zfiStatus = response.data.financeInf.zfiStatus;
  529. //签发金额大写
  530. this.issuedAmount = this.smallToBig(this.form.zfiAmount);
  531. //开立方编号
  532. this.zfiCoreId = response.data.financeInf.zfiCoreId;
  533. //接收方
  534. this.zfiSupplierId = response.data.financeInf.zfiSupplierId;
  535. //类型
  536. this.zfiCreateType = response.data.financeInf.zfiCreateType;
  537. //融资方审批状态
  538. this.zfiSupplierStatus = response.data.financeInf.zfiSupplierStatus;
  539. //核心
  540. if( this.zfiCreateType == "1"){
  541. this.isClick = false;
  542. }else{
  543. this.isClick = true;
  544. }
  545. //给表格赋值
  546. this.openName = response.data.openName;
  547. this.openCode = response.data.openCode;
  548. this.openBank = response.data.openBank;
  549. this.openAccount = response.data.openAccount;
  550. this.receiveName = response.data.receiveName;
  551. this.receiverCode = response.data.receiverCode;
  552. this.receiverBank = response.data.receiverBank;
  553. this.receiverAccount = response.data.receiverAccount;
  554. this.stopDate = response.data.stopDate;
  555. this.zfiRate = response.data.financeInf.zfiRate;
  556. }
  557. if(response.data.payList){
  558. this.ticketList = response.data.payList.records;
  559. this.getReTotal(this.ticketList);
  560. //附件
  561. this.getFile(this.ticketList);
  562. }
  563. //查询有无签收内部审批
  564. this.isOpenApproval();
  565. //盖章合同
  566. this.getCreditSealFile();
  567. });
  568. this.getFinanceInf(zfiId);
  569. },
  570. methods: {
  571. PDFData(val){
  572. console.log(val,"子传父")
  573. this.pdfFileLists = val;
  574. this.pdfShowDialogs = true;
  575. },
  576. /** 查询融信编号 */
  577. getFinanceInf(zfrFinanceId) {
  578. this.loading = true;
  579. listFinanceInf(zfrFinanceId).then(response => {
  580. debugger;
  581. if (response.data) {
  582. this.financeInfList = response.data;
  583. for (let item of this.financeInfList) {
  584. if (item.zfiId == zfrFinanceId) {
  585. this.amount(item);
  586. }
  587. }
  588. this.loading = false;
  589. }
  590. });
  591. },
  592. /* 融信编号赋值融资金额 */
  593. amount(item) {
  594. debugger;
  595. this.$set(this.forms, "zfiAmount", item.zfiAmount);
  596. this.$set(this.forms, "zfrAmount", item.zfiAmount);
  597. this.$set(this.forms, "zfrRepaymentDate", item.zfiExpireDate);
  598. this.$set(this.forms, "zfrRate", item.zfpcrRate);
  599. this.$set(this.forms, "zfpcrLoanType", item.zfpcrLoanType);
  600. this.$set(this.forms, "zfiProductId", item.zfiProductId);
  601. this.$set(this.forms, "zfpcrChargeRate", item.zfpcrChargeRate);
  602. this.$set(this.forms, "termIng", item.termIng);
  603. this.$set(this.forms, "zfiEffectiveDate", item.zfiEffectiveDate);
  604. },
  605. // 取消按钮
  606. cancel() {
  607. this.$store.dispatch("tagsView/delView", this.$route);
  608. this.$router.go(-1);
  609. },
  610. /* 多选框跨页 */
  611. rowkeyCustomer(row) {
  612. return row.cciId;
  613. },
  614. //获取附件信息
  615. getFile(datas){
  616. var queryParamsFile = {};
  617. queryParamsFile.ticketList = datas;
  618. getFile(queryParamsFile).then((response) => {
  619. if(response.data){
  620. //获取发票文件
  621. this.invoiceFileList = response.data.invoiceFileList;
  622. //获取合同文件
  623. this.contractFileList = response.data.contractFileList;
  624. //获取其他文件
  625. this.otherFileList = response.data.otherFileList;
  626. }
  627. });
  628. },
  629. //获取盖章文件
  630. getCreditSealFile(){
  631. getCreditSealFile(this.form).then((response) => {
  632. if(response.data.list){
  633. this.creditSealList = response.data.list;
  634. }
  635. });
  636. },
  637. //文件下载
  638. handleDownload(row){
  639. const pfiUrl = row.pfiUrl;
  640. if(pfiUrl != null && pfiUrl != ''){
  641. window.open(pfiUrl +"/"+ getToken());
  642. }else{
  643. this.$message({
  644. message: '该附件不存在!',
  645. type: 'warning'
  646. });
  647. return;
  648. }
  649. },
  650. resetQuerys() {
  651. this.resetForm("formQuery");
  652. this.handleQuerys();
  653. },
  654. handleQuerys() {
  655. this.queryParamsPay.pageNum = 1;
  656. this.getAccountsCollection();
  657. },
  658. //打开应收账款选择列表
  659. openTicket(id) {
  660. //清空搜索条件
  661. this.queryParamsPay.zbiName = "";
  662. this.queryParamsPay.pageNum = 1;
  663. if(id){
  664. this.queryParamsPay.zfiId = id;
  665. }
  666. this.chooseTicket = eval("(" + JSON.stringify(this.ticketList) + ")");
  667. this.getAccountsCollection();
  668. this.open = true;
  669. this.payTitle = "应收账款";
  670. },
  671. //应收账款查询列表
  672. getAccountsCollection() {
  673. //开立方为应收企业的
  674. this.queryParamsPay.payId = this.zfiCoreId;
  675. //接收方
  676. this.queryParamsPay.zfiSupplierId = this.zfiSupplierId;
  677. return getAccountsCollection(this.queryParamsPay).then((response) => {
  678. this.payList = response.data.records;
  679. this.selectChecked();
  680. this.total = response.data.total;
  681. return Promise.resolve(response)
  682. });
  683. },
  684. selectChecked() {
  685. //清空选择
  686. //             this.$refs.tablePay && this.$refs.tablePay.clearSelection();
  687. var changeSelectionTemp = eval("(" + JSON.stringify(this.chooseTicket) + ")")
  688. this.$nextTick(() => {
  689. this.$refs.tablePay.clearSelection();
  690. changeSelectionTemp.forEach((item) => {
  691. var f = true;
  692. for (var i=0; i < this.payList.length; i++) {
  693. var row = this.payList[i];
  694. if (row.zbiId == item.zbiId) {
  695. this.$refs.tablePay && this.$refs.tablePay.toggleRowSelection(row, true);
  696. f = false;
  697. break;
  698. }
  699. };
  700. if (f) {
  701. this.$refs.tablePay && this.$refs.tablePay.toggleRowSelection(item, true);
  702. }
  703. });
  704. })
  705. //合计
  706. // this.getReTotal(this.ticketList);
  707. //附件
  708. // this.getFile(this.ticketList);
  709. },
  710. /* 删除按钮 */
  711. handleDelete(index, rows) {
  712. rows.splice(index, 1);
  713. if(this.$refs.tablePay){
  714. this.$refs.tablePay.clearSelection();
  715. }
  716. this.selectChecked();
  717. },
  718. //详情按钮
  719. handleDetail(index, rows){
  720. this.zbiId = rows[index].zbiId
  721. this.openDetailBill = true
  722. },
  723. /* 修改按钮 */
  724. handleUpdate(index, rows) {
  725. this.zbiId = rows[index].zbiId;
  726. this.openEditBill = true
  727. },
  728. /* 多选框跨页 */
  729. rowkey(row) {
  730. return row.zbiId;
  731. },
  732. // 多选框选中数据
  733. handleSelectionChange(val) {
  734. this.chooseTicket = val
  735. },
  736. //回到父页
  737. cancelGo(){
  738. this.goShow = false;
  739. this.$store.dispatch(
  740. "tagsView/delView",
  741. this.$route
  742. );
  743. this.$router.go(-1);
  744. },
  745. // 确认选择
  746. closeTicket() {
  747. if(this.chooseTicket.length > 0){
  748. var flag = true;
  749. //获取选中第一个的预计还款日期
  750. var zbiPayDate = this.chooseTicket[0].zbiPayDate;
  751. for(var i = 0 ;i < this.chooseTicket.length;i++){
  752. if(zbiPayDate != this.chooseTicket[i].zbiPayDate){
  753. flag = false;
  754. this.$message({
  755. message: '请选择预计还款日期相同的应收账款',
  756. type: 'warning'
  757. });
  758. break;
  759. }
  760. }
  761. if(flag){
  762. //合计
  763. this.getReTotal(this.chooseTicket);
  764. this.ticketList = this.chooseTicket;
  765. //更新附件信息
  766. this.getFile(this.ticketList);
  767. this.open = false;
  768. }
  769. }else{
  770. this.$message({
  771. message: '请选择应收账款',
  772. type: 'warning'
  773. });
  774. }
  775. },
  776. //重新合计
  777. getReTotal(chooseTicket){
  778. //合计
  779. this.checkTotalAmt = "0.00";
  780. for(var i = 0; i < chooseTicket.length;i++){
  781. this.checkTotalAmt = accAdd(this.checkTotalAmt,chooseTicket[i].zbiAmount,2);
  782. }
  783. this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
  784. this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
  785. },
  786. //取消选择按钮
  787. cancelTicket(){
  788. /* this.ticketList = [];
  789. if(this.$refs.tablePay){
  790. this.$refs.tablePay.clearSelection();
  791. } */
  792. this.open = false;
  793. },
  794. /** 清空选择信息 */
  795. deleteTicekt() {
  796. this.ticketList = [];
  797. this.checkTotalAmt = "0.00";
  798. this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
  799. if(this.$refs.tablePay){
  800. this.$refs.tablePay.clearSelection();
  801. }
  802. //更新附件
  803. this.getFile(this.ticketList);
  804. },
  805. /* 删除按钮 */
  806. handleDelete(index, rows) {
  807. rows.splice(index, 1);
  808. if(this.$refs.tablePay){
  809. this.$refs.tablePay.clearSelection();
  810. }
  811. this.selectChecked();
  812. },
  813. onSelectAll() {
  814. if(this.$refs.tablePay){
  815. this.$refs.tablePay.clearSelection();
  816. }
  817. },
  818. //格式化金额
  819. amtFormat(cellValue) {
  820. if(cellValue == null || cellValue== undefined || cellValue == ''){
  821. cellValue = '0.00'
  822. }
  823. cellValue += '';
  824.       if (!cellValue.includes('.')) {
  825. cellValue += '.00';
  826. }
  827.       return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
  828.         return $1 + ',';
  829.       }).replace(/\.$/, '');
  830. },
  831. //获取签发金额大写
  832. getBigSmall(){
  833. this.issuedAmount = this.smallToBig(this.form.zfiAmount);
  834. },
  835. /* // 将数字金额转换为大写金额 */
  836. smallToBig(money) {
  837. // 将数字金额转换为大写金额
  838. var cnNums = new Array(
  839. "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ); //汉字的数字
  840. var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
  841. var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
  842. var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
  843. var cnInteger = "整"; //整数金额时后面跟的字符
  844. var cnIntLast = "元"; //整数完以后的单位
  845. //最大处理的数字
  846. var maxNum = 999999999999999.9999;
  847. var integerNum; //金额整数部分
  848. var decimalNum; //金额小数部分
  849. //输出的中文金额字符串
  850. var chineseStr = "";
  851. var parts; //分离金额后用的数组,预定义
  852. if (money == "" || money == null || money == undefined) {
  853. return "零元零角零分";
  854. }
  855. money = parseFloat(money);
  856. if (money >= maxNum) {
  857. //超出最大处理数字
  858. return "超出最大处理数字";
  859. }
  860. if (money == 0) {
  861. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  862. return chineseStr;
  863. }
  864. //四舍五入保留两位小数,转换为字符串
  865. money = Math.round(money * 100).toString();
  866. integerNum = money.substr(0, money.length - 2);
  867. decimalNum = money.substr(money.length - 2);
  868. //获取整型部分转换
  869. if (parseInt(integerNum, 10) > 0) {
  870. var zeroCount = 0;
  871. var IntLen = integerNum.length;
  872. for (var i = 0; i < IntLen; i++) {
  873. var n = integerNum.substr(i, 1);
  874. var p = IntLen - i - 1;
  875. var q = p / 4;
  876. var m = p % 4;
  877. if (n == "0") {
  878. zeroCount++;
  879. } else {
  880. if (zeroCount > 0) {
  881. chineseStr += cnNums[0];
  882. }
  883. //归零
  884. zeroCount = 0;
  885. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  886. }
  887. if (m == 0 && zeroCount < 4) {
  888. chineseStr += cnIntUnits[q];
  889. }
  890. }
  891. chineseStr += cnIntLast;
  892. }
  893. //小数部分
  894. if (decimalNum != "") {
  895. var decLen = decimalNum.length;
  896. for (var i = 0; i < decLen; i++) {
  897. var n = decimalNum.substr(i, 1);
  898. if (n != "0") {
  899. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  900. }
  901. }
  902. }
  903. if (chineseStr == "") {
  904. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  905. } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
  906. chineseStr += cnInteger;
  907. }
  908. return chineseStr;
  909. },
  910. //选择授信触发
  911. change(val) {
  912. if (!val) {
  913. //可用额度
  914. this.availableAmt = "0.00";
  915. //有效期
  916. this.validityDate ="";
  917. //产品是否可拆分
  918. this.zfpSplit= "",
  919. //融资放款方式
  920. this.zfpcrLoanType = "";
  921. //产品
  922. this.zfpId = "";
  923. //利率
  924. this.zfiRate = "";
  925. return;
  926. }
  927. let obj = {};
  928. obj = this.creditLineList.find(item => {
  929. return item.value === val;
  930. });
  931. //获取有效期的类型
  932. this.zfpcrDateType = obj.zfpcrDateType;
  933. //产品是否可拆分
  934. this.zfpSplit= obj.zfpSplit;
  935. //放款方式
  936. this.zfpcrLoanType = obj.zfpcrLoanType;
  937. //产品
  938. this.zfpId = obj.zfpId;
  939. //利率
  940. this.zfiRate = obj.zfpcrRate;
  941. //长期
  942. if("0"== this.zfpcrDateType){
  943. this.validityDate = "长期";
  944. }else{
  945. this.validityDate = obj.zfpcrEndDate;
  946. }
  947. var lineQueryParam = {};
  948. lineQueryParam.zfpcrId = val;
  949. //获取可用额度
  950. getAvailableBalance(lineQueryParam).then((response) => {
  951. this.availableAmt = response.data.remaining;
  952. });
  953. },
  954. //内部审批
  955. submitForm(param){
  956. this.$refs["form"].validate(valid => {
  957. //通过
  958. if(param == "00"){
  959. if(this.ticketList.length < 1){
  960. this.$message({
  961. message: '请选择应收账款',
  962. type: 'warning'
  963. });
  964. return;
  965. }
  966. if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
  967. this.$message({
  968. message: '签发金额不可大于合计金额',
  969. type: 'warning'
  970. });
  971. return;
  972. }
  973. }
  974. if (valid) {
  975. const loading = this.$loading({
  976. lock: true,
  977. text: 'Loading',
  978. background: 'rgba(0, 0, 0,0)'
  979. });
  980. //如果签发金额小于合计金额(通过需判断)
  981. if(((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))) && "00" == param){
  982. var _this = this;
  983. this.$confirm('签发金额小于应收金额合计,是否确认提交', "警告", {
  984. confirmButtonText: "确定",
  985. cancelButtonText: "取消",
  986. type: "warning"
  987. }).then(function() {
  988. //应收账款
  989. _this.form.ticketList = _this.ticketList;
  990. _this.form.flag = param;
  991. signFor(_this.form).then(response => {
  992. loading.close();
  993. //通过
  994. /* if("00" == param){ */
  995. _this.msgSuccess("融信资料已提交内部审核");
  996. _this.$store.dispatch("tagsView/delView", _this.$route);
  997. _this.$router.go(-1);
  998. /* }else if ("01" == param){//拒绝
  999. _this.msgSuccess("该笔融信将作废");
  1000. _this.$store.dispatch("tagsView/delView", _this.$route);
  1001. _this.$router.go(-1);
  1002. } */
  1003. }).catch((response)=>{
  1004. loading.close();
  1005. });
  1006. }).catch((e) => {
  1007. loading.close();
  1008. });
  1009. }else{
  1010. //应收账款
  1011. this.form.ticketList = this.ticketList;
  1012. this.form.flag = param;
  1013. signFor(this.form).then(response => {
  1014. loading.close();
  1015. //通过
  1016. if("00" == param){
  1017. this.msgSuccess("融信资料已提交内部审核");
  1018. this.$store.dispatch("tagsView/delView", this.$route);
  1019. this.$router.go(-1);
  1020. }else if ("01" == param){//拒绝
  1021. this.msgSuccess("该笔融信将作废");
  1022. this.$store.dispatch("tagsView/delView", this.$route);
  1023. this.$router.go(-1);
  1024. }
  1025. }).catch((response)=>{
  1026. loading.close();
  1027. });
  1028. }
  1029. }
  1030. });
  1031. },
  1032. //金额去掉千分位
  1033. moneyDelete(num){
  1034. if(num &&num != undefined && num != null){
  1035. let _num = num;
  1036. _num = _num.toString();
  1037. _num = _num.replace(/,/gi,'');
  1038. return _num;
  1039. }else{
  1040. return num;
  1041. }
  1042. },
  1043. //预览
  1044. handlePreview(row) {
  1045. const pfiUrl = row.pfiUrl;
  1046. const pfiFileName = row.pfiFileName;
  1047. if (row.pfiUrl) {
  1048. console.log(pfiFileName.substr(-3));
  1049. if (pfiFileName.substr(-3) == "pdf") {
  1050. this.wordUrl = pfiUrl + "/" + getToken();
  1051. this.show=false;
  1052. this.heid=true;
  1053. } else if (
  1054. pfiFileName.substr(-3) == "jpg" ||
  1055. pfiFileName.substr(-3) == "png" ||
  1056. pfiFileName.substr(-3) == "JPG" ||
  1057. pfiFileName.substr(-3) == "PNG" ||
  1058. pfiFileName.substr(-4) == "jpeg" ||
  1059. pfiFileName.substr(-3) == "JPEG"
  1060. ) {
  1061. this.wordUrl =
  1062. pfiUrl +
  1063. "/" +
  1064. getToken();
  1065. this.show=true;
  1066. this.heid=false;
  1067. console.log("====>",this.wordUrl);
  1068. } else if (
  1069. pfiFileName.substr(-3) == "doc" ||
  1070. pfiFileName.substr(-3) == "DOC"||
  1071. pfiFileName.substr(-4) == "docx" ||
  1072. pfiFileName.substr(-3) == "DOCX"
  1073. ) {
  1074. this.wordUrl =
  1075. "https://view.officeapps.live.com/op/view.aspx?src=" +
  1076. pfiUrl +
  1077. "/" +
  1078. getToken() +
  1079. "/" +
  1080. pfiFileName;
  1081. this.show=false;
  1082. this.heid=true;
  1083. console.log("====>",this.wordUrl);
  1084. } else {
  1085. this.$message({
  1086. message: "暂不支持该类型文件预览",
  1087. type: "warning",
  1088. });
  1089. return;
  1090. }
  1091. }
  1092. this.openFile = true;
  1093. },
  1094. //新增应付
  1095. addPay(){
  1096. //获取选中第一个的预计还款日期
  1097. if(this.chooseTicket[0]){
  1098. var zbiPayDate = this.chooseTicket[0].zbiPayDate;
  1099. this.payDate = zbiPayDate;
  1100. }
  1101. if(this.form.zfiCoreId){
  1102. this.openAddBill = true
  1103. }else{
  1104. this.$message({
  1105. message: "开立方不能为空",
  1106. type: "warning",
  1107. });
  1108. }
  1109. },
  1110. //新增账款回调
  1111. emitAddClick(val){
  1112. var self = this
  1113. this.getAccountsCollection().then((response) => {
  1114. //新增付款返回id直接选中
  1115. if (val) {
  1116. self.payList.forEach(element => {
  1117. if(element.zbiId == val){
  1118. // 将当前点击项选中
  1119. self.chooseTicket.push(element)
  1120. self.closeTicket()
  1121. }
  1122. });
  1123. }
  1124. })
  1125. self.openAddBill = false
  1126. },
  1127. //修改账款回调
  1128. emitEditClick(val) {
  1129. var self = this
  1130. getBill(val).then((response) => {
  1131. for (var i = 0; i < this.ticketList.length; i ++) {
  1132. if (response.data.zbiId == this.ticketList[i].zbiId) {
  1133. this.$set(this.ticketList, i, response.data)
  1134. break;
  1135. }
  1136. }
  1137. for (var i = 0; i < this.ticketList.length; i ++) {
  1138. if (response.data.zbiId == this.ticketList[i].zbiId) {
  1139. this.$set(this.chooseTicket, i, response.data)
  1140. break;
  1141. }
  1142. }
  1143. self.closeTicket();
  1144. })
  1145. self.openEditBill = false
  1146. },
  1147. //查询有无签收内部审批
  1148. isOpenApproval(){
  1149. var confirmParam = {};
  1150. confirmParam.menuId = "1000000005";
  1151. isOpenApproval(confirmParam).then((response) => {
  1152. var result = response.data.isOpen;
  1153. //有签收内部审批
  1154. if(true == result){
  1155. //获取融资方审批状态(拒绝或者状态为空时显示通过按钮)
  1156. if(this.zfiSupplierStatus == "02" || this.zfiSupplierStatus == "" || this.zfiSupplierStatus == "null" || this.zfiSupplierStatus == null ){
  1157. this.isHas = true;
  1158. }else{
  1159. this.isHas = false;
  1160. //获取文件
  1161. //融资方通过
  1162. if(this.zfiSupplierStatus == '01'){
  1163. //预览文件
  1164. this.getContractFile(true);
  1165. }
  1166. }
  1167. }else{//无签收内部审批,显示签收按钮
  1168. this.isHas = false;
  1169. //融资方通过
  1170. if(this.zfiSupplierStatus == '01'){
  1171. //预览文件
  1172. this.getContractFile(true);
  1173. }
  1174. }
  1175. });
  1176. },
  1177. //签收
  1178. sign(){
  1179. //融资方通过
  1180. if(this.zfiSupplierStatus == '01'){
  1181. //预览文件
  1182. this.getContractFile(false);
  1183. }else{
  1184. this.$refs["form"].validate(valid => {
  1185. //通过
  1186. if(this.ticketList.length < 1){
  1187. this.$message({
  1188. message: '请选择应收账款',
  1189. type: 'warning'
  1190. });
  1191. return;
  1192. }
  1193. if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
  1194. this.$message({
  1195. message: '签发金额不可大于合计金额',
  1196. type: 'warning'
  1197. });
  1198. return;
  1199. }
  1200. if (valid) {
  1201. const loading = this.$loading({
  1202. lock: true,
  1203. text: 'Loading',
  1204. background: 'rgba(0, 0, 0,0)'
  1205. });
  1206. //如果签发金额小于合计金额
  1207. if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
  1208. var _this = this;
  1209. this.$confirm('签发金额小于应收金额合计,是否确认提交', "警告", {
  1210. confirmButtonText: "确定",
  1211. cancelButtonText: "取消",
  1212. type: "warning"
  1213. }).then(function() {
  1214. //应收账款
  1215. _this.form.ticketList = _this.ticketList;
  1216. _this.form.flag = "00";
  1217. signFor(_this.form).then(response => {
  1218. loading.close();
  1219. //预览文件
  1220. _this.getContractFile(false);
  1221. }).catch((response)=>{
  1222. loading.close();
  1223. });
  1224. }).catch((e) => {
  1225. loading.close();
  1226. });
  1227. }else{
  1228. //应收账款
  1229. this.form.ticketList = this.ticketList;
  1230. this.form.flag = "00";
  1231. signFor(this.form).then(response => {
  1232. loading.close();
  1233. //预览文件
  1234. this.getContractFile(false);
  1235. }).catch((response)=>{
  1236. loading.close();
  1237. });
  1238. }
  1239. }
  1240. });
  1241. }
  1242. },
  1243. //获取合同文件
  1244. getContractFile(nosign){
  1245. const loading = this.$loading({
  1246. lock: true,
  1247. text: 'Loading',
  1248. background: 'rgba(0, 0, 0,0)'
  1249. });
  1250. getContractFile(this.form).then((response) => {
  1251. loading.close();
  1252. if(response.data.list){
  1253. this.pdfFileList = response.data.list;
  1254. }
  1255. //文件存在
  1256. if(this.pdfFileList.length > 0 ){
  1257. this.pdfShowDialog = true;
  1258. }else{
  1259. /* this.$message({
  1260. message: '文件不存在!',
  1261. type: 'warning'
  1262. }); */
  1263. //文件不存在,并且不是一进页面调的文件预览才盖章
  1264. if(!nosign){
  1265. this.contractSigning();
  1266. }
  1267. }
  1268. }).catch((response)=>{
  1269. loading.close();
  1270. });
  1271. },
  1272. closePdfShow(){
  1273. this.pdfShowDialog = false;
  1274. },
  1275. closePdfShows(){
  1276. this.pdfShowDialogs = false;
  1277. },
  1278. //盖章
  1279. contractSigning(){
  1280. const loading = this.$loading({
  1281. lock: true,
  1282. text: 'Loading',
  1283. background: 'rgba(0, 0, 0,0)'
  1284. });
  1285. listCompanyHandler().then((response) => {
  1286. if (response.data == true) {
  1287. contractSigning(this.form).then((response) => {
  1288. loading.close();
  1289. const zfiId = this.$route.params && this.$route.params.zfiId;
  1290. getFinanceSign(zfiId).then((response) => {
  1291. //融信编号
  1292. this.financeSignForm.zfiNumber = response.data.zfiNumber;
  1293. //融信金额
  1294. if(response.data.zfiAmount){
  1295. this.financeSignForm.zfiAmount = response.data.zfiAmount;
  1296. }else{
  1297. this.financeSignForm.zfiAmount = "0.00";
  1298. }
  1299. //利率
  1300. if(response.data.zfiRate){
  1301. this.financeSignForm.zfiRate = response.data.zfiRate;
  1302. }else{
  1303. this.financeSignForm.zfiRate = "0";
  1304. }
  1305. //最长融信期限
  1306. this.financeSignForm.intervalTime = response.data.intervalTime;
  1307. //融信有效期
  1308. if(response.data.validity){
  1309. this.financeSignForm.validity = response.data.validity;
  1310. }
  1311. this.goShow = true;
  1312. });
  1313. }).catch((response) => {
  1314. loading.close();
  1315. });
  1316. } else {
  1317. loading.close();
  1318. this.$message({
  1319. message: "此操作需经办人权限,请确认您是否是经办人",
  1320. type: 'warning'
  1321. });
  1322. }
  1323. });
  1324. },
  1325. //去融资
  1326. goFinance(){
  1327. //关闭当前页
  1328. this.$store.dispatch(
  1329. "tagsView/delView",
  1330. this.$route
  1331. );
  1332. //关闭弹框
  1333. this.goShow = false;
  1334. Cookies.set("/credit/goFinance/"+this.zfiId + "/", this.$route.fullPath)
  1335. this.$router.push({ path: "/credit/goFinance/"+this.zfiId + "/" });
  1336. },
  1337. //返回到列表页
  1338. goParent(){
  1339. var self = this
  1340. this.pdfShowDialog = false;
  1341. self.$store.dispatch(
  1342. "tagsView/delView",
  1343. self.$route
  1344. );
  1345. //self.$router.push("/Bill/credit")
  1346. self.$router.push("/Bill/credit")
  1347. },
  1348. /* 金额展示 */
  1349. handleInput(str) {
  1350. return amtformat(str, 2, ".", ",");
  1351. },
  1352. }
  1353. };
  1354. </script>
  1355. <style lang="scss">
  1356. .uoloadfj .el-upload--picture-card{
  1357. width:110px;
  1358. height:110px;
  1359. line-height:110px;
  1360. }
  1361. .fjUoloadSty .el-upload--picture-card{
  1362. display:none;
  1363. }
  1364. table th.star div::before {
  1365. content: '*';
  1366. color: red;
  1367. }
  1368. </style>
  1369. <style type="text/css">
  1370. table.gridtable {
  1371. font-size:11px;
  1372. color:#333333;
  1373. border-width: 1px;
  1374. border-collapse: collapse;
  1375. }
  1376. table.gridtable th {
  1377. border-width: 1px;
  1378. padding: 8px;
  1379. border-style: solid;
  1380. background-color: #dedede;
  1381. }
  1382. table.gridtable td {
  1383. border-width: 1px;
  1384. padding: 8px;
  1385. border-style: solid;
  1386. }
  1387. </style>