detailCreditLine.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  1. <template>
  2. <div class="app-container">
  3. <el-form ref="form" :label-position="labelPosition" :model="form" :rules="rules" label-width="106px" >
  4. <el-divider content-position="left">授信信息</el-divider>
  5. <el-row>
  6. <el-col :span="8">
  7. <el-form-item label="资金方:" prop="zfpcrFundSide">
  8. <el-select v-model="form.zfpcrFundSide" style="width : 284px" clearable disabled>
  9. <el-option
  10. v-for="(item,index) in zfCompanyList"
  11. :key="index"
  12. :label="item.scyName"
  13. :value="item.scyId"
  14. ></el-option>
  15. </el-select>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :span="8">
  19. <el-form-item label="融资产品:" prop="zfpcrProductId">
  20. <el-select v-model="form.zfpcrProductId" style="width : 284px" clearable disabled>
  21. <el-option
  22. v-for="(item,index) in financeProductList"
  23. :key="index"
  24. :label="item.zfpName"
  25. :value="item.zfpId"
  26. ></el-option>
  27. </el-select>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="8">
  31. <el-form-item label="授信企业名称:" prop="zfpcrCompanyId">
  32. <el-select v-model="form.zfpcrCompanyId" style="width : 284px" clearable disabled>
  33. <el-option
  34. v-for="(item,index) in hxCompanyList"
  35. :key="index"
  36. :label="item.scyName"
  37. :value="item.scyId"
  38. ></el-option>
  39. </el-select>
  40. </el-form-item>
  41. </el-col>
  42. </el-row>
  43. <el-row>
  44. <el-col :span="8">
  45. <el-form-item label="原授信额度:" prop="zfpcrOldAmount" >
  46. <el-input v-model="form.zfpcrOldAmount" style="width:284px" disabled>
  47. <template slot="append">元</template>
  48. </el-input>
  49. </el-form-item>
  50. </el-col>
  51. <el-col :span="8">
  52. <el-form-item label="已用授信额度:" prop="zfiAmount" >
  53. <el-input v-model="form.zfiAmount" style="width:284px" disabled>
  54. <template slot="append">元</template>
  55. </el-input>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :span="8">
  59. <el-form-item label="剩余授信额度:" prop="usableAmount" >
  60. <el-input v-model="form.usableAmount" style="width:284px" disabled>
  61. <template slot="append">元</template>
  62. </el-input>
  63. </el-form-item>
  64. </el-col>
  65. </el-row>
  66. <el-row>
  67. <el-col :span="8">
  68. <el-form-item label="授信额度:" prop="zfpcrAmount">
  69. <!-- <el-tooltip class="item" effect="light" :content= "zfpcrAmountFormat" placement="top-start"> -->
  70. <el-input v-model="form.zfpcrAmount" placeholder="请输入授信额度" style="width:284px" readonly>
  71. <template slot="append">元</template>
  72. </el-input>
  73. <!-- </el-tooltip> -->
  74. </el-form-item>
  75. </el-col>
  76. <el-col :span="8">
  77. <el-form-item label="利率:" prop="zfpcrRate">
  78. <el-input v-model="form.zfpcrRate" placeholder="请输入利率" style="width:284px" readonly>
  79. <template slot="append">%起</template>
  80. </el-input>
  81. </el-form-item>
  82. </el-col>
  83. <el-col :span="8">
  84. <el-form-item label="有效期:" prop="zfpcrDateType">
  85. <el-radio-group v-model="form.zfpcrDateType" size="medium" disabled>
  86. <el-radio-button v-for="(dict,index) in dateTypeOptions" :key="index" :label="dict.dictValue" border>{{dict.dictLabel}}</el-radio-button>
  87. </el-radio-group>
  88. </el-form-item>
  89. </el-col>
  90. </el-row>
  91. <el-row>
  92. <el-col :span="8">
  93. <el-form-item label="有效期范围:" prop="dateTime" v-if="this.form.zfpcrDateType == '1'" >
  94. <el-date-picker
  95. v-model="form.dateTime"
  96. clearable
  97. disabled
  98. style="width: 284px"
  99. unlink-panels
  100. value-format="yyyy-MM-dd"
  101. type="daterange"
  102. range-separator="-"
  103. start-placeholder="开始日期"
  104. end-placeholder="结束日期">
  105. </el-date-picker>
  106. </el-form-item>
  107. </el-col>
  108. <el-col :span="8">
  109. <el-form-item label="融资网点:" prop="zfpcrAddress">
  110. <el-input v-model="form.zfpcrAddress" placeholder="请输入融资网点" style="width:284px" readonly/>
  111. </el-form-item>
  112. </el-col>
  113. <el-col :span="8">
  114. <el-form-item label="是否收取手续费:" prop="zfpcrCharge" label-width="113px">
  115. <el-radio-group v-model="form.zfpcrCharge" size="medium" disabled>
  116. <el-radio-button v-for="(dict,index) in chargeOptions" :key="index" :label="dict.dictValue" border>{{dict.dictLabel}}</el-radio-button>
  117. </el-radio-group>
  118. </el-form-item>
  119. </el-col>
  120. </el-row>
  121. <el-row>
  122. <el-col :span="8">
  123. <el-form-item label="平台服务费收取费率:" prop="zfpcrChargeRate" label-width="139px" v-if="this.form.zfpcrCharge == '1'">
  124. <el-input v-model="form.zfpcrChargeRate" placeholder="请输入平台服务费收取费率" style="width:284px" readonly>
  125. <template slot="append">%</template>
  126. </el-input>
  127. </el-form-item>
  128. </el-col>
  129. <el-col :span="8">
  130. <el-form-item label="核心企业还款账户账号:" prop="zfpcrAccount" label-width="142px">
  131. <el-autocomplete
  132. readonly
  133. style="width:286px"
  134. class="inline-input"
  135. v-model="form.zfpcrAccount"
  136. :fetch-suggestions="querySearch"
  137. placeholder="核心企业还款账户账号"
  138. ></el-autocomplete>
  139. </el-form-item>
  140. </el-col>
  141. <el-col :span="8">
  142. <el-form-item label="核心企业还款账户开户行:" prop="zfpcrAccountBank" label-width="142px">
  143. <el-input v-model="form.zfpcrAccountBank" placeholder="请输入核心企业还款账户开户行" style="width:284px" maxlength="30" readonly>
  144. </el-input>
  145. </el-form-item>
  146. </el-col>
  147. </el-row>
  148. <el-row>
  149. <el-col :span="8">
  150. <el-form-item label="融资放款方式:" prop="zfpcrLoanType">
  151. <el-select v-model="form.zfpcrLoanType" placeholder="请选择状态" clearable style="width : 284px" clearable disabled>
  152. <el-option
  153. v-for="dict in loanTypeOptions"
  154. :key="dict.dictValue"
  155. :label="dict.dictLabel"
  156. :value="dict.dictValue"
  157. />
  158. </el-select>
  159. </el-form-item>
  160. </el-col>
  161. <el-col :span="8">
  162. <el-form-item label="记账簿托管方式:" prop="zfpcrBookkeepingType" label-width="113px">
  163. <el-select v-model="form.zfpcrBookkeepingType" placeholder="请选择状态" clearable style="width : 284px" clearable disabled>
  164. <el-option
  165. v-for="dict in bookkeepingTypeOptions"
  166. :key="dict.dictValue"
  167. :label="dict.dictLabel"
  168. :value="dict.dictValue"
  169. />
  170. </el-select>
  171. </el-form-item>
  172. </el-col>
  173. </el-row>
  174. <el-divider content-position="left">关联合同</el-divider>
  175. <el-form-item prop="zfqcrContractId" style="margin-left: 100px" >
  176. <!-- <el-button size="mini" type="primary" @click="openTicket">选择合同</el-button>
  177. <el-button size="mini" @click="deleteTicekt">清空全部</el-button> -->
  178. <el-table :data="ticketList" style="width: 1100px">
  179. <el-table-column label="序号" type="index" width="50" align="center">
  180. <template slot-scope="scope">
  181. <span>{{ (queryParamsContract.pageNum - 1) * queryParamsContract.pageSize + scope.$index + 1}}</span>
  182. </template>
  183. </el-table-column>
  184. <el-table-column label="合同模板名称" align="center" prop="zfcName" />
  185. <el-table-column label="签署节点" align="center" prop="zfcNode" :formatter="nodeFormat"/>
  186. <el-table-column label="合同id" align="center" prop="zfcId" v-if="false" />
  187. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
  188. <template slot-scope="scope">
  189. <el-button
  190. :disabled="!scope.row.pfiUrl"
  191. style="font-size:12px"
  192. type="text"
  193. icon="el-icon-s-promotion"
  194. @click="handlePreview(scope.row)"
  195. >预览</el-button>
  196. </template>
  197. </el-table-column>
  198. </el-table>
  199. </el-form-item>
  200. </el-form>
  201. <!-- 合同信息 -->
  202. <el-dialog :title="title" :visible.sync="open" width="1120px" append-to-body>
  203. <el-form :model="queryParamsContract" ref="formQuery" :inline="true" label-width="68px" style="margin-bottom: -21px">
  204. <el-form-item label="合同模板编号" prop="zfcNumber">
  205. <el-input
  206. v-model="queryParamsContract.zfcNumber"
  207. placeholder="请输入合同模板编号"
  208. clearable
  209. size="small"
  210. maxlength="11"
  211. @keyup.enter.native="handleQuerys"/>
  212. </el-form-item>
  213. <el-form-item label="合同模板名称" prop="zfcName">
  214. <el-input
  215. v-model="queryParamsContract.zfcName"
  216. placeholder="请输入合同模板名称"
  217. clearable
  218. size="small"
  219. maxlength="11"
  220. @keyup.enter.native="handleQuerys"/>
  221. </el-form-item>
  222. <el-form-item>
  223. <el-button
  224. type="cyan"
  225. icon="el-icon-search"
  226. size="mini"
  227. @click="handleQuerys"
  228. >搜索</el-button>
  229. <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys"
  230. >重置</el-button>
  231. </el-form-item>
  232. </el-form>
  233. <el-table :data="contractList"
  234. ref="tableContract"
  235. class="single-select-table"
  236. @selection-change="handleSelectionChange"
  237. :row-key="rowkey">
  238. <el-table-column
  239. type="selection"
  240. :reserve-selection="true"
  241. width="50"
  242. align="center"/>
  243. <el-table-column label="序号" type="index" width="50" align="center">
  244. <template slot-scope="scope">
  245. <span>{{ (queryParamsContract.pageNum - 1) * queryParamsContract.pageSize + scope.$index + 1}}</span>
  246. </template>
  247. </el-table-column>
  248. <el-table-column label="合同模板编号" align="center" prop="zfcNumber" show-overflow-tooltip />
  249. <el-table-column label="合同模板名称" align="center" prop="zfcName" />
  250. <el-table-column label="签署节点" align="center" prop="zfcNode" :formatter="nodeFormat"/>
  251. </el-table>
  252. <pagination
  253. v-show="total > 0"
  254. :total="total"
  255. :page.sync="queryParamsContract.pageNum"
  256. :limit.sync="queryParamsContract.pageSize"
  257. @pagination="getContractList" />
  258. <span slot="footer" class="dialog-footer">
  259. <el-button size="mini" @click="cancelTicket">取消</el-button>
  260. <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
  261. </span>
  262. </el-dialog>
  263. <div style="margin-top: 100px; margin-left:45%">
  264. <el-button type="info" @click="cancel">取消</el-button>
  265. <!-- <el-button type="success" @click="submitForm"
  266. >提交</el-button> -->
  267. </div>
  268. <el-dialog :title="title" :visible.sync="openWord" width="900px" append-to-body>
  269. <iframe :src="wordUrl" width='800px' height='500px' frameborder='1' />
  270. </el-dialog>
  271. </div>
  272. </template>
  273. <script>
  274. import { listCreditLine, getCreditLine, delCreditLine, addCreditLine, updateCreditLine} from "@/api/service/creditLine/creditLine";
  275. import { listFinanceProduct } from "@/api/common/financeProduct";
  276. import { listCompany } from "@/api/common/company";
  277. import { listCompanyAcc } from "@/api/common/companyAcc";
  278. import { getToken } from "@/utils/auth";
  279. export default {
  280. name: "detailCreditLine",
  281. components: {},
  282. data() {
  283. return {
  284. wordUrl: '',
  285. openWord: false,
  286. //金额展示
  287. zfpcrAmountFormat: '',
  288. //还款账户搜所
  289. restaurants: [],
  290. labelPosition: 'top',
  291. // 遮罩层
  292. loading: true,
  293. // 选中数组
  294. ids: [],
  295. // 非单个禁用
  296. single: true,
  297. // 非多个禁用
  298. multiple: true,
  299. // 显示搜索条件
  300. showSearch: true,
  301. // 总条数
  302. total: 0,
  303. // 企业授信额度表格数据
  304. creditLineList: [],
  305. //资金方数据
  306. zfCompanyList: [],
  307. //融资产品数据
  308. financeProductList: [],
  309. //核心企业数据
  310. hxCompanyList: [],
  311. //核心企业还款账户数据:
  312. accList: [],
  313. //合同表格数据
  314. ticketList: [],
  315. //合同列表数据
  316. contractList: [],
  317. //有效期数据字典
  318. dateTypeOptions: [],
  319. //是否收取手续费数据字典
  320. chargeOptions: [],
  321. //融资放款方式数据字典
  322. loanTypeOptions: [],
  323. //记账簿托管方式数据字典
  324. bookkeepingTypeOptions: [],
  325. //签署节点数据字典
  326. nodeOptions: [],
  327. // 弹出层标题
  328. title: "",
  329. // 是否显示弹出层
  330. open: false,
  331. // 查询参数
  332. queryParams: {
  333. pageNum: 1,
  334. pageSize: 10,
  335. zfpcrProductId: null,
  336. zfpcrCompanyId: null,
  337. zfpcrType: null,
  338. zfpcrAmount: null,
  339. zfpcrRate: null,
  340. zfpcrDivisionAmount: null,
  341. zfpcrDateType: null,
  342. zfpcrStartDate: null,
  343. zfpcrEndDate: null,
  344. zfpcrAddress: null,
  345. zfpcrCharge: null,
  346. zfpcrChargeRate: null,
  347. zfpcrAccount: null,
  348. zfpcrLoanType: null,
  349. zfpcrBookkeepingType: null,
  350. zfpcrStatus: null,
  351. zfpcrProfitSpare1: null,
  352. zfpcrProfitSpare2: null,
  353. zfpcrProfitSpare3: null,
  354. zfpcrProfitSpare4: null,
  355. zfpcrProfitSpare5: null,
  356. zfpcrProfitSpare6: null,
  357. zfpcrProfitSpare7: null,
  358. zfpcrProfitSpare8: null,
  359. zfpcrProfitSpare9: null,
  360. },
  361. queryParamsContract: {
  362. pageNum: 1,
  363. pageSize: 10,
  364. zfcId: null,
  365. zfcName: null,
  366. zfcNumber: null,
  367. zfcManagementId: null
  368. },
  369. // 表单参数
  370. form: {
  371. zfpcrDateType: '0',
  372. zfpcrCharge: '1'
  373. },
  374. // 表单校验
  375. rules: {
  376. zfpcrFundSide: [
  377. { required: true, message: "资金方不能为空", trigger: ["blur", "change"] }
  378. ],
  379. zfpcrProductId: [
  380. { required: true, message: "融资产品不能为空", trigger: ["blur", "change"] }
  381. ],
  382. zfpcrCompanyId: [
  383. { required: true, message: "授信企业名称不能为空", trigger: ["blur", "change"] }
  384. ],
  385. zfpcrAmount: [
  386. { required: true, message: "授信额度不能为空", trigger: ["blur", "change"] },
  387. {
  388. pattern: /^[0-9][0-9]{0,7}$|^[1-9][0-9]{0,7}[.]\d{1,2}$/,
  389. message: "请输入正确的额度",
  390. trigger: "change",
  391. },
  392. ],
  393. zfpcrRate: [
  394. { required: true, message: "利率不能为空", trigger: ["blur", "change"] },
  395. {
  396. pattern: /^([0-9]{1,2}$)|(^[0-9]{1,2}\.[0-9]{1,2}$)|100$/,
  397. message: "请输入正确的利率",
  398. trigger: "change",
  399. },
  400. ],
  401. dateTime: [
  402. { required: true, message: "有效期范围不能为空", trigger: ["blur", "change"] }
  403. ],
  404. zfpcrChargeRate: [
  405. { required: true, message: "平台服务费收取费率不能为空", trigger: ["blur", "change"] },
  406. {
  407. pattern: /^([0-9]{1,2}$)|(^[0-9]{1,2}\.[0-9]{1,2}$)|100$/,
  408. message: "请输入正确的平台服务费收取费率",
  409. trigger: "change",
  410. },
  411. ],
  412. zfpcrAccount: [
  413. { required: true, message: "核心企业还款账户账号", trigger: ["blur", "change"] }
  414. ],
  415. zfpcrAccountBank: [
  416. { required: true, message: "核心企业还款账户开户行", trigger: ["blur", "change"] }
  417. ],
  418. zfpcrLoanType: [
  419. { required: true, message: "融资放款方式不能为空", trigger: ["blur", "change"] }
  420. ],
  421. zfpcrBookkeepingType: [
  422. { required: true, message: "记账簿托管方式不能为空", trigger: ["blur", "change"] }
  423. ],
  424. }
  425. };
  426. },
  427. created() {
  428. const zfpcrId = this.$route.params && this.$route.params.zfpcrId;
  429. const zfiAmount = this.$route.params && this.$route.params.zfiAmount;
  430. const usableAmount = this.$route.params && this.$route.params.usableAmount;
  431. var self =this;
  432. getCreditLine(zfpcrId).then((response) => {
  433. debugger
  434. this.ticketList = response.data.ticketList;
  435. /* 查询资方 */
  436. //公司类型
  437. const scyType = '03';
  438. //公司id
  439. const scyId = response.data.list[0].zfpManagementId;
  440. listCompany(scyType,scyId).then((response) =>{
  441. this.zfCompanyList = response.data
  442. });
  443. /* 查询融资产品 */
  444. //产品id
  445. const zfpcrProductId = response.data.list[0].zfpcrProductId;
  446. listFinanceProduct(zfpcrProductId).then((response) =>{
  447. this.financeProductList = response.data
  448. });
  449. /* 查询授信企业名称 */
  450. //公司类型
  451. const scyTypes = '01';
  452. //公司id
  453. const scyIds = response.data.list[0].zfpcrCompanyId;
  454. listCompany(scyTypes,scyIds).then((response) =>{
  455. this.hxCompanyList = response.data
  456. });
  457. /* 查询还款账户 */
  458. //银行卡号
  459. const zfpcrAccount = response.data.list[0].zfpcrAccount;
  460. listCompanyAcc(zfpcrAccount).then((response) =>{
  461. this.accList = response.data
  462. this.restaurants = response.data;
  463. }).then(()=>{
  464. self.form = response.data.list[0]
  465. self.form.zfpcrFundSide = self.zfCompanyList[0].scyId;
  466. this.$set(this.form, "dateTime", [response.data.list[0].zfpcrStartDate, response.data.list[0].zfpcrEndDate])
  467. this.$set(this.form, "zfiAmount", zfiAmount);
  468. this.$set(this.form, "usableAmount", usableAmount);
  469. });
  470. });
  471. // this.getZfCompany();
  472. // this.getFinanceProduct();
  473. // this.getHxCompany();
  474. // this.getCompanyAcc();
  475. this.getDicts("zc_zfpcr_date_type").then(response => {
  476. this.dateTypeOptions = response.data;
  477. });
  478. this.getDicts("zc_zfpcr_charge").then(response => {
  479. this.chargeOptions = response.data;
  480. });
  481. this.getDicts("zc_zfpcr_loan_type").then(response => {
  482. this.loanTypeOptions = response.data;
  483. });
  484. this.getDicts("zc_zfpcr_bookkeeping_type").then(response => {
  485. this.bookkeepingTypeOptions = response.data;
  486. });
  487. this.getDicts("zc_zfc_node").then((response) => {
  488. this.nodeOptions = response.data;
  489. });
  490. },
  491. methods: {
  492. /* 资方公司 */
  493. getZfCompany(){
  494. //公司类型
  495. const scyType = '03'
  496. listCompany(scyType).then((response) =>{
  497. this.zfCompanyList = response.data
  498. })
  499. },
  500. /* 融资产品 */
  501. getFinanceProduct(){
  502. listFinanceProduct().then((response) =>{
  503. this.financeProductList = response.data
  504. })
  505. },
  506. /* 授信企业 */
  507. getHxCompany(){
  508. //公司类型
  509. const scyTypes = '01'
  510. listCompany(scyTypes).then((response) =>{
  511. this.hxCompanyList = response.data
  512. })
  513. },
  514. /* 核心企业还款账户账号 */
  515. getCompanyAcc(){
  516. listCompanyAcc().then((response) =>{
  517. this.accList = response.data
  518. this.restaurants = response.data;
  519. })
  520. },
  521. /* 账户模糊搜所 */
  522. querySearch(queryString, cb) {
  523. var restaurants = this.restaurants;
  524. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
  525. // 调用 callback 返回建议列表的数据
  526. cb(results);
  527. },
  528. createFilter(queryString) {
  529. return (restaurant) => {
  530. return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
  531. };
  532. },
  533. /* 合同相关 */
  534. //合同列表
  535. getContractList() {
  536. this.queryParamsContract.zfcManagementId = this.form.zfpcrFundSide
  537. listContract(this.queryParamsContract).then((response) => {
  538. this.contractList = response.data.records;
  539. this.selectChecked();
  540. this.total = response.data.total;
  541. });
  542. },
  543. //打开合同选择列表
  544. openTicket() {
  545. this.getContractList()
  546. this.open = true
  547. this.title = "合同信息"
  548. },
  549. selectChecked() {
  550. this.ticketList.forEach((item) => {
  551. this.contractList.forEach(row => {
  552. if (row.zfcId == item.zfcId) {
  553. this.$nextTick(() => {
  554. this.$refs.tableContract && this.$refs.tableContract.toggleRowSelection(row, true);
  555. })
  556. }
  557. });
  558. });
  559. },
  560. /* 多选框跨页 */
  561. rowkey(row) {
  562. return row.zfcId;
  563. },
  564. // 多选框选中数据
  565. handleSelectionChange(val) {
  566. this.chooseTicket = val
  567. },
  568. // 确认选择
  569. closeTicket() {
  570. if(this.chooseTicket.length > 0){
  571. this.ticketList = this.chooseTicket
  572. this.$set(this.form, "zfcName", this.ticketList[0].zfcName);
  573. this.$set(this.form, "zfcNumber", this.ticketList[0].zfcNumber);
  574. this.$set(this.form, "zfcSubject", this.ticketList[0].zfcSubject);
  575. this.$set(this.form, "zfcId", this.ticketList[0].zfcId);
  576. this.open = false
  577. }else{
  578. this.$message({
  579. message: '请选择合同',
  580. type: 'warning'
  581. });
  582. }
  583. },
  584. //取消选择合同按钮
  585. cancelTicket(){
  586. this.ticketList = [];
  587. if(this.$refs.tableContract){
  588. this.$refs.tableContract.clearSelection();
  589. }
  590. this.open = false;
  591. },
  592. // 取消按钮
  593. cancel() {
  594. // this.reset();
  595. this.$store.dispatch("tagsView/delView", this.$route);
  596. this.$router.go(-1);
  597. this.open = false;
  598. },
  599. /** 清空选择发票信息 */
  600. deleteTicekt() {
  601. this.ticketList = []
  602. if(this.$refs.tableContract){
  603. this.$refs.tableContract.clearSelection();
  604. }
  605. },
  606. /* 删除按钮 */
  607. handleDelete(index, rows) {
  608. rows.splice(index, 1);
  609. if(this.$refs.tableContract){
  610. this.$refs.tableContract.clearSelection();
  611. }
  612. this.selectChecked();
  613. },
  614. onSelectAll() {
  615. if(this.$refs.tableContract){
  616. this.$refs.tableContract.clearSelection();
  617. }
  618. },
  619. handleQuerys() {
  620. this.queryParamsContract.pageNum = 1;
  621. this.getContractList();
  622. },
  623. resetQuerys() {
  624. this.resetForm("formQuery");
  625. this.handleQuerys();
  626. },
  627. handlePreview(row) {
  628. debugger
  629. this.title = "";
  630. const pfiUrl = row.pfiUrl;
  631. const pfiFileName = row.pfiFileName;
  632. console.log(pfiFileName.substr(-3),"laalal");
  633. if (row.pfiUrl) {
  634. if (pfiFileName.substr(-3) == "pdf") {
  635. this.wordUrl = pfiUrl + "/" + getToken();
  636. } else if(pfiFileName.substr(-3) == "doc" || pfiFileName.substr(-4) == "docx"){
  637. this.wordUrl =
  638. "https://view.officeapps.live.com/op/view.aspx?src=" +
  639. pfiUrl +
  640. "/" +
  641. getToken() +
  642. "/" +
  643. pfiFileName;
  644. }else{
  645. this.$message({
  646. message: "暂不支持该类型文件预览",
  647. type: "warning",
  648. });
  649. return;
  650. }
  651. }
  652. this.openWord = true;
  653. },
  654. /** 提交按钮 */
  655. submitForm() {
  656. // if(this.ticketList == undefined || this.ticketList.length == 0){
  657. // this.$message({
  658. // message: '请选择合同',
  659. // type: 'warning'
  660. // });
  661. // return;
  662. // }
  663. this.$refs["form"].validate(valid => {
  664. this.form.ticketList = this.ticketList;
  665. if (valid) {
  666. const loading = this.$loading({
  667. lock: true,
  668. text: "Loading",
  669. spinner: "el-icon-loading",
  670. background: "rgba(0, 0, 0, 0.7)",
  671. });
  672. addCreditLine(this.form).then(response => {
  673. this.msgSuccess("新增成功");
  674. this.$store.dispatch("tagsView/delView", this.$route);
  675. this.$router.go(-1);
  676. }).catch((response) => {
  677. loading.close();
  678. });
  679. }
  680. });
  681. },
  682. //签署节点字典反显
  683.     nodeFormat(row, column) {
  684.       var zfcNodes = row.zfcNode.split(",");
  685.       var zfcNodeList='';
  686.       for(var i=0;i<zfcNodes.length;i++){
  687.         zfcNodeList += this.selectDictLabel(this.nodeOptions, zfcNodes[i]);
  688.         if(i < zfcNodes.length-1){
  689.           zfcNodeList +=",";
  690.         }
  691.       }
  692.       return zfcNodeList;
  693.     },
  694. /* 金额展示 */
  695. handleInput(str) {
  696. this.zfpcrAmountFormat = amtformat(str,2, ".", ",");
  697. },
  698. /* // 将数字金额转换为大写金额 */
  699. smallToBig(money) {
  700. // 将数字金额转换为大写金额
  701. var cnNums = new Array(
  702. "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ); //汉字的数字
  703. var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
  704. var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
  705. var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
  706. var cnInteger = "整"; //整数金额时后面跟的字符
  707. var cnIntLast = "元"; //整数完以后的单位
  708. //最大处理的数字
  709. var maxNum = 999999999999999.9999;
  710. var integerNum; //金额整数部分
  711. var decimalNum; //金额小数部分
  712. //输出的中文金额字符串
  713. var chineseStr = "";
  714. var parts; //分离金额后用的数组,预定义
  715. if (money == "" || money == null || money == undefined) {
  716. return "零元零角零分";
  717. }
  718. money = parseFloat(money);
  719. if (money >= maxNum) {
  720. //超出最大处理数字
  721. return "超出最大处理数字";
  722. }
  723. if (money == 0) {
  724. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  725. return chineseStr;
  726. }
  727. //四舍五入保留两位小数,转换为字符串
  728. money = Math.round(money * 100).toString();
  729. integerNum = money.substr(0, money.length - 2);
  730. decimalNum = money.substr(money.length - 2);
  731. //获取整型部分转换
  732. if (parseInt(integerNum, 10) > 0) {
  733. var zeroCount = 0;
  734. var IntLen = integerNum.length;
  735. for (var i = 0; i < IntLen; i++) {
  736. var n = integerNum.substr(i, 1);
  737. var p = IntLen - i - 1;
  738. var q = p / 4;
  739. var m = p % 4;
  740. if (n == "0") {
  741. zeroCount++;
  742. } else {
  743. if (zeroCount > 0) {
  744. chineseStr += cnNums[0];
  745. }
  746. //归零
  747. zeroCount = 0;
  748. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  749. }
  750. if (m == 0 && zeroCount < 4) {
  751. chineseStr += cnIntUnits[q];
  752. }
  753. }
  754. chineseStr += cnIntLast;
  755. }
  756. //小数部分
  757. if (decimalNum != "") {
  758. var decLen = decimalNum.length;
  759. for (var i = 0; i < decLen; i++) {
  760. var n = decimalNum.substr(i, 1);
  761. if (n != "0") {
  762. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  763. }
  764. }
  765. }
  766. if (chineseStr == "") {
  767. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  768. } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
  769. chineseStr += cnInteger;
  770. }
  771. return chineseStr;
  772. },
  773. },
  774. };
  775. </script>
  776. <style>
  777. .single-select-table thead .el-table-column--selection .cell {
  778. display: none;
  779. }
  780. </style>