detailCreditLine.vue 25 KB

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