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