editCreditLine.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  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>
  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: "editCreditLine",
  263. components: {},
  264. data() {
  265. return {
  266. //存储授信额度
  267. amount: '',
  268. //金额展示
  269. zfpcrAmountFormat: '',
  270. //还款账户搜所
  271. restaurants: [],
  272. labelPosition: 'top',
  273. // 遮罩层
  274. loading: true,
  275. // 选中数组
  276. ids: [],
  277. // 非单个禁用
  278. single: true,
  279. // 非多个禁用
  280. multiple: true,
  281. // 显示搜索条件
  282. showSearch: true,
  283. // 总条数
  284. total: 0,
  285. // 企业授信额度表格数据
  286. creditLineList: [],
  287. //资金方数据
  288. zfCompanyList: [],
  289. //融资产品数据
  290. financeProductList: [],
  291. //核心企业数据
  292. hxCompanyList: [],
  293. //核心企业还款账户数据:
  294. accList: [],
  295. //合同表格数据
  296. ticketList: [],
  297. //合同列表数据
  298. contractList: [],
  299. //有效期数据字典
  300. dateTypeOptions: [],
  301. //是否收取手续费数据字典
  302. chargeOptions: [],
  303. //融资放款方式数据字典
  304. loanTypeOptions: [],
  305. //记账簿托管方式数据字典
  306. bookkeepingTypeOptions: [],
  307. // 弹出层标题
  308. title: "",
  309. // 是否显示弹出层
  310. open: false,
  311. // 查询参数
  312. queryParams: {
  313. pageNum: 1,
  314. pageSize: 10,
  315. zfpcrProductId: null,
  316. zfpcrCompanyId: null,
  317. zfpcrType: null,
  318. zfpcrAmount: null,
  319. zfpcrRate: null,
  320. zfpcrDivisionAmount: null,
  321. zfpcrDateType: null,
  322. zfpcrStartDate: null,
  323. zfpcrEndDate: null,
  324. zfpcrAddress: null,
  325. zfpcrCharge: null,
  326. zfpcrChargeRate: null,
  327. zfpcrAccount: null,
  328. zfpcrLoanType: null,
  329. zfpcrBookkeepingType: null,
  330. zfpcrStatus: null,
  331. zfpcrProfitSpare1: null,
  332. zfpcrProfitSpare2: null,
  333. zfpcrProfitSpare3: null,
  334. zfpcrProfitSpare4: null,
  335. zfpcrProfitSpare5: null,
  336. zfpcrProfitSpare6: null,
  337. zfpcrProfitSpare7: null,
  338. zfpcrProfitSpare8: null,
  339. zfpcrProfitSpare9: null,
  340. },
  341. queryParamsContract: {
  342. pageNum: 1,
  343. pageSize: 10,
  344. zfcId: null,
  345. zfcName: null,
  346. zfcNumber: null,
  347. zfcManagementId: null
  348. },
  349. // 表单参数
  350. form: {
  351. zfpcrDateType: '0',
  352. zfpcrCharge: '1'
  353. },
  354. // 表单校验
  355. rules: {
  356. zfpcrFundSide: [
  357. { required: true, message: "资金方不能为空", trigger: ["blur", "change"] }
  358. ],
  359. zfpcrProductId: [
  360. { required: true, message: "融资产品不能为空", trigger: ["blur", "change"] }
  361. ],
  362. zfpcrCompanyId: [
  363. { required: true, message: "授信企业名称不能为空", trigger: ["blur", "change"] }
  364. ],
  365. zfpcrAmount: [
  366. { required: true, message: "授信额度不能为空", trigger: ["blur", "change"] },
  367. {
  368. pattern: /^[0-9][0-9]{0,7}$|^[1-9][0-9]{0,7}[.]\d{1,2}$/,
  369. message: "请输入正确的额度",
  370. trigger: "change",
  371. },
  372. ],
  373. zfpcrRate: [
  374. { required: true, message: "利率不能为空", trigger: ["blur", "change"] },
  375. {
  376. pattern: /^([0-9]{1,2}$)|(^[0-9]{1,2}\.[0-9]{1,2}$)|100$/,
  377. message: "请输入正确的利率",
  378. trigger: "change",
  379. },
  380. ],
  381. dateTime: [
  382. { required: true, message: "有效期范围不能为空", trigger: ["blur", "change"] }
  383. ],
  384. zfpcrChargeRate: [
  385. { required: true, message: "平台服务费收取费率不能为空", trigger: ["blur", "change"] },
  386. {
  387. pattern: /^([0-9]{1,2}$)|(^[0-9]{1,2}\.[0-9]{1,2}$)|100$/,
  388. message: "请输入正确的平台服务费收取费率",
  389. trigger: "change",
  390. },
  391. ],
  392. zfpcrAccount: [
  393. { required: true, message: "核心企业还款账户账号", trigger: ["blur", "change"] }
  394. ],
  395. zfpcrLoanType: [
  396. { required: true, message: "融资放款方式不能为空", trigger: ["blur", "change"] }
  397. ],
  398. zfpcrBookkeepingType: [
  399. { required: true, message: "记账簿托管方式不能为空", trigger: ["blur", "change"] }
  400. ],
  401. }
  402. };
  403. },
  404. created() {
  405. const zfpcrId = this.$route.params && this.$route.params.zfpcrId;
  406. const zfiAmount = this.$route.params && this.$route.params.zfiAmount;
  407. const usableAmount = this.$route.params && this.$route.params.usableAmount;
  408. getCreditLine(zfpcrId).then((response) => {
  409. this.ticketList = response.data.ticketList;
  410. /* 查询资方 */
  411. //公司类型
  412. const scyType = '03';
  413. //公司id
  414. const scyId = response.data.list[0].zfpManagementId;
  415. listCompany(scyType,scyId).then((response) =>{
  416. this.zfCompanyList = response.data
  417. });
  418. /* 查询融资产品 */
  419. //产品id
  420. const zfpcrProductId = response.data.list[0].zfpcrProductId;
  421. listFinanceProduct(zfpcrProductId).then((response) =>{
  422. this.financeProductList = response.data
  423. });
  424. /* 查询授信企业名称 */
  425. //公司类型
  426. const scyTypes = '01';
  427. //公司id
  428. const scyIds = response.data.list[0].zfpcrCompanyId;
  429. listCompany(scyTypes,scyIds).then((response) =>{
  430. this.hxCompanyList = response.data
  431. });
  432. /* 查询还款账户 */
  433. //银行卡号
  434. const zfpcrAccount = response.data.list[0].zfpcrAccount;
  435. listCompanyAcc(zfpcrAccount).then((response) =>{
  436. this.accList = response.data
  437. this.restaurants = response.data;
  438. }).then(()=>{
  439. this.form = response.data.list[0]
  440. this.amount = response.data.list[0].zfpcrAmount
  441. this.form.zfpcrFundSide = this.zfCompanyList[0];
  442. this.$set(this.form, "dateTime", [response.data.list[0].zfpcrStartDate, response.data.list[0].zfpcrEndDate])
  443. this.$set(this.form, "zfiAmount", zfiAmount);
  444. this.$set(this.form, "usableAmount", usableAmount);
  445. });
  446. });
  447. // this.getZfCompany();
  448. // this.getFinanceProduct();
  449. // this.getHxCompany();
  450. // this.getCompanyAcc();
  451. this.getDicts("zc_zfpcr_date_type").then(response => {
  452. this.dateTypeOptions = response.data;
  453. });
  454. this.getDicts("zc_zfpcr_charge").then(response => {
  455. this.chargeOptions = response.data;
  456. });
  457. this.getDicts("zc_zfpcr_loan_type").then(response => {
  458. this.loanTypeOptions = response.data;
  459. });
  460. this.getDicts("zc_zfpcr_bookkeeping_type").then(response => {
  461. this.bookkeepingTypeOptions = response.data;
  462. });
  463. },
  464. methods: {
  465. /* 资方公司 */
  466. getZfCompany(){
  467. //公司类型
  468. const scyType = '03'
  469. listCompany(scyType).then((response) =>{
  470. this.zfCompanyList = response.data
  471. })
  472. },
  473. /* 融资产品 */
  474. getFinanceProduct(){
  475. listFinanceProduct().then((response) =>{
  476. this.financeProductList = response.data
  477. })
  478. },
  479. /* 授信企业 */
  480. getHxCompany(){
  481. //公司类型
  482. const scyTypes = '01'
  483. listCompany(scyTypes).then((response) =>{
  484. this.hxCompanyList = response.data
  485. })
  486. },
  487. /* 核心企业还款账户账号 */
  488. getCompanyAcc(){
  489. listCompanyAcc().then((response) =>{
  490. this.accList = response.data
  491. this.restaurants = response.data;
  492. })
  493. },
  494. /* 账户模糊搜所 */
  495. querySearch(queryString, cb) {
  496. var restaurants = this.restaurants;
  497. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
  498. // 调用 callback 返回建议列表的数据
  499. cb(results);
  500. },
  501. createFilter(queryString) {
  502. return (restaurant) => {
  503. return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
  504. };
  505. },
  506. /* 合同相关 */
  507. //合同列表
  508. getContractList() {
  509. this.queryParamsContract.zfcManagementId = this.form.zfpcrFundSide
  510. listContract(this.queryParamsContract).then((response) => {
  511. this.contractList = response.data.records;
  512. this.selectChecked();
  513. this.total = response.data.total;
  514. });
  515. },
  516. //打开合同选择列表
  517. openTicket() {
  518. this.getContractList()
  519. this.open = true
  520. this.title = "合同信息"
  521. },
  522. selectChecked() {
  523. this.ticketList.forEach((item) => {
  524. this.contractList.forEach(row => {
  525. if (row.zfcId == item.zfcId) {
  526. this.$nextTick(() => {
  527. this.$refs.tableContract && this.$refs.tableContract.toggleRowSelection(row, true);
  528. })
  529. }
  530. });
  531. });
  532. },
  533. /* 多选框跨页 */
  534. rowkey(row) {
  535. return row.zfcId;
  536. },
  537. // 多选框选中数据
  538. handleSelectionChange(val) {
  539. this.chooseTicket = val
  540. },
  541. // 确认选择
  542. closeTicket() {
  543. if(this.chooseTicket.length > 0){
  544. this.ticketList = this.chooseTicket
  545. this.$set(this.form, "zfcName", this.ticketList[0].zfcName);
  546. this.$set(this.form, "zfcNumber", this.ticketList[0].zfcNumber);
  547. this.$set(this.form, "zfcSubject", this.ticketList[0].zfcSubject);
  548. this.$set(this.form, "zfcId", this.ticketList[0].zfcId);
  549. this.open = false
  550. }else{
  551. this.$message({
  552. message: '请选择合同',
  553. type: 'warning'
  554. });
  555. }
  556. },
  557. //取消选择合同按钮
  558. cancelTicket(){
  559. this.ticketList = [];
  560. if(this.$refs.tableContract){
  561. this.$refs.tableContract.clearSelection();
  562. }
  563. this.open = false;
  564. },
  565. /** 清空选择发票信息 */
  566. deleteTicekt() {
  567. this.ticketList = []
  568. if(this.$refs.tableContract){
  569. this.$refs.tableContract.clearSelection();
  570. }
  571. },
  572. /* 删除按钮 */
  573. handleDelete(index, rows) {
  574. rows.splice(index, 1);
  575. if(this.$refs.tableContract){
  576. this.$refs.tableContract.clearSelection();
  577. }
  578. this.selectChecked();
  579. },
  580. onSelectAll() {
  581. if(this.$refs.tableContract){
  582. this.$refs.tableContract.clearSelection();
  583. }
  584. },
  585. handleQuerys() {
  586. this.queryParamsContract.pageNum = 1;
  587. this.getContractList();
  588. },
  589. resetQuerys() {
  590. this.resetForm("formQuery");
  591. this.handleQuerys();
  592. },
  593. /** 提交按钮 */
  594. submitForm() {
  595. // if(this.ticketList == undefined || this.ticketList.length == 0){
  596. // this.$message({
  597. // message: '请选择合同',
  598. // type: 'warning'
  599. // });
  600. // return;
  601. // }
  602. this.$refs["form"].validate(valid => {
  603. this.form.ticketList = this.ticketList;
  604. this.form.zfpcrOldAmount = this.amount;
  605. if (valid) {
  606. const loading = this.$loading({
  607. lock: true,
  608. text: "Loading",
  609. spinner: "el-icon-loading",
  610. background: "rgba(0, 0, 0, 0.7)",
  611. });
  612. updateCreditLine(this.form).then(response => {
  613. this.msgSuccess("修改成功");
  614. this.$store.dispatch("tagsView/delView", this.$route);
  615. this.$router.go(-1);
  616. }).catch((response) => {
  617. loading.close();
  618. });
  619. }
  620. });
  621. },
  622. /* 金额展示 */
  623. handleInput(str) {
  624. this.zfpcrAmountFormat = amtformat(str,2, ".", ",");
  625. },
  626. /* // 将数字金额转换为大写金额 */
  627. smallToBig(money) {
  628. // 将数字金额转换为大写金额
  629. var cnNums = new Array(
  630. "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ); //汉字的数字
  631. var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
  632. var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
  633. var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
  634. var cnInteger = "整"; //整数金额时后面跟的字符
  635. var cnIntLast = "元"; //整数完以后的单位
  636. //最大处理的数字
  637. var maxNum = 999999999999999.9999;
  638. var integerNum; //金额整数部分
  639. var decimalNum; //金额小数部分
  640. //输出的中文金额字符串
  641. var chineseStr = "";
  642. var parts; //分离金额后用的数组,预定义
  643. if (money == "" || money == null || money == undefined) {
  644. return "零元零角零分";
  645. }
  646. money = parseFloat(money);
  647. if (money >= maxNum) {
  648. //超出最大处理数字
  649. return "超出最大处理数字";
  650. }
  651. if (money == 0) {
  652. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  653. return chineseStr;
  654. }
  655. //四舍五入保留两位小数,转换为字符串
  656. money = Math.round(money * 100).toString();
  657. integerNum = money.substr(0, money.length - 2);
  658. decimalNum = money.substr(money.length - 2);
  659. //获取整型部分转换
  660. if (parseInt(integerNum, 10) > 0) {
  661. var zeroCount = 0;
  662. var IntLen = integerNum.length;
  663. for (var i = 0; i < IntLen; i++) {
  664. var n = integerNum.substr(i, 1);
  665. var p = IntLen - i - 1;
  666. var q = p / 4;
  667. var m = p % 4;
  668. if (n == "0") {
  669. zeroCount++;
  670. } else {
  671. if (zeroCount > 0) {
  672. chineseStr += cnNums[0];
  673. }
  674. //归零
  675. zeroCount = 0;
  676. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  677. }
  678. if (m == 0 && zeroCount < 4) {
  679. chineseStr += cnIntUnits[q];
  680. }
  681. }
  682. chineseStr += cnIntLast;
  683. }
  684. //小数部分
  685. if (decimalNum != "") {
  686. var decLen = decimalNum.length;
  687. for (var i = 0; i < decLen; i++) {
  688. var n = decimalNum.substr(i, 1);
  689. if (n != "0") {
  690. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  691. }
  692. }
  693. }
  694. if (chineseStr == "") {
  695. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  696. } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
  697. chineseStr += cnInteger;
  698. }
  699. return chineseStr;
  700. },
  701. },
  702. };
  703. </script>
  704. <style>
  705. .single-select-table thead .el-table-column--selection .cell {
  706. display: none;
  707. }
  708. </style>