index.vue 40 KB

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