detailCreditLine.vue 28 KB

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