index.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618
  1. <template>
  2. <div class="tenant">
  3. <div class="content">
  4. <byTable
  5. :source="sourceList.data"
  6. :pagination="sourceList.pagination"
  7. :config="config"
  8. :loading="loading"
  9. :selectConfig="selectConfig"
  10. highlight-current-row
  11. :action-list="[
  12. {
  13. text: '导出Excel',
  14. action: () => deriveExcel(),
  15. },
  16. {
  17. text: '添加借款',
  18. action: () => addloan(),
  19. },
  20. {
  21. text: '添加流水',
  22. action: () => openModal('add'),
  23. },
  24. {
  25. text: '内部转账',
  26. action: () => openTransferMoney('add'),
  27. },
  28. {
  29. text: '结汇',
  30. action: () => openSettlementModal('add'),
  31. },
  32. ]"
  33. @moreSearch="moreSearch"
  34. @get-list="getList"
  35. >
  36. <template #amount="{ item }">
  37. <div
  38. :style="'color: ' + (item.status === '10' ? '#04cb04;' : 'red;')"
  39. >
  40. <span style="padding-right: 4px" v-if="item.currency">{{
  41. item.currency
  42. }}</span>
  43. <span style="padding-right: 4px" v-else>
  44. {{ accountCurrency[0].value }}
  45. </span>
  46. <span v-if="item.status === '20'">-</span>
  47. <span>{{ moneyFormat(item.amount, 2) }}</span>
  48. </div>
  49. </template>
  50. <template #contractCodes="{ item }">
  51. <div style="width: 100%">
  52. <div v-if="item.contractCodes">
  53. <div
  54. v-for="(contract, index) in item.contractCodes.split(',')"
  55. :key="index"
  56. >
  57. <a
  58. style="color: #409eff; cursor: pointer; word-break: break-all"
  59. @click="openDetails(contract)"
  60. >{{ contract }}</a
  61. >
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. </byTable>
  67. </div>
  68. <el-dialog
  69. :title="modalType == 'add' ? '添加流水' : '编辑流水'"
  70. v-if="dialogVisible"
  71. v-model="dialogVisible"
  72. width="600"
  73. v-loading="loadingDialog"
  74. >
  75. <byForm
  76. :formConfig="formConfig"
  77. :formOption="formOption"
  78. v-model="formData.data"
  79. :rules="rules"
  80. ref="submit"
  81. >
  82. <template #transactionTime>
  83. <div>
  84. <el-date-picker
  85. v-model="formData.data.transactionTime"
  86. type="datetime"
  87. placeholder="请选择交易时间"
  88. value-format="YYYY-MM-DD HH:mm:ss"
  89. />
  90. </div>
  91. </template>
  92. <template #money>
  93. <div style="width: 100%">
  94. <el-row :gutter="10">
  95. <el-col :span="6">
  96. <el-form-item prop="status">
  97. <el-select
  98. v-model="formData.data.status"
  99. placeholder="请选择"
  100. style="width: 100%"
  101. @change="changeStatus()"
  102. >
  103. <el-option
  104. v-for="item in status"
  105. :key="item.value"
  106. :label="item.label"
  107. :value="item.value"
  108. />
  109. </el-select>
  110. </el-form-item>
  111. </el-col>
  112. <el-col :span="6">
  113. <el-form-item prop="currency">
  114. <el-select
  115. v-model="formData.data.currency"
  116. placeholder="请选择"
  117. style="width: 100%"
  118. >
  119. <el-option
  120. v-for="item in accountCurrency"
  121. :key="item.value"
  122. :label="item.label"
  123. :value="item.value"
  124. />
  125. </el-select>
  126. </el-form-item>
  127. </el-col>
  128. <el-col :span="12">
  129. <el-form-item prop="amount">
  130. <el-input-number
  131. onmousewheel="return false;"
  132. v-model="formData.data.amount"
  133. placeholder="请输入金额"
  134. style="width: 100%"
  135. :precision="2"
  136. :controls="false"
  137. :min="0"
  138. />
  139. </el-form-item>
  140. </el-col>
  141. </el-row>
  142. </div>
  143. </template>
  144. <template #received>
  145. <div>
  146. <el-form-item prop="received">
  147. <el-radio-group v-model="formData.data.received">
  148. <el-radio
  149. v-for="item in received"
  150. :key="item.value"
  151. :label="item.value"
  152. border
  153. >{{ item.label }}</el-radio
  154. >
  155. </el-radio-group>
  156. </el-form-item>
  157. </div>
  158. </template>
  159. </byForm>
  160. <template #footer>
  161. <el-button @click="dialogVisible = false" size="large">取 消</el-button>
  162. <el-button type="primary" @click="submitForm()" size="large"
  163. >确 定</el-button
  164. >
  165. </template>
  166. </el-dialog>
  167. <el-dialog
  168. title="内部转账"
  169. v-if="transferMoneyModal"
  170. v-model="transferMoneyModal"
  171. width="600"
  172. v-loading="loadingDialog"
  173. >
  174. <byForm
  175. :formConfig="transferMoneyConfig"
  176. :formOption="formOption"
  177. v-model="formData2.data"
  178. :rules="rules2"
  179. ref="transferMoneySubmit"
  180. >
  181. </byForm>
  182. <template #footer>
  183. <el-button @click="transferMoneyModal = false" size="large"
  184. >取 消</el-button
  185. >
  186. <el-button type="primary" @click="submitForm2()" size="large"
  187. >确 定</el-button
  188. >
  189. </template>
  190. </el-dialog>
  191. <el-dialog
  192. title="高级检索"
  193. v-if="openSearch"
  194. v-model="openSearch"
  195. width="600"
  196. :before-close="cancelSearch"
  197. >
  198. <byForm
  199. :formConfig="formSearchConfig"
  200. :formOption="formOption"
  201. v-model="sourceList.pagination"
  202. >
  203. <template #money>
  204. <div style="width: 100%">
  205. <el-row :gutter="10">
  206. <el-col :span="11">
  207. <el-input-number
  208. onmousewheel="return false;"
  209. v-model="sourceList.pagination.beginAmount"
  210. placeholder="请输入"
  211. style="width: 100%"
  212. :precision="2"
  213. :controls="false"
  214. :min="0"
  215. />
  216. </el-col>
  217. <el-col :span="2" style="text-align: center">到</el-col>
  218. <el-col :span="11">
  219. <el-input-number
  220. onmousewheel="return false;"
  221. v-model="sourceList.pagination.endAmount"
  222. placeholder="请输入"
  223. style="width: 100%"
  224. :precision="2"
  225. :controls="false"
  226. :min="0"
  227. />
  228. </el-col>
  229. </el-row>
  230. </div>
  231. </template>
  232. <template #time>
  233. <div style="width: 100%">
  234. <el-row :gutter="10">
  235. <el-col :span="11">
  236. <el-date-picker
  237. v-model="sourceList.pagination.startTime"
  238. type="datetime"
  239. placeholder="请选择"
  240. style="width: 100%"
  241. value-format="YYYY-MM-DD HH:mm:ss"
  242. />
  243. </el-col>
  244. <el-col :span="2" style="text-align: center">到</el-col>
  245. <el-col :span="11">
  246. <el-date-picker
  247. v-model="sourceList.pagination.stopTime"
  248. type="datetime"
  249. placeholder="请选择"
  250. style="width: 100%"
  251. value-format="YYYY-MM-DD HH:mm:ss"
  252. />
  253. </el-col>
  254. </el-row>
  255. </div>
  256. </template>
  257. </byForm>
  258. <template #footer>
  259. <el-button @click="cancelSearch()" size="large">取 消</el-button>
  260. <el-button type="primary" @click="submitSearch()" size="large"
  261. >确 定</el-button
  262. >
  263. </template>
  264. </el-dialog>
  265. <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="860">
  266. <ContractPDF :rowData="rowData"></ContractPDF>
  267. <template #footer>
  268. <el-button @click="openPrint = false" size="large">取消</el-button>
  269. <el-button v-print="printObj" size="large">打印</el-button>
  270. <el-button type="primary" @click="clickDownload()" size="large"
  271. >下载PDF</el-button
  272. >
  273. </template>
  274. </el-dialog>
  275. <el-dialog
  276. :title="submitType == 'add' ? '添加借款' : '还款'"
  277. v-if="openLoanDialog"
  278. v-model="openLoanDialog"
  279. width="500"
  280. destroy-on-close
  281. >
  282. <byForm
  283. :formConfig="loanFormConfig"
  284. :formOption="formOption"
  285. :rules="loanRules"
  286. v-model="formData.loanData"
  287. ref="byform"
  288. >
  289. <template #loanUserName>
  290. <div style="width: 100%">
  291. <el-autocomplete
  292. v-model="formData.data.loanUserName"
  293. :fetch-suggestions="querySearch"
  294. :disabled="submitType == 'edit'"
  295. clearable
  296. class="inline-input w-50"
  297. placeholder="请输入"
  298. />
  299. </div>
  300. </template>
  301. </byForm>
  302. <template #footer>
  303. <el-button @click="openLoanDialog = false" size="large"
  304. >取 消</el-button
  305. >
  306. <el-button
  307. type="primary"
  308. @click="handleSubmitLoan()"
  309. size="large"
  310. :loading="submitLoading"
  311. >确 定</el-button
  312. >
  313. </template>
  314. </el-dialog>
  315. <!-- 结汇 -->
  316. <el-dialog
  317. title="结汇"
  318. v-if="settlementModal"
  319. v-model="settlementModal"
  320. width="600"
  321. v-loading="loadingDialog"
  322. >
  323. <byForm
  324. :formConfig="settlementFormConfig"
  325. :formOption="formOption"
  326. v-model="formData3.data"
  327. :rules="rules3"
  328. ref="submit3"
  329. >
  330. </byForm>
  331. <template #footer>
  332. <el-button @click="settlementModal = false" size="large"
  333. >取 消</el-button
  334. >
  335. <el-button type="primary" @click="settlementSubmitForm()" size="large"
  336. >确 定</el-button
  337. >
  338. </template>
  339. </el-dialog>
  340. </div>
  341. </template>
  342. <script setup>
  343. import { computed, ref } from "vue";
  344. import byTable from "@/components/byTable/index";
  345. import byForm from "@/components/byForm/index";
  346. import useUserStore from "@/store/modules/user";
  347. import { ElMessage, ElMessageBox } from "element-plus";
  348. import moment from "moment";
  349. import ContractPDF from "@/components/PDF/contractPDF.vue";
  350. const { proxy } = getCurrentInstance();
  351. const accountCurrency = ref([]);
  352. const accountList = ref([]);
  353. const corporationList = ref([]);
  354. const status = ref([
  355. {
  356. label: "收入",
  357. value: "10",
  358. },
  359. {
  360. label: "支出",
  361. value: "20",
  362. },
  363. ]);
  364. const received = ref([
  365. {
  366. label: "是",
  367. value: "10",
  368. },
  369. {
  370. label: "否",
  371. value: "20",
  372. },
  373. ]);
  374. const sourceList = ref({
  375. data: [],
  376. pagination: {
  377. total: 0,
  378. pageNum: 1,
  379. pageSize: 10,
  380. keyword: "",
  381. accountManagementId: "",
  382. currency: "",
  383. status: "",
  384. received: "",
  385. beginAmount: undefined,
  386. endAmount: undefined,
  387. startTime: "",
  388. stopTime: "",
  389. remarks: "",
  390. },
  391. });
  392. //结汇
  393. const contractList2 = ref([]);
  394. const settlementModal = ref(false);
  395. const openSettlementModal = (type, row) => {
  396. formData3.data = {
  397. accountManagementId: null,
  398. amount: null,
  399. currency: null,
  400. inAccountManagementId: null,
  401. inAmount: null,
  402. inCurrency: "CNY",
  403. rate: null,
  404. commissionAmount: null,
  405. commissionCurrency: null,
  406. remarks: null,
  407. businessId: null,
  408. };
  409. settlementModal.value = true;
  410. };
  411. const validatePass4 = (rule, value, callback) => {
  412. console.log(formData3.data.currency);
  413. if (!formData3.data.currency) {
  414. callback(new Error("请输入金额和选择币种"));
  415. } else {
  416. callback();
  417. }
  418. };
  419. const validatePass3 = (rule, value, callback) => {
  420. if (!formData3.data.inCurrency) {
  421. callback(new Error("请输入金额和选择币种"));
  422. } else {
  423. callback();
  424. }
  425. };
  426. const rules3 = ref({
  427. accountManagementId: [
  428. { required: true, message: "请选择账户", trigger: "change" },
  429. ],
  430. currency: [{ required: true, message: "请选择币种", trigger: "change" }],
  431. received: [
  432. { required: true, message: "请选择合同是否到账", trigger: "change" },
  433. ],
  434. amount: [
  435. { required: true, message: "请输入金额和选择币种", trigger: "blur" },
  436. { required: true, validator: validatePass4, trigger: "blur" },
  437. ],
  438. inAccountManagementId: [
  439. { required: true, message: "请选择账户", trigger: "change" },
  440. ],
  441. inAmount: [
  442. { required: true, message: "请输入金额和选择币种", trigger: "blur" },
  443. { required: true, validator: validatePass3, trigger: "blur" },
  444. ],
  445. businessId: [{ required: true, message: "请选择合同", trigger: "change" }],
  446. });
  447. const formData3 = reactive({
  448. data: {
  449. accountManagementId: null,
  450. amount: null,
  451. currency: null,
  452. inAccountManagementId: null,
  453. inAmount: null,
  454. inCurrency: "CNY",
  455. rate: null,
  456. commissionAmount: null,
  457. commissionCurrency: null,
  458. remarks: null,
  459. businessId: null,
  460. },
  461. });
  462. const submit3 = ref(null);
  463. const settlementSubmitForm = () => {
  464. submit3.value.handleSubmit(() => {
  465. //汇出汇入账号不能相同
  466. if (
  467. formData3.data.accountManagementId ===
  468. formData3.data.inAccountManagementId
  469. ) {
  470. ElMessage({
  471. message: "汇出汇入账号不能相同",
  472. type: "error",
  473. });
  474. return;
  475. }
  476. loadingDialog.value = true;
  477. proxy.post("/accountRunningWater/exchangeSettlement", formData3.data).then(
  478. () => {
  479. ElMessage({
  480. message: "结汇成功",
  481. type: "success",
  482. });
  483. settlementModal.value = false;
  484. getList();
  485. },
  486. (err) => {
  487. console.log(err);
  488. loadingDialog.value = false;
  489. }
  490. );
  491. });
  492. };
  493. const settlementFormConfig = computed(() => {
  494. return [
  495. {
  496. type: "title",
  497. title: "结汇信息",
  498. },
  499. {
  500. type: "select",
  501. prop: "accountManagementId",
  502. label: "汇出账户",
  503. data: accountList.value,
  504. },
  505. {
  506. type: "selectInput",
  507. label: "汇出金额",
  508. prop: "amount",
  509. itemWidth: 60,
  510. data: accountCurrency.value,
  511. placeholder: "请输入",
  512. selectPlaceholder: "币种",
  513. selectProp: "currency",
  514. fn: (value) => {
  515. console.log(formData3.data);
  516. //判断value的类型
  517. if (isNaN(value)) {
  518. formData3.data.commissionCurrency = formData3.data.currency;
  519. } else {
  520. if (value != "") {
  521. if (value.indexOf(".") > -1) {
  522. formData3.data.amount = value.slice(0, value.indexOf(".") + 3);
  523. } else {
  524. formData3.data.amount = value;
  525. }
  526. }
  527. formData3.data.inAmount = formData3.data.amount;
  528. }
  529. if (formData3.data.amount && formData3.data.inAmount) {
  530. formData3.data.rate = (
  531. formData3.data.inAmount / formData3.data.amount
  532. ).toFixed(4);
  533. }
  534. },
  535. },
  536. {
  537. type: "select",
  538. prop: "inAccountManagementId",
  539. label: "汇入账户",
  540. data: accountList.value,
  541. },
  542. {
  543. type: "selectInput",
  544. label: "汇入金额",
  545. prop: "inAmount",
  546. itemWidth: 60,
  547. data: accountCurrency.value,
  548. placeholder: "请输入",
  549. selectPlaceholder: "币种",
  550. selectDisabled: true,
  551. selectProp: "inCurrency",
  552. fn: (value) => {
  553. //判断value的类型
  554. if (isNaN(value)) {
  555. formData2.data.commissionCurrency = formData2.data.currency;
  556. } else {
  557. if (value != "") {
  558. if (value.indexOf(".") > -1) {
  559. formData2.data.amount = value.slice(0, value.indexOf(".") + 3);
  560. } else {
  561. formData2.data.amount = value;
  562. }
  563. }
  564. formData2.data.inAmount = formData2.data.amount;
  565. }
  566. if (formData3.data.amount && formData3.data.inAmount) {
  567. formData3.data.rate = (
  568. formData3.data.inAmount / formData3.data.amount
  569. ).toFixed(4);
  570. }
  571. },
  572. },
  573. {
  574. type: "input",
  575. prop: "rate",
  576. label: "汇率",
  577. itemType: "text",
  578. disabled: true,
  579. },
  580. {
  581. type: "selectInput",
  582. label: "手续费",
  583. prop: "commissionAmount",
  584. itemWidth: 60,
  585. data: accountCurrency.value,
  586. placeholder: "请输入",
  587. selectPlaceholder: "币种",
  588. selectProp: "commissionCurrency",
  589. },
  590. {
  591. type: "input",
  592. prop: "remarks",
  593. label: "摘要",
  594. itemType: "textarea",
  595. },
  596. //关联合同
  597. {
  598. type: "title",
  599. title: "关联合同",
  600. },
  601. {
  602. type: "select",
  603. prop: "businessId",
  604. label: "选择合同",
  605. filterable: true,
  606. data: contractList2.value,
  607. },
  608. ];
  609. });
  610. const loading = ref(false);
  611. const selectConfig = computed(() => {
  612. return [
  613. {
  614. label: "收支类型",
  615. prop: "status",
  616. data: status.value,
  617. },
  618. {
  619. label: "资金账户",
  620. prop: "accountManagementId",
  621. data: accountList.value,
  622. },
  623. {
  624. label: "币种",
  625. prop: "currency",
  626. data: accountCurrency.value,
  627. },
  628. ];
  629. });
  630. const config = computed(() => {
  631. return [
  632. {
  633. attrs: {
  634. label: "归属公司",
  635. prop: "corporationName",
  636. width: 160,
  637. },
  638. },
  639. {
  640. attrs: {
  641. label: "关联销售合同",
  642. slot: "contractCodes",
  643. width: 160,
  644. },
  645. },
  646. {
  647. attrs: {
  648. label: "资金账户",
  649. prop: "accountManagementName",
  650. width: 200,
  651. },
  652. },
  653. {
  654. attrs: {
  655. label: "交易时间",
  656. prop: "transactionTime",
  657. width: 160,
  658. },
  659. },
  660. {
  661. attrs: {
  662. label: "交易金额",
  663. slot: "amount",
  664. width: 200,
  665. },
  666. },
  667. {
  668. attrs: {
  669. label: "对方账户",
  670. prop: "name",
  671. width: 200,
  672. },
  673. },
  674. {
  675. attrs: {
  676. label: "对方银行",
  677. prop: "openingBank",
  678. width: 200,
  679. },
  680. },
  681. {
  682. attrs: {
  683. label: "对方账号",
  684. prop: "accountOpening",
  685. width: 240,
  686. },
  687. },
  688. {
  689. attrs: {
  690. label: "摘要",
  691. prop: "remarks",
  692. },
  693. },
  694. {
  695. attrs: {
  696. label: "操作",
  697. width: "120",
  698. align: "center",
  699. },
  700. renderHTML(row) {
  701. return [
  702. {
  703. attrs: {
  704. label: "修改",
  705. type: "primary",
  706. text: true,
  707. },
  708. el: "button",
  709. click() {
  710. update(row);
  711. },
  712. },
  713. {
  714. attrs: {
  715. label: "删除",
  716. type: "primary",
  717. text: true,
  718. },
  719. el: "button",
  720. click() {
  721. ElMessageBox.confirm(
  722. "此操作将永久删除该数据, 是否继续?",
  723. "提示",
  724. {
  725. confirmButtonText: "确定",
  726. cancelButtonText: "取消",
  727. type: "warning",
  728. }
  729. ).then(() => {
  730. proxy
  731. .post("/accountRunningWater/delete", {
  732. id: row.id,
  733. })
  734. .then(() => {
  735. ElMessage({
  736. message: "删除成功",
  737. type: "success",
  738. });
  739. getList();
  740. });
  741. });
  742. },
  743. },
  744. ];
  745. },
  746. },
  747. ];
  748. });
  749. const getDict = () => {
  750. proxy
  751. .post("/dictTenantData/page", {
  752. pageNum: 1,
  753. pageSize: 999,
  754. dictCode: "account_currency",
  755. tenantId: useUserStore().user.tenantId,
  756. })
  757. .then((res) => {
  758. if (res.rows && res.rows.length > 0) {
  759. accountCurrency.value = res.rows.map((item) => {
  760. return {
  761. label: item.dictValue,
  762. value: item.dictKey,
  763. };
  764. });
  765. }
  766. });
  767. proxy
  768. .post("/contract/page1", {
  769. pageNum: 1,
  770. pageSize: 9999,
  771. isExchangeSettlement: 0,
  772. })
  773. .then((res) => {
  774. contractList2.value = res.rows.map((item) => {
  775. return {
  776. ...item,
  777. label: item.code,
  778. value: item.id,
  779. };
  780. });
  781. });
  782. proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
  783. if (res.rows && res.rows.length > 0) {
  784. corporationList.value = res.rows.map((item) => {
  785. return {
  786. ...item,
  787. label: item.name,
  788. value: item.id,
  789. };
  790. });
  791. }
  792. });
  793. proxy
  794. .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
  795. .then((res) => {
  796. if (res.rows && res.rows.length > 0) {
  797. accountList.value = res.rows.map((item) => {
  798. return {
  799. label: item.alias,
  800. value: item.id,
  801. };
  802. });
  803. }
  804. });
  805. };
  806. const getList = async (req) => {
  807. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  808. loading.value = true;
  809. proxy
  810. .post("/accountRunningWater/page", sourceList.value.pagination)
  811. .then((res) => {
  812. sourceList.value.data = res.rows;
  813. sourceList.value.pagination.total = res.total;
  814. setTimeout(() => {
  815. loading.value = false;
  816. }, 200);
  817. });
  818. };
  819. getDict();
  820. getList();
  821. let transferMoneyModal = ref(false);
  822. const openTransferMoney = () => {
  823. formData2.data = {
  824. transactionTime: moment().format("yyyy-MM-DD HH:mm:ss"),
  825. isTransaction: "0",
  826. };
  827. transferMoneyModal.value = true;
  828. };
  829. const modalType = ref("add");
  830. const dialogVisible = ref(false);
  831. const loadingDialog = ref(false);
  832. const submit = ref(null);
  833. const formOption = reactive({
  834. inline: true,
  835. labelWidth: 100,
  836. itemWidth: 100,
  837. rules: [],
  838. });
  839. const formData = reactive({
  840. data: {
  841. isTransaction: "1",
  842. },
  843. loanData: {},
  844. });
  845. const formData2 = reactive({
  846. data: {},
  847. });
  848. const transferMoneyConfig = computed(() => {
  849. return [
  850. {
  851. label: "转出信息",
  852. },
  853. {
  854. type: "select",
  855. prop: "accountManagementId",
  856. label: "转出账户",
  857. data: accountList.value,
  858. },
  859. {
  860. type: "selectInput",
  861. label: "转出金额",
  862. prop: "amount",
  863. itemWidth: 60,
  864. data: accountCurrency.value,
  865. placeholder: "请输入",
  866. selectPlaceholder: "币种",
  867. selectProp: "currency",
  868. fn: (value) => {
  869. //判断value的类型
  870. if (isNaN(value)) {
  871. formData2.data.inCurrency = formData2.data.currency;
  872. formData2.data.commissionCurrency = formData2.data.currency;
  873. } else {
  874. if (value != "") {
  875. if (value.indexOf(".") > -1) {
  876. formData2.data.amount = value.slice(0, value.indexOf(".") + 3);
  877. } else {
  878. formData2.data.amount = value;
  879. }
  880. }
  881. formData2.data.inAmount = formData2.data.amount;
  882. }
  883. },
  884. },
  885. {
  886. type: "date",
  887. prop: "transactionTime",
  888. label: "转出时间",
  889. itemType: "datetime",
  890. },
  891. {
  892. label: "转入信息",
  893. },
  894. {
  895. type: "select",
  896. prop: "inAccountManagementId",
  897. label: "转入账户",
  898. data: accountList.value,
  899. },
  900. {
  901. type: "selectInput",
  902. label: "转入金额",
  903. prop: "inAmount",
  904. itemWidth: 60,
  905. data: accountCurrency.value,
  906. placeholder: "请输入",
  907. selectPlaceholder: "币种",
  908. selectProp: "inCurrency",
  909. },
  910. {
  911. label: "其他信息",
  912. },
  913. {
  914. type: "radio",
  915. prop: "isTransaction",
  916. label: "是否往来",
  917. border: true,
  918. data: [
  919. {
  920. label: "是",
  921. value: "1",
  922. },
  923. {
  924. label: "否",
  925. value: "0",
  926. },
  927. ],
  928. },
  929. {
  930. type: "selectInput",
  931. label: "手续费",
  932. prop: "commissionAmount",
  933. itemWidth: 60,
  934. data: accountCurrency.value,
  935. placeholder: "请输入",
  936. selectPlaceholder: "币种",
  937. selectProp: "commissionCurrency",
  938. },
  939. {
  940. type: "input",
  941. prop: "remarks",
  942. label: "摘要",
  943. itemType: "textarea",
  944. },
  945. ];
  946. });
  947. const formConfig = computed(() => {
  948. return [
  949. {
  950. label: "账户信息",
  951. },
  952. {
  953. type: "select",
  954. prop: "accountManagementId",
  955. label: "选择账户",
  956. data: accountList.value,
  957. },
  958. {
  959. label: "交易信息",
  960. },
  961. {
  962. type: "slot",
  963. prop: "transactionTime",
  964. slotName: "transactionTime",
  965. label: "交易时间",
  966. },
  967. {
  968. type: "slot",
  969. prop: "money",
  970. slotName: "money",
  971. label: "交易金额",
  972. },
  973. formData.data.status == "10"
  974. ? {
  975. type: "slot",
  976. prop: "received",
  977. slotName: "received",
  978. label: "合同到账",
  979. }
  980. : {},
  981. // sysUserMenu/list
  982. //单选框
  983. {
  984. type: "radio",
  985. prop: "isTransaction",
  986. label: "是否往来",
  987. border: true,
  988. data: [
  989. {
  990. label: "是",
  991. value: 1,
  992. },
  993. {
  994. label: "否",
  995. value: 0,
  996. },
  997. ],
  998. fn: (val) => {
  999. formData.data.transactionDeptId = "";
  1000. formData.data.deptType = "";
  1001. formConfig.value[7].data = transactionDepartmentData.value;
  1002. },
  1003. },
  1004. {
  1005. type: "select",
  1006. prop: "transactionDeptId",
  1007. label: "往来单位",
  1008. data: [],
  1009. isShow: formData.data.isTransaction == 1,
  1010. fn: (val) => {
  1011. if (val) {
  1012. console.log(transactionDepartmentData.value);
  1013. let list = transactionDepartmentData.value.filter((item) => {
  1014. if (item.value == val) return item;
  1015. });
  1016. console.log(list);
  1017. if (list && list.length > 0) {
  1018. formData.data.deptType = list[0].deptType;
  1019. } else {
  1020. formData.data.deptType = "";
  1021. }
  1022. } else {
  1023. formData.data.deptType = "";
  1024. }
  1025. },
  1026. },
  1027. {
  1028. type: "input",
  1029. prop: "name",
  1030. label: "账户名称",
  1031. itemType: "text",
  1032. },
  1033. {
  1034. type: "input",
  1035. prop: "openingBank",
  1036. label: "开户银行",
  1037. itemType: "text",
  1038. },
  1039. {
  1040. type: "input",
  1041. prop: "accountOpening",
  1042. label: "银行账号",
  1043. itemType: "text",
  1044. },
  1045. {
  1046. label: "对方信息",
  1047. },
  1048. {
  1049. type: "select",
  1050. prop: "otherId",
  1051. label: "对方名称",
  1052. data: [
  1053. {
  1054. label: "客户",
  1055. value: "10",
  1056. },
  1057. {
  1058. label: "供应商",
  1059. value: "20",
  1060. },
  1061. {
  1062. label: "其他",
  1063. value: "30",
  1064. },
  1065. ],
  1066. },
  1067. {
  1068. type: "input",
  1069. prop: "name",
  1070. label: "账户名称",
  1071. itemType: "text",
  1072. },
  1073. {
  1074. type: "input",
  1075. prop: "openingBank",
  1076. label: "开户银行",
  1077. itemType: "text",
  1078. },
  1079. {
  1080. type: "input",
  1081. prop: "accountOpening",
  1082. label: "银行账号",
  1083. itemType: "text",
  1084. },
  1085. {
  1086. label: "其他信息",
  1087. },
  1088. {
  1089. type: "input",
  1090. prop: "remarks",
  1091. label: "摘要",
  1092. itemType: "textarea",
  1093. },
  1094. ];
  1095. });
  1096. const validatePass = (rule, value, callback) => {
  1097. console.log(formData2.data.currency);
  1098. if (!formData2.data.currency) {
  1099. callback(new Error("请输入金额和选择币种"));
  1100. } else {
  1101. callback();
  1102. }
  1103. };
  1104. const validatePass2 = (rule, value, callback) => {
  1105. if (!formData2.data.inCurrency) {
  1106. callback(new Error("请输入金额和选择币种"));
  1107. } else {
  1108. callback();
  1109. }
  1110. };
  1111. const rules = ref({
  1112. accountManagementId: [
  1113. { required: true, message: "请选择账户", trigger: "change" },
  1114. ],
  1115. transactionTime: [
  1116. { required: true, message: "请选择交易时间", trigger: "change" },
  1117. ],
  1118. status: [{ required: true, message: "请选择收支类型", trigger: "change" }],
  1119. currency: [{ required: true, message: "请选择币种", trigger: "change" }],
  1120. received: [
  1121. { required: true, message: "请选择合同是否到账", trigger: "change" },
  1122. ],
  1123. inAccountManagementId: [
  1124. { required: true, message: "请选择账户", trigger: "change" },
  1125. ],
  1126. inAmount: [
  1127. { required: true, message: "请输入金额和选择币种", trigger: "blur" },
  1128. { required: true, validator: validatePass2, trigger: "blur" },
  1129. ],
  1130. isTransaction: [
  1131. { required: true, message: "请选择是否往来", trigger: "change" },
  1132. ],
  1133. transactionDeptId: [
  1134. { required: true, message: "请选择往来单位", trigger: "change" },
  1135. ],
  1136. amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
  1137. });
  1138. const rules2 = ref({
  1139. accountManagementId: [
  1140. { required: true, message: "请选择账户", trigger: "change" },
  1141. ],
  1142. transactionTime: [
  1143. { required: true, message: "请选择交易时间", trigger: "change" },
  1144. ],
  1145. status: [{ required: true, message: "请选择收支类型", trigger: "change" }],
  1146. currency: [{ required: true, message: "请选择币种", trigger: "change" }],
  1147. received: [
  1148. { required: true, message: "请选择合同是否到账", trigger: "change" },
  1149. ],
  1150. inAccountManagementId: [
  1151. { required: true, message: "请选择账户", trigger: "change" },
  1152. ],
  1153. inAmount: [
  1154. { required: true, message: "请输入金额和选择币种", trigger: "blur" },
  1155. { required: true, validator: validatePass2, trigger: "blur" },
  1156. ],
  1157. isTransaction: [
  1158. { required: true, message: "请选择是否往来", trigger: "change" },
  1159. ],
  1160. transactionDeptId: [
  1161. { required: true, message: "请选择往来单位", trigger: "change" },
  1162. ],
  1163. amount: [
  1164. { required: true, message: "请输入金额和选择币种", trigger: "blur" },
  1165. { required: true, validator: validatePass, trigger: "blur" },
  1166. ],
  1167. });
  1168. const openModal = (val) => {
  1169. modalType.value = val;
  1170. formData.data = {
  1171. transactionTime: moment().format("yyyy-MM-DD HH:mm:ss"),
  1172. };
  1173. console.log(formConfig.value);
  1174. loadingDialog.value = false;
  1175. dialogVisible.value = true;
  1176. };
  1177. const transactionDepartmentData = ref([]);
  1178. const getTransactionDepartment = () => {
  1179. return proxy
  1180. .get("transactionDepartment/list?pageNum=1&pageSize=999", {})
  1181. .then((res) => {
  1182. transactionDepartmentData.value = res.data.map((item) => {
  1183. return {
  1184. label: item.name,
  1185. value: item.id,
  1186. deptType: item.deptType,
  1187. };
  1188. });
  1189. formConfig.value[7].data = transactionDepartmentData.value;
  1190. formConfig.value = { ...formConfig.value };
  1191. });
  1192. };
  1193. getTransactionDepartment();
  1194. const changeStatus = () => {
  1195. formData.data.received = "";
  1196. };
  1197. const transferMoneySubmit = ref(null);
  1198. const submitForm2 = () => {
  1199. transferMoneySubmit.value.handleSubmit(() => {
  1200. console.log(formData2.data);
  1201. loadingDialog.value = true;
  1202. proxy
  1203. .post("/accountRunningWater/internalTransfer", { ...formData2.data })
  1204. .then(
  1205. () => {
  1206. ElMessage({
  1207. message: modalType.value == "add" ? "转账成功" : "转账成功",
  1208. type: "success",
  1209. });
  1210. transferMoneyModal.value = false;
  1211. getList();
  1212. },
  1213. (err) => {
  1214. console.log(err);
  1215. loadingDialog.value = false;
  1216. }
  1217. );
  1218. });
  1219. };
  1220. const submitForm = () => {
  1221. submit.value.handleSubmit(() => {
  1222. if (!formData.data.amount || Number(formData.data.amount) == 0) {
  1223. return ElMessage("交易金额不能为0");
  1224. }
  1225. loadingDialog.value = true;
  1226. proxy.post("/accountRunningWater/" + modalType.value, formData.data).then(
  1227. () => {
  1228. ElMessage({
  1229. message: modalType.value == "add" ? "添加成功" : "编辑成功",
  1230. type: "success",
  1231. });
  1232. dialogVisible.value = false;
  1233. getList();
  1234. },
  1235. (err) => {
  1236. console.log(err);
  1237. loadingDialog.value = false;
  1238. }
  1239. );
  1240. });
  1241. };
  1242. const update = (row) => {
  1243. modalType.value = "edit";
  1244. loadingDialog.value = true;
  1245. proxy.post("/accountRunningWater/detail", { id: row.id }).then((res) => {
  1246. formData.data = res;
  1247. loadingDialog.value = false;
  1248. getTransactionDepartment();
  1249. });
  1250. dialogVisible.value = true;
  1251. };
  1252. const deriveExcel = () => {
  1253. let queryParams = proxy.deepClone(sourceList.value.pagination);
  1254. queryParams.pageNum = 1;
  1255. queryParams.pageSize = 9999;
  1256. proxy.postTwo("/accountRunningWater/exportExcel", queryParams).then((res) => {
  1257. exportData(res, "资金流水.xlsx");
  1258. });
  1259. };
  1260. const exportData = (res, name) => {
  1261. const content = res;
  1262. const blob = new Blob([content], { type: "application/ms-excel" });
  1263. const fileName = name;
  1264. if ("download" in document.createElement("a")) {
  1265. // 非IE下载
  1266. const elink = document.createElement("a");
  1267. elink.download = fileName;
  1268. elink.style.display = "none";
  1269. elink.href = URL.createObjectURL(blob);
  1270. document.body.appendChild(elink);
  1271. elink.click();
  1272. URL.revokeObjectURL(elink.href); // 释放URL 对象
  1273. document.body.removeChild(elink);
  1274. } else {
  1275. navigator.msSaveBlob(blob, fileName);
  1276. }
  1277. };
  1278. const openSearch = ref(false);
  1279. const formSearchConfig = computed(() => {
  1280. return [
  1281. {
  1282. type: "select",
  1283. prop: "accountManagementId",
  1284. label: "资金账户",
  1285. data: accountList.value,
  1286. clearable: true,
  1287. },
  1288. {
  1289. type: "select",
  1290. prop: "status",
  1291. label: "交易类型",
  1292. data: status.value,
  1293. itemWidth: 50,
  1294. clearable: true,
  1295. },
  1296. {
  1297. type: "select",
  1298. prop: "received",
  1299. label: "是否合同到账",
  1300. data: received.value,
  1301. itemWidth: 50,
  1302. clearable: true,
  1303. },
  1304. {
  1305. type: "select",
  1306. prop: "currency",
  1307. label: "币种",
  1308. data: accountCurrency.value,
  1309. clearable: true,
  1310. },
  1311. {
  1312. type: "slot",
  1313. slotName: "money",
  1314. label: "交易金额",
  1315. },
  1316. {
  1317. type: "slot",
  1318. slotName: "time",
  1319. label: "交易时间",
  1320. },
  1321. {
  1322. type: "input",
  1323. prop: "remarks",
  1324. label: "摘要",
  1325. itemType: "text",
  1326. },
  1327. ];
  1328. });
  1329. let copySearch = ref({});
  1330. const moreSearch = () => {
  1331. copySearch.value = proxy.deepClone(sourceList.value.pagination);
  1332. openSearch.value = true;
  1333. };
  1334. const cancelSearch = () => {
  1335. sourceList.value.pagination = copySearch.value;
  1336. openSearch.value = false;
  1337. };
  1338. const submitSearch = () => {
  1339. if (
  1340. sourceList.value.pagination.beginAmount &&
  1341. sourceList.value.pagination.endAmount &&
  1342. Number(sourceList.value.pagination.beginAmount) >
  1343. Number(sourceList.value.pagination.endAmount)
  1344. ) {
  1345. return ElMessage("交易金额输入错误");
  1346. }
  1347. if (
  1348. sourceList.value.pagination.startTime &&
  1349. sourceList.value.pagination.stopTime &&
  1350. sourceList.value.pagination.startTime > sourceList.value.pagination.stopTime
  1351. ) {
  1352. return ElMessage("开始时间不能大于结束时间");
  1353. }
  1354. openSearch.value = false;
  1355. sourceList.value.pagination.keyword = "";
  1356. sourceList.value.pagination.pageNum = 1;
  1357. getList();
  1358. };
  1359. const openPrint = ref(false);
  1360. const rowData = ref({});
  1361. const openDetails = (val) => {
  1362. rowData.value = {
  1363. code: val,
  1364. };
  1365. openPrint.value = true;
  1366. };
  1367. const printObj = ref({
  1368. id: "printMe",
  1369. popTitle: "",
  1370. extraCss:
  1371. "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
  1372. extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
  1373. });
  1374. const clickDownload = () => {
  1375. proxy.getPdf("外销合同PDF文件");
  1376. };
  1377. const loanRules = ref({
  1378. corporationId: [
  1379. { required: true, message: "请选择归属公司", trigger: "change" },
  1380. ],
  1381. loanUserName: [{ required: true, message: "请输入借款人", trigger: "blur" }],
  1382. loanTime: [{ required: true, message: "请选择借款时间", trigger: "change" }],
  1383. currency: [{ required: true, message: "请选择币种", trigger: "change" }],
  1384. amount: [{ required: true, message: "请输入借款金额", trigger: "blur" }],
  1385. loanAccountId: [
  1386. { required: true, message: "请选择付款账户", trigger: "change" },
  1387. ],
  1388. repaymentAccountId: [
  1389. { required: true, message: "请选择收款账户", trigger: "change" },
  1390. ],
  1391. amountOne: [{ required: true, message: "请输入还款金额", trigger: "blur" }],
  1392. repaymentTime: [
  1393. { required: true, message: "请选择还款时间", trigger: "change" },
  1394. ],
  1395. });
  1396. const loanFormConfig = computed(() => {
  1397. return [
  1398. {
  1399. type: "select",
  1400. prop: "corporationId",
  1401. label: "归属公司",
  1402. data: corporationList.value,
  1403. clearable: true,
  1404. disabled: submitType.value != "add",
  1405. itemWidth: 100,
  1406. style: {
  1407. width: "100%",
  1408. },
  1409. },
  1410. {
  1411. type: "slot",
  1412. prop: "loanUserName",
  1413. label: "借款人",
  1414. slotName: "loanUserName",
  1415. disabled: submitType.value != "add",
  1416. itemWidth: 100,
  1417. style: {
  1418. width: "50%",
  1419. },
  1420. },
  1421. {
  1422. type: "date",
  1423. itemType: "datetime",
  1424. prop: "loanTime",
  1425. label: "借款时间",
  1426. disabled: submitType.value != "add",
  1427. itemWidth: 100,
  1428. style: {
  1429. width: "50%",
  1430. },
  1431. },
  1432. {
  1433. type: "select",
  1434. prop: "currency",
  1435. label: "借款金额",
  1436. data: accountCurrency.value,
  1437. clearable: true,
  1438. disabled: submitType.value != "add",
  1439. itemWidth: 25,
  1440. style: {
  1441. width: "100%",
  1442. },
  1443. },
  1444. {
  1445. type: "number",
  1446. prop: "amount",
  1447. label: " ",
  1448. precision: 2,
  1449. min: 0,
  1450. controls: false,
  1451. disabled: submitType.value != "add",
  1452. itemWidth: 30,
  1453. style: {
  1454. width: "100%",
  1455. },
  1456. },
  1457. {
  1458. type: "select",
  1459. prop: "loanAccountId",
  1460. label: "付款账户",
  1461. data: accountList.value,
  1462. disabled: submitType.value != "add",
  1463. itemWidth: 100,
  1464. clearable: true,
  1465. style: {
  1466. width: "100%",
  1467. },
  1468. },
  1469. {
  1470. type: "input",
  1471. itemType: "textarea",
  1472. prop: "remarks",
  1473. label: "备注",
  1474. disabled: submitType.value != "add",
  1475. },
  1476. submitType.value != "add"
  1477. ? {
  1478. type: "title",
  1479. title: "还款信息",
  1480. }
  1481. : {},
  1482. {
  1483. type: "select",
  1484. prop: "repaymentAccountId",
  1485. label: "收款账户",
  1486. data: accountList.value,
  1487. itemWidth: 100,
  1488. clearable: true,
  1489. isShow: submitType.value != "add",
  1490. style: {
  1491. width: "100%",
  1492. },
  1493. },
  1494. {
  1495. type: "select",
  1496. prop: "currency",
  1497. label: "还款金额",
  1498. data: accountCurrency.value,
  1499. clearable: true,
  1500. itemWidth: 25,
  1501. isShow: submitType.value != "add",
  1502. disabled: true,
  1503. style: {
  1504. width: "100%",
  1505. },
  1506. },
  1507. {
  1508. type: "number",
  1509. prop: "amountOne",
  1510. label: " ",
  1511. precision: 2,
  1512. min: 0,
  1513. controls: false,
  1514. itemWidth: 30,
  1515. isShow: submitType.value != "add",
  1516. style: {
  1517. width: "100%",
  1518. },
  1519. },
  1520. {
  1521. type: "date",
  1522. itemType: "datetime",
  1523. prop: "repaymentTime",
  1524. label: "还款时间",
  1525. itemWidth: 100,
  1526. isShow: submitType.value != "add",
  1527. style: {
  1528. width: "50%",
  1529. },
  1530. },
  1531. {
  1532. type: "input",
  1533. itemType: "textarea",
  1534. prop: "remarksOne",
  1535. label: "备注",
  1536. isShow: submitType.value != "add",
  1537. },
  1538. ];
  1539. });
  1540. const openLoanDialog = ref(false);
  1541. const byform = ref(null);
  1542. const submitLoading = ref(false);
  1543. const submitType = ref("add");
  1544. const addloan = () => {
  1545. formData.loanData = {};
  1546. openLoanDialog.value = true;
  1547. };
  1548. const querySearch = (queryString, callback) => {
  1549. proxy
  1550. .post("/loanInfo/getLoanUserList", { keyword: queryString })
  1551. .then((res) => {
  1552. if (res && res.length > 0) {
  1553. res = res.map((item) => {
  1554. return {
  1555. ...item,
  1556. value: item.loanUserName,
  1557. };
  1558. });
  1559. callback(res);
  1560. } else {
  1561. callback([]);
  1562. }
  1563. });
  1564. };
  1565. const handleSubmitLoan = () => {
  1566. byform.value.handleSubmit(() => {
  1567. submitLoading.value = true;
  1568. let requestUrl = "/loanInfo/add";
  1569. proxy.post(requestUrl, formData.loanData).then(
  1570. () => {
  1571. ElMessage({
  1572. message: "操作成功",
  1573. type: "success",
  1574. });
  1575. getList();
  1576. openLoanDialog.value = false;
  1577. submitLoading.value = false;
  1578. },
  1579. () => {
  1580. submitLoading.value = false;
  1581. }
  1582. );
  1583. });
  1584. };
  1585. </script>
  1586. <style lang="scss" scoped>
  1587. .tenant {
  1588. padding: 20px;
  1589. }
  1590. ::v-deep(.el-input-number .el-input__inner) {
  1591. text-align: left;
  1592. }
  1593. </style>