ExpenseManagement.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399
  1. <template>
  2. <!--布局容器-->
  3. <div class="container" style="width: 99%; margin-top: 0px">
  4. <!-- 顶部查询 -->
  5. <el-row class="top">
  6. <el-form v-model="queryFrom" size="small" label-width="95px" class="form">
  7. <el-form-item label="账户类别" label-width="95px" prop="outerFlag">
  8. <el-select
  9. v-model="queryFrom.outerFlag"
  10. placeholder="请选择账户类别"
  11. clearable
  12. >
  13. <el-option label="内部账户" value="0"></el-option>
  14. <el-option label="外部账户" value="1"></el-option>
  15. </el-select>
  16. </el-form-item>
  17. <!-- <el-form-item label="账户性质" label-width="95px" prop="accountQuality">
  18. <el-select
  19. v-model="queryFrom.accountQuality"
  20. placeholder="请选择账户性质"
  21. clearable
  22. >
  23. <el-option
  24. v-for="item in account_qualityData"
  25. :key="item.value + 'aa'"
  26. :label="item.label"
  27. :value="item.value"
  28. ></el-option>
  29. </el-select>
  30. </el-form-item> -->
  31. <el-form-item label="户名" label-width="95px" prop="invCompanyName">
  32. <el-input
  33. v-model="queryFrom.accountName"
  34. placeholder="请输入户名"
  35. class="widths"
  36. clearable
  37. ></el-input>
  38. </el-form-item>
  39. <el-form-item label="银行卡号" label-width="95px" prop="invCompanyName">
  40. <el-input
  41. v-model="queryFrom.bankCardNum"
  42. placeholder="请输入银行卡号"
  43. class="widths"
  44. clearable
  45. ></el-input>
  46. </el-form-item>
  47. <el-form-item>
  48. <el-button type="primary" size="small" @click="queryStaffInfo"
  49. >查询</el-button
  50. >
  51. </el-form-item>
  52. </el-form>
  53. </el-row>
  54. <!-- 新增 -->
  55. <el-button
  56. class="operation"
  57. type="primary"
  58. plain
  59. size="medium"
  60. @click="addAmount"
  61. >新增账户</el-button
  62. >
  63. <!-- 表格 -->
  64. <el-table
  65. :data="accountData"
  66. border
  67. size="small"
  68. ref="account"
  69. :header-cell-style="{
  70. background: '#F2F7FC',
  71. fontWeight: '900',
  72. color: '#606266',
  73. }"
  74. height="600px"
  75. style="width: 100%; margin-top: 30px"
  76. @expand-change="handleRowChange"
  77. >
  78. <el-table-column type="expand">
  79. <template slot-scope="scope">
  80. <el-table
  81. :data="scope.row.invAccountCardList"
  82. size="small"
  83. :header-cell-style="{
  84. background: '#ccc',
  85. fontWeight: '900',
  86. color: '#606266',
  87. }"
  88. style="width: 100%"
  89. >
  90. <el-table-column
  91. type="index"
  92. width="50"
  93. align="center"
  94. label="序号"
  95. >
  96. </el-table-column>
  97. <el-table-column
  98. v-for="(childItem, index) in childColums"
  99. :key="'child' + index"
  100. :prop="childItem.prop"
  101. align="center"
  102. :label="childItem.label"
  103. :min-width="childItem.minWidth"
  104. >
  105. </el-table-column>
  106. <el-table-column
  107. fixed="right"
  108. label="操作"
  109. align="center"
  110. width="300"
  111. >
  112. <template slot-scope="scopes">
  113. <el-button size="mini" @click="childEdit(scopes.row)"
  114. >编辑</el-button
  115. >
  116. <el-button
  117. size="mini"
  118. type="danger"
  119. @click="cardDelete(scopes.row)"
  120. >删除</el-button
  121. >
  122. <el-button
  123. size="mini"
  124. type="success"
  125. @click="handleTableIncome(scope.row, scopes.row)"
  126. >收入</el-button
  127. >
  128. <el-button
  129. size="mini"
  130. type="warning"
  131. @click="handleTableExpend(scopes.row)"
  132. >支出</el-button
  133. >
  134. </template>
  135. </el-table-column>
  136. </el-table>
  137. </template>
  138. </el-table-column>
  139. <el-table-column
  140. v-for="(dataItem, dataIndex) in columns"
  141. :key="dataIndex"
  142. :label="dataItem.label"
  143. :prop="dataItem.prop"
  144. :min-width="dataItem.minWidth"
  145. align="center"
  146. >
  147. </el-table-column>
  148. <el-table-column fixed="right" label="操作" align="center" width="240">
  149. <template slot-scope="scope">
  150. <el-button
  151. size="mini"
  152. @click.native.prevent="handleTableEdit(scope.row, scope)"
  153. >编辑</el-button
  154. >
  155. <el-button
  156. size="mini"
  157. type="danger"
  158. @click.native.prevent="handleTableDelete(scope.row)"
  159. >删除</el-button
  160. >
  161. <el-tooltip
  162. class="item"
  163. effect="dark"
  164. content="新增卡信息"
  165. placement="bottom-end"
  166. >
  167. <el-button
  168. size="mini"
  169. type="success"
  170. @click.native.prevent="handleTableAdd(scope.row)"
  171. >新增</el-button
  172. >
  173. </el-tooltip>
  174. </template>
  175. </el-table-column>
  176. </el-table>
  177. <el-pagination
  178. @size-change="handleSizeChange"
  179. layout="total, sizes, prev, pager, next, jumper"
  180. @current-change="refreshPageRequest"
  181. :current-page="pageRequest.pageNo"
  182. :page-size="pageRequest.pageSize"
  183. :page-sizes="[10, 20, 50, 100, 200, 300, 400, 500]"
  184. :total="pageRequest.totalSize"
  185. style="float: left; margin-left: 20px; margin-top: 20px"
  186. >
  187. </el-pagination>
  188. <!-- 新增修改弹框 -->
  189. <expense-component
  190. ref="expenseComponent"
  191. :type="type"
  192. :formData="type == 1 ? accountFormData : accountCardFormData"
  193. :formDataId="formDataId"
  194. :title="title"
  195. :dialogFormVisible="dialogFormVisible"
  196. :nature_businessData="nature_businessData"
  197. @resetForm="resetForm"
  198. @submitForm="submitForm"
  199. @setDateInterval="setDateInterval"
  200. ></expense-component>
  201. <!-- 支出弹框 -->
  202. <el-dialog
  203. class="dialog expendDialog"
  204. title="支出信息"
  205. :close-on-click-modal="false"
  206. :before-close="expendResetForm"
  207. :visible.sync="expendDialogVisible"
  208. width="60%"
  209. >
  210. <!-- 支出表格 -->
  211. <kt-common-table
  212. :operationWidth="130"
  213. class="ktTable expendTable"
  214. ref="expendTable"
  215. :data="expendPageResult"
  216. :columns="expendColumns"
  217. :showBatchDelete="false"
  218. :showOperation="true"
  219. :button1Name="expendButton1Name"
  220. button2Background="#92D050"
  221. button3Background="#f56c6c"
  222. button1Icon="el-icon-s-finance"
  223. @handleButton1="handleTableConfirm"
  224. @findPage="getExpendData"
  225. :isshowpagination="true"
  226. ></kt-common-table>
  227. </el-dialog>
  228. <!-- 收入弹框 -->
  229. <el-dialog
  230. class="dialog expendDialog"
  231. title="收入信息"
  232. :close-on-click-modal="false"
  233. :before-close="incomeResetForm"
  234. :visible.sync="incomeDialogVisible"
  235. width="60%"
  236. >
  237. <el-form
  238. :model="inComeFormData"
  239. :rules="inComeFormRules"
  240. ref="inComeFormData"
  241. label-width="130px"
  242. size="small"
  243. class="inComeForm"
  244. >
  245. <el-row>
  246. <el-col :span="12">
  247. <el-form-item label="转账方" prop="company">
  248. <el-select
  249. v-model="inComeFormData.company"
  250. filterable
  251. placeholder=""
  252. @change="companyChange"
  253. >
  254. <el-option
  255. v-for="item in collectionData"
  256. :key="item.accountId"
  257. :label="item.name"
  258. :value="item.nameValue"
  259. >
  260. </el-option>
  261. </el-select>
  262. </el-form-item>
  263. </el-col>
  264. <el-col :span="12">
  265. <el-form-item label="收款方" prop="collectionMessage">
  266. <el-input
  267. disabled
  268. v-model="inComeFormData.collectionMessage"
  269. autocomplete="off"
  270. ></el-input>
  271. </el-form-item>
  272. </el-col>
  273. </el-row>
  274. <el-row>
  275. <el-col :span="12">
  276. <el-form-item label="金额" prop="outerFlag">
  277. <el-input-number
  278. v-model="inComeFormData.applyAmount"
  279. :min="0"
  280. :precision="2"
  281. @blur="chageAppl"
  282. :max="99999999999999999"
  283. label=""
  284. ></el-input-number>
  285. </el-form-item>
  286. </el-col>
  287. <el-col :span="12">
  288. <el-form-item label="大写金额" prop="bigApplyAmount">
  289. <el-input
  290. v-model="inComeFormData.bigApplyAmount"
  291. disabled
  292. autocomplete="off"
  293. ></el-input>
  294. </el-form-item>
  295. </el-col>
  296. </el-row>
  297. <el-row class="collec">
  298. <el-col :span="24">
  299. <el-form-item label="资金流向" style="width: 100%">
  300. <el-input
  301. v-model="inComeFormData.company"
  302. disabled
  303. autocomplete="off"
  304. ></el-input>
  305. <i class="el-icon-right"></i>
  306. <el-input
  307. disabled
  308. v-model="inComeFormData.collectionMessage"
  309. autocomplete="off"
  310. ></el-input>
  311. </el-form-item>
  312. </el-col>
  313. <el-col :span="12"> </el-col>
  314. </el-row>
  315. <el-row>
  316. <el-col :span="12">
  317. <el-form-item label="支付方式" prop="payMethod">
  318. <el-select
  319. v-model="inComeFormData.payMethod"
  320. multiple
  321. placeholder=""
  322. >
  323. <el-option
  324. v-for="item in payment_methodsData"
  325. :key="item.value"
  326. :label="item.label"
  327. :value="item.value"
  328. >
  329. </el-option>
  330. </el-select>
  331. </el-form-item>
  332. </el-col>
  333. <el-col :span="12">
  334. <el-form-item label="备注" prop="remark">
  335. <el-select
  336. v-model="inComeFormData.remark"
  337. allow-create
  338. filterable
  339. placeholder=""
  340. >
  341. <el-option
  342. v-for="item in use_fundsData"
  343. :key="item.value"
  344. :label="item.label"
  345. :value="item.label"
  346. >
  347. </el-option>
  348. </el-select>
  349. </el-form-item>
  350. </el-col>
  351. </el-row>
  352. <el-row>
  353. <el-col :span="12">
  354. <el-form-item label="资金用途" prop="fundUse">
  355. <el-cascader
  356. v-model="inComeFormData.fundUse"
  357. :show-all-levels="false"
  358. :clearable="true"
  359. :checkStrictly="true"
  360. :emitPath="false"
  361. placeholder=""
  362. :options="fundFlowData"
  363. filterable
  364. :props="{
  365. children: 'child',
  366. label: 'category',
  367. value: 'category',
  368. checkStrictly: true,
  369. }"
  370. ></el-cascader>
  371. </el-form-item>
  372. </el-col>
  373. </el-row>
  374. </el-form>
  375. <div slot="footer" class="dialog-footer">
  376. <el-button @click="incomeResetForm()" size="small">取 消</el-button>
  377. <el-button type="primary" @click="submitIncomeForm()" size="small"
  378. >确 定</el-button
  379. >
  380. </div>
  381. </el-dialog>
  382. </div>
  383. </template>
  384. <script>
  385. import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
  386. import KtButton from "@/views/Core/KtButton"; // 按钮权限组件
  387. import ExpenseComponent from "./ExpenseComponent.vue"; //新增账户信息弹框
  388. import { toChies } from "../../../utils/moneyTransition";
  389. export default {
  390. name: "ExpenseManagement",
  391. components: { KtCommonTable, KtButton, ExpenseComponent },
  392. created() {
  393. this.business("account_quality"); //账户性质字典;
  394. this.business("use_funds"); //备注字典
  395. this.business("payment_methods"); //支付方式字典
  396. this.business("nature_business"); //营业性质字典
  397. this.getTreeList(); //获取资金用途字典
  398. },
  399. mounted() {},
  400. data() {
  401. return {
  402. type: 1, //1为账户信息,2为卡信息
  403. /**
  404. * 账户收入模块
  405. */
  406. incomeDialogVisible: false, //收入 弹出框状态
  407. collectionData: [], //收入 转账方下拉菜单数组
  408. fundFlowData: [], //资金用途字典数据
  409. use_fundsData: [], //收入 备注字典数据
  410. payment_methodsData: [], //收入 支付方式字典数据
  411. inComeFormData: {
  412. //收入form表单
  413. collectionMessage: "", //收款名字
  414. fundFlow: "", //资金流向
  415. applyAmount: "", //金额
  416. bigApplyAmount: "", //大写金额
  417. remark: "", //备注
  418. company: "", //转账方
  419. payMethod: [], //转账方
  420. fundUse: "", //资金用途
  421. },
  422. inComeFormRules: {
  423. //收入规则
  424. company: [
  425. { required: true, message: "转账方不能为空", trigger: "change" },
  426. ],
  427. remark: [{ required: true, message: "请选择备注", trigger: "change" }],
  428. payMethod: [
  429. { required: true, message: "请选择支付方式", trigger: "change" },
  430. ],
  431. },
  432. enterCardId: "", //收入id
  433. /**
  434. * 账户模块
  435. */
  436. title: "新增账户信息",
  437. accountData: [], //账户信息数据
  438. dialogFormVisible: false, //弹出框状态
  439. operationWidth: 200, //操作列宽度
  440. account_qualityData: [], //账户性质数据字典
  441. nature_businessData: [], //营业性质数据字典
  442. queryFrom: {
  443. //查询条件
  444. // accountQuality: "", //账户性质查询
  445. bankCardNum: "", //银行卡号查询
  446. accountName: "", //户名查询
  447. },
  448. button1Name: "支出", //按钮内容
  449. button3Name: "删除",
  450. button2Name: "收入",
  451. expendButton1Name: "确认已转账",
  452. formDataId: "", //数据Id
  453. pageRequest: {
  454. // 列表查询条件
  455. pageNo: 1,
  456. pageSize: 10,
  457. },
  458. // 数据列
  459. columns: [
  460. {
  461. prop: "outerFlagName",
  462. label: "账户类别",
  463. minWidth: 80,
  464. sortable: false,
  465. },
  466. {
  467. prop: "businessQualityName",
  468. label: "营业性质",
  469. minWidth: 80,
  470. sortable: false,
  471. },
  472. {
  473. prop: "accountName",
  474. label: "户名",
  475. minWidth: 240,
  476. sortable: false,
  477. },
  478. {
  479. prop: "juridicalPerson",
  480. label: "法人",
  481. minWidth: 80,
  482. sortable: false,
  483. },
  484. {
  485. prop: "owned",
  486. label: "所属地",
  487. minWidth: 80,
  488. sortable: false,
  489. },
  490. {
  491. prop: "biller",
  492. label: "开票员",
  493. minWidth: 80,
  494. sortable: false,
  495. },
  496. {
  497. prop: "invoicingAmount",
  498. label: "开票额度",
  499. minWidth: 80,
  500. sortable: false,
  501. },
  502. {
  503. prop: "invoicingAmountExcess",
  504. label: "剩余开票额度",
  505. minWidth: 90,
  506. sortable: false,
  507. },
  508. {
  509. prop: "establishTime",
  510. label: "成立日期",
  511. minWidth: 80,
  512. sortable: false,
  513. },
  514. {
  515. prop: "quarterAmountExcess",
  516. label: "季度开票额度",
  517. minWidth: 120,
  518. sortable: false,
  519. },
  520. {
  521. prop: "sumInvoicingAmount",
  522. label: "总开票额度",
  523. minWidth: 120,
  524. sortable: false,
  525. },
  526. {
  527. prop: "tentativeEstimates",
  528. label: "暂估",
  529. minWidth: 120,
  530. sortable: false,
  531. },
  532. ],
  533. //子部数据列
  534. childColums: [
  535. {
  536. prop: "accountQualityName",
  537. label: "账户性质",
  538. minWidth: 80,
  539. sortable: false,
  540. },
  541. {
  542. prop: "bankCardNum",
  543. label: "银行卡号",
  544. minWidth: 170,
  545. sortable: false,
  546. },
  547. { prop: "bank", label: "开户行", minWidth: 100, sortable: false },
  548. {
  549. prop: "bankName",
  550. label: "开户行名称",
  551. minWidth: 190,
  552. sortable: false,
  553. },
  554. { prop: "bankNum", label: "开户行号", minWidth: 150, sortable: false },
  555. {
  556. prop: "balance",
  557. label: "余额",
  558. minWidth: 100,
  559. sortable: false,
  560. },
  561. {
  562. prop: "startCertExpirationDate",
  563. label: "证书有效开始日期",
  564. minWidth: 120,
  565. sortable: false,
  566. },
  567. {
  568. prop: "endCertExpirationDate",
  569. label: "证书有效结束日期",
  570. minWidth: 120,
  571. sortable: false,
  572. },
  573. {
  574. prop: "clearingProfit",
  575. label: "结算卡",
  576. minWidth: 120,
  577. sortable: false,
  578. },
  579. {
  580. prop: "dayStrokeNum",
  581. label: "单日转账笔数限制",
  582. minWidth: 120,
  583. sortable: false,
  584. },
  585. {
  586. prop: "exteriorProfit",
  587. label: "外部过账金额",
  588. minWidth: 120,
  589. sortable: false,
  590. },
  591. {
  592. prop: "fiscalProfit",
  593. label: "财税公司利润",
  594. minWidth: 120,
  595. sortable: false,
  596. },
  597. {
  598. prop: "insuranceProfit",
  599. label: "保险公司回款",
  600. minWidth: 120,
  601. sortable: false,
  602. },
  603. {
  604. prop: "otherProfit",
  605. label: "其他利润",
  606. minWidth: 120,
  607. sortable: false,
  608. },
  609. {
  610. prop: "parkProfit",
  611. label: "园区利润",
  612. minWidth: 120,
  613. sortable: false,
  614. },
  615. {
  616. prop: "priDayLines",
  617. label: "对私单日限额",
  618. minWidth: 120,
  619. sortable: false,
  620. },
  621. {
  622. prop: "priSingleLines",
  623. label: "对私单笔限额",
  624. minWidth: 120,
  625. sortable: false,
  626. },
  627. {
  628. prop: "priYearExcess",
  629. label: "对私年剩余额度",
  630. minWidth: 120,
  631. sortable: false,
  632. },
  633. {
  634. prop: "priYearLines",
  635. label: "对私年额度",
  636. minWidth: 120,
  637. sortable: false,
  638. },
  639. {
  640. prop: "pubDayLines",
  641. label: "对公单日限额",
  642. minWidth: 120,
  643. sortable: false,
  644. },
  645. {
  646. prop: "pubSingleLines",
  647. label: "对公单笔限额",
  648. minWidth: 120,
  649. sortable: false,
  650. },
  651. {
  652. prop: "pubYearExcess",
  653. label: "对公年剩余额度",
  654. minWidth: 120,
  655. sortable: false,
  656. },
  657. {
  658. prop: "pubYearLines",
  659. label: "对公年额度",
  660. minWidth: 120,
  661. sortable: false,
  662. },
  663. {
  664. prop: "tianqinProfit",
  665. label: "天勤利润",
  666. minWidth: 120,
  667. sortable: false,
  668. },
  669. ],
  670. //账户信息form
  671. accountFormData: {
  672. outerFlag: "0", //账户类别
  673. accountName: "", //户名
  674. businessQuality: "", //营业性质
  675. establishTime: "", //成立日期
  676. invoicingAmount: 0, //开票额度
  677. // invoicingAmountExcess:0,//剩余开票额度
  678. juridicalPerson: "", //法人
  679. owned: "", //所属地
  680. biller: "", //开票员
  681. tentativeEstimates: "", //暂估值
  682. },
  683. //账户卡信息form
  684. accountCardFormData: {
  685. accountQuality: "", //账户性质
  686. bankCardNum: "", //银行卡号
  687. bank: "", //开户行
  688. bankName: "", //开户行名称
  689. bankNum: "", //开户行号
  690. balance: "", //余额
  691. certExpirationDate: "", //证书有效期
  692. clearingProfit: 0, //结算卡
  693. dayStrokeNum: 0, //单日转账笔数限制
  694. dayStrokeNumExcess: 0, //单日转账笔数剩余
  695. exteriorProfit: 0, //外部过账金额
  696. fiscalProfit: 0, // 财务公司利润
  697. insuranceProfit: 0, //保险公司回款
  698. otherProfit: 0, //其他利润
  699. parkProfit: 0, //园区利润
  700. priDayLines: 0, //对私单日限额
  701. priDayLinesExcess: 0, //对私单日限额剩余
  702. priSingleLines: 0, //对私单笔限额
  703. priYearExcess: 0, //对私年剩余额度
  704. priYearLines: 0, //对私年额度
  705. pubDayLines: 0, //对公单日限额
  706. pubDayLinesExcess: 0, //对公单日限额剩余
  707. pubSingleLines: 0, //对公单笔限额
  708. pubYearExcess: 0, //对公年剩余额度
  709. pubYearLines: 0, //对公年额度
  710. spend: 0, //支出金额
  711. tianqinProfit: 0, //天勤利润
  712. },
  713. /**
  714. * 支出模块
  715. */
  716. expendColumns: [
  717. // 支出数据列
  718. {
  719. prop: "company",
  720. label: "转账方",
  721. minWidth: 160,
  722. sortable: false,
  723. },
  724. {
  725. prop: "collectionMessage",
  726. label: "收账方",
  727. minWidth: 80,
  728. sortable: false,
  729. },
  730. {
  731. prop: "applyAmount",
  732. label: "金额",
  733. minWidth: 150,
  734. sortable: false,
  735. },
  736. {
  737. prop: "applyTime",
  738. label: "转账日期",
  739. minWidth: 150,
  740. sortable: false,
  741. },
  742. {
  743. prop: "transferFlagName",
  744. label: "转账状态",
  745. minWidth: 150,
  746. sortable: false,
  747. },
  748. ],
  749. expendPageResult: {
  750. //支出表格参数
  751. pageNo: 1,
  752. pageSize: 10,
  753. },
  754. expendDialogVisible: false, //支出弹出框状态
  755. outCardNum: "", //点击支出按钮当条数据支出id
  756. companyItem: {}, //选择单位整条数据
  757. typeName: "card", //账户信息 跟 卡信息
  758. };
  759. },
  760. watch: {
  761. expendDialogVisible(n) {
  762. if (n == false) {
  763. this.outCardNum = "";
  764. }
  765. },
  766. //收入去除form表单信息
  767. incomeDialogVisible(n) {
  768. if (n == false) {
  769. this.enterCardId = "";
  770. this.$refs.inComeFormData.clearValidate();
  771. this.inComeFormData = {
  772. //收入form数据
  773. collectionMessage: "", //收款名字
  774. fundFlow: "", //资金流向
  775. applyAmount: "", //金额
  776. bigApplyAmount: "", //大写金额
  777. remark: "", //备注
  778. company: "", //转账方
  779. payMethod: [], //支付方式
  780. };
  781. }
  782. },
  783. },
  784. methods: {
  785. //获取资金用途树数据
  786. getTreeList() {
  787. this.$api.expense.getAccountExpensesTreeList().then((res) => {
  788. this.fundFlowData = res.data;
  789. });
  790. },
  791. //展开事件
  792. handleRowChange(e, row) {
  793. if (row.length > 0) {
  794. //展开
  795. if (
  796. e.invAccountCardList != null &&
  797. e.invAccountCardList != "" &&
  798. e.invAccountCardList != undefined &&
  799. e.invAccountCardList.length > 0
  800. ) {
  801. } else {
  802. this.$message.error("暂无数据");
  803. this.$refs.account.toggleRowExpansion(e, false);
  804. }
  805. }
  806. },
  807. // 换页刷新
  808. refreshPageRequest: function (pageNum) {
  809. this.pageRequest.pageNo = pageNum;
  810. this.findPage();
  811. },
  812. // 每页条数发生改变
  813. handleSizeChange(pageSize) {
  814. this.pageRequest.pageSize = pageSize;
  815. this.findPage();
  816. },
  817. //申请金额填写完成后
  818. chageAppl(e) {
  819. this.inComeFormData.bigApplyAmount = toChies(
  820. this.inComeFormData.applyAmount
  821. );
  822. },
  823. //获取所有外部账户信息
  824. getAllUser() {
  825. this.$api.expense.getAccountByAccountName().then((res) => {
  826. if (res.code == 200) {
  827. let arr = [];
  828. /**获取所有外部用户 */
  829. let outArr = res.data.filter((item) => item.outerFlag == 1);
  830. outArr.forEach((item) => {
  831. if (item.invAccountCardList != null) {
  832. item.invAccountCardList.forEach((it) => {
  833. it.name =
  834. (item.outerFlag == 0 ? "内部用户" : "外部用户") +
  835. " " +
  836. (it.accountQuality == 0 ? "公户" : "私户") +
  837. " " +
  838. item.accountName +
  839. " " +
  840. it.bankCardNum +
  841. " " +
  842. it.bank;
  843. it.nameValue =
  844. item.accountName + " " + it.bankCardNum + " " + it.bank;
  845. });
  846. arr.push(...item.invAccountCardList);
  847. }
  848. });
  849. this.collectionData = arr;
  850. }
  851. });
  852. },
  853. //选择收款单位change事件
  854. companyChange(val) {
  855. const item = this.collectionData.find((item) => item.accountId === val);
  856. this.companyItem = item;
  857. },
  858. //点击确认收入事件
  859. submitIncomeForm() {
  860. let obj = JSON.parse(JSON.stringify(this.inComeFormData));
  861. obj.enterCardId = this.enterCardId;
  862. obj.fundFlow = obj.company + "→" + obj.collectionMessage;
  863. obj.payMethod = obj.payMethod.join(",");
  864. obj.revenueOutlay = "0";
  865. obj.fundUse = obj.fundUse[obj.fundUse.length - 1]; //资金用途
  866. this.$refs.inComeFormData.validate((valid) => {
  867. if (valid) {
  868. this.$api.expense.insertAccountOperate(obj).then((res) => {
  869. this.incomeDialogVisible = false;
  870. if (res.code == 200) {
  871. this.$message.success("添加成功!");
  872. } else {
  873. this.$message.success(res.msg);
  874. }
  875. });
  876. } else {
  877. return false;
  878. }
  879. });
  880. },
  881. //点击页面收入按钮
  882. handleTableIncome(row, rows) {
  883. if (row.outerFlag == 1) {
  884. this.$message.error("请选择内部账户");
  885. return;
  886. }
  887. this.getAllUser();
  888. this.enterCardId = rows.bankCardNum;
  889. this.inComeFormData.collectionMessage =
  890. row.accountName + " " + rows.bankCardNum + " " + rows.bank;
  891. this.incomeDialogVisible = true;
  892. },
  893. //点击页面支出按钮
  894. handleTableExpend(row) {
  895. if (row.outerFlag == 1) {
  896. this.$message.error("请选择内部账户");
  897. return;
  898. }
  899. this.expendDialogVisible = true;
  900. this.outCardNum = row.bankCardNum;
  901. this.getExpendData();
  902. },
  903. //获取支出信息列表
  904. getExpendData(data) {
  905. if (data && data.pageRequest) {
  906. this.expendPageResult.pageNo = data.pageRequest.pageNum;
  907. this.expendPageResult.pageSize = data.pageRequest.pageSize;
  908. }
  909. let obj = {
  910. pageNo: this.expendPageResult.pageNo,
  911. pageSize: this.expendPageResult.pageSize,
  912. transferFlag: 1,
  913. outCardNum: this.outCardNum,
  914. };
  915. this.$api.expense
  916. .getAccountExcel(obj)
  917. .then((res) => {
  918. res.data.records.forEach((element) => {
  919. element.transferFlagName =
  920. element.transferFlag == 0 ? "已转账" : "未转账";
  921. });
  922. this.expendPageResult = {
  923. content: res.data.records,
  924. pageNum: res.data.current,
  925. pageSize: res.data.size,
  926. totalPages: res.data.pages,
  927. totalSize: res.data.total,
  928. };
  929. })
  930. .then(data != null ? data.callback : "");
  931. },
  932. //弹框确认支出按钮事件
  933. handleTableConfirm(index) {
  934. this.$confirm("确认把该条数据设为已转账状态吗?", "提示", {
  935. type: "warning",
  936. })
  937. .then(() => {
  938. this.$api.expense
  939. .updateTransferFlag(index.row.excelAccountOperateId)
  940. .then((res) => {
  941. if (res.code == 200) {
  942. this.$message.success("确认转账成功");
  943. this.getExpendData();
  944. } else {
  945. this.$message.error(res.msg);
  946. }
  947. });
  948. })
  949. .catch(() => {});
  950. },
  951. //选择证书有效日期区间
  952. setDateInterval(e) {
  953. if (e != null && e != "") {
  954. this.accountCardFormData.startCertExpirationDate = e[0];
  955. this.accountCardFormData.endCertExpirationDate = e[1];
  956. } else {
  957. this.accountCardFormData.startCertExpirationDate = "";
  958. this.accountCardFormData.endCertExpirationDate = "";
  959. }
  960. },
  961. //获取支出页面列表数据
  962. expendFindPage(data) {},
  963. //获取页面列表数据
  964. findPage(data) {
  965. if (data && data.pageRequest) {
  966. this.pageRequest.pageNo = data.pageRequest.pageNum;
  967. this.pageRequest.pageSize = data.pageRequest.pageSize;
  968. }
  969. let obj = { ...this.queryFrom, ...this.pageRequest };
  970. this.$api.expense
  971. .getAccount(obj)
  972. .then((res) => {
  973. if (res.code == 200) {
  974. res.data.records.forEach((element) => {
  975. if (element != null && element != "" && element != undefined) {
  976. //转化营业性质
  977. let quality = this.nature_businessData.find(
  978. (item) => item.value == element.businessQuality
  979. );
  980. if (quality != null && quality != "" && quality != undefined) {
  981. element.businessQualityName = quality.label;
  982. } else {
  983. element.businessQualityName = "";
  984. }
  985. element.outerFlagName =
  986. element.outerFlag == 0 ? "内部账户" : "外部账户";
  987. if (element.invAccountCardList != null) {
  988. element.invAccountCardList.forEach((inv) => {
  989. inv.outerFlag = element.outerFlag;
  990. inv.accountQualityName = this.dictFn(inv, 1); //转化账户性质
  991. });
  992. }
  993. }
  994. });
  995. this.accountData = res.data.records;
  996. this.pageRequest.pageNo = res.data.current;
  997. this.pageRequest.pageSize = res.data.size;
  998. this.pageRequest.totalPages = res.data.pages;
  999. this.pageRequest.totalSize = res.data.total;
  1000. }
  1001. })
  1002. .then(data != null ? data.callback : "");
  1003. },
  1004. //数据字典
  1005. business(typeName) {
  1006. this.$api.dict.findByLableName(typeName).then((res) => {
  1007. // this.account_qualityData = res.data;
  1008. this[typeName + "Data"] = res.data;
  1009. if (typeName == "account_quality" && this.accountData.length == 0) {
  1010. this.findPage();
  1011. }
  1012. });
  1013. },
  1014. //用户性质转换
  1015. dictFn(obj, type) {
  1016. if (obj.accountQuality == null) {
  1017. return;
  1018. }
  1019. if (type == 1) {
  1020. return this.account_qualityData.find(
  1021. (item) => item.value == obj.accountQuality
  1022. ).label;
  1023. } else {
  1024. return this.account_qualityData.find(
  1025. (item) => item.label == obj.accountQuality
  1026. ).value;
  1027. }
  1028. },
  1029. // 查询
  1030. queryStaffInfo() {
  1031. this.findPage();
  1032. },
  1033. //新增事件
  1034. addAmount() {
  1035. this.title = "新增账户信息";
  1036. this.type = 1;
  1037. this.dialogFormVisible = true;
  1038. },
  1039. //卡删除数据事件
  1040. cardDelete(row) {
  1041. this.$confirm("确认删除该条数据吗?", "提示", {
  1042. type: "warning",
  1043. })
  1044. .then(() => {
  1045. this.$api.expense.deleteAccountCard(row.bankCardNum).then((res) => {
  1046. if (res.code == 200) {
  1047. this.$message.success("删除成功");
  1048. this.findPage();
  1049. } else {
  1050. this.$message.error(res.msg);
  1051. }
  1052. });
  1053. })
  1054. .catch(() => {});
  1055. },
  1056. //账户删除数据事件
  1057. handleTableDelete(row) {
  1058. this.$confirm("确认删除该记录吗?", "提示", {
  1059. type: "warning",
  1060. })
  1061. .then(() => {
  1062. this.$api.expense.deleteAccount(row.accountId).then((res) => {
  1063. if (res.code == 200) {
  1064. this.$message.success("删除成功");
  1065. this.findPage();
  1066. } else {
  1067. this.$message.error(res.msg);
  1068. }
  1069. });
  1070. })
  1071. .catch(() => {});
  1072. },
  1073. //收入弹框取消重置
  1074. incomeResetForm() {
  1075. this.incomeDialogVisible = false;
  1076. },
  1077. //支出弹框取消重置
  1078. expendResetForm() {
  1079. this.expendDialogVisible = false;
  1080. },
  1081. //弹框取消重置
  1082. resetForm() {
  1083. this.dialogFormVisible = false;
  1084. this.formDataId = "";
  1085. if (this.type == 1) {
  1086. this.accountFormData = {
  1087. outerFlag: "0", //账户类别
  1088. accountName: "", //户名
  1089. businessQuality: "", //营业性质
  1090. establishTime: "", //成立日期
  1091. invoicingAmount: 0, //开票额度
  1092. // invoicingAmountExcess:0,//剩余开票额度
  1093. juridicalPerson: "", //法人
  1094. owned: "", //所属地
  1095. tentativeEstimates: "", //暂估值
  1096. };
  1097. } else {
  1098. this.accountCardFormData = {
  1099. accountQuality: "", //账户性质
  1100. bankCardNum: "", //银行卡号
  1101. bank: "", //开户行
  1102. bankName: "", //开户行名称
  1103. bankNum: "", //开户行号
  1104. balance: 0, //余额
  1105. certExpirationDate: "", //证书有效期
  1106. clearingProfit: 0, //结算卡
  1107. dayStrokeNum: 0, //单日转账笔数限制
  1108. dayStrokeNumExcess: 0, //单日转账笔数剩余
  1109. exteriorProfit: 0, //外部过账金额
  1110. fiscalProfit: 0, // 财务公司利润
  1111. insuranceProfit: 0, //保险公司回款
  1112. otherProfit: 0, //其他利润
  1113. parkProfit: 0, //园区利润
  1114. priDayLines: 0, //对私单日限额
  1115. priDayLinesExcess: 0, //对私单日限额剩余
  1116. priSingleLines: 0, //对私单笔限额
  1117. priYearExcess: 0, //对私年剩余额度
  1118. priYearLines: 0, //对私年额度
  1119. pubDayLines: 0, //对公单日限额
  1120. pubDayLinesExcess: 0, //对公单日限额剩余
  1121. pubSingleLines: 0, //对公单笔限额
  1122. pubYearExcess: 0, //对公年剩余额度
  1123. pubYearLines: 0, //对公年额度
  1124. spend: 0, //支出金额
  1125. tianqinProfit: 0, //天勤利润
  1126. };
  1127. }
  1128. },
  1129. //卡信息修改事件
  1130. childEdit(row) {
  1131. this.type = 2; //卡信息
  1132. this.title = "编辑账户卡信息";
  1133. this.formDataId = row.accountId;
  1134. this.$api.expense
  1135. .getAccountCardList({
  1136. accountId: row.accountId,
  1137. bankCardNum: row.bankCardNum,
  1138. bank: row.bank,
  1139. })
  1140. .then((res) => {
  1141. if (res.code == 200) {
  1142. if (
  1143. res.data[0].startCertExpirationDate &&
  1144. res.data[0].startCertExpirationDate != null &&
  1145. res.data[0].endCertExpirationDate &&
  1146. res.data[0].endCertExpirationDate != null
  1147. ) {
  1148. res.data[0].certExpirationDate = [
  1149. res.data[0].startCertExpirationDate,
  1150. res.data[0].endCertExpirationDate,
  1151. ];
  1152. }else{
  1153. res.data[0].certExpirationDate = [];
  1154. }
  1155. this.accountCardFormData = res.data[0];
  1156. this.accountCardFormData.outerFlag = row.outerFlag;
  1157. this.dialogFormVisible = true;
  1158. } else {
  1159. this.$message.error(res.msg);
  1160. }
  1161. });
  1162. },
  1163. //账户卡信息增加
  1164. handleTableAdd(row) {
  1165. this.type = 2; //卡信息
  1166. this.title = "新增账户卡信息";
  1167. this.dialogFormVisible = true;
  1168. this.accountCardFormData.accountId = row.accountId;
  1169. this.accountCardFormData.outerFlag = row.outerFlag;
  1170. },
  1171. //账户信息修改
  1172. handleTableEdit(row, scope) {
  1173. this.type = 1; //账户类型
  1174. this.formDataId = row.accountId;
  1175. this.$api.expense
  1176. .getAccount({ accountId: this.formDataId })
  1177. .then((res) => {
  1178. if (res.code == 200) {
  1179. this.accountFormData = JSON.parse(
  1180. JSON.stringify(res.data.records[0])
  1181. );
  1182. } else {
  1183. this.$message.error(res.msg);
  1184. }
  1185. });
  1186. this.title = "编辑账户信息";
  1187. this.dialogFormVisible = true;
  1188. },
  1189. //提交
  1190. submitForm() {
  1191. if (this.type == 1) {
  1192. //新增修改账户信息
  1193. let params = JSON.parse(JSON.stringify(this.accountFormData));
  1194. if (this.formDataId) {
  1195. //修改
  1196. params.accountId = this.formDataId;
  1197. // delete params.invAccountCardList;
  1198. this.$api.expense.updateAccoount(params).then((res) => {
  1199. if (res.code == 200) {
  1200. this.$message({
  1201. message: "修改成功",
  1202. type: "success",
  1203. });
  1204. this.findPage();
  1205. this.resetForm();
  1206. } else {
  1207. this.$message({
  1208. message: `修改失败, ${res.msg}`,
  1209. type: "error",
  1210. });
  1211. }
  1212. });
  1213. } else {
  1214. //新增
  1215. this.$api.expense.insertAccount(params).then((res) => {
  1216. if (res.code == 200) {
  1217. this.$message({
  1218. message: "添加成功",
  1219. type: "success",
  1220. });
  1221. this.findPage();
  1222. this.resetForm();
  1223. } else {
  1224. this.$message({
  1225. message: `添加失败, ${res.msg}`,
  1226. type: "error",
  1227. });
  1228. }
  1229. });
  1230. }
  1231. } else {
  1232. //新增修改卡信息
  1233. let params = JSON.parse(JSON.stringify(this.accountCardFormData));
  1234. delete params.certExpirationDate;
  1235. //修改
  1236. if (this.formDataId) {
  1237. this.$api.expense.updateAccountCard(params).then((res) => {
  1238. if (res.code == 200) {
  1239. this.$message({
  1240. message: "修改成功",
  1241. type: "success",
  1242. });
  1243. this.findPage();
  1244. this.resetForm();
  1245. } else {
  1246. this.$message({
  1247. message: `修改失败, ${res.msg}`,
  1248. type: "error",
  1249. });
  1250. }
  1251. });
  1252. //新增
  1253. } else {
  1254. this.$api.expense.insertAccountCard(params).then((res) => {
  1255. if (res.code == 200) {
  1256. this.$message({
  1257. message: "添加成功",
  1258. type: "success",
  1259. });
  1260. this.findPage();
  1261. this.resetForm();
  1262. } else {
  1263. this.$message.error(res.msg);
  1264. }
  1265. });
  1266. }
  1267. }
  1268. },
  1269. },
  1270. };
  1271. </script>
  1272. <style scoped>
  1273. .operation {
  1274. margin-left: 14px !important;
  1275. margin-top: 15px !important ;
  1276. }
  1277. .form {
  1278. display: flex;
  1279. margin-top: 14px;
  1280. align-items: center;
  1281. margin-left: -12px;
  1282. margin-bottom: 20px;
  1283. }
  1284. .el-pagination {
  1285. font-weight: normal;
  1286. }
  1287. .el-card__body {
  1288. padding: 12px !important;
  1289. }
  1290. .footer .footerdiv {
  1291. display: flex;
  1292. align-items: center;
  1293. }
  1294. .container .el-form-item {
  1295. margin-bottom: -14px !important;
  1296. }
  1297. .form .el-form-item__label {
  1298. font-size: 15px !important;
  1299. font-weight: 600 !important;
  1300. }
  1301. .ktTable {
  1302. margin-top: 20px;
  1303. }
  1304. .el-row {
  1305. margin-top: 18px;
  1306. }
  1307. .top {
  1308. margin-top: 0px;
  1309. }
  1310. .el-date-editor--daterange.el-input__inner {
  1311. width: 300px;
  1312. }
  1313. /deep/ .el-select--small {
  1314. width: 100%;
  1315. }
  1316. .frame {
  1317. width: 100%;
  1318. background-color: #fff;
  1319. padding: 20px;
  1320. -webkit-box-sizing: border-box;
  1321. box-sizing: border-box;
  1322. margin-bottom: 15px;
  1323. border-radius: 6px;
  1324. border: 1px solid #ebeef5;
  1325. -webkit-transition: all 0.2s ease-in-out;
  1326. transition: all 0.2s ease-in-out;
  1327. -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  1328. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  1329. }
  1330. /deep/ .el-dialog__body {
  1331. overflow-y: scroll;
  1332. max-height: 500px;
  1333. }
  1334. .addremove-box {
  1335. width: 100%;
  1336. display: flex;
  1337. justify-content: center;
  1338. align-items: center;
  1339. font-size: 25px;
  1340. margin-top: 10px;
  1341. /* position: absolute;
  1342. bottom:0;
  1343. left: 0; */
  1344. }
  1345. .addremove-box > i {
  1346. cursor: pointer;
  1347. }
  1348. .frame >>> .el-date-editor {
  1349. width: 100%;
  1350. }
  1351. .frame .el-input-number--small {
  1352. width: 200px;
  1353. }
  1354. .ktTable >>> .el-button span {
  1355. margin-left: 0;
  1356. }
  1357. .expendTable >>> .bottomFixed {
  1358. position: static;
  1359. margin-top: 20px;
  1360. }
  1361. .expendTable >>> .el-table {
  1362. height: 400px !important;
  1363. }
  1364. .expendDialog >>> .el-dialog__body {
  1365. overflow-y: hidden !important;
  1366. max-height: 500px;
  1367. }
  1368. .collec >>> .el-form-item__content {
  1369. display: flex;
  1370. align-items: center;
  1371. }
  1372. .inComeForm >>> .el-input-number__decrease,
  1373. .inComeForm >>> .el-input-number__increase {
  1374. display: none;
  1375. }
  1376. .inComeForm >>> .el-input-number {
  1377. width: 100%;
  1378. }
  1379. .inComeForm >>> .el-input.is-disabled .el-input__inner {
  1380. background-color: #fff;
  1381. color: #606266;
  1382. }
  1383. .el-icon-right {
  1384. margin: 0 10px;
  1385. font-size: 20px;
  1386. }
  1387. .ktTable >>> .cell .el-button {
  1388. width: 80px;
  1389. }
  1390. .expendDialog >>> .cell .el-button {
  1391. width: auto;
  1392. }
  1393. </style>